Maintain an average position by summing up positions with weights. More...
#include <OpenMS/MATH/STATISTICS/AveragePosition.h>
Public Types | |
| enum | { DIMENSION = D } |
Dimensionality. More... | |
| typedef DPosition< DIMENSION > | PositionType |
| Position type (a D-dimensional position). | |
| typedef PositionType::CoordinateType | CoordinateType |
| Weight type (for weighted average - a scalar type). | |
Public Member Functions | |
| AveragePosition () | |
| Default constructor. | |
| AveragePosition (AveragePosition const &rhs) | |
| Copy constructor. | |
| PositionType const & | getPosition () const |
| Returns the current average position. | |
| CoordinateType const & | getWeight () const |
| Returns the total weight. | |
| void | clear () |
Reset everything. (Note that update() will cause a division by zero after that.). | |
| void | add (PositionType position, CoordinateType const weight=1) |
| Add a position. | |
Protected Attributes | |
| PositionType | position_ |
| PositionType | position_weighted_sum_ |
| CoordinateType | weight_sum_ |
Maintain an average position by summing up positions with weights.
Weight type (for weighted average - a scalar type).
| typedef DPosition<DIMENSION> PositionType |
Position type (a D-dimensional position).
| AveragePosition | ( | ) | [inline] |
Default constructor.
| AveragePosition | ( | AveragePosition< D > const & | rhs | ) | [inline] |
Copy constructor.
| void add | ( | PositionType | position, | |
| CoordinateType const | weight = 1 | |||
| ) | [inline] |
Add a position.
Referenced by SimpleExtender< PeakType, FeatureType >::extend().
| void clear | ( | ) | [inline] |
Reset everything. (Note that update() will cause a division by zero after that.).
Referenced by SimpleExtender< PeakType, FeatureType >::extend().
| PositionType const& getPosition | ( | ) | const [inline] |
Returns the current average position.
Referenced by SimpleExtender< PeakType, FeatureType >::isTooFarFromCentroid_().
| CoordinateType const& getWeight | ( | ) | const [inline] |
Returns the total weight.
PositionType position_ [protected] |
Referenced by AveragePosition< 2 >::add(), AveragePosition< 2 >::clear(), and AveragePosition< 2 >::getPosition().
PositionType position_weighted_sum_ [protected] |
Referenced by AveragePosition< 2 >::add(), and AveragePosition< 2 >::clear().
CoordinateType weight_sum_ [protected] |
Referenced by AveragePosition< 2 >::add(), AveragePosition< 2 >::clear(), and AveragePosition< 2 >::getWeight().
| OpenMS / TOPP release 1.10.0 | Documentation generated on Thu Mar 7 2013 09:43:00 using doxygen 1.7.1 |