OpenMS
2.7.0
|
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) More... | |
typedef PositionType::CoordinateType | CoordinateType |
Weight type (for weighted average - a scalar type) More... | |
Public Member Functions | |
AveragePosition () | |
Default constructor. More... | |
AveragePosition (AveragePosition const &rhs) | |
Copy constructor. More... | |
PositionType const & | getPosition () const |
Returns the current average position. More... | |
CoordinateType const & | getWeight () const |
Returns the total weight. More... | |
void | clear () |
Reset everything. (Note that update() will cause a division by zero after that.) More... | |
void | add (PositionType position, CoordinateType const weight=1) |
Add a position. More... | |
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)
|
inline |
Default constructor.
|
inline |
Copy constructor.
|
inline |
|
inline |
Reset everything. (Note that update()
will cause a division by zero after that.)
References DPosition< D, TCoordinateType >::clear(), AveragePosition< D >::position_, AveragePosition< D >::position_weighted_sum_, and AveragePosition< D >::weight_sum_.
|
inline |
Returns the current average position.
References AveragePosition< D >::position_.
|
inline |
Returns the total weight.
References AveragePosition< D >::weight_sum_.
|
protected |
Referenced by AveragePosition< D >::add(), AveragePosition< D >::clear(), and AveragePosition< D >::getPosition().
|
protected |
Referenced by AveragePosition< D >::add(), and AveragePosition< D >::clear().
|
protected |
Referenced by AveragePosition< D >::add(), AveragePosition< D >::clear(), and AveragePosition< D >::getWeight().