27 #ifndef GUM_LEARNING_DB_TRANSLATOR_4_RANGE_VARIABLE_H 28 #define GUM_LEARNING_DB_TRANSLATOR_4_RANGE_VARIABLE_H 30 #include <agrum/agrum.h> 31 #include <agrum/tools/core/hashTable.h> 32 #include <agrum/tools/core/set.h> 33 #include <agrum/tools/database/DBTranslator.h> 34 #include <agrum/tools/variables/rangeVariable.h> 131 template <
template <
typename >
class ALLOC =
std::
allocator >
158 template <
template <
typename >
class XALLOC >
200 template <
template <
typename >
class XALLOC >
202 const RangeVariable& var,
229 const bool editable_dictionary =
false,
230 std::size_t max_dico_entries
239 const allocator_type& alloc);
246 const allocator_type& alloc);
372 #ifndef DOXYGEN_SHOULD_SKIP_THIS 376 RangeVariable _variable_;
385 Set<
long, ALLOC<
long > > _translated_int_missing_symbols_;
389 std::string _nonint_missing_symbol_;
401 #include <agrum/tools/database/DBTranslator4RangeVariable_tpl.h> virtual bool needsReordering() const final
indicates whether a reordering is needed to make the translations sorted by increasing numbers ...
DBTranslator4RangeVariable(DBTranslator4RangeVariable< ALLOC > &&from)
move constructor
virtual const RangeVariable * variable() const final
returns the variable stored into the translator
virtual std::string translateBack(const DBTranslatedValue translated_val) const final
returns the original value for a given translation
INLINE void emplace(Args &&... args)
DBTranslator4RangeVariable< ALLOC > & operator=(DBTranslator4RangeVariable< ALLOC > &&from)
move operator
DBTranslator4RangeVariable(DBTranslator4RangeVariable< ALLOC > &&from, const allocator_type &alloc)
move constructor with a given allocator
DBTranslator4RangeVariable(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
DBTranslator4RangeVariable< ALLOC > & operator=(const DBTranslator4RangeVariable< ALLOC > &from)
copy operator
DBTranslator4RangeVariable(const DBTranslator4RangeVariable< ALLOC > &from, const allocator_type &alloc)
copy constructor with a given translator
virtual ~DBTranslator4RangeVariable()
destructor
virtual DBTranslatedValue missingValue() const final
returns the translation of a missing value
DBTranslator4RangeVariable(const DBTranslator4RangeVariable< ALLOC > &from)
copy constructor
virtual DBTranslatedValue translate(const std::string &str) final
returns the translation of a string
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...
DBTranslator4RangeVariable(const RangeVariable &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 range variable as translator
virtual DBTranslator4RangeVariable< ALLOC > * clone(const allocator_type &alloc) const
virtual copy constructor with a given allocator
DBTranslator4RangeVariable(const RangeVariable &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 range variable as translator but without missing symbols ...
virtual std::size_t domainSize() const final
returns the domain size of a variable corresponding to the translations
virtual DBTranslator4RangeVariable< ALLOC > * clone() const
virtual copy constructor
Database(const std::string &filename, const BayesNet< GUM_SCALAR > &bn, const std::vector< std::string > &missing_symbols)
DBTranslator4RangeVariable(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