50#ifndef DOXYGEN_SHOULD_SKIP_THIS
64 template < GUM_Numeric GUM_SCALAR >
66 const ContinuousVariable< GUM_SCALAR >& var,
67 const std::vector< std::string >& missing_symbols,
68 const bool fit_range) :
70 _variable_(var.name(), var.description()), _fit_range_(fit_range) {
72 const float lower_bound = float(var.lowerBound());
73 const float upper_bound = float(var.upperBound());
74 _variable_.setLowerBound(lower_bound);
75 _variable_.setUpperBound(upper_bound);
79 bool non_float_symbol_found =
false;
80 for (
auto iter = this->missing_symbols_.beginSafe(); iter != this->missing_symbols_.endSafe();
82 if (DBCell::isReal(*iter)) {
83 const float missing_val = std::stof(*iter);
84 if ((missing_val >= lower_bound) && (missing_val <= upper_bound)) {
85 this->missing_symbols_.erase(iter);
86 }
else _status_float_missing_symbols_.insert(*iter,
false);
87 }
else if (!non_float_symbol_found) {
88 non_float_symbol_found =
true;
89 _nonfloat_missing_symbol_ = *iter;
94 _real_variable_ = var.clone();
96 GUM_CONSTRUCTOR(DBTranslator4ContinuousVariable);
100 template < GUM_Numeric GUM_SCALAR >
101 DBTranslator4ContinuousVariable::DBTranslator4ContinuousVariable(
102 const ContinuousVariable< GUM_SCALAR >& var,
103 const bool fit_range) :
104 DBTranslator(DBTranslatedValueType::
CONTINUOUS, true, fit_range, 1),
105 _variable_(var.name(), var.description()), _fit_range_(fit_range) {
107 const float lower_bound = float(var.lowerBound());
108 const float upper_bound = float(var.upperBound());
109 _variable_.setLowerBound(lower_bound);
110 _variable_.setUpperBound(upper_bound);
113 _real_variable_ = var.clone();
115 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