Public Member Functions | Private Types | Static Private Member Functions | Private Attributes | Friends

alize::DoubleSquareMatrix Class Reference

#include <DoubleSquareMatrix.h>

Inheritance diagram for alize::DoubleSquareMatrix:
Inheritance graph
[legend]
Collaboration diagram for alize::DoubleSquareMatrix:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 DoubleSquareMatrix (unsigned long size=0)
const DoubleSquareMatrixoperator= (const DoubleSquareMatrix &)
bool operator== (const DoubleSquareMatrix &) const
bool operator!= (const DoubleSquareMatrix &) const
 DoubleSquareMatrix (const DoubleSquareMatrix &)
virtual ~DoubleSquareMatrix ()
unsigned long size () const
void setSize (const unsigned long size, const bool updateCapacity=false)
real_t invert (DoubleSquareMatrix &m)
void setAllValues (_type v)
_typeoperator() (unsigned long col, unsigned long row)
_type operator() (unsigned long col, unsigned long row) const
_typegetArray () const
virtual String toString () const
virtual String getClassName () const

Private Types

typedef double _type

Static Private Member Functions

static void choleskyDecomp (real_t *, real_t *, long)
static void choleskySolve (real_t *, real_t *, real_t *, long)

Private Attributes

unsigned long _size
DoubleVector _array

Friends

class TestDoubleSquareMatrix

Detailed Description

This class implements a symmetric matrix of real_t values.
Inside the object, the matrix is stored as a single-dimension array. Remember that when you call the method getArray() to access the internal array.

Author:
Frederic Wils frederic.wils@lia.univ-avignon.fr
Version:
1.0
Date:
2003

Definition at line 82 of file DoubleSquareMatrix.h.


Member Typedef Documentation

typedef double alize::DoubleSquareMatrix::_type [private]

Definition at line 88 of file DoubleSquareMatrix.h.


Constructor & Destructor Documentation

M::DoubleSquareMatrix ( unsigned long  size = 0 ) [explicit]

Create a symmetric matrix of type double values.

Parameters:
dimensionof the matrix

Definition at line 70 of file DoubleSquareMatrix.cpp.

M::DoubleSquareMatrix ( const DoubleSquareMatrix v )

Definition at line 73 of file DoubleSquareMatrix.cpp.

M::~DoubleSquareMatrix (  ) [virtual]

Definition at line 238 of file DoubleSquareMatrix.cpp.


Member Function Documentation

void M::choleskyDecomp ( real_t pMatrix,
real_t pDiag,
long  n 
) [static, private]

Definition at line 153 of file DoubleSquareMatrix.cpp.

void M::choleskySolve ( real_t pMatrix,
real_t pDiag,
real_t pB,
long  n 
) [static, private]

Definition at line 186 of file DoubleSquareMatrix.cpp.

M::_type * M::getArray (  ) const

Use this method to access directly to the internal vector

Returns:
a pointer on the first element
Warning:
Fast but dangerous ! Use preferably operator (col, row).

Definition at line 217 of file DoubleSquareMatrix.cpp.

Referenced by alize::DistribGF::computeLK(), and invert().

String M::getClassName (  ) const [virtual]

Returns the name of the class

Returns:
the name of the class of the object as a String

Implements alize::Object.

Definition at line 221 of file DoubleSquareMatrix.cpp.

real_t M::invert ( DoubleSquareMatrix m )

Inverts the matrix and compute the determinant
ONLY for symmetric positive definite matrix

Parameters:
mto store the inverted matrix
Returns:
the determinant
Exceptions:
ifthe matrix is not a positive definite matrix

Definition at line 109 of file DoubleSquareMatrix.cpp.

References _size, alize::RealVector< T >::getArray(), and getArray().

Referenced by alize::DistribGF::computeAll().

bool M::operator!= ( const DoubleSquareMatrix v ) const

Definition at line 86 of file DoubleSquareMatrix.cpp.

M::_type M::operator() ( unsigned long  col,
unsigned long  row 
) const

like the other operator[] but for constant DoubleSquareMatrix object.

Definition at line 96 of file DoubleSquareMatrix.cpp.

M::_type & M::operator() ( unsigned long  col,
unsigned long  row 
)

Overloaded operator() to access an element in the matrix.
WARNING : contrary to class Matrix, colum index is FIRST argument and row index is SECOND argument
This will probably change in next release of Alize

Parameters:
colcolumn index of the element to access
rowindex of the element to access
Returns:
a reference to the element
Exceptions:
IndexOutOfBoundsException

Definition at line 89 of file DoubleSquareMatrix.cpp.

const DoubleSquareMatrix & M::operator= ( const DoubleSquareMatrix v )

Definition at line 76 of file DoubleSquareMatrix.cpp.

References _array, and _size.

bool M::operator== ( const DoubleSquareMatrix v ) const

Definition at line 83 of file DoubleSquareMatrix.cpp.

References _array.

void M::setAllValues ( _type  v )

Sets all the values to a a particular value

Parameters:
vthe real_t value to set

Definition at line 215 of file DoubleSquareMatrix.cpp.

void M::setSize ( const unsigned long  size,
const bool  updateCapacity = false 
)

Sets the new size of the square matrix

Parameters:
sizethe size
updateCapacitytrue = frees unused memory false = does not free unused memory

Definition at line 103 of file DoubleSquareMatrix.cpp.

Referenced by alize::DistribGF::computeAll(), alize::DistribGF::getCov(), and alize::DistribGF::setCov().

unsigned long M::size (  ) const
String M::toString (  ) const [virtual]

This method is frequently overridden in the derived classes. If it is not, it returns the name of the class of the object and the address of the object

Returns:
a description of the object

Reimplemented from alize::Object.

Definition at line 223 of file DoubleSquareMatrix.cpp.

References alize::Object::toString(), and alize::String::valueOf().


Friends And Related Function Documentation

friend class TestDoubleSquareMatrix [friend]

Definition at line 84 of file DoubleSquareMatrix.h.


Member Data Documentation

Definition at line 153 of file DoubleSquareMatrix.h.

Referenced by operator=(), and operator==().

unsigned long alize::DoubleSquareMatrix::_size [private]

Definition at line 152 of file DoubleSquareMatrix.h.

Referenced by invert(), and operator=().


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