コード例 #1
0
 const char *get_category_data_from_value(size_t value) const {
     if (value >= get_category_count()) {
         throw std::runtime_error("category value is out of bounds");
     }
     return m_categories.get_readonly_originptr() +
            m_value_to_category_index[value] *
                reinterpret_cast<const strided_dim_type_arrmeta *>(
                    m_categories.get_arrmeta())->stride;
 }
コード例 #2
0
ファイル: categorical_type.hpp プロジェクト: will133/libdynd
 const char *get_category_data_from_value(uint32_t value) const
 {
   if (value >= get_category_count()) {
     throw std::runtime_error("category value is out of bounds");
   }
   return m_categories.get_readonly_originptr() +
          unchecked_fixed_dim_get<intptr_t>(m_value_to_category_index,
                                            value) *
              reinterpret_cast<const fixed_dim_type_arrmeta *>(
                  m_categories.get_arrmeta())->stride;
 }