45#ifndef DOXYGEN_SHOULD_SKIP_THIS
55 if (_real_variable_ !=
nullptr)
delete _real_variable_;
66 return this->
back_dico_.second(translated_val.discr_val);
67 }
catch (Exception
const&) {
69 if ((translated_val.discr_val == std::numeric_limits< std::size_t >::max())
70 && !this->missing_symbols_.empty())
74 "The back translation of \"" << translated_val.discr_val
75 <<
"\" could not be found");
90 return HashTable< std::size_t, std::size_t >();
95 return _variable_.domainSize();
100 return _real_variable_;
105 return DBTranslatedValue{std::numeric_limits< std::size_t >::max()};
The databases' cell translators for discretized variables.
std::string translateBack(const DBTranslatedValue translated_val) const final
returns the original value for a given translation
DBTranslatedValue missingValue() const final
returns the translation of a missing value
DBTranslator4DiscretizedVariable(const DiscretizedVariable< GUM_SCALAR > &var, const std::vector< std::string > &missing_symbols, std::size_t max_dico_entries=std::numeric_limits< std::size_t >::max())
default constructor with a discretized variable as translator
void setEditableDictionaryMode(bool new_mode) final
sets/unset the editable dictionary mode
~DBTranslator4DiscretizedVariable() override
destructor
bool needsReordering() const final
indicates that the translations should never be reordered
const IDiscretizedVariable * variable() const final
returns the variable stored into the translator
std::size_t domainSize() const final
returns the number of discretization intervals used for translations
bool hasEditableDictionary() const final
indicates that the translator is never in editable dictionary mode
HashTable< std::size_t, std::size_t > reorder() final
returns an empty HashTable to indicate that no reordering is needed.
Bijection< std::size_t, std::string > back_dico_
the bijection relating back translated values and their original strings.
Set< std::string > missing_symbols_
the set of missing symbols
#define GUM_ERROR(type, msg)
include the inlined functions if necessary
gum is the global namespace for all aGrUM entities
The union class for storing the translated values in learning databases.