Public Types | Public Member Functions | Protected Attributes | List of all members
Seldon::Matrix< T, General, BandedCol, Allocator > Class Template Reference

banded matrix stored by columns (Lapack format) More...

#include <BandMatrix.hxx>

Inheritance diagram for Seldon::Matrix< T, General, BandedCol, Allocator >:
Seldon::Matrix_Band< T, General, BandedCol, Allocator > Seldon::VirtualMatrix< T >

Public Types

typedef T entry_type
 

Public Member Functions

int GetKL () const
 returns the number of extra-diagonals in lower part of the matrix
 
int GetKU () const
 returns the number of extra-diagonals in upper part of the matrix
 
int GetM () const
 returns the number of rows
 
int GetM () const
 Returns the number of rows. More...
 
int GetM (const Seldon::SeldonTranspose &status) const
 Returns the number of rows of the matrix possibly transposed. More...
 
int GetM (const CBLAS_TRANSPOSE &status) const
 Returns the number of rows of the matrix possibly transposed. More...
 
int GetN () const
 returns the number of rows
 
int GetN () const
 Returns the number of columns. More...
 
int GetN (const Seldon::SeldonTranspose &status) const
 Returns the number of columns of the matrix possibly transposed. More...
 
int GetN (const CBLAS_TRANSPOSE &status) const
 Returns the number of columns of the matrix possibly transposed. More...
 
long GetDataSize () const
 returns the number of elements stored in the matrix
 
size_t GetMemorySize () const
 returns the memory used by the object in bytes
 
void Clear ()
 clears the matrix
 
void Zero ()
 fills non-zero entries with 0
 
void HideMessages ()
 present for compatibility
 
void Reallocate (int m, int n)
 changes the size of the matrix, previous entries are lost
 
void Reallocate (int m, int n, int kl, int ku)
 changes the size of the matrix, previous entries are lost
 
T * GetData () const
 returns a pointer to the array containing values
 
void AddInteraction (int i, int j, const T &val)
 sets A(i, j) = A(i, j) + val
 
void AddInteractionRow (int i, int n, const IVect &num, const Vector< T > &val, bool sorted=false)
 adds severals values on a single row of the matrix
More...
 
void ClearRow (int i)
 clears row i, fills it with 0 More...
 
const T operator() (int i, int j) const
 returns entry (i, j) of the matrix
 
Matrix< T, General, BandedCol, Allocator > & operator*= (const T &alpha)
 multiplication by a scalar
 
T & Get (int i, int j)
 returns a reference to A(i, j)
 
const T & Get (int i, int j) const
 returns a reference to A(i, j)
 
T & Val (int i, int j)
 returns a reference to A(i, j)
 
const T & Val (int i, int j) const
 returns a reference to A(i, j)
 
void Set (int, int, const T &)
 sets A(i, j)

 
void SetEntry (int, int, const T &)
 sets A(i, j)

 
void SetIdentity ()
 sets the matrix to the identity matrix
 
void Fill (const T0 &x)
 sets all non-zero entries to a same value
 
void FillRand ()
 sets all non-zero entries to random values
 
void Copy (const Matrix< T, General, ArrayRowSparse > &A)
 conversion from a CSR matrix
 
void Factorize ()
 performs LU factorisation without pivoting
 
void Factorize (IVect &)
 performs LU factorisation with pivoting
 
void Add_ (const T0 &alpha, const Matrix< T, General, BandedCol, Allocator > &A)
 performs the operation *this = *this + alpha A
 
void MltAdd (const T0 &alpha, const SeldonTranspose &trans, const Vector< T1 > &x, Vector< T1 > &y) const
 performs matrix-vector product y = y + alpha A x
 
void Solve (Vector< T1 > &x) const
 solves A x = b, assuming that Factorize has been previously called
 
void Solve (const IVect &, Vector< T1 > &x) const
 
void Solve (const Vector< int > &ipivot, Vector< T1 > &x) const
 solves A x = b, assuming that Factorize has been previously called (with pivoting)
 
void Write (string FileName) const
 writes the matrix in a file in binary format
 
void Write (ostream &FileStream) const
 writes the matrix in binary format
 
void WriteText (string FileName) const
 writes the matrix in a file in text format
 
void WriteText (ostream &FileStream) const
 writes the matrix in text format
 
long GetSize () const
 Returns the number of elements in the matrix. More...
 

Protected Attributes

int kl_
 number of extra-diagonals in lower part
 
int ku_
 number of extra-diagonals in upper part
 
Matrix< T, General, ColMajor, Allocator > data_
 values are stored in a dense matrix (in Lapack format)
 
int m_
 
int n_
 

Detailed Description

template<class T, class Allocator>
class Seldon::Matrix< T, General, BandedCol, Allocator >

banded matrix stored by columns (Lapack format)

Definition at line 161 of file BandMatrix.hxx.

Member Function Documentation

◆ AddInteractionRow()

void Seldon::Matrix_Band< T, General , BandedCol , Allocator >::AddInteractionRow ( int  i,
int  n,
const IVect num,
const Vector< T > &  val,
bool  sorted = false 
)
inherited

adds severals values on a single row of the matrix

Parameters
[in]irow on which values are added
[in]nnumber of values to add
[in]numcolumn numbers
[in]valvalues

Definition at line 94 of file BandMatrix.cxx.

◆ ClearRow()

void Seldon::Matrix_Band< T, General , BandedCol , Allocator >::ClearRow ( int  i)
inherited

clears row i, fills it with 0

Parameters
[in]irow to clear

Definition at line 107 of file BandMatrix.cxx.

◆ GetM() [1/3]

template<class T >
int Seldon::VirtualMatrix< T >::GetM
inlineinherited

Returns the number of rows.

Returns
The number of rows.

Definition at line 69 of file Matrix_BaseInline.cxx.

◆ GetM() [2/3]

template<class T >
int Seldon::VirtualMatrix< T >::GetM ( const CBLAS_TRANSPOSE &  status) const
inlineinherited

Returns the number of rows of the matrix possibly transposed.

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

Definition at line 122 of file Matrix_BaseInline.cxx.

◆ GetM() [3/3]

template<class T >
int Seldon::VirtualMatrix< T >::GetM ( const Seldon::SeldonTranspose status) const
inlineinherited

Returns the number of rows of the matrix possibly transposed.

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

Definition at line 92 of file Matrix_BaseInline.cxx.

◆ GetN() [1/3]

template<class T >
int Seldon::VirtualMatrix< T >::GetN
inlineinherited

Returns the number of columns.

Returns
The number of columns.

Definition at line 80 of file Matrix_BaseInline.cxx.

◆ GetN() [2/3]

template<class T >
int Seldon::VirtualMatrix< T >::GetN ( const CBLAS_TRANSPOSE &  status) const
inlineinherited

Returns the number of columns of the matrix possibly transposed.

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

Definition at line 137 of file Matrix_BaseInline.cxx.

◆ GetN() [3/3]

template<class T >
int Seldon::VirtualMatrix< T >::GetN ( const Seldon::SeldonTranspose status) const
inlineinherited

Returns the number of columns of the matrix possibly transposed.

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

Definition at line 107 of file Matrix_BaseInline.cxx.

◆ GetSize()

template<class T >
long Seldon::VirtualMatrix< T >::GetSize
inlineinherited

Returns the number of elements in the matrix.

Returns the number of elements in the matrix, i.e. the number of rows multiplied by the number of columns.

Returns
The number of elements in the matrix.

Definition at line 153 of file Matrix_BaseInline.cxx.


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