27 #ifndef GUM_LEARNING_DB_TRANSLATOR_4_DISCRETIZED_VARIABLE_H 28 #define GUM_LEARNING_DB_TRANSLATOR_4_DISCRETIZED_VARIABLE_H 30 #include <agrum/agrum.h> 31 #include <agrum/tools/database/DBTranslator.h> 32 #include <agrum/tools/variables/discretizedVariable.h> 119 template <
template <
typename >
class ALLOC =
std::
allocator >
146 template <
typename GUM_SCALAR,
template <
typename >
class XALLOC >
148 const DiscretizedVariable< GUM_SCALAR >& var,
167 template <
typename GUM_SCALAR >
169 std::size_t max_dico_entries
187 template <
template <
typename >
class XALLOC >
189 const IDiscretizedVariable& var,
209 std::size_t max_dico_entries
218 const allocator_type& alloc);
225 const allocator_type& alloc);
318 #ifndef DOXYGEN_SHOULD_SKIP_THIS 322 DiscretizedVariable<
float > _variable_;
327 IDiscretizedVariable* _real_variable_;
339 #include <agrum/tools/database/DBTranslator4DiscretizedVariable_tpl.h> DBTranslator4DiscretizedVariable< ALLOC > & operator=(const DBTranslator4DiscretizedVariable< ALLOC > &from)
copy operator
virtual DBTranslator4DiscretizedVariable< ALLOC > * clone() const
virtual copy constructor
DBTranslator4DiscretizedVariable(DBTranslator4DiscretizedVariable< ALLOC > &&from, const allocator_type &alloc)
move constructor with a given allocator
virtual DBTranslatedValue translate(const std::string &str) final
returns the translation of a string
INLINE void emplace(Args &&... args)
virtual ~DBTranslator4DiscretizedVariable()
destructor
DBTranslator4DiscretizedVariable(const DiscretizedVariable< GUM_SCALAR > &var, std::size_t max_dico_entries=std::numeric_limits< std::size_t >::max(), const allocator_type &alloc=allocator_type())
default constructor with a discretized variable as translator but without missing symbols ...
DBTranslator4DiscretizedVariable(const IDiscretizedVariable &var, 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 with a IDiscretized variable as translator
virtual std::string translateBack(const DBTranslatedValue translated_val) const final
returns the original value for a given translation
DBTranslator4DiscretizedVariable(const IDiscretizedVariable &var, std::size_t max_dico_entries=std::numeric_limits< std::size_t >::max(), const allocator_type &alloc=allocator_type())
default constructor with a IDiscretized variable as translator but without missing symbols ...
virtual const IDiscretizedVariable * variable() const final
returns the variable stored into the translator
virtual DBTranslator4DiscretizedVariable< ALLOC > * clone(const allocator_type &alloc) const
virtual copy constructor with a given allocator
virtual DBTranslatedValue missingValue() const final
returns the translation of a missing value
DBTranslator4DiscretizedVariable(const DBTranslator4DiscretizedVariable< ALLOC > &from, const allocator_type &alloc)
copy constructor with a given allocator
virtual bool hasEditableDictionary() const final
indicates that the translator is never in editable dictionary mode
virtual bool needsReordering() const final
indicates that the translations should never be reordered
DBTranslator4DiscretizedVariable(const DiscretizedVariable< GUM_SCALAR > &var, 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 with a discretized variable as translator
DBTranslator4DiscretizedVariable(const DBTranslator4DiscretizedVariable< ALLOC > &from)
copy constructor
virtual std::size_t domainSize() const final
returns the number of discretization intervals used for translations
virtual HashTable< std::size_t, std::size_t, ALLOC< std::pair< std::size_t, std::size_t > > > reorder() final
returns an empty HashTable to indicate that no reordering is needed.
DBTranslator4DiscretizedVariable< ALLOC > & operator=(DBTranslator4DiscretizedVariable< ALLOC > &&from)
move operator
Database(const std::string &filename, const BayesNet< GUM_SCALAR > &bn, const std::vector< std::string > &missing_symbols)
DBTranslator4DiscretizedVariable(DBTranslator4DiscretizedVariable< ALLOC > &&from)
move constructor
virtual void setEditableDictionaryMode(bool new_mode) final
sets/unset the editable dictionary mode