Seldon::Matrix< T, Prop, RowUpTriangPacked, Allocator > Class Template Reference

Row-major upper-triangular packed matrix class. More...

#include <Matrix_TriangPacked.hxx>

Inheritance diagram for Seldon::Matrix< T, Prop, RowUpTriangPacked, Allocator >:
Seldon::Matrix_TriangPacked< T, Prop, RowUpTriangPacked, Allocator > Seldon::Matrix_Base< T, Allocator >

List of all members.

Public Types

typedef Allocator::value_type value_type
typedef Prop property
typedef RowUpTriangPacked storage
typedef Allocator allocator
typedef Allocator::pointer pointer
typedef Allocator::const_pointer const_pointer
typedef Allocator::reference reference
typedef Allocator::const_reference const_reference
typedef Allocator::value_type entry_type
typedef Allocator::reference access_type
typedef Allocator::const_reference const_access_type

Public Member Functions

 Matrix ()
 Default constructor.
 Matrix (int i, int j=0)
 Main constructor.
void Resize (int i, int j)
 Reallocates memory to resize the matrix and keeps previous entries.
template<class T0 >
Matrix< T, Prop,
RowUpTriangPacked, Allocator > & 
operator= (const T0 &x)
 Fills the matrix with a given value.
Matrix< T, Prop,
RowUpTriangPacked, Allocator > & 
operator= (const Matrix< T, Prop, RowUpTriangPacked, Allocator > &A)
 Duplicates a matrix (assignment operator).
template<class T0 >
Matrix< T, Prop,
RowUpTriangPacked, Allocator > & 
operator*= (const T0 &x)
 Multiplies the matrix by a given value.
void Clear ()
int GetDataSize () const
void Reallocate (int i, int j)
void SetData (int i, int j, pointer data)
void Nullify ()
value_type operator() (int i, int j) const
reference Val (int i, int j)
const_reference Val (int i, int j) const
reference Get (int i, int j)
const_reference Get (int i, int j) const
reference operator[] (int i)
const_reference operator[] (int i) const
void Set (int i, int j, const T &x)
void Copy (const Matrix_TriangPacked< T, Prop, RowUpTriangPacked, Allocator > &A)
void Zero ()
void SetIdentity ()
void Fill ()
void Fill (const T0 &x)
void FillRand ()
void Print () const
void Print (int a, int b, int m, int n) const
void Print (int l) const
void Write (string FileName) const
void Write (ostream &FileStream) const
void WriteText (string FileName) const
void WriteText (ostream &FileStream) const
void Read (string FileName)
void Read (istream &FileStream)
void ReadText (string FileName)
void ReadText (istream &FileStream)
int GetM () const
 Returns the number of rows.
int GetM (const Seldon::SeldonTranspose &status) const
 Returns the number of rows of the matrix possibly transposed.
int GetN () const
 Returns the number of columns.
int GetN (const Seldon::SeldonTranspose &status) const
 Returns the number of columns of the matrix possibly transposed.
int GetSize () const
 Returns the number of elements in the matrix.
pointer GetData () const
 Returns a pointer to the data array.
const_pointer GetDataConst () const
 Returns a const pointer to the data array.
void * GetDataVoid () const
 Returns a pointer of type "void*" to the data array.
const void * GetDataConstVoid () const
 Returns a pointer of type "const void*" to the data array.
Allocator & GetAllocator ()
 Returns the allocator of the matrix.

Protected Attributes

int m_
int n_
pointer data_

Static Protected Attributes

static Allocator allocator_

Detailed Description

template<class T, class Prop, class Allocator>
class Seldon::Matrix< T, Prop, RowUpTriangPacked, Allocator >

Row-major upper-triangular packed matrix class.

Definition at line 167 of file Matrix_TriangPacked.hxx.


Constructor & Destructor Documentation

template<class T , class Prop , class Allocator >
Seldon::Matrix< T, Prop, RowUpTriangPacked, Allocator >::Matrix (  )  [inline]

Default constructor.

On exit, the matrix is an empty 0x0 matrix.

Definition at line 1290 of file Matrix_TriangPacked.cxx.

template<class T , class Prop , class Allocator >
Seldon::Matrix< T, Prop, RowUpTriangPacked, Allocator >::Matrix ( int  i,
int  j = 0 
) [inline]

Main constructor.

Builds a i x j row-major upper triangular matrix in packed form.

Parameters:
i number of rows.
j number of columns.
Note:
'j' is assumed to be equal to 'i' and is therefore discarded.

Definition at line 1303 of file Matrix_TriangPacked.cxx.


Member Function Documentation

template<class T , class Allocator >
Allocator & Seldon::Matrix_Base< T, Allocator >::GetAllocator (  )  [inherited]

Returns the allocator of the matrix.

Returns:
The allocator.

Definition at line 258 of file Matrix_Base.cxx.

template<class T , class Allocator >
Matrix_Base< T, Allocator >::pointer Seldon::Matrix_Base< T, Allocator >::GetData (  )  const [inherited]

Returns a pointer to the data array.

Returns a pointer to data, i.e. the data array 'data_'.

Returns:
A pointer to the data array.

Definition at line 208 of file Matrix_Base.cxx.

template<class T , class Allocator >
Matrix_Base< T, Allocator >::const_pointer Seldon::Matrix_Base< T, Allocator >::GetDataConst (  )  const [inherited]

Returns a const pointer to the data array.

Returns a const pointer to data, i.e. the data array 'data_'.

Returns:
A const pointer to the data array.

Definition at line 221 of file Matrix_Base.cxx.

template<class T , class Allocator >
const void * Seldon::Matrix_Base< T, Allocator >::GetDataConstVoid (  )  const [inherited]

Returns a pointer of type "const void*" to the data array.

Returns a pointer of type "const void*" to data, i.e. the data array 'data_'.

Returns:
A const pointer of type "void*" to the data array.

Definition at line 247 of file Matrix_Base.cxx.

template<class T , class Allocator >
void * Seldon::Matrix_Base< T, Allocator >::GetDataVoid (  )  const [inherited]

Returns a pointer of type "void*" to the data array.

Returns a pointer of type "void*" to data, i.e. the data array 'data_'.

Returns:
A pointer of type "void*" to the data array.

Definition at line 234 of file Matrix_Base.cxx.

template<class T , class Allocator >
int Seldon::Matrix_Base< T, Allocator >::GetM ( const Seldon::SeldonTranspose status  )  const [inherited]

Returns the number of rows of the matrix possibly transposed.

Parameters:
status assumed status about the transposition of the matrix.
Returns:
The number of rows of the possibly-transposed matrix.

Reimplemented in Seldon::SubMatrix_Base< T, Prop, M, Allocator >.

Definition at line 130 of file Matrix_Base.cxx.

template<class T , class Allocator >
int Seldon::Matrix_Base< T, Allocator >::GetN ( const Seldon::SeldonTranspose status  )  const [inherited]

Returns the number of columns of the matrix possibly transposed.

Parameters:
status assumed status about the transposition of the matrix.
Returns:
The number of columns of the possibly-transposed matrix.

Reimplemented in Seldon::SubMatrix_Base< T, Prop, M, Allocator >.

Definition at line 145 of file Matrix_Base.cxx.

template<class T , class Allocator >
int Seldon::Matrix_Base< T, Allocator >::GetSize (  )  const [inherited]
template<class T , class Prop , class Allocator >
template<class T0 >
Matrix< T, Prop, RowUpTriangPacked, Allocator > & Seldon::Matrix< T, Prop, RowUpTriangPacked, Allocator >::operator*= ( const T0 &  x  ) 

Multiplies the matrix by a given value.

Parameters:
x multiplication coefficient

Definition at line 1389 of file Matrix_TriangPacked.cxx.

template<class T , class Prop , class Allocator >
template<class T0 >
Matrix< T, Prop, RowUpTriangPacked, Allocator > & Seldon::Matrix< T, Prop, RowUpTriangPacked, Allocator >::operator= ( const T0 &  x  ) 

Fills the matrix with a given value.

Parameters:
x value to fill the matrix with.

Reimplemented from Seldon::Matrix_TriangPacked< T, Prop, RowUpTriangPacked, Allocator >.

Definition at line 1358 of file Matrix_TriangPacked.cxx.

template<class T , class Prop , class Allocator >
Matrix< T, Prop, RowUpTriangPacked, Allocator > & Seldon::Matrix< T, Prop, RowUpTriangPacked, Allocator >::operator= ( const Matrix< T, Prop, RowUpTriangPacked, Allocator > &  A  )  [inline]

Duplicates a matrix (assignment operator).

Parameters:
A matrix to be copied.
Note:
Memory is duplicated: A is therefore independent from the current instance after the copy.

Definition at line 1375 of file Matrix_TriangPacked.cxx.

template<class T , class Prop , class Allocator >
void Seldon::Matrix< T, Prop, RowUpTriangPacked, Allocator >::Resize ( int  i,
int  j 
) [inline]

Reallocates memory to resize the matrix and keeps previous entries.

On exit, the matrix is a i x j matrix.

Parameters:
i new number of rows.
j new number of columns.
Warning:
The previous entries are kept, extra-entries may not be initialized (depending of the allocator).

Definition at line 1324 of file Matrix_TriangPacked.cxx.


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