Public Types | Public Member Functions | Protected Attributes | List of all members
Seldon::Matrix_Arrow< T, Prop, Storage, Allocator > Class Template Reference

base class for arrow matrix (banded matrix + dense columns/rows) More...

#include <BandMatrix.hxx>

Inheritance diagram for Seldon::Matrix_Arrow< T, Prop, Storage, Allocator >:
Seldon::Matrix_Band< T, Prop, Storage, typename SeldonDefaultAllocator< Storage, T >::allocator > Seldon::VirtualMatrix< T >

Public Types

typedef T entry_type
 

Public Member Functions

 Matrix_Arrow ()
 default constructor
 
int GetM () const
 returns the number of rows
 
int GetN () const
 returns the number of columns
 
int GetNbLastRow () const
 returns the number of dense rows placed at the end of the matrix
 
int GetNbLastCol () const
 returns the number of dense columns placed at the end of the matrix
 
long GetDataSize () const
 returns the number of non-zero entries
 
size_t GetMemorySize () const
 returns the memory used by the object in bytes
 
void Clear ()
 clears the matrix
 
void Zero ()
 sets all non-zero entries to 0
 
void HideMessages ()
 present for compatibility
 
void Reallocate (int m, int n)
 changes the size of the matrix
 
void Reallocate (int m, int n, int kl, int ku, int nb_last_row=0, int nb_last_col=0)
 changes the size of the matrix
 
void AddInteraction (int i, int j, const T &val)
 performs the operation 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, Prop, Storage, 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
 
template<class T0 >
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 Factorize ()
 performs LU factorisation without pivoting
 
template<class T0 >
void Add_ (const T0 &alpha, const Matrix< T, General, ArrowCol, Allocator > &A)
 performs the operation *this = *this + alpha A
 
template<class T0 , class T1 >
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

 
template<class T1 >
void Solve (Vector< T1 > &x) const
 solves A x = b, assuming that Factorize has been previously called
 
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
 
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 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 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 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 Copy (const Matrix< T, General, ArrayRowSparse > &A)
 conversion from a CSR matrix
 
void Factorize (IVect &)
 performs LU factorisation with pivoting
 
void Add_ (const T0 &alpha, const Matrix< T, General, BandedCol, typename SeldonDefaultAllocator< Storage, T >::allocator > &A)
 performs the operation *this = *this + alpha A
 
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)
 
long GetSize () const
 Returns the number of elements in the matrix. More...
 

Protected Attributes

Matrix< T, General, RowMajor, Allocator > last_rows_
 last rows
 
Matrix< T, General, ColMajor, Allocator > last_columns_
 last columns
 
Matrix< T, General, ColMajor, Allocator > last_block_
 last block
 
int kl_
 number of extra-diagonals in lower part
 
int ku_
 number of extra-diagonals in upper part
 
Matrix< T, General, ColMajor, typename SeldonDefaultAllocator< Storage, T >::allocator > data_
 values are stored in a dense matrix (in Lapack format)
 
int m_
 
int n_
 

Detailed Description

template<class T, class Prop, class Storage, class Allocator = typename SeldonDefaultAllocator<Storage, T>::allocator>
class Seldon::Matrix_Arrow< T, Prop, Storage, Allocator >

base class for arrow matrix (banded matrix + dense columns/rows)

Definition at line 170 of file BandMatrix.hxx.

Member Function Documentation

◆ AddInteractionRow()

template<class T , class Prop , class Storage , class Allocator >
void Seldon::Matrix_Arrow< T, Prop, Storage, Allocator >::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

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

Definition at line 592 of file BandMatrix.cxx.

◆ ClearRow()

template<class T , class Prop , class Storage , class Allocator >
void Seldon::Matrix_Arrow< T, Prop, Storage, Allocator >::ClearRow ( int  i)

clears row i, fills it with 0

Parameters
[in]irow to clear

Definition at line 605 of file BandMatrix.cxx.

◆ GetM() [1/2]

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() [2/2]

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/2]

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() [2/2]

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 files: