27 #ifndef GUM_LEARNING_DB_TRANSLATOR_4_LABELIZED_VARIABLE_H 28 #define GUM_LEARNING_DB_TRANSLATOR_4_LABELIZED_VARIABLE_H 30 #include <agrum/agrum.h> 31 #include <agrum/tools/database/DBTranslator.h> 32 #include <agrum/tools/variables/labelizedVariable.h> 133 template <
template <
typename >
class ALLOC =
std::
allocator >
159 template <
template <
typename >
class XALLOC >
200 template <
template <
typename >
class XALLOC >
202 const LabelizedVariable& var,
228 const bool editable_dictionary =
false,
229 std::size_t max_dico_entries
238 const allocator_type& alloc);
245 const allocator_type& alloc);
372 #ifndef DOXYGEN_SHOULD_SKIP_THIS 376 LabelizedVariable _variable_;
388 #include <agrum/tools/database/DBTranslator4LabelizedVariable_tpl.h> virtual const LabelizedVariable * variable() const final
returns the variable stored into the translator
virtual DBTranslatedValue missingValue() const final
returns the translation of a missing value
DBTranslator4LabelizedVariable< ALLOC > & operator=(DBTranslator4LabelizedVariable< ALLOC > &&from)
move operator
virtual ~DBTranslator4LabelizedVariable()
destructor
INLINE void emplace(Args &&... args)
DBTranslator4LabelizedVariable(const LabelizedVariable &var, const std::vector< std::string, XALLOC< std::string > > &missing_symbols, const bool editable_dictionary=false, std::size_t max_dico_entries=std::numeric_limits< std::size_t >::max(), const allocator_type &alloc=allocator_type())
default constructor with a labelized variable as translator
DBTranslator4LabelizedVariable(const std::vector< std::string, XALLOC< std::string > > &missing_symbols, std::size_t max_dico_entries=std::numeric_limits< std::size_t >::max(), const allocator_type &alloc=allocator_type())
default constructor without any initial variable
virtual std::size_t domainSize() const final
returns the domain size of a variable corresponding to the translations
DBTranslator4LabelizedVariable(DBTranslator4LabelizedVariable< ALLOC > &&from, const allocator_type &alloc)
move constructor with a given allocator
virtual std::string translateBack(const DBTranslatedValue translated_val) const final
returns the original value for a given translation
DBTranslator4LabelizedVariable(std::size_t max_dico_entries=std::numeric_limits< std::size_t >::max(), const allocator_type &alloc=allocator_type())
default constructor without any initial variable nor missing symbols
DBTranslator4LabelizedVariable< ALLOC > & operator=(const DBTranslator4LabelizedVariable< ALLOC > &from)
copy operator
virtual bool needsReordering() const final
indicates whether a reordering is needed to make the translations sorted
DBTranslator4LabelizedVariable(const DBTranslator4LabelizedVariable< ALLOC > &from)
copy constructor
virtual DBTranslatedValue translate(const std::string &str) final
returns the translation of a string
virtual DBTranslator4LabelizedVariable< ALLOC > * clone() const
virtual copy constructor
virtual DBTranslator4LabelizedVariable< ALLOC > * clone(const allocator_type &alloc) const
virtual copy constructor with a given allocator
virtual HashTable< std::size_t, std::size_t, ALLOC< std::pair< std::size_t, std::size_t > > > reorder() final
performs a reordering of the dictionary and returns a mapping from the old translated values to the n...
Database(const std::string &filename, const BayesNet< GUM_SCALAR > &bn, const std::vector< std::string > &missing_symbols)
DBTranslator4LabelizedVariable(DBTranslator4LabelizedVariable< ALLOC > &&from)
move constructor
DBTranslator4LabelizedVariable(const LabelizedVariable &var, const bool editable_dictionary=false, std::size_t max_dico_entries=std::numeric_limits< std::size_t >::max(), const allocator_type &alloc=allocator_type())
default constructor with a labelized variable as translator but without missing symbols ...
DBTranslator4LabelizedVariable(const DBTranslator4LabelizedVariable< ALLOC > &from, const allocator_type &alloc)
copy constructor with a given allocator