47 inline std::string
getUnits()
const {
return _units; }
49 inline void setUnits(std::string units) { _units = units; }
60 inline unsigned int getNumValues()
const {
return static_cast<unsigned int>(_values.size()); }
96 inline double getValue(
unsigned int index)
const {
return (index < _values.size()) ? _values[index] : 0.0; }
99 void setValue(
unsigned int index,
double value);
102 inline void appendValue(
double value) { _values.push_back(value); }
104 inline void setValueFrom(
unsigned int index,
unsigned int source) { _values[index] = _values[source]; }
133 inline double getStdValue()
const {
return getStandardDeviationValue(); }
135 inline double getRMSDValue()
const {
return getRootMeanSquareDeviationValue(); }
139 std::vector<double>&
values() {
return _values; }
142 const std::vector<double>&
constValues()
const {
return _values; }
150 std::string _description;
162 bool _fixedMinMaxValues;
176 std::vector<double> _values;
Wraps a FileMap so we can handle errors and exceptions more easily.
Stores a value list where the values are associated to primitives (WEMNode, WEMEdge,...
void extendValues(unsigned int number, double value)
Extends the list with the given amount and initializes new values with that given value.
void setValue(unsigned int index, double value)
Sets the given value at the given index.
void resetValues()
Clears the internal values and resets the min/max and statistical values.
void multiplyValues(double modifier)
Multiplies all values with the given modifier.
double getRootMeanSquareDeviationValue() const
Returns the root mean sqaure deviation value. Make sure to have called updateStatistics() before!
void setPersistence(bool persistent)
Sets whether the value list should be saved when saving the WEM.
std::string getDescription() const
Returns the description of this PVL.
void saveTo(OutStreamWrapper &ostreamWrapper)
Saves attributes to the given output stream.
PrimitiveValueListTypes getPrimitiveValueListType() const
Returns the primitive mode.
const std::vector< double > & constValues() const
Get access to the underlying array.
void copyProperties(const WEMPrimitiveValueList &valueList)
Copies properties of the given primitive value list.
WEMPrimitiveValueList(const WEMPrimitiveValueList &valueList)
Copy constructor.
~WEMPrimitiveValueList()
Destructor.
void initializeValues(unsigned int number, double value)
Initializes the first number of values with the given value.
WEMPrimitiveValueList(std::string description)
Constructor.
double getStandardDeviationValue() const
Returns the standard deviation value. Make sure to have called updateStatistics() before!
void addValueFrom(unsigned int index, unsigned int source, double modifier)
Adds the value from the index source to the given index. The min and max values are not adjusted.
void setUnits(std::string units)
Sets the units string.
void resize(unsigned int numValues)
Resizes the PVL to the given number of values.
void loadFrom(FileMapWrapper &mapper, short version)
Loads attributes from the given memory map.
void setMinMaxValue(double minValue, double maxValue)
Sets the min and max values, switches to fixed values.
void computeAndSetMinMaxFixedValues()
Computes the min and max values, sets them and switches to fixed values.
double getRMSDValue() const
Use getRootMeanSquareDeviationValue() instead.
double getValue(unsigned int index) const
Returns the value at the given index.
MLDataType getDataType() const
Returns the data type.
void removeLastEntry()
Removes the last entry, shortens the list.
void clampMinValue(double minValue)
Clamps all values to the given min value.
void setDataType(MLDataType dataType)
Sets the data type.
double getMeanValue() const
Returns the mean value. Make sure to have called updateStatistics() before!
std::vector< double > & values()
Get access to the underlying array.
void appendValue(double value)
Appends the given value.
double getMaxValue() const
Returns the maximum value.
void updateStatistics()
Update statistics: mean, standard deviation, and root mean square deviation.
void clampMaxValue(double maxValue)
Clamps all values to the given max value.
double getMinValue() const
Returns the minimum value.
bool isPersistent() const
Returns whether this PVL should be saved when saving the WEM?
std::string getUnits() const
Returns the units string.
WEMPrimitiveValueList()
Constructor.
void setValueFrom(unsigned int index, unsigned int source)
Copies the value from the index source to the given index.
double getStdValue() const
unsigned int getNumValues() const
Returns the number of values.
void setPrimitiveValueListType(PrimitiveValueListTypes primitiveValueListType)
Sets the primitive mode.
bool isValid() const
Returns whether the values are valid? The description should be non-empty, the list should contain va...
MLint32 MLDataType
MLDataType.
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
PrimitiveValueListTypes
Enumeration of primitive value list types.