latest version v1.9 - last update 10 Apr 2010 |
Implements a mixing operator for vectors and matrices. More...
#include <ltiLinearMixer.h>
Public Member Functions | |
linearMixer () | |
linearMixer (const linearMixer &other) | |
virtual | ~linearMixer () |
virtual const char * | getTypeName () const |
linearMixer< T > & | copy (const linearMixer< T > &other) |
linearMixer< T > & | operator= (const linearMixer< T > &other) |
virtual functor * | clone () const |
bool | apply (const matrix< T > &mixer, const std::vector< const vector< T > * > &src, const std::vector< vector< T > * > &dest) const |
bool | apply (const matrix< T > &mixer, const std::vector< const matrix< T > * > &src, const std::vector< matrix< T > * > &dest) const |
Implements a mixing operator for vectors and matrices.
Mixing means that you have a mixing matrix M and a list of vectors (or matrices) v[i]. Then the result of a mix is another list of vectors. Example: Let the Mixing matrix be
[ 1 0 1 ] M = [ 0 1 0 ]
Let the source vector list be
v = { [ 0 0 1 1 ], [ 0 1 0 1 ], [ 1 0 0 0 ] }
Then, the result is:
v= { [ 0 0 1 1 ] + [ 1 0 0 0 ] , [ 0 1 0 1 ] } = { [ 1 0 1 1 ], [ 0 1 0 1 ] }
So, the number of rows of the mixing matrix is the number of result vectors, and the number of columns of the mixing matrix must be the number of source vectors.
lti::linearMixer< T >::linearMixer | ( | ) |
default constructor
lti::linearMixer< T >::linearMixer | ( | const linearMixer< T > & | other | ) |
copy constructor
other | the object to be copied |
virtual lti::linearMixer< T >::~linearMixer | ( | ) | [virtual] |
destructor
bool lti::linearMixer< T >::apply | ( | const matrix< T > & | mixer, | |
const std::vector< const matrix< T > * > & | src, | |||
const std::vector< matrix< T > * > & | dest | |||
) | const |
On-Copy Apply method for the mixing functor.
The functor takes the mixing matrix and the source matrices. The result is returned in the second list. This list must contain pointers to already allocated matrix objects. Its size must be equal to the number of rows of the mixing matrix. The size of the list of source matrices must be equal to the number of columns of the mixing matrix.
bool lti::linearMixer< T >::apply | ( | const matrix< T > & | mixer, | |
const std::vector< const vector< T > * > & | src, | |||
const std::vector< vector< T > * > & | dest | |||
) | const |
On-Copy Apply method for the mixing functor.
The functor takes the mixing matrix and the source vectors. The result is returned in the second list. This list must contain pointers to already allocated vector objects. Its size must be equal to the number of rows of the mixing matrix. The size of the list of source vectors must be equal to the number of columns of the mixing matrix.
virtual functor* lti::linearMixer< T >::clone | ( | ) | const [virtual] |
returns a pointer to a clone of this functor.
Implements lti::functor.
linearMixer<T>& lti::linearMixer< T >::copy | ( | const linearMixer< T > & | other | ) |
copy data of "other" functor.
other | the functor to be copied |
Reimplemented from lti::functor.
virtual const char* lti::linearMixer< T >::getTypeName | ( | ) | const [virtual] |
returns the name of this type ("linearMixer")
Reimplemented from lti::functor.
linearMixer<T>& lti::linearMixer< T >::operator= | ( | const linearMixer< T > & | other | ) |