48#ifndef DOXYGEN_SHOULD_SKIP_THIS
62 template <
typename GUM_SCALAR >
64 const ContinuousVariable< GUM_SCALAR >& var,
65 const std::vector< std::string >& missing_symbols,
66 const bool fit_range) :
68 _variable_(var.name(), var.description()), _fit_range_(fit_range) {
70 const float lower_bound = float(var.lowerBound());
71 const float upper_bound = float(var.upperBound());
72 _variable_.setLowerBound(lower_bound);
73 _variable_.setUpperBound(upper_bound);
77 bool non_float_symbol_found =
false;
78 for (
auto iter = this->missing_symbols_.beginSafe(); iter != this->missing_symbols_.endSafe();
80 if (DBCell::isReal(*iter)) {
81 const float missing_val = std::stof(*iter);
82 if ((missing_val >= lower_bound) && (missing_val <= upper_bound)) {
83 this->missing_symbols_.erase(iter);
84 }
else _status_float_missing_symbols_.insert(*iter,
false);
85 }
else if (!non_float_symbol_found) {
86 non_float_symbol_found =
true;
87 _nonfloat_missing_symbol_ = *iter;
92 _real_variable_ = var.clone();
94 GUM_CONSTRUCTOR(DBTranslator4ContinuousVariable);
98 template <
typename GUM_SCALAR >
99 DBTranslator4ContinuousVariable::DBTranslator4ContinuousVariable(
100 const ContinuousVariable< GUM_SCALAR >& var,
101 const bool fit_range) :
102 DBTranslator(DBTranslatedValueType::
CONTINUOUS, true, fit_range, 1),
103 _variable_(var.name(), var.description()), _fit_range_(fit_range) {
105 const float lower_bound = float(var.lowerBound());
106 const float upper_bound = float(var.upperBound());
107 _variable_.setLowerBound(lower_bound);
108 _variable_.setUpperBound(upper_bound);
111 _real_variable_ = var.clone();
113 GUM_CONSTRUCTOR(DBTranslator4ContinuousVariable);
The class representing the original values of the cells of databases.
The databases' cell translators for continuous variables.
DBTranslator4ContinuousVariable(const std::vector< std::string > &missing_symbols, const bool fit_range=false)
default constructor without any initial variable
The base class for all the tabular database cell translators.
DBTranslatedValueType
The nature of the elements handled by translators (discrete, continuous).
include the inlined functions if necessary
gum is the global namespace for all aGrUM entities