Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | Friends | List of all members
Seldon::TinyMatrix< T, Symmetric, m, m > Class Template Reference

class storing tiny small matrices More...

#include <TinyMatrix.hxx>

Inheritance diagram for Seldon::TinyMatrix< T, Symmetric, m, m >:
Seldon::TinyMatrixExpression< T, m, m, TinyMatrix< T, Symmetric, m, m > >

Public Types

enum  { size_ = m*(m+1)/2 }
 

Public Member Functions

 TinyMatrix ()
 Default constructor : all elements of the matrix are set to 0.
 
 TinyMatrix (int i)
 Default constructor : all elements of the matrix are set to 0.
 
 TinyMatrix (int i, int j)
 Default constructor : all elements of the matrix are set to 0.
 
template<class E >
 TinyMatrix (const TinyMatrixExpression< T, m, m, E > &A)
 Constructor taking an expression.
 
T * GetData ()
 returns the pointer to the C-array
 
template<class T1 >
TinyMatrix< T, Symmetric, m, m > & operator*= (const T1 &a)
 *this = *this*a
 
template<class T1 , class E >
TinyMatrix< T, Symmetric, m, m > & operator+= (const TinyMatrixExpression< T1, m, m, E > &B)
 *this = *this + A
 
template<class T1 , class E >
TinyMatrix< T, Symmetric, m, m > & operator-= (const TinyMatrixExpression< T1, m, m, E > &B)
 *this = *this -B
 
TinyMatrix< T, Symmetric, m, m > & operator= (const T &x)
 *this = x (sets all values to x)
 
template<class T0 , class E >
TinyMatrix< T, Symmetric, m, m > & operator= (const TinyMatrixExpression< T0, m, m, E > &x)
 *this = x
 
T & operator() (int i, int j)
 returns A(i, j)
 
const T & operator() (int i, int j) const
 returns A(i, j)
 
void Zero ()
 sets all elements of the matrix to 0
 
void SetIdentity ()
 sets the matrix to the identity matrix
 
template<class T0 >
void SetDiagonal (const T0 &alpha)
 sets the matrix to the identity matrix multiplied by a coefficient alpha
 
void Fill ()
 sets matrix to [0, 1, 2; 1, 3, 4 ...]
 
void FillRand ()
 sets randomly all the elements of A
 
template<class T1 >
void Fill (const T1 &a)
 
bool IsZero () const
 returns true if the matrix is null
 
void WriteText (const string &file_name) const
 writing matrix in ascii format
 
void Write (const string &file_name) const
 writing matrix in binary format
 
void Write (ostream &out) const
 writing matrix in binary format
 
template<class T0 >
void Fill (const T0 &a)
 sets matrix to [0, 1, 2; 1, 3, 4 ...]
 
 operator TinyMatrix< T, Symmetric, m, m > & ()
 
 operator TinyMatrix< T, Symmetric, m, m > const & () const
 

Static Public Member Functions

static int GetM ()
 returns the number of rows
 
static int GetN ()
 returns the number of columns
 
static int GetSize ()
 returns the number of stored elements
 

Protected Attributes

data_ [m *(m+1)/2]
 elements stored in the matrix
 

Friends

template<int p>
class TinyMatrixLoop
 
template<int p, int q>
class TinyMatrixDoubleLoop
 

Detailed Description

template<class T, int m>
class Seldon::TinyMatrix< T, Symmetric, m, m >

class storing tiny small matrices

Definition at line 672 of file TinyMatrix.hxx.


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