Public Member Functions | Protected Attributes
openfluid::core::Matrix< T > Class Template Reference

List of all members.

Public Member Functions

 Matrix ()
 Matrix (const Matrix &Matrix)
 Matrix (unsigned long ColsNbr, unsigned long RowsNbr)
 Matrix (unsigned long ColsNbr, unsigned long RowsNbr, T InitValue)
virtual ~Matrix ()
unsigned long getColsNbr () const
unsigned long getRowsNbr () const
unsigned long getSize () const
unsigned long size () const
T * getData () const
void setData (T *Data)
T getElement (unsigned long ColIndex, unsigned long RowIndex) const
T at (unsigned long ColIndex, unsigned long RowIndex) const
T get (unsigned long ColIndex, unsigned long RowIndex) const
void setElement (unsigned long ColIndex, unsigned long RowIndex, T Element)
void set (unsigned long ColIndex, unsigned long RowIndex, T Element)
Matrix< T > & operator= (const Matrix &A)
void fill (const T &Val)
void clear ()

Protected Attributes

boost::multi_array< T, 2 > m_Data
unsigned long m_ColsNbr
unsigned long m_RowsNbr

Detailed Description

template<class T>
class openfluid::core::Matrix< T >

Template class for matrix data


Constructor & Destructor Documentation

template<class T >
openfluid::core::Matrix< T >::Matrix ( )

Default constructor, creates an empty Matrix

template<class T >
openfluid::core::Matrix< T >::Matrix ( const Matrix< T > &  Matrix)

Copy constructor

template<class T >
openfluid::core::Matrix< T >::Matrix ( unsigned long  ColsNbr,
unsigned long  RowsNbr 
)

Constructor, creates a Matrix containing Size elements

template<class T>
openfluid::core::Matrix< T >::Matrix ( unsigned long  ColsNbr,
unsigned long  RowsNbr,
T  InitValue 
)

Constructor, creates a Matrix containing Size elements, initialized with value InitValue

template<class T>
virtual openfluid::core::Matrix< T >::~Matrix ( ) [inline, virtual]

Destructor


Member Function Documentation

template<class T>
T openfluid::core::Matrix< T >::at ( unsigned long  ColIndex,
unsigned long  RowIndex 
) const [inline]

Returns the element of the Matrix for index Index

template<class T >
void openfluid::core::Matrix< T >::clear ( )

Clears the Matrix (empty and size is 0)

template<class T>
void openfluid::core::Matrix< T >::fill ( const T &  Val)

Fills the Matrix with given value

template<class T>
T openfluid::core::Matrix< T >::get ( unsigned long  ColIndex,
unsigned long  RowIndex 
) const [inline]

Returns the element of the Matrix for index Index

template<class T>
unsigned long openfluid::core::Matrix< T >::getColsNbr ( ) const [inline]

Returns the number of columns of the Matrix

Returns:
number of columns
template<class T>
T* openfluid::core::Matrix< T >::getData ( ) const [inline]

Returns a pointer to the content of the Matrix (like C arrays)

template<class T >
T openfluid::core::Matrix< T >::getElement ( unsigned long  ColIndex,
unsigned long  RowIndex 
) const

Returns the element of the Matrix for index Index

template<class T>
unsigned long openfluid::core::Matrix< T >::getRowsNbr ( ) const [inline]

Returns the number of rows of the Matrix

Returns:
number of rows
template<class T>
unsigned long openfluid::core::Matrix< T >::getSize ( ) const [inline]

Returns the full size of the Matrix (number of columns x number of rows)

Returns:
size of the Matrix
template<class T >
Matrix< T > & openfluid::core::Matrix< T >::operator= ( const Matrix< T > &  A)

Allocation operator

template<class T>
void openfluid::core::Matrix< T >::set ( unsigned long  ColIndex,
unsigned long  RowIndex,
T  Element 
) [inline]

Sets a new value for element at the given index

template<class T>
void openfluid::core::Matrix< T >::setData ( T *  Data)

Sets data from a pointer to a content (like C arrays)

template<class T>
void openfluid::core::Matrix< T >::setElement ( unsigned long  ColIndex,
unsigned long  RowIndex,
T  Element 
)

Sets a new value for element at the given index

template<class T>
unsigned long openfluid::core::Matrix< T >::size ( ) const [inline]

Returns the full size of the Matrix


Member Data Documentation

template<class T>
unsigned long openfluid::core::Matrix< T >::m_ColsNbr [protected]
template<class T>
boost::multi_array<T, 2> openfluid::core::Matrix< T >::m_Data [protected]
template<class T>
unsigned long openfluid::core::Matrix< T >::m_RowsNbr [protected]

Generated using Doxygen 1.7.6.1
Creative Commons License Creative Commons By-NC-ND license