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

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

triMatrix is a very simple class to optimize memory usage when using an square triangular matrix with following form: More...

#include <ltiTriMatrix.h>

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

List of all members.

Public Types

typedef T value_type
typedef int size_type

Public Member Functions

 triMatrix ()
 triMatrix (const int y)
 triMatrix (const triMatrix< T > &x)
virtual ~triMatrix ()
T & at (const int y, const int x)
const T & at (const int y, const int x) const
T * operator[] (const int y)
const T * operator[] (const int y) const
triMatrix< T > & operator= (const triMatrix< T > &x)
triMatrix< T > & copy (const triMatrix< T > &x)
int size () const
virtual const char * getTypeName () const
virtual mathObjectclone () const
virtual bool write (ioHandler &handler, const bool complete=true) const
virtual bool read (ioHandler &handler, const bool complete=true)

Protected Attributes

T * mem
T ** rows
int dimension

Detailed Description

template<class T>
class lti::triMatrix< T >

triMatrix is a very simple class to optimize memory usage when using an square triangular matrix with following form:

     x x x x x x
     x x x x x
     x x x x
     x x x
     x x
     x

Member Typedef Documentation

template<class T>
typedef int lti::triMatrix< T >::size_type

return type of the size() member

template<class T>
typedef T lti::triMatrix< T >::value_type

type of the contained data


Constructor & Destructor Documentation

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

default constructor

template<class T>
lti::triMatrix< T >::triMatrix ( const int  y  ) 

constructor with a default size.

The matrix will be a y times y diagonal matrix.

template<class T>
lti::triMatrix< T >::triMatrix ( const triMatrix< T > &  x  ) 

copy constructor

template<class T>
virtual lti::triMatrix< T >::~triMatrix (  )  [virtual]

destructor


Member Function Documentation

template<class T>
const T& lti::triMatrix< T >::at ( const int  y,
const int  x 
) const

read-only access operator.

Parameters:
y which row
x which column
template<class T>
T& lti::triMatrix< T >::at ( const int  y,
const int  x 
)

read/write access operator.

Parameters:
y which row
x which column
template<class T>
virtual mathObject* lti::triMatrix< T >::clone (  )  const [virtual]

returns a copy of this object

Implements lti::mathObject.

template<class T>
triMatrix<T>& lti::triMatrix< T >::copy ( const triMatrix< T > &  x  ) 

copy the other matrix

Reimplemented from lti::ioObject.

template<class T>
virtual const char* lti::triMatrix< T >::getTypeName ( void   )  const [inline, virtual]

returns the name of this class

Reimplemented from lti::mathObject.

template<class T>
triMatrix<T>& lti::triMatrix< T >::operator= ( const triMatrix< T > &  x  ) 

copy the other matrix

Reimplemented from lti::ioObject.

template<class T>
const T* lti::triMatrix< T >::operator[] ( const int  y  )  const

return a pointer to the begin of the given row

template<class T>
T* lti::triMatrix< T >::operator[] ( const int  y  ) 

return a pointer to the begin of the given row

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

read the object from the given ioHandler

Reimplemented from lti::mathObject.

template<class T>
int lti::triMatrix< T >::size (  )  const [inline]

return the number of rows (or columns) of this matrix

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

write the object in the given ioHandler

Reimplemented from lti::mathObject.


Member Data Documentation

template<class T>
int lti::triMatrix< T >::dimension [protected]

the dimension of the matrix

Referenced by lti::triMatrix< int >::size().

template<class T>
T* lti::triMatrix< T >::mem [protected]

the data of the matrix

template<class T>
T** lti::triMatrix< T >::rows [protected]

the pointers to the rows of the matrix


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

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