libwt  1.0.0
A C++ library for the continous wavelet transform.
Public Types | Public Member Functions | Protected Attributes | List of all members
wt::MovingSum< Scalar > Class Template Reference

A simple vector-valued moving sum. More...

#include <movingaverage.hh>

Public Types

typedef Eigen::Matrix< Scalar, 1, Eigen::Dynamic > RowVector
 Specifies the vector type to sum over. More...
 

Public Member Functions

 MovingSum (size_t N, size_t M)
 Constructor. More...
 
void resize (size_t N, size_t M)
 Resizes the moving sum operator. More...
 
template<class Derived >
const RowVectoroperator() (const Eigen::DenseBase< Derived > &in)
 Adds a vector and updates the moving sum. More...
 
const RowVectoraddZero ()
 Adds a vector and updates the moving sum. More...
 

Protected Attributes

Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > _hist
 Holds the "history" of the last N vectors (stored in rows). More...
 
Eigen::Matrix< Scalar, 1, Eigen::Dynamic > _current
 Holds the current sum. More...
 
size_t _currentIdx
 Holds the index, where the next vector should be inserted into _hist. More...
 

Detailed Description

template<class Scalar>
class wt::MovingSum< Scalar >

A simple vector-valued moving sum.

Member Typedef Documentation

template<class Scalar >
typedef Eigen::Matrix<Scalar, 1, Eigen::Dynamic> wt::MovingSum< Scalar >::RowVector

Specifies the vector type to sum over.

Constructor & Destructor Documentation

template<class Scalar >
wt::MovingSum< Scalar >::MovingSum ( size_t  N,
size_t  M 
)
inline

Constructor.

Parameters
NSpecifies the number of vectors to sum over.
MSpecifies the dimension of the vectors.

Member Function Documentation

template<class Scalar >
const RowVector& wt::MovingSum< Scalar >::addZero ( )
inline

Adds a vector and updates the moving sum.

template<class Scalar >
template<class Derived >
const RowVector& wt::MovingSum< Scalar >::operator() ( const Eigen::DenseBase< Derived > &  in)
inline

Adds a vector and updates the moving sum.

template<class Scalar >
void wt::MovingSum< Scalar >::resize ( size_t  N,
size_t  M 
)
inline

Resizes the moving sum operator.

Parameters
NSpecifies the number of vector to sum over.
MSpecifies the dimension of the vectors.

Member Data Documentation

template<class Scalar >
Eigen::Matrix<Scalar, 1, Eigen::Dynamic> wt::MovingSum< Scalar >::_current
protected

Holds the current sum.

template<class Scalar >
size_t wt::MovingSum< Scalar >::_currentIdx
protected

Holds the index, where the next vector should be inserted into _hist.

template<class Scalar >
Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic> wt::MovingSum< Scalar >::_hist
protected

Holds the "history" of the last N vectors (stored in rows).


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