1 #ifndef __WT_MOVINGAVERAGE_HH__
2 #define __WT_MOVINGAVERAGE_HH__
9 template <
class Scalar>
14 typedef Eigen::Matrix<Scalar, 1, Eigen::Dynamic>
RowVector;
37 template <
class Derived>
38 const RowVector &
operator() (
const Eigen::DenseBase<Derived> &in) {
60 Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic>
_hist;
62 Eigen::Matrix<Scalar, 1, Eigen::Dynamic>
_current;
70 #endif // __WT_MOVINGAVERAGE_HH__
void resize(size_t N, size_t M)
Resizes the moving sum operator.
Definition: movingaverage.hh:30
const RowVector & addZero()
Adds a vector and updates the moving sum.
Definition: movingaverage.hh:49
A simple vector-valued moving sum.
Definition: movingaverage.hh:10
Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > _hist
Holds the "history" of the last N vectors (stored in rows).
Definition: movingaverage.hh:60
Eigen::Matrix< Scalar, 1, Eigen::Dynamic > RowVector
Specifies the vector type to sum over.
Definition: movingaverage.hh:14
Eigen::Matrix< Scalar, 1, Eigen::Dynamic > _current
Holds the current sum.
Definition: movingaverage.hh:62
size_t _currentIdx
Holds the index, where the next vector should be inserted into _hist.
Definition: movingaverage.hh:65
MovingSum(size_t N, size_t M)
Constructor.
Definition: movingaverage.hh:20
Definition: convolution.hh:7
const RowVector & operator()(const Eigen::DenseBase< Derived > &in)
Adds a vector and updates the moving sum.
Definition: movingaverage.hh:38