Main Page | User's Guide | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members

Seldon::Matrix_SymComplexSparse< T, Prop, Storage, Allocator > Class Template Reference

Symmetric complex sparse-matrix class. More...

#include <Matrix_SymComplexSparse.hxx>

Inheritance diagram for Seldon::Matrix_SymComplexSparse< T, Prop, Storage, Allocator >:

Seldon::Matrix_Base< T, Allocator > List of all members.

Public Types

typedef Allocator::value_type value_type
typedef Allocator::pointer pointer
typedef Allocator::const_pointer const_pointer
typedef Allocator::reference reference
typedef Allocator::const_reference const_reference

Public Member Functions

 Matrix_SymComplexSparse ()
 Default constructor.
 Matrix_SymComplexSparse (int i, int j)
 Constructor.
 Matrix_SymComplexSparse (int i, int j, int real_nz, int imag_nz)
 Constructor.
template<class Storage0, class Allocator0, class Storage1, class Allocator1, class Storage2, class Allocator2>
 Matrix_SymComplexSparse (int i, int j, Vector< T, Storage0, Allocator0 > &real_values, Vector< int, Storage1, Allocator1 > &real_ptr, Vector< int, Storage2, Allocator2 > &real_ind, Vector< T, Storage0, Allocator0 > &imag_values, Vector< int, Storage1, Allocator1 > &imag_ptr, Vector< int, Storage2, Allocator2 > &imag_ind)
 Constructor.
 ~Matrix_SymComplexSparse ()
 Destructor.
void Clear ()
 Clears the matrix.
template<class Storage0, class Allocator0, class Storage1, class Allocator1, class Storage2, class Allocator2>
void SetData (int i, int j, Vector< T, Storage0, Allocator0 > &real_values, Vector< int, Storage1, Allocator1 > &real_ptr, Vector< int, Storage2, Allocator2 > &real_ind, Vector< T, Storage0, Allocator0 > &imag_values, Vector< int, Storage1, Allocator1 > &imag_ptr, Vector< int, Storage2, Allocator2 > &imag_ind)
 Redefines the matrix.
void SetData (int i, int j, int real_nz, pointer real_values, int *real_ptr, int *real_ind, int imag_nz, pointer imag_values, int *imag_ptr, int *imag_ind)
 Redefines the matrix.
int GetNonZeros () const
int GetDataSize () const
 Returns the number of elements stored in memory.
int * GetRealPtr () const
 Returns (row or column) start indices for the real part.
int * GetImagPtr () const
 Returns (row or column) start indices for the imaginary part.
int * GetRealInd () const
 Returns (row or column) indices of non-zero entries for the real part.
int * GetImagInd () const
int GetRealPtrSize () const
 Returns the length of the array of start indices for the real part.
int GetImagPtrSize () const
 Returns the length of the array of start indices for the imaginary part.
int GetRealIndSize () const
int GetImagIndSize () const
T * GetRealData () const
 Returns the array of values of the real part.
T * GetImagData () const
 Returns the array of values of the imaginary part.
complex< value_type > operator() (int i, int j) const
 Access operator.
void Print () const
 Displays the matrix on the standard output.

Protected Attributes

int real_nz_
int imag_nz_
int * real_ptr_
int * imag_ptr_
int * real_ind_
int * imag_ind_
T * real_data_
T * imag_data_

Detailed Description

template<class T, class Prop, class Storage, class Allocator = SELDON_DEFAULT_ALLOCATOR<T>>
class Seldon::Matrix_SymComplexSparse< T, Prop, Storage, Allocator >

Symmetric complex sparse-matrix class.

Symmetric sparse matrices are defined by: (1) the number of rows and columns; (2) the number of non-zero entries; (3) an array 'ptr_' of start indices (i.e. indices of the first element of each row or column, depending on the storage); (4) an array 'ind_' of column or row indices of each non-zero entry; (5) values of non-zero entries.

Complex sparse matrices are defined in the same way except that real and imaginary parts are splitted. It is as if two matrices were stored. There are therefore 6 arrays: 'real_ptr_', 'real_ind_', 'real_data_', 'imag_ptr_', 'imag_ind_' and 'imag_data_'.
Finally, since the matrix is symmetric, only its upper part is stored.


Constructor & Destructor Documentation

template<class T, class Prop, class Storage, class Allocator>
Seldon::Matrix_SymComplexSparse< T, Prop, Storage, Allocator >::Matrix_SymComplexSparse  )  [inline]
 

Default constructor.

Builds an empty 0x0 matrix.

template<class T, class Prop, class Storage, class Allocator>
Seldon::Matrix_SymComplexSparse< T, Prop, Storage, Allocator >::Matrix_SymComplexSparse int  i,
int  j
[inline]
 

Constructor.

Builds an empty i by j sparse matrix.

Parameters:
i number of rows.
j number of columns.
Warning:
'j' is assumed to be equal to 'i' so that 'j' is discarded.

template<class T, class Prop, class Storage, class Allocator>
Seldon::Matrix_SymComplexSparse< T, Prop, Storage, Allocator >::Matrix_SymComplexSparse int  i,
int  j,
int  real_nz,
int  imag_nz
[inline]
 

Constructor.

Builds a sparse matrix of size i by j , with real_nz non-zero (stored) elements in the real part of the matrix and imag_nz non-zero elements in the imaginary part of the matrix.

Parameters:
i number of rows.
j number of columns.
real_nz number of non-zero elements that are stored for the real part.
imag_nz number of non-zero elements that are stored for the imaginary part.
Note:
Matrix values are not initialized. Indices of non-zero entries are not initialized either.

template<class T, class Prop, class Storage, class Allocator>
template<class Storage0, class Allocator0, class Storage1, class Allocator1, class Storage2, class Allocator2>
Seldon::Matrix_SymComplexSparse< T, Prop, Storage, Allocator >::Matrix_SymComplexSparse int  i,
int  j,
Vector< T, Storage0, Allocator0 > &  real_values,
Vector< int, Storage1, Allocator1 > &  real_ptr,
Vector< int, Storage2, Allocator2 > &  real_ind,
Vector< T, Storage0, Allocator0 > &  imag_values,
Vector< int, 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:
i number of rows.
j number of columns.
real_values values of non-zero entries for the real part.
real_ptr row or column start indices for the real part.
real_ind row or column indices for the real part.
imag_values values of non-zero entries for the imaginary part.
imag_ptr row or column start indices for the imaginary part.
imag_ind row 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.


Member Function Documentation

template<class T, class Prop, class Storage, class Allocator>
void Seldon::Matrix_SymComplexSparse< T, Prop, Storage, Allocator >::Clear  )  [inline]
 

Clears the matrix.

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

template<class T, class Prop, class Storage, class Allocator>
int Seldon::Matrix_SymComplexSparse< T, Prop, Storage, Allocator >::GetDataSize  )  const
 

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.

template<class T, class Prop, class Storage, class Allocator>
T * Seldon::Matrix_SymComplexSparse< T, Prop, Storage, Allocator >::GetImagData  )  const
 

Returns the array of values of the imaginary part.

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

template<class T, class Prop, class Storage, class Allocator>
int * Seldon::Matrix_SymComplexSparse< T, Prop, Storage, Allocator >::GetImagInd  )  const
 

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.

template<class T, class Prop, class Storage, class Allocator>
int Seldon::Matrix_SymComplexSparse< T, Prop, Storage, Allocator >::GetImagIndSize  )  const
 

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.

template<class T, class Prop, class Storage, class Allocator>
int * Seldon::Matrix_SymComplexSparse< T, Prop, Storage, Allocator >::GetImagPtr  )  const
 

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.

template<class T, class Prop, class Storage, class Allocator>
int Seldon::Matrix_SymComplexSparse< T, Prop, Storage, Allocator >::GetImagPtrSize  )  const
 

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.

template<class T, class Prop, class Storage, class Allocator>
T * Seldon::Matrix_SymComplexSparse< T, Prop, Storage, Allocator >::GetRealData  )  const
 

Returns the array of values of the real part.

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

template<class T, class Prop, class Storage, class Allocator>
int * Seldon::Matrix_SymComplexSparse< T, Prop, Storage, Allocator >::GetRealInd  )  const
 

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.

template<class T, class Prop, class Storage, class Allocator>
int Seldon::Matrix_SymComplexSparse< T, Prop, Storage, Allocator >::GetRealIndSize  )  const
 

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.

template<class T, class Prop, class Storage, class Allocator>
int * Seldon::Matrix_SymComplexSparse< T, Prop, Storage, Allocator >::GetRealPtr  )  const
 

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.

template<class T, class Prop, class Storage, class Allocator>
int Seldon::Matrix_SymComplexSparse< T, Prop, Storage, Allocator >::GetRealPtrSize  )  const
 

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.

template<class T, class Prop, class Storage, class Allocator>
complex< typename Matrix_SymComplexSparse< T, Prop, Storage, Allocator >::value_type > Seldon::Matrix_SymComplexSparse< T, Prop, Storage, Allocator >::operator() int  i,
int  j
const [inline]
 

Access operator.

Returns the value of element (i, j).

Parameters:
i row index.
j column index.
Returns:
Element (i, j) of the matrix.

template<class T, class Prop, class Storage, class Allocator>
void Seldon::Matrix_SymComplexSparse< T, Prop, Storage, Allocator >::Print  )  const
 

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.

template<class T, class Prop, class Storage, class Allocator>
void Seldon::Matrix_SymComplexSparse< T, Prop, Storage, Allocator >::SetData int  i,
int  j,
int  real_nz,
typename Matrix_SymComplexSparse< T, Prop, Storage, Allocator >::pointer  real_values,
int *  real_ptr,
int *  real_ind,
int  imag_nz,
typename Matrix_SymComplexSparse< T, Prop, Storage, Allocator >::pointer  imag_values,
int *  imag_ptr,
int *  imag_ind
[inline]
 

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:
i number of rows.
j number of columns.
real_nz number of non-zero entries (real part).
real_values values of non-zero entries for the real part.
real_ptr row or column start indices for the real part.
real_ind row or column indices for the real part.
imag_nz number of non-zero entries (imaginary part).
imag_values values of non-zero entries for the imaginary part.
imag_ptr row or column start indices for the imaginary part.
imag_ind row 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.

template<class T, class Prop, class Storage, class Allocator>
template<class Storage0, class Allocator0, class Storage1, class Allocator1, class Storage2, class Allocator2>
void Seldon::Matrix_SymComplexSparse< T, Prop, Storage, Allocator >::SetData int  i,
int  j,
Vector< T, Storage0, Allocator0 > &  real_values,
Vector< int, Storage1, Allocator1 > &  real_ptr,
Vector< int, Storage2, Allocator2 > &  real_ind,
Vector< T, Storage0, Allocator0 > &  imag_values,
Vector< int, Storage1, Allocator1 > &  imag_ptr,
Vector< int, Storage2, Allocator2 > &  imag_ind
 

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:
i number of rows.
j number of columns.
real_values values of non-zero entries for the real part.
real_ptr row or column start indices for the real part.
real_ind row or column indices for the real part.
imag_values values of non-zero entries for the imaginary part.
imag_ptr row or column start indices for the imaginary part.
imag_ind row 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.


The documentation for this class was generated from the following files:
Generated on Sun Jan 16 23:38:02 2005 for Multivac by  doxygen 1.4.0