Collection of statistics for a scalar signal.
More...
#include <ignition/math/SignalStats.hh>
|
| | SignalStats () |
| | Constructor.
|
| |
| | SignalStats (const SignalStats &_ss) |
| | Copy constructor.
|
| |
| | ~SignalStats () |
| | Destructor.
|
| |
| size_t | Count () const |
| | Get number of data points in first statistic.
|
| |
| void | InsertData (const double _data) |
| | Add a new sample to the statistical measures.
|
| |
| bool | InsertStatistic (const std::string &_name) |
| | Add a new type of statistic.
|
| |
| bool | InsertStatistics (const std::string &_names) |
| | Add multiple statistics.
|
| |
| std::map< std::string, double > | Map () const |
| | Get the current values of each statistical measure, stored in a map using the short name as the key.
|
| |
| SignalStats & | operator= (const SignalStats &_s) |
| | Assignment operator.
|
| |
| void | Reset () |
| | Forget all previous data.
|
| |
Collection of statistics for a scalar signal.
◆ SignalStats() [1/2]
| ignition::math::IGNITION_MATH_VERSION_NAMESPACE::SignalStats::SignalStats |
( |
| ) |
|
◆ ~SignalStats()
| ignition::math::IGNITION_MATH_VERSION_NAMESPACE::SignalStats::~SignalStats |
( |
| ) |
|
◆ SignalStats() [2/2]
| ignition::math::IGNITION_MATH_VERSION_NAMESPACE::SignalStats::SignalStats |
( |
const SignalStats & | _ss | ) |
|
◆ Count()
| size_t ignition::math::IGNITION_MATH_VERSION_NAMESPACE::SignalStats::Count |
( |
| ) |
const |
Get number of data points in first statistic.
Technically you can have different numbers of data points in each statistic if you call InsertStatistic after InsertData, but this is not a recommended use case.
- Returns
- Number of data points in first statistic.
◆ InsertData()
| void ignition::math::IGNITION_MATH_VERSION_NAMESPACE::SignalStats::InsertData |
( |
const double | _data | ) |
|
Add a new sample to the statistical measures.
- Parameters
-
| [in] | _data | New signal data point. |
◆ InsertStatistic()
| bool ignition::math::IGNITION_MATH_VERSION_NAMESPACE::SignalStats::InsertStatistic |
( |
const std::string & | _name | ) |
|
Add a new type of statistic.
- Parameters
-
| [in] | _name | Short name of new statistic. Valid values include: "maxAbs" "mean" "rms" |
- Returns
- True if statistic was successfully added, false if name was not recognized or had already been inserted.
◆ InsertStatistics()
| bool ignition::math::IGNITION_MATH_VERSION_NAMESPACE::SignalStats::InsertStatistics |
( |
const std::string & | _names | ) |
|
Add multiple statistics.
- Parameters
-
| [in] | _names | Comma-separated list of new statistics. For example, all statistics could be added with: "maxAbs,mean,rms" |
- Returns
- True if all statistics were successfully added, false if any names were not recognized or had already been inserted.
◆ Map()
| std::map< std::string, double > ignition::math::IGNITION_MATH_VERSION_NAMESPACE::SignalStats::Map |
( |
| ) |
const |
Get the current values of each statistical measure, stored in a map using the short name as the key.
- Returns
- Map with short name of each statistic as key and value of statistic as the value.
◆ operator=()
| SignalStats & ignition::math::IGNITION_MATH_VERSION_NAMESPACE::SignalStats::operator= |
( |
const SignalStats & | _s | ) |
|
Assignment operator.
- Parameters
-
- Returns
- this
References SignalStats().
◆ Reset()
| void ignition::math::IGNITION_MATH_VERSION_NAMESPACE::SignalStats::Reset |
( |
| ) |
|
Forget all previous data.
The documentation for this class was generated from the following file: