27 #ifndef GUM_LEARNING_DB_TRANSLATOR_4_CONTINUOUS_VARIABLE_H 28 #define GUM_LEARNING_DB_TRANSLATOR_4_CONTINUOUS_VARIABLE_H 32 #include <agrum/agrum.h> 33 #include <agrum/tools/core/hashTable.h> 34 #include <agrum/tools/database/DBTranslator.h> 35 #include <agrum/tools/variables/continuousVariable.h> 125 template <
template <
typename >
class ALLOC = std::allocator >
152 template <
template <
typename >
class XALLOC >
154 const std::vector< std::string, XALLOC< std::string > >& missing_symbols,
155 const bool fit_range =
false,
187 template <
typename GUM_SCALAR,
template <
typename >
class XALLOC >
189 const ContinuousVariable< GUM_SCALAR >& var,
190 const std::vector< std::string, XALLOC< std::string > >& missing_symbols,
191 const bool fit_range =
false,
208 template <
typename GUM_SCALAR >
210 const bool fit_range =
false,
227 template <
template <
typename >
class XALLOC >
229 const IContinuousVariable& var,
230 const std::vector< std::string, XALLOC< std::string > >& missing_symbols,
231 const bool fit_range =
false,
249 const bool fit_range =
false,
257 const allocator_type& alloc);
264 const allocator_type& alloc);
344 virtual std::string
translateBack(
const DBTranslatedValue translated_val)
const final;
366 #ifndef DOXYGEN_SHOULD_SKIP_THIS 371 ContinuousVariable<
float > _variable_;
376 IContinuousVariable* _real_variable_;
381 HashTable< std::string,
bool, ALLOC< std::pair<
float,
bool > > >
382 _status_float_missing_symbols_;
386 std::string _nonfloat_missing_symbol_;
400 #include <agrum/tools/database/DBTranslator4ContinuousVariable_tpl.h> virtual DBTranslatedValue translate(const std::string &str) final
returns the translation of a string
virtual ~DBTranslator4ContinuousVariable()
destructor
DBTranslator4ContinuousVariable(const bool fit_range=false, const allocator_type &alloc=allocator_type())
default constructor without any initial variable nor missing symbol
INLINE void emplace(Args &&... args)
virtual DBTranslator4ContinuousVariable< ALLOC > * clone() const
virtual copy constructor
DBTranslator4ContinuousVariable(const DBTranslator4ContinuousVariable< ALLOC > &from, const allocator_type &alloc)
copy constructor with a given allocator
DBTranslator4ContinuousVariable(const DBTranslator4ContinuousVariable< ALLOC > &from)
copy constructor
DBTranslator4ContinuousVariable(const ContinuousVariable< GUM_SCALAR > &var, const std::vector< std::string, XALLOC< std::string > > &missing_symbols, const bool fit_range=false, const allocator_type &alloc=allocator_type())
default constructor with a continuous variable as translator
DBTranslator4ContinuousVariable(const ContinuousVariable< GUM_SCALAR > &var, const bool fit_range=false, const allocator_type &alloc=allocator_type())
default constructor with a continuous variable as translator but without missing symbol ...
DBTranslator4ContinuousVariable(const IContinuousVariable &var, const std::vector< std::string, XALLOC< std::string > > &missing_symbols, const bool fit_range=false, const allocator_type &alloc=allocator_type())
default constructor with a IContinuous variable as translator
virtual DBTranslator4ContinuousVariable< ALLOC > * clone(const allocator_type &alloc) const
virtual copy constructor with a given allocator
DBTranslator4ContinuousVariable< ALLOC > & operator=(const DBTranslator4ContinuousVariable< ALLOC > &from)
copy operator
virtual std::size_t domainSize() const final
returns std::numeric_limits<std::size_t>::max ()
DBTranslator4ContinuousVariable(const std::vector< std::string, XALLOC< std::string > > &missing_symbols, const bool fit_range=false, const allocator_type &alloc=allocator_type())
default constructor without any initial variable
virtual bool needsReordering() const final
indicates that the translations should never be reordered
DBTranslator4ContinuousVariable(DBTranslator4ContinuousVariable< ALLOC > &&from, const allocator_type &alloc)
move constructor with a given allocator
DBTranslator4ContinuousVariable(DBTranslator4ContinuousVariable< ALLOC > &&from)
move constructor
virtual HashTable< std::size_t, std::size_t, ALLOC< std::pair< std::size_t, std::size_t > > > reorder() final
returns an empty mapping, indicating that old tanslations are equal to the newly reordered ones...
DBTranslator4ContinuousVariable< ALLOC > & operator=(DBTranslator4ContinuousVariable< ALLOC > &&from)
move operator
virtual std::string translateBack(const DBTranslatedValue translated_val) const final
returns the original value for a given translation
The databases' cell translators for continuous variables.
DBTranslator4ContinuousVariable(const IContinuousVariable &var, const bool fit_range=false, const allocator_type &alloc=allocator_type())
default constructor with a IContinuous variable as translator but without missing symbol ...
Database(const std::string &filename, const BayesNet< GUM_SCALAR > &bn, const std::vector< std::string > &missing_symbols)
virtual const IContinuousVariable * variable() const final
returns the variable stored into the translator
virtual DBTranslatedValue missingValue() const final
returns the translation of a missing value