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

Class storing small matrices whose number of rows and columns is known at compilation time. More...

#include <TinyMatrix.hxx>

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

Public Types

enum  { size_ = m*n }
 

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

Friends

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

Detailed Description

template<class T, int m, int n>
class Seldon::TinyMatrix< T, General, m, n >

Class storing small matrices whose number of rows and columns is known at compilation time.

Definition at line 37 of file TinyMatrix.hxx.


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