LTI-Lib latest version v1.9 - last update 10 Apr 2010

lti::serialLDA< T > Class Template Reference
[LAPack based functors]

Functor for iteratively computing a linear discriminant analysis. More...

#include <ltiSerialLDA.h>

Inheritance diagram for lti::serialLDA< T >:
Inheritance graph
[legend]
Collaboration diagram for lti::serialLDA< T >:
Collaboration graph
[legend]

List of all members.

Classes

class  parameters
 the parameters for the class serialLDA More...

Public Member Functions

 serialLDA ()
 serialLDA (const serialLDA &other)
virtual ~serialLDA ()
virtual const char * getTypeName () const
bool consider (const matrix< T > &src)
bool apply (const matrix< T > &src, matrix< T > &result)
bool apply (const vector< T > &src, vector< T > &result)
bool apply (matrix< T > &srcdest)
void setDimension (int k)
bool getEigenValues (vector< T > &result) const
const vector< T > & getEigenValues () const
bool getEigenVectors (matrix< T > &result) const
bool getEigenVectorsInRows (matrix< T > &result) const
serialLDAcopy (const serialLDA &other)
virtual functorclone () const
const parametersgetParameters () const
bool read (ioHandler &handler, const bool complete=true)
bool write (ioHandler &handler, const bool complete=true) const

Protected Member Functions

int checkDim ()

Detailed Description

template<class T>
class lti::serialLDA< T >

Functor for iteratively computing a linear discriminant analysis.

The functor is used by subsequent calls of consider(), which is given the data of another class each time. Then, the first time apply() is called, the LDA is computed and can be used. It is possible to mix calls to consider and apply.

It uses functors that require the LAPack.

See also:
LAPack based functors

Constructor & Destructor Documentation

template<class T >
lti::serialLDA< T >::serialLDA (  ) 

default constructor

template<class T >
lti::serialLDA< T >::serialLDA ( const serialLDA< T > &  other  ) 

copy constructor

Parameters:
other the object to be copied
template<class T >
virtual lti::serialLDA< T >::~serialLDA (  )  [virtual]

destructor


Member Function Documentation

template<class T >
bool lti::serialLDA< T >::apply ( matrix< T > &  srcdest  ) 

On-Place version of the transformation.

Parameters:
srcdest matrix<T> with the source data, which will also contain the result.
Returns:
true if the LDA could be applied, false otherwise
template<class T >
bool lti::serialLDA< T >::apply ( const vector< T > &  src,
vector< T > &  result 
)

Uses a previously computed transform in order to reduce the given data set's dimensionality according to the resultDim parameter.

Parameters:
src matrix<T> with the source data.
result matrix<T> with the result data.
Returns:
true if the LDA could be applied, false otherwise
template<class T >
bool lti::serialLDA< T >::apply ( const matrix< T > &  src,
matrix< T > &  result 
)

Uses a previously computed transform in order to reduce the given data set's dimensionality according to the resultDim parameter.

Parameters:
src matrix<T> with the source data.
result matrix<T> with the result data.
Returns:
true if the LDA could be applied, false otherwise
template<class T >
int lti::serialLDA< T >::checkDim (  )  [protected]

Determines the intrinsic dimensionality of the data set if the user specify autoDim, otherwise return parameters::resultDim.

The member usedDimensionality will be set with the returned value

template<class T >
virtual functor* lti::serialLDA< T >::clone (  )  const [virtual]

returns a pointer to a clone of this functor.

Implements lti::functor.

template<class T >
bool lti::serialLDA< T >::consider ( const matrix< T > &  src  ) 

Adds a single class to the lda.

This can be used as an iterative version of the apply method. Class labels are determined automatically.

Parameters:
src matrix<T> with the source data.
Returns:
true if the data could be considered, false otherwise
template<class T >
serialLDA& lti::serialLDA< T >::copy ( const serialLDA< T > &  other  ) 

copy data of "other" functor.

Parameters:
other the functor to be copied
Returns:
a reference to this functor object

Reimplemented from lti::functor.

template<class T >
const vector<T>& lti::serialLDA< T >::getEigenValues (  )  const

Returns the previously computed eigenvalues of the scatter matrix.

Returns:
true if the values could be obtained, false otherwise.
template<class T >
bool lti::serialLDA< T >::getEigenValues ( vector< T > &  result  )  const

Returns the previously computed eigenvalues of the scatter matrix.

Parameters:
result the vector which will receive the eigenvalues.
Returns:
true if the values could be obtained, false otherwise.
template<class T >
bool lti::serialLDA< T >::getEigenVectors ( matrix< T > &  result  )  const

Returns the previously computed eigenvectors of the scatter matrix.

Parameters:
result the matrix which will receive the eigenvectors. Each column of the matrix contains one eigenvector.
Returns:
true if the vectors could be obtained, false otherwise
template<class T >
bool lti::serialLDA< T >::getEigenVectorsInRows ( matrix< T > &  result  )  const

Returns the previously computed eigenvectors of the scatter matrix.

This method will call the normal getEigenVectors() methods and after that will transpose the obtained matrix, i.e. it is faster to get the eigenvectors in the columns.

Parameters:
result the matrix which will receive the eigenvectors. Each row of the matrix contains one eigenvector.
Returns:
true if the vectors could be obtained, false otherwise
template<class T >
const parameters& lti::serialLDA< T >::getParameters (  )  const

returns used parameters

Reimplemented from lti::functor.

template<class T >
virtual const char* lti::serialLDA< T >::getTypeName (  )  const [virtual]

returns the name of this type ("serialLDA")

Reimplemented from lti::linearAlgebraFunctor.

template<class T >
bool lti::serialLDA< T >::read ( ioHandler handler,
const bool  complete = true 
) [virtual]

Computes the between-class scatter matrix Sb.

Reimplemented from lti::functor.

template<class T >
void lti::serialLDA< T >::setDimension ( int  k  ) 

Set the dimension to which the vectors should be reduced.

template<class T >
bool lti::serialLDA< T >::write ( ioHandler handler,
const bool  complete = true 
) const [virtual]

return the last message set with setStatusString().

This will never return 0. If no status-string has been set yet an empty string (pointer to a string with only the char(0)) will be returned. set a status string.

Parameters:
msg the const string to be reported next time by getStatusString(). The given string will be copied. This message will be usually set within the apply methods to indicate an error cause.

Note that the change of the status string is not considered as a change in the functor status. append a message to the current status string. Take care to reset the status string by calling setStatusString() for each call of an apply() or similar method. appendStatusString() should only be used after setStatusString() has been called.

Parameters:
msg message to be appended to the current status string.

Note that the change of the status string is not considered as a change in the functor status. append an integer value to the current status string. Take care to reset the status string by calling setStatusString() for each call of an apply() or similar method. appendStatusString() should only be used after setStatusString() has been called.

Parameters:
msg integer value to be appended to the current status string.

Note that the change of the status string is not considered as a change in the functor status. append a double value to the current status string. Take care to reset the status string by calling setStatusString() for each call of an apply() or similar method. appendStatusString() should only be used after setStatusString() has been called.

Parameters:
msg double value to be appended to the current status string.

Note that the change of the status string is not considered as a change in the functor status. Append the status string of another functor to this functors status string. To achieve better readability of the resulting message a new line is started with the other functor's name and the message.

Parameters:
other functor whose status string is to be append to this status string.

Note that the change of the status string is not considered as a change in the functor status. write the functor in the given ioHandler. The default implementation is to write just the parameters object.

Parameters:
handler the ioHandler to be used
complete if true (the default) the enclosing begin/end will be also written, otherwise only the data block will be written.
Returns:
true if write was successful

Reimplemented from lti::functor.


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

Generated on Sat Apr 10 15:29:15 2010 for LTI-Lib by Doxygen 1.6.1