DiSMEC++
dismec::opaque_int_type< Tag, T > Class Template Reference

An integer-like type that represents categorical values. More...

#include <opaque_int.h>

Public Member Functions

constexpr opaque_int_type (T v) noexcept
 ! Explicit constructor from an underlying int. More...
 
constexpr T to_index () const
 ! Explicitly convert to an integer. More...
 

Protected Attributes

m_Value
 

Detailed Description

template<class Tag, class T = std::int_fast32_t>
class dismec::opaque_int_type< Tag, T >

An integer-like type that represents categorical values.

The opaque_int_type differs from a normal integer in that it is not implicitly convertible to any other type, and does not support arithmetic operators unless the user defines them. It does, however, define comparison operators so that its values can be ordered. It is intended to be used to represent categorical values.

Template Parameters
TagA tag type that allows to define different, non-interacting opaque_int_type types
TThe integer type that is used to store the actual value.

Definition at line 24 of file opaque_int.h.

Constructor & Destructor Documentation

◆ opaque_int_type()

template<class Tag , class T = std::int_fast32_t>
constexpr dismec::opaque_int_type< Tag, T >::opaque_int_type ( v)
inlineexplicitconstexprnoexcept

! Explicit constructor from an underlying int.

Definition at line 29 of file opaque_int.h.

Member Function Documentation

◆ to_index()

template<class Tag , class T = std::int_fast32_t>
constexpr T dismec::opaque_int_type< Tag, T >::to_index ( ) const
inlineconstexpr

! Explicitly convert to an integer.

Definition at line 32 of file opaque_int.h.

References dismec::opaque_int_type< Tag, T >::m_Value.

Referenced by dismec::TrainingStatsGatherer::add_accu(), dismec::model::Model::adjust_label(), dismec::stats::StatisticsCollection::declare_stat(), dismec::stats::StatisticsCollection::declare_tag(), dismec::stats::StatisticsCollection::disable(), dismec::prediction::PredictionBase::do_prediction(), dismec::stats::StatisticsCollection::enable(), anonymous_namespace{numa.cpp}::for_each_shared_cache_sibling(), anonymous_namespace{numa.cpp}::for_each_sibling(), dismec::prediction::ConfusionMatrixRecorder::get_confusion_matrix(), dismec::init::NumpyInitializer::get_initial_weight(), dismec::MultiLabelData::get_label_instances(), dismec::MultiLabelData::get_labels(), dismec::CustomWeighting::get_negative_weight(), dismec::CustomWeighting::get_positive_weight(), dismec::model::DenseModel::get_weights_for_label_unchecked(), dismec::model::SparseModel::get_weights_for_label_unchecked(), dismec::model::SubModelWrapper< T >::get_weights_for_label_unchecked(), dismec::prediction::PredictionBase::init_thread(), dismec::prediction::EvaluateMetrics::init_thread(), dismec::TrainingTaskGenerator::init_thread(), dismec::io::model::PartialModelIO::insert_sub_file(), dismec::stats::StatisticsCollection::is_enabled(), dismec::model::Model::is_partial_model(), main(), dismec::model::Model::Model(), dismec::operator!=(), dismec::operator+(), dismec::operator-(), dismec::operator<(), dismec::operator<<(), dismec::operator<=(), dismec::operator==(), dismec::operator>(), dismec::operator>=(), dismec::parallel::ThreadDistributor::pin_this_thread(), PYBIND11_MODULE(), dismec::stats::StatisticsCollection::record(), TrainingProgram::run(), dismec::prediction::EvaluateMetrics::run_task(), dismec::TrainingTaskGenerator::run_task(), dismec::prediction::TopKPredictionTaskGenerator::run_tasks(), dismec::io::save_xmc_dataset(), dismec::MultiLabelData::select_labels(), dismec::stats::StatisticsCollection::set_tag(), anonymous_namespace{numa.cpp}::set_thread_affinity(), dismec::model::SubModelWrapper< T >::set_weights_for_label_unchecked(), dismec::model::DenseModel::set_weights_for_label_unchecked(), dismec::model::SparseModel::set_weights_for_label_unchecked(), anonymous_namespace{statistics.cpp}::DefaultGatherer::start_label(), dismec::prediction::TopKPredictionTaskGenerator::TopKPredictionTaskGenerator(), dismec::TrainingTaskGenerator::train_label(), dismec::CascadeTraining::update_minimizer(), and dismec::CascadeTraining::update_objective().

Member Data Documentation

◆ m_Value

template<class Tag , class T = std::int_fast32_t>
T dismec::opaque_int_type< Tag, T >::m_Value
protected

Definition at line 35 of file opaque_int.h.

Referenced by dismec::opaque_int_type< Tag, T >::to_index().


The documentation for this class was generated from the following file: