49 inline std::string
getUnits()
const {
return _units; }
51 inline void setUnits(std::string units) { _units = units; }
62 inline unsigned int getNumValues()
const {
return static_cast<unsigned int>(_values.size()); }
86 inline void setMinMaxValue(
double minValue,
double maxValue) { _minValue = minValue; _maxValue = maxValue; _fixedMinMaxValues =
true; }
98 inline double getValue(
unsigned int index)
const {
return (index < _values.size()) ? _values[index] : 0.0; }
104 inline void appendValue(
double value) { _values.push_back(value); }
106 inline void setValueFrom(
unsigned int index,
unsigned int source) { _values[index] = _values[source]; }
108 inline void addValueFrom(
unsigned int index,
unsigned int source,
double modifier) { _values[index] += _values[source] * modifier; }
135 inline double getStdValue()
const {
return getStandardDeviationValue(); }
137 inline double getRMSDValue()
const {
return getRootMeanSquareDeviationValue(); }
141 std::vector<double>&
values() {
return _values; }
144 const std::vector<double>&
constValues()
const {
return _values; }
152 std::string _description;
164 bool _fixedMinMaxValues;
178 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.
void copyFrom(const WEMPrimitiveValueList &valueList)
Copies properties and values from the given primitive value list.
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.
PrimitiveValueListTypes
Enumeration of primitive value list types.