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

Column-major complex sparse-matrix class. More...

#include <Matrix_SymComplexSparse.hxx>

Inheritance diagram for Seldon::Matrix< T, Prop, ColSymComplexSparse, Allocator >:
Seldon::Matrix_SymComplexSparse< T, Prop, ColSymComplexSparse, Allocator > Seldon::Matrix_Base< T, Allocator > Seldon::VirtualMatrix< T >

Public Types

typedef Allocator::value_type value_type
 
typedef Prop property
 
typedef ColSymComplexSparse 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 SeldonDefaultAllocator< VectFull, int >::allocator AllocatorInt
 
typedef SeldonDefaultAllocator< VectFull, long >::allocator AllocatorLong
 
typedef complex< value_type > entry_type
 
typedef complex< value_type > access_type
 
typedef complex< value_type > const_access_type
 

Public Member Functions

 Matrix ()
 Default constructor. More...
 
 Matrix (int i, int j)
 Builds a i by j matrix. More...
 
 Matrix (int i, int j, long real_nz, long imag_nz)
 Constructor. More...
 
template<class Storage0 , class Allocator0 , class Storage1 , class Allocator1 , class Storage2 , class Allocator2 >
 Matrix (int i, int j, Vector< value_type, Storage0, Allocator0 > &real_values, Vector< long, Storage1, Allocator1 > &real_ptr, Vector< int, Storage2, Allocator2 > &real_ind, Vector< value_type, Storage0, Allocator0 > &imag_values, Vector< long, Storage1, Allocator1 > &imag_ptr, Vector< int, Storage2, Allocator2 > &imag_ind)
 Constructor. More...
 
void Clear ()
 Clears the matrix. More...
 
void SetData (int i, int j, Vector< value_type, Storage0, Allocator0 > &real_values, Vector< long, Storage1, Allocator1 > &real_ptr, Vector< int, Storage2, Allocator2 > &real_ind, Vector< value_type, Storage0, Allocator0 > &imag_values, Vector< long, Storage1, Allocator1 > &imag_ptr, Vector< int, Storage2, Allocator2 > &imag_ind)
 Redefines the matrix. More...
 
void SetData (int i, int j, long real_nz, pointer real_values, long *real_ptr, int *real_ind, long imag_nz, pointer imag_values, long *imag_ptr, int *imag_ind)
 
void SetData (int i, int j, long real_nz, typename Matrix_SymComplexSparse< T, Prop, ColSymComplexSparse, Allocator > ::pointer real_values, long *real_ptr, int *real_ind, long imag_nz, typename Matrix_SymComplexSparse< T, Prop, ColSymComplexSparse, Allocator > ::pointer imag_values, long *imag_ptr, int *imag_ind)
 Redefines the matrix. More...
 
void Nullify ()
 Clears the matrix without releasing memory. More...
 
void Reallocate (int i, int j)
 Initialization of an empty matrix i x j.
 
void Reallocate (int i, int j, long real_nz, long imag_nz)
 Initialization of a matrix i x j with n non-zero entries.
 
void Resize (int i, int j)
 Changing the number of rows and columns. More...
 
void Resize (int i, int j, long real_nz, long imag_nz)
 Changing the number of rows, columns and non-zero entries. More...
 
void Copy (const Matrix_SymComplexSparse< T, Prop, ColSymComplexSparse, Allocator > &A)
 Copies a matrix.
 
long GetNonZeros () const
 Returns the number of elements stored in memory. More...
 
long GetDataSize () const
 Returns the number of elements stored in memory. More...
 
size_t GetMemorySize () const
 returns size of A in bytes used to store the matrix
 
long * GetRealPtr () const
 Returns (row or column) start indices for the real part. More...
 
long * GetImagPtr () const
 Returns (row or column) start indices for the imaginary part. More...
 
int * GetRealInd () const
 Returns (row or column) indices of non-zero entries for the real part. More...
 
int * GetImagInd () const
 Returns (row or column) indices of non-zero entries for the imaginary part. More...
 
int GetRealPtrSize () const
 Returns the length of the array of start indices for the real part. More...
 
int GetImagPtrSize () const
 Returns the length of the array of start indices for the imaginary part. More...
 
long GetRealIndSize () const
 Returns the length of the array of (column or row) indices for the real part. More...
 
long GetImagIndSize () const
 Returns the length of the array of (column or row) indices for the imaginary part. More...
 
long GetRealDataSize () const
 Returns the length of the array of (column or row) indices for the real part. More...
 
long GetImagDataSize () const
 Returns the length of the array of (column or row) indices for the imaginary part. More...
 
value_type * GetRealData () const
 Returns the array of values of the real part. More...
 
value_type * GetImagData () const
 Returns the array of values of the imaginary part. More...
 
const complex< value_type > operator() (int i, int j) const
 Access operator. More...
 
value_type & ValReal (int i, int j)
 Access method. More...
 
const value_type & ValReal (int i, int j) const
 Access method. More...
 
value_type & ValImag (int i, int j)
 Access method. More...
 
const value_type & ValImag (int i, int j) const
 Access method. More...
 
value_type & GetReal (int i, int j)
 Access method. More...
 
const value_type & GetReal (int i, int j) const
 Access method. More...
 
value_type & GetImag (int i, int j)
 Access method. More...
 
const value_type & GetImag (int i, int j) const
 Access method. More...
 
void Set (int i, int j, const entry_type &x)
 Sets an element (i, j) to a value. More...
 
void AddInteraction (int i, int j, const entry_type &x)
 Add a value to a non-zero entry. More...
 
void AddInteractionRow (int i, int nb, const IVect &col, const Vector< entry_type > &val, bool sorted=false)
 Adds values to several non-zero entries on a given row.
 
void Zero ()
 Resets all non-zero entries to 0-value. More...
 
void SetIdentity ()
 Sets the matrix to identity. More...
 
void Fill ()
 Fills the non-zero entries with 0, 1, 2, ... More...
 
void Fill (const entry_type &x)
 Fills the non-zero entries with a given value. More...
 
void FillRand ()
 Fills the non-zero entries randomly. More...
 
void Print () const
 Displays the matrix on the standard output. More...
 
void Write (string FileName) const
 Writes the matrix in a file. More...
 
void Write (ostream &FileStream) const
 Writes the matrix to an output stream. More...
 
void WriteText (string FileName, bool cplx=false) const
 Writes the matrix in a file. More...
 
void WriteText (ostream &FileStream, bool cplx=false) const
 Writes the matrix to an output stream. More...
 
void Read (string FileName)
 Reads the matrix from a file. More...
 
void Read (istream &FileStream)
 Reads the matrix from an input stream. More...
 
void ReadText (string FileName, bool cplx=false)
 Reads the matrix from a file. More...
 
void ReadText (istream &FileStream, bool cplx=false)
 Reads the matrix from an input stream. More...
 
pointer GetData () const
 Returns a pointer to the data array. More...
 
const_pointer GetDataConst () const
 Returns a const pointer to the data array. More...
 
void * GetDataVoid () const
 Returns a pointer of type "void*" to the data array. More...
 
const void * GetDataConstVoid () const
 Returns a pointer of type "const void*" to the data array. More...
 
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 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 GetSize () const
 Returns the number of elements in the matrix. More...
 

Protected Attributes

long real_nz_
 
long imag_nz_
 
long * real_ptr_
 
long * imag_ptr_
 
int * real_ind_
 
int * imag_ind_
 
value_type * real_data_
 
value_type * imag_data_
 
pointer data_
 
int m_
 
int n_
 

Detailed Description

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

Column-major complex sparse-matrix class.

Definition at line 288 of file Matrix_SymComplexSparse.hxx.

Constructor & Destructor Documentation

◆ Matrix() [1/4]

template<class T , class Prop , class Allocator >
Seldon::Matrix< T, Prop, ColSymComplexSparse, Allocator >::Matrix
inline

Default constructor.

Builds an empty 0x0 matrix.

Definition at line 486 of file Matrix_SymComplexSparseInline.cxx.

◆ Matrix() [2/4]

template<class T , class Prop , class Allocator >
Seldon::Matrix< T, Prop, ColSymComplexSparse, Allocator >::Matrix ( int  i,
int  j 
)
inlineexplicit

Builds a i by j matrix.

Parameters
inumber of rows.
jnumber of columns.

Definition at line 499 of file Matrix_SymComplexSparseInline.cxx.

◆ Matrix() [3/4]

template<class T , class Prop , class Allocator >
Seldon::Matrix< T, Prop, ColSymComplexSparse, Allocator >::Matrix ( int  i,
int  j,
long  real_nz,
long  imag_nz 
)
inline

Constructor.

Builds a i by j matrix with real_nz and imag_nz non-zero (stored) elements for the real part and the imaginary part respectively.

Parameters
inumber of rows.
jnumber of columns.
real_nznumber of non-zero elements that are stored for the real part.
imag_nznumber of non-zero elements that are stored for the imaginary part.
Note
Matrix values are not initialized.
Warning
'j' is assumed to be equal to 'i' so that 'j' is discarded.

Definition at line 519 of file Matrix_SymComplexSparseInline.cxx.

◆ Matrix() [4/4]

template<class T , class Prop , class Allocator >
template<class Storage0 , class Allocator0 , class Storage1 , class Allocator1 , class Storage2 , class Allocator2 >
Seldon::Matrix< T, Prop, ColSymComplexSparse, Allocator >::Matrix ( int  i,
int  j,
Vector< value_type, Storage0, Allocator0 > &  real_values,
Vector< long, Storage1, Allocator1 > &  real_ptr,
Vector< int, Storage2, Allocator2 > &  real_ind,
Vector< value_type, Storage0, Allocator0 > &  imag_values,
Vector< long, Storage1, Allocator1 > &  imag_ptr,
Vector< int, Storage2, Allocator2 > &  imag_ind 
)
inline

Constructor.

Builds a i by j sparse matrix with non-zero values and indices provided by 'real_values' (values of the real part), 'real_ptr' (pointers for the real part), 'real_ind' (indices for the real part), 'imag_values' (values of the imaginary part), 'imag_ptr' (pointers for the imaginary part) and 'imag_ind' (indices for the imaginary part). Input vectors are released and are empty on exit.

Parameters
inumber of rows.
jnumber of columns.
real_valuesvalues of non-zero entries for the real part.
real_ptrrow or column start indices for the real part.
real_indrow or column indices for the real part.
imag_valuesvalues of non-zero entries for the imaginary part.
imag_ptrrow or column start indices for the imaginary part.
imag_indrow or column indices for the imaginary part.
Warning
Input vectors 'real_values', 'real_ptr' and 'real_ind', 'imag_values', 'imag_ptr' and 'imag_ind' are empty on exit. Moreover 'j' is assumed to be equal to 'i' so that 'j' is discarded.

Definition at line 554 of file Matrix_SymComplexSparseInline.cxx.

Member Function Documentation

◆ AddInteraction()

void Seldon::Matrix_SymComplexSparse< T, Prop, ColSymComplexSparse , Allocator >::AddInteraction ( int  i,
int  j,
const entry_type &  val 
)
inlineinherited

Add a value to a non-zero entry.

This function adds val to the element (i, j), provided that this element is already a non-zero entry. Otherwise a non-zero entry is inserted equal to val.

Parameters
[in]irow index.
[in]jcolumn index.
[in]valvalue to be added to the element (i, j).

Definition at line 313 of file Matrix_SymComplexSparseInline.cxx.

◆ Clear()

void Seldon::Matrix_SymComplexSparse< T, Prop, ColSymComplexSparse , Allocator >::Clear
inherited

Clears the matrix.

This methods is equivalent to the destructor. On exit, the matrix is empty (0x0).

Definition at line 317 of file Matrix_SymComplexSparse.cxx.

◆ Fill() [1/2]

void Seldon::Matrix_SymComplexSparse< T, Prop, ColSymComplexSparse , Allocator >::Fill
inherited

Fills the non-zero entries with 0, 1, 2, ...

On exit, the non-zero entries are 0, 1, 2, 3, ... The order of the numbers depends on the storage.

Definition at line 2306 of file Matrix_SymComplexSparse.cxx.

◆ Fill() [2/2]

void Seldon::Matrix_SymComplexSparse< T, Prop, ColSymComplexSparse , Allocator >::Fill ( const entry_type &  x)
inherited

Fills the non-zero entries with a given value.

Parameters
xthe value to set the non-zero entries to.

Definition at line 2322 of file Matrix_SymComplexSparse.cxx.

◆ FillRand()

void Seldon::Matrix_SymComplexSparse< T, Prop, ColSymComplexSparse , Allocator >::FillRand
inherited

Fills the non-zero entries randomly.

Note
The random generator is very basic.

Definition at line 2337 of file Matrix_SymComplexSparse.cxx.

◆ GetData()

template<class T , class Allocator >
Matrix_Base< T, Allocator >::pointer Seldon::Matrix_Base< T, Allocator >::GetData
inlineinherited

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 241 of file Matrix_BaseInline.cxx.

◆ GetDataConst()

template<class T , class Allocator >
Matrix_Base< T, Allocator >::const_pointer Seldon::Matrix_Base< T, Allocator >::GetDataConst
inlineinherited

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 254 of file Matrix_BaseInline.cxx.

◆ GetDataConstVoid()

template<class T , class Allocator >
const void * Seldon::Matrix_Base< T, Allocator >::GetDataConstVoid
inlineinherited

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 280 of file Matrix_BaseInline.cxx.

◆ GetDataSize()

long Seldon::Matrix_SymComplexSparse< T, Prop, ColSymComplexSparse , Allocator >::GetDataSize
inlineinherited

Returns the number of elements stored in memory.

Returns the number of elements stored in memory, i.e. the cumulated number of non-zero entries of both the real and the imaginary part.

Returns
The number of elements stored in memory.

Definition at line 71 of file Matrix_SymComplexSparseInline.cxx.

◆ GetDataVoid()

template<class T , class Allocator >
void * Seldon::Matrix_Base< T, Allocator >::GetDataVoid
inlineinherited

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 267 of file Matrix_BaseInline.cxx.

◆ GetImag() [1/2]

Matrix_SymComplexSparse< T, Prop, ColSymComplexSparse , Allocator >::value_type & Seldon::Matrix_SymComplexSparse< T, Prop, ColSymComplexSparse , Allocator >::GetImag ( int  i,
int  j 
)
inherited

Access method.

Returns the imaginary part of element (i, j) if it can be returned as a reference. If the non-zero entry does not exit, it is created

Parameters
[in]irow index.
[in]jcolumn index.
Returns
Element (i, j) of the matrix.

Definition at line 2177 of file Matrix_SymComplexSparse.cxx.

◆ GetImag() [2/2]

const Matrix_SymComplexSparse< T, Prop, ColSymComplexSparse , Allocator >::value_type & Seldon::Matrix_SymComplexSparse< T, Prop, ColSymComplexSparse , Allocator >::GetImag ( int  i,
int  j 
) const
inlineinherited

Access method.

Returns the imaginary part of element (i, j) if it can be returned as a reference. If the non-zero entry does not exit, it is created

Parameters
[in]irow index.
[in]jcolumn index.
Returns
Element (i, j) of the matrix.

Definition at line 297 of file Matrix_SymComplexSparseInline.cxx.

◆ GetImagData()

Allocator::value_type * Seldon::Matrix_SymComplexSparse< T, Prop, ColSymComplexSparse , Allocator >::GetImagData
inlineinherited

Returns the array of values of the imaginary part.

Returns
The array 'imag_data_' of values of the imaginary part..

Definition at line 258 of file Matrix_SymComplexSparseInline.cxx.

◆ GetImagDataSize()

long Seldon::Matrix_SymComplexSparse< T, Prop, ColSymComplexSparse , Allocator >::GetImagDataSize
inlineinherited

Returns the length of the array of (column or row) indices for the imaginary part.

Returns the length of the array ('ind_') of (row or column) indices of non-zero entries (that are stored) for the imaginary part. This array defines non-zero entries indices if coupled with (column or row) start indices.

Returns
The length of the array of (column or row) indices for the imaginary part.
Note
The length of the array of (column or row) indices is the number of non-zero entries that are stored.

Definition at line 234 of file Matrix_SymComplexSparseInline.cxx.

◆ GetImagInd()

int * Seldon::Matrix_SymComplexSparse< T, Prop, ColSymComplexSparse , Allocator >::GetImagInd
inlineinherited

Returns (row or column) indices of non-zero entries for the imaginary part.

Returns the array ('ind_') of (row or column) indices of non-zero entries for the imaginary part. This array defines non-zero entries indices if coupled with (column or row) start indices.

Returns
The array of (row or column) indices of non-zero entries for the imaginary part.

Definition at line 130 of file Matrix_SymComplexSparseInline.cxx.

◆ GetImagIndSize()

long Seldon::Matrix_SymComplexSparse< T, Prop, ColSymComplexSparse , Allocator >::GetImagIndSize
inlineinherited

Returns the length of the array of (column or row) indices for the imaginary part.

Returns the length of the array ('ind_') of (row or column) indices of non-zero entries (that are stored) for the imaginary part. This array defines non-zero entries indices if coupled with (column or row) start indices.

Returns
The length of the array of (column or row) indices for the imaginary part.
Note
The length of the array of (column or row) indices is the number of non-zero entries that are stored.

Definition at line 194 of file Matrix_SymComplexSparseInline.cxx.

◆ GetImagPtr()

long * Seldon::Matrix_SymComplexSparse< T, Prop, ColSymComplexSparse , Allocator >::GetImagPtr
inlineinherited

Returns (row or column) start indices for the imaginary part.

Returns the array ('ptr_') of start indices for the imaginary part.

Returns
The array of start indices for the imaginary part.

Definition at line 97 of file Matrix_SymComplexSparseInline.cxx.

◆ GetImagPtrSize()

int Seldon::Matrix_SymComplexSparse< T, Prop, ColSymComplexSparse , Allocator >::GetImagPtrSize
inlineinherited

Returns the length of the array of start indices for the imaginary part.

Returns
The length of the array of start indices for the imaginary part.

Definition at line 154 of file Matrix_SymComplexSparseInline.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.

◆ GetNonZeros()

long Seldon::Matrix_SymComplexSparse< T, Prop, ColSymComplexSparse , Allocator >::GetNonZeros
inlineinherited

Returns the number of elements stored in memory.

Returns the number of elements stored in memory, i.e. the cumulated number of non-zero entries of both the real and the imaginary part.

Returns
The number of elements stored in memory.

Definition at line 56 of file Matrix_SymComplexSparseInline.cxx.

◆ GetReal() [1/2]

Matrix_SymComplexSparse< T, Prop, ColSymComplexSparse , Allocator >::value_type & Seldon::Matrix_SymComplexSparse< T, Prop, ColSymComplexSparse , Allocator >::GetReal ( int  i,
int  j 
)
inherited

Access method.

Returns the real part of element (i, j) if it can be returned as a reference. If the non-zero entry does not exit, it is created

Parameters
[in]irow index.
[in]jcolumn index.
Returns
Element (i, j) of the matrix.

Definition at line 2104 of file Matrix_SymComplexSparse.cxx.

◆ GetReal() [2/2]

const Matrix_SymComplexSparse< T, Prop, ColSymComplexSparse , Allocator >::value_type & Seldon::Matrix_SymComplexSparse< T, Prop, ColSymComplexSparse , Allocator >::GetReal ( int  i,
int  j 
) const
inlineinherited

Access method.

Returns the real part of element (i, j) if it can be returned as a reference. If the non-zero entry does not exit, it is created

Parameters
[in]irow index.
[in]jcolumn index.
Returns
Element (i, j) of the matrix.

Definition at line 280 of file Matrix_SymComplexSparseInline.cxx.

◆ GetRealData()

Allocator::value_type * Seldon::Matrix_SymComplexSparse< T, Prop, ColSymComplexSparse , Allocator >::GetRealData
inlineinherited

Returns the array of values of the real part.

Returns
The array 'real_data_' of values of the real part..

Definition at line 246 of file Matrix_SymComplexSparseInline.cxx.

◆ GetRealDataSize()

long Seldon::Matrix_SymComplexSparse< T, Prop, ColSymComplexSparse , Allocator >::GetRealDataSize
inlineinherited

Returns the length of the array of (column or row) indices for the real part.

Returns the length of the array ('ind_') of (row or column) indices of non-zero entries (that are stored) for the real part. This array defines non-zero entries indices if coupled with (column or row) start indices.

Returns
The length of the array of (column or row) indices for the real part.
Note
The length of the array of (column or row) indices is the number of non-zero entries that are stored.

Definition at line 214 of file Matrix_SymComplexSparseInline.cxx.

◆ GetRealInd()

int * Seldon::Matrix_SymComplexSparse< T, Prop, ColSymComplexSparse , Allocator >::GetRealInd
inlineinherited

Returns (row or column) indices of non-zero entries for the real part.

Returns the array ('ind_') of (row or column) indices of non-zero entries for the real part. This array defines non-zero entries indices if coupled with (column or row) start indices.

Returns
The array of (row or column) indices of non-zero entries for the real part.

Definition at line 113 of file Matrix_SymComplexSparseInline.cxx.

◆ GetRealIndSize()

long Seldon::Matrix_SymComplexSparse< T, Prop, ColSymComplexSparse , Allocator >::GetRealIndSize
inlineinherited

Returns the length of the array of (column or row) indices for the real part.

Returns the length of the array ('ind_') of (row or column) indices of non-zero entries (that are stored) for the real part. This array defines non-zero entries indices if coupled with (column or row) start indices.

Returns
The length of the array of (column or row) indices for the real part.
Note
The length of the array of (column or row) indices is the number of non-zero entries that are stored.

Definition at line 174 of file Matrix_SymComplexSparseInline.cxx.

◆ GetRealPtr()

long * Seldon::Matrix_SymComplexSparse< T, Prop, ColSymComplexSparse , Allocator >::GetRealPtr
inlineinherited

Returns (row or column) start indices for the real part.

Returns the array ('ptr_') of start indices for the real part.

Returns
The array of start indices for the real part.

Definition at line 84 of file Matrix_SymComplexSparseInline.cxx.

◆ GetRealPtrSize()

int Seldon::Matrix_SymComplexSparse< T, Prop, ColSymComplexSparse , Allocator >::GetRealPtrSize
inlineinherited

Returns the length of the array of start indices for the real part.

Returns
The length of the array of start indices for the real part.

Definition at line 142 of file Matrix_SymComplexSparseInline.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.

◆ Nullify()

void Seldon::Matrix_SymComplexSparse< T, Prop, ColSymComplexSparse , Allocator >::Nullify
inherited

Clears the matrix without releasing memory.

On exit, the matrix is empty and the memory has not been released. It is useful for low level manipulations on a Matrix instance.

Definition at line 671 of file Matrix_SymComplexSparse.cxx.

◆ operator()()

const complex< typename Matrix_SymComplexSparse< T, Prop, ColSymComplexSparse , Allocator >::value_type > Seldon::Matrix_SymComplexSparse< T, Prop, ColSymComplexSparse , Allocator >::operator() ( int  i,
int  j 
) const
inherited

Access operator.

Returns the value of element (i, j).

Parameters
irow index.
jcolumn index.
Returns
Element (i, j) of the matrix.

Definition at line 1770 of file Matrix_SymComplexSparse.cxx.

◆ Print()

void Seldon::Matrix_SymComplexSparse< T, Prop, ColSymComplexSparse , Allocator >::Print
inherited

Displays the matrix on the standard output.

Displays elements on the standard output, in text format. Each row is displayed on a single line and elements of a row are delimited by tabulations.

Definition at line 2357 of file Matrix_SymComplexSparse.cxx.

◆ Read() [1/2]

void Seldon::Matrix_SymComplexSparse< T, Prop, ColSymComplexSparse , Allocator >::Read ( istream &  FileStream)
inherited

Reads the matrix from an input stream.

Reads a matrix in binary format from an input stream.

Parameters
FileStreaminput stream

Definition at line 2524 of file Matrix_SymComplexSparse.cxx.

◆ Read() [2/2]

void Seldon::Matrix_SymComplexSparse< T, Prop, ColSymComplexSparse , Allocator >::Read ( string  FileName)
inherited

Reads the matrix from a file.

Reads a matrix stored in binary format in a file.

Parameters
FileNameinput file name.

Definition at line 2499 of file Matrix_SymComplexSparse.cxx.

◆ ReadText() [1/2]

void Seldon::Matrix_SymComplexSparse< T, Prop, ColSymComplexSparse , Allocator >::ReadText ( istream &  FileStream,
bool  cplx = false 
)
inherited

Reads the matrix from an input stream.

Reads a matrix from a stream in text format.

Parameters
FileStreaminput stream.

Definition at line 2598 of file Matrix_SymComplexSparse.cxx.

◆ ReadText() [2/2]

void Seldon::Matrix_SymComplexSparse< T, Prop, ColSymComplexSparse , Allocator >::ReadText ( string  FileName,
bool  cplx = false 
)
inherited

Reads the matrix from a file.

Reads the matrix from a file in text format.

Parameters
FileNameinput file name.

Definition at line 2573 of file Matrix_SymComplexSparse.cxx.

◆ Resize() [1/2]

void Seldon::Matrix_SymComplexSparse< T, Prop, ColSymComplexSparse , Allocator >::Resize ( int  i,
int  j 
)
inherited

Changing the number of rows and columns.

Parameters
inumber of rows
jnumber of columns

Definition at line 1097 of file Matrix_SymComplexSparse.cxx.

◆ Resize() [2/2]

void Seldon::Matrix_SymComplexSparse< T, Prop, ColSymComplexSparse , Allocator >::Resize ( int  i,
int  j,
long  real_nz,
long  imag_nz 
)
inherited

Changing the number of rows, columns and non-zero entries.

Parameters
inumber of rows
jnumber of columns Previous entries are kept during the operation

Definition at line 1114 of file Matrix_SymComplexSparse.cxx.

◆ Set()

void Seldon::Matrix_SymComplexSparse< T, Prop, ColSymComplexSparse , Allocator >::Set ( int  i,
int  j,
const entry_type &  val 
)
inlineinherited

Sets an element (i, j) to a value.

This function sets val to the element (i, j)

Parameters
[in]irow index.
[in]jcolumn index.
[in]valA(i, j) = val

Definition at line 344 of file Matrix_SymComplexSparseInline.cxx.

◆ SetData() [1/2]

void Seldon::Matrix_SymComplexSparse< T, Prop, ColSymComplexSparse , Allocator >::SetData ( int  i,
int  j,
long  real_nz,
typename Matrix_SymComplexSparse< T, Prop, ColSymComplexSparse , Allocator > ::pointer  real_values,
long *  real_ptr,
int *  real_ind,
long  imag_nz,
typename Matrix_SymComplexSparse< T, Prop, ColSymComplexSparse , Allocator > ::pointer  imag_values,
long *  imag_ptr,
int *  imag_ind 
)
inherited

Redefines the matrix.

It clears the matrix and sets it to a new matrix defined by arrays 'real_values' (values of the real part), 'real_ptr' (pointers for the real part), 'real_ind' (indices for the real part), 'imag_values' (values of the imaginary part), 'imag_ptr' (pointers for the imaginary part) and 'imag_ind' (indices for the imaginary part).

Parameters
inumber of rows.
jnumber of columns.
real_nznumber of non-zero entries (real part).
real_valuesvalues of non-zero entries for the real part.
real_ptrrow or column start indices for the real part.
real_indrow or column indices for the real part.
imag_nznumber of non-zero entries (imaginary part).
imag_valuesvalues of non-zero entries for the imaginary part.
imag_ptrrow or column start indices for the imaginary part.
imag_indrow or column indices for the imaginary part.
Warning
On exit, arrays 'real_values', 'real_ptr', 'real_ind', 'imag_values', 'imag_ptr' and 'imag_ind' are managed by the matrix. For example, it means that the destructor will release those arrays; therefore, the user mustn't release those arrays. Moreover 'j' is assumed to be equal to 'i' so that 'j' is discarded.

Definition at line 640 of file Matrix_SymComplexSparse.cxx.

◆ SetData() [2/2]

void Seldon::Matrix_SymComplexSparse< T, Prop, ColSymComplexSparse , Allocator >::SetData ( int  i,
int  j,
Vector< value_type, Storage0, Allocator0 > &  real_values,
Vector< long, Storage1, Allocator1 > &  real_ptr,
Vector< int, Storage2, Allocator2 > &  real_ind,
Vector< value_type, Storage0, Allocator0 > &  imag_values,
Vector< long, Storage1, Allocator1 > &  imag_ptr,
Vector< int, Storage2, Allocator2 > &  imag_ind 
)
inherited

Redefines the matrix.

It clears the matrix and sets it to a new matrix defined by 'real_values' (values of the real part), 'real_ptr' (pointers for the real part), 'real_ind' (indices for the real part), 'imag_values' (values of the imaginary part), 'imag_ptr' (pointers for the imaginary part) and 'imag_ind' (indices for the imaginary part). Input vectors are released and are empty on exit.

Parameters
inumber of rows.
jnumber of columns.
real_valuesvalues of non-zero entries for the real part.
real_ptrrow or column start indices for the real part.
real_indrow or column indices for the real part.
imag_valuesvalues of non-zero entries for the imaginary part.
imag_ptrrow or column start indices for the imaginary part.
imag_indrow or column indices for the imaginary part.
Warning
Input vectors 'real_values', 'real_ptr' and 'real_ind', 'imag_values', 'imag_ptr' and 'imag_ind' are empty on exit. Moreover 'j' is assumed to be equal to 'i' so that 'j' is discarded.

Definition at line 466 of file Matrix_SymComplexSparse.cxx.

◆ SetIdentity()

void Seldon::Matrix_SymComplexSparse< T, Prop, ColSymComplexSparse , Allocator >::SetIdentity
inherited

Sets the matrix to identity.

This method fills the diagonal of the matrix with ones.

Definition at line 2273 of file Matrix_SymComplexSparse.cxx.

◆ ValImag() [1/2]

Matrix_SymComplexSparse< T, Prop, ColSymComplexSparse , Allocator >::value_type & Seldon::Matrix_SymComplexSparse< T, Prop, ColSymComplexSparse , Allocator >::ValImag ( int  i,
int  j 
)
inherited

Access method.

Returns the imaginary part of element (i, j) if it can be returned as a reference.

Parameters
[in]irow index.
[in]jcolumn index.
Returns
Element (i, j) of the matrix.
Exceptions
WrongArgumentNo reference can be returned because the element is a zero entry (not stored in the matrix).

Definition at line 1985 of file Matrix_SymComplexSparse.cxx.

◆ ValImag() [2/2]

const Matrix_SymComplexSparse< T, Prop, ColSymComplexSparse , Allocator >::value_type & Seldon::Matrix_SymComplexSparse< T, Prop, ColSymComplexSparse , Allocator >::ValImag ( int  i,
int  j 
) const
inherited

Access method.

Returns the imaginary part of element (i, j) if it can be returned as a reference.

Parameters
[in]irow index.
[in]jcolumn index.
Returns
Element (i, j) of the matrix.
Exceptions
WrongArgumentNo reference can be returned because the element is a zero entry (not stored in the matrix).

Definition at line 2045 of file Matrix_SymComplexSparse.cxx.

◆ ValReal() [1/2]

Matrix_SymComplexSparse< T, Prop, ColSymComplexSparse , Allocator >::value_type & Seldon::Matrix_SymComplexSparse< T, Prop, ColSymComplexSparse , Allocator >::ValReal ( int  i,
int  j 
)
inherited

Access method.

Returns the real value of element (i, j) if it can be returned as a reference.

Parameters
[in]irow index.
[in]jcolumn index.
Returns
Element (i, j) of the matrix.
Exceptions
WrongArgumentNo reference can be returned because the element is a zero entry (not stored in the matrix).

Definition at line 1865 of file Matrix_SymComplexSparse.cxx.

◆ ValReal() [2/2]

const Matrix_SymComplexSparse< T, Prop, ColSymComplexSparse , Allocator >::value_type & Seldon::Matrix_SymComplexSparse< T, Prop, ColSymComplexSparse , Allocator >::ValReal ( int  i,
int  j 
) const
inherited

Access method.

Returns the real value of element (i, j) if it can be returned as a reference.

Parameters
[in]irow index.
[in]jcolumn index.
Returns
Element (i, j) of the matrix.
Exceptions
WrongArgumentNo reference can be returned because the element is a zero entry (not stored in the matrix).

Definition at line 1925 of file Matrix_SymComplexSparse.cxx.

◆ Write() [1/2]

void Seldon::Matrix_SymComplexSparse< T, Prop, ColSymComplexSparse , Allocator >::Write ( ostream &  FileStream) const
inherited

Writes the matrix to an output stream.

Stores the matrix in an output stream in binary format.

Parameters
FileStreamoutput stream.

Definition at line 2400 of file Matrix_SymComplexSparse.cxx.

◆ Write() [2/2]

void Seldon::Matrix_SymComplexSparse< T, Prop, ColSymComplexSparse , Allocator >::Write ( string  FileName) const
inherited

Writes the matrix in a file.

Stores the matrix in a file in binary format.

Parameters
FileNameoutput file name.

Definition at line 2375 of file Matrix_SymComplexSparse.cxx.

◆ WriteText() [1/2]

void Seldon::Matrix_SymComplexSparse< T, Prop, ColSymComplexSparse , Allocator >::WriteText ( ostream &  FileStream,
bool  cplx = false 
) const
inherited

Writes the matrix to an output stream.

Stores the matrix in a file in ascii format. The entries are written in coordinate format (row column value) 1-index convention is used

Parameters
FileStreamoutput stream.

Definition at line 2473 of file Matrix_SymComplexSparse.cxx.

◆ WriteText() [2/2]

void Seldon::Matrix_SymComplexSparse< T, Prop, ColSymComplexSparse , Allocator >::WriteText ( string  FileName,
bool  cplx = false 
) const
inherited

Writes the matrix in a file.

Stores the matrix in a file in ascii format. The entries are written in coordinate format (row column value) 1-index convention is used

Parameters
FileNameoutput file name.

Definition at line 2443 of file Matrix_SymComplexSparse.cxx.

◆ Zero()

void Seldon::Matrix_SymComplexSparse< T, Prop, ColSymComplexSparse , Allocator >::Zero
inherited

Resets all non-zero entries to 0-value.

The sparsity pattern remains unchanged.

Definition at line 2259 of file Matrix_SymComplexSparse.cxx.


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