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

lti::dynamicMatrix< T > Class Template Reference
[Aggregate Data Types]

This template class allows the use of matrices which change its dimensions without losing any data. More...

#include <ltiDynamicMatrix.h>

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

List of all members.

Public Types

typedef point size_type
typedef std::list< int > stdIndexList

Public Member Functions

 dynamicMatrix ()
 dynamicMatrix (const dynamicMatrix< T > &other)
 ~dynamicMatrix ()
unsigned int rows () const
unsigned int columns () const
size_type size () const
bool isRowValid (const int theRow) const
bool isColumnValid (const int theColumn) const
bool addRow (const int theRow, const T initialValue=T())
bool addColumn (const int theColumn, const T initialValue=T())
bool deleteRow (const int theRow)
bool deleteColumn (const int theColumn)
T & at (const int &theRow, const int &theColumn)
const T & at (const int &theRow, const int &theColumn) const
dynamicMatrixoperator= (const dynamicMatrix< T > &theMatrix)
dynamicMatrixcopy (const dynamicMatrix< T > &theMatrix)
mathObjectclone () const
void setErrorValue (T error)
void clear ()
const stdIndexListgetUsedRows () const
const stdIndexListgetUsedColumns () const

Protected Types

typedef std::map< int, T > stdRowMap
typedef std::map< int, stdRowMapstddynamicMatrix

Protected Attributes

stdIndexList theRowIdx
stdIndexList theColIdx
stddynamicMatrix theMatrix
errorValue

Detailed Description

template<class T>
class lti::dynamicMatrix< T >

This template class allows the use of matrices which change its dimensions without losing any data.

They are base on the STL-maps. The intention of this class is to provide a base data-structure for the generation of classification statistics (confusion-matrices). This is a VERY SLOW class, but highly confortable for dynamically growing matrices.


Member Typedef Documentation

template<class T>
typedef point lti::dynamicMatrix< T >::size_type

Return type of the size() member.

template<class T>
typedef std::map<int,stdRowMap> lti::dynamicMatrix< T >::stddynamicMatrix [protected]

the matrix-data type

template<class T>
typedef std::list<int> lti::dynamicMatrix< T >::stdIndexList

list of integers, used to indicate the used indices in the matrix

template<class T>
typedef std::map<int,T> lti::dynamicMatrix< T >::stdRowMap [protected]

type of a "dynamic"-row


Constructor & Destructor Documentation

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

default constructor (create an empty matrix)

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

copy constructor

template<class T>
lti::dynamicMatrix< T >::~dynamicMatrix (  ) 

destructor


Member Function Documentation

template<class T>
bool lti::dynamicMatrix< T >::addColumn ( const int  theColumn,
const T  initialValue = T() 
)

insert a column with index "theColumn" on the matrix, and initialize its contents with "initialValue"

template<class T>
bool lti::dynamicMatrix< T >::addRow ( const int  theRow,
const T  initialValue = T() 
)

insert a row with index "theRow" on the matrix, and initialize its contents with "initialValue"

template<class T>
const T& lti::dynamicMatrix< T >::at ( const int &  theRow,
const int &  theColumn 
) const [inline]

read only access operator

template<class T>
T& lti::dynamicMatrix< T >::at ( const int &  theRow,
const int &  theColumn 
) [inline]

read-write access operator

template<class T>
void lti::dynamicMatrix< T >::clear (  ) 

clear the contents of the matrix

template<class T>
mathObject* lti::dynamicMatrix< T >::clone (  )  const [virtual]

clone member

Implements lti::mathObject.

template<class T>
unsigned int lti::dynamicMatrix< T >::columns (  )  const [inline]

get the number of columns actually being stored

template<class T>
dynamicMatrix& lti::dynamicMatrix< T >::copy ( const dynamicMatrix< T > &  theMatrix  )  [inline]

copy operator

Reimplemented from lti::ioObject.

Referenced by lti::dynamicMatrix< double >::operator=().

template<class T>
bool lti::dynamicMatrix< T >::deleteColumn ( const int  theColumn  ) 

delete the given column if it exists

template<class T>
bool lti::dynamicMatrix< T >::deleteRow ( const int  theRow  ) 

delete the given row if it exists

template<class T>
const stdIndexList& lti::dynamicMatrix< T >::getUsedColumns (  )  const [inline]

returns a list of integers with the used column indices

template<class T>
const stdIndexList& lti::dynamicMatrix< T >::getUsedRows (  )  const [inline]

returns a list of integers with the used row indices

template<class T>
bool lti::dynamicMatrix< T >::isColumnValid ( const int  theColumn  )  const

check if the given matrix exist on the matrix

template<class T>
bool lti::dynamicMatrix< T >::isRowValid ( const int  theRow  )  const

check if the given row exist on the matrix

template<class T>
dynamicMatrix& lti::dynamicMatrix< T >::operator= ( const dynamicMatrix< T > &  theMatrix  )  [inline]

assignment operator

Reimplemented from lti::ioObject.

template<class T>
unsigned int lti::dynamicMatrix< T >::rows (  )  const [inline]

get number of rows actually being stored

template<class T>
void lti::dynamicMatrix< T >::setErrorValue ( error  )  [inline]

the value given here will be return if the content of a non existent cell is requested

template<class T>
size_type lti::dynamicMatrix< T >::size (  )  const [inline]

return the size of the matrix (number of used rows and columns) as a point.

The "x" member contains the used columns and "y" the used rows.


Member Data Documentation

template<class T>
T lti::dynamicMatrix< T >::errorValue [protected]

value used when unexistent cells are accessed.

Referenced by lti::dynamicMatrix< double >::setErrorValue().

template<class T>
stdIndexList lti::dynamicMatrix< T >::theColIdx [protected]

the list of column indices

template<class T>
stddynamicMatrix lti::dynamicMatrix< T >::theMatrix [protected]

the matrix data

template<class T>
stdIndexList lti::dynamicMatrix< T >::theRowIdx [protected]

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

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