SignalStats Class Reference

Collection of statistics for a scalar signal. More...

#include <math/gzmath.hh>

Public Member Functions

 SignalStats () GAZEBO_DEPRECATED(8.0)
 Constructor. More...
 
 SignalStats (const ignition::math::SignalStats &_s)
 Ignition math copy constructor. More...
 
 SignalStats (const SignalStats &_ss) GAZEBO_DEPRECATED(8.0)
 Copy constructor. More...
 
 ~SignalStats ()
 Destructor. More...
 
size_t Count () const
 Get number of data points in first statistic. More...
 
ignition::math::SignalStats Ign () const
 Get this object as an ignition::math::SignalStats. More...
 
void InsertData (const double _data)
 Add a new sample to the statistical measures. More...
 
bool InsertStatistic (const std::string &_name)
 Add a new type of statistic. More...
 
bool InsertStatistics (const std::string &_names)
 Add multiple statistics. More...
 
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. More...
 
SignalStatsoperator= (const ignition::math::SignalStats &_s)
 Assignment operator for ignition math. More...
 
void Reset ()
 Forget all previous data. More...
 

Protected Attributes

std::unique_ptr
< SignalStatsPrivate > 
dataPtr
 Pointer to private data. More...
 

Detailed Description

Collection of statistics for a scalar signal.

Constructor & Destructor Documentation

Constructor.

Deprecated:
See ignition::math::SignalStats
SignalStats ( const ignition::math::SignalStats &  _s)

Ignition math copy constructor.

Parameters
[in]_sSignalStats to copy

Destructor.

SignalStats ( const SignalStats _ss)

Copy constructor.

Parameters
[in]_ssSignalStats to copy
Deprecated:
See ignition::math::SignalStats

Member Function Documentation

size_t 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.
ignition::math::SignalStats Ign ( ) const

Get this object as an ignition::math::SignalStats.

Returns
This as an ignition math object.
void InsertData ( const double  _data)

Add a new sample to the statistical measures.

Parameters
[in]_dataNew signal data point.
bool InsertStatistic ( const std::string &  _name)

Add a new type of statistic.

Parameters
[in]_nameShort 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.
bool InsertStatistics ( const std::string &  _names)

Add multiple statistics.

Parameters
[in]_namesComma-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.
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.

Returns
Map with short name of each statistic as key and value of statistic as the value.
SignalStats& operator= ( const ignition::math::SignalStats &  _s)

Assignment operator for ignition math.

Parameters
[in]_sNew signal stats
Returns
Reference to this
void Reset ( )

Forget all previous data.

Member Data Documentation

std::unique_ptr<SignalStatsPrivate> dataPtr
protected

Pointer to private data.


The documentation for this class was generated from the following file: