Seldon::Matrix< T, Prop, RowComplexSparse, Allocator > Class Template Reference

Row-major sparse-matrix class. More...

#include <Matrix_ComplexSparse.hxx>

Inheritance diagram for Seldon::Matrix< T, Prop, RowComplexSparse, Allocator >:
Seldon::Matrix_ComplexSparse< T, Prop, RowComplexSparse, Allocator > Seldon::Matrix_Base< T, Allocator >

List of all members.

Public Types

typedef Allocator::value_type value_type
typedef Prop property
typedef RowComplexSparse 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 complex< value_type > entry_type
typedef complex< value_type > access_type
typedef complex< value_type > const_access_type

Public Member Functions

 Matrix ()
 Default constructor.
 Matrix (int i, int j)
 Builds a i by j matrix.
 Matrix (int i, int j, int real_nz, int imag_nz)
template<class Storage0 , class Allocator0 , class Storage1 , class Allocator1 , class Storage2 , class Allocator2 >
 Matrix (int i, int j, Vector< T, Storage0, Allocator0 > &values, Vector< int, Storage1, Allocator1 > &ptr, Vector< int, Storage2, Allocator2 > &ind, Vector< T, Storage0, Allocator0 > &imag_values, Vector< int, Storage1, Allocator1 > &imag_ptr, Vector< int, Storage2, Allocator2 > &imag_ind)
 Constructor.
void Clear ()
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)
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)
void Nullify ()
void Reallocate (int i, int j)
void Reallocate (int i, int j, int real_nz, int imag_nz)
void Resize (int i, int j)
void Resize (int i, int j, int real_nz, int imag_nz)
void Copy (const Matrix_ComplexSparse< T, Prop, RowComplexSparse, Allocator > &A)
int GetNonZeros () const
int GetDataSize () const
int * GetRealPtr () const
int * GetImagPtr () const
int * GetRealInd () const
int * GetImagInd () const
int GetRealPtrSize () const
int GetImagPtrSize () const
int GetRealIndSize () const
int GetImagIndSize () const
int GetRealDataSize () const
int GetImagDataSize () const
T * GetRealData () const
T * GetImagData () const
complex< value_type > operator() (int i, int j) const
value_type & ValReal (int i, int j)
const value_type & ValReal (int i, int j) const
value_type & ValImag (int i, int j)
const value_type & ValImag (int i, int j) const
value_type & GetReal (int i, int j)
const value_type & GetReal (int i, int j) const
value_type & GetImag (int i, int j)
const value_type & GetImag (int i, int j) const
void Set (int i, int j, const complex< T > &x)
void AddInteraction (int i, int j, const complex< T > &x)
void Zero ()
void SetIdentity ()
void Fill ()
void Fill (const complex< T > &x)
void FillRand ()
void Print () const
void Write (string FileName) const
void Write (ostream &FileStream) const
void WriteText (string FileName) const
void WriteText (ostream &FileStream) const
void Read (string FileName)
void Read (istream &FileStream)
void ReadText (string FileName)
void ReadText (istream &FileStream)
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.
int GetN () const
 Returns the number of columns.
int GetN (const Seldon::SeldonTranspose &status) const
 Returns the number of columns of the matrix possibly transposed.
int GetSize () const
 Returns the number of elements in the matrix.
pointer GetData () const
 Returns a pointer to the data array.
const_pointer GetDataConst () const
 Returns a const pointer to the data array.
void * GetDataVoid () const
 Returns a pointer of type "void*" to the data array.
const void * GetDataConstVoid () const
 Returns a pointer of type "const void*" to the data array.
Allocator & GetAllocator ()
 Returns the allocator of the matrix.

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_
int m_
int n_
pointer data_

Static Protected Attributes

static Allocator allocator_

Detailed Description

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

Row-major sparse-matrix class.

Definition at line 204 of file Matrix_ComplexSparse.hxx.


Constructor & Destructor Documentation

template<class T , class Prop , class Allocator >
Seldon::Matrix< T, Prop, RowComplexSparse, Allocator >::Matrix (  ) 

Default constructor.

Builds an empty 0x0 matrix.

Definition at line 2982 of file Matrix_ComplexSparse.cxx.

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

Builds a i by j matrix.

Parameters:
i number of rows.
j number of columns.

Definition at line 2994 of file Matrix_ComplexSparse.cxx.

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

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

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

Definition at line 3009 of file Matrix_ComplexSparse.cxx.

template<class T , class Prop , class Allocator >
template<class Storage0 , class Allocator0 , class Storage1 , class Allocator1 , class Storage2 , class Allocator2 >
Seldon::Matrix< T, Prop, RowComplexSparse, Allocator >::Matrix ( 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.

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.

Definition at line 3043 of file Matrix_ComplexSparse.cxx.


Member Function Documentation

template<class T , class Allocator >
Allocator & Seldon::Matrix_Base< T, Allocator >::GetAllocator (  )  [inherited]

Returns the allocator of the matrix.

Returns:
The allocator.

Definition at line 258 of file Matrix_Base.cxx.

template<class T , class Allocator >
Matrix_Base< T, Allocator >::pointer Seldon::Matrix_Base< T, Allocator >::GetData (  )  const [inherited]

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 208 of file Matrix_Base.cxx.

template<class T , class Allocator >
Matrix_Base< T, Allocator >::const_pointer Seldon::Matrix_Base< T, Allocator >::GetDataConst (  )  const [inherited]

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 221 of file Matrix_Base.cxx.

template<class T , class Allocator >
const void * Seldon::Matrix_Base< T, Allocator >::GetDataConstVoid (  )  const [inherited]

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 247 of file Matrix_Base.cxx.

template<class T , class Allocator >
void * Seldon::Matrix_Base< T, Allocator >::GetDataVoid (  )  const [inherited]

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 234 of file Matrix_Base.cxx.

template<class T , class Allocator >
int Seldon::Matrix_Base< T, Allocator >::GetM ( const Seldon::SeldonTranspose status  )  const [inherited]

Returns the number of rows of the matrix possibly transposed.

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

Reimplemented in Seldon::SubMatrix_Base< T, Prop, M, Allocator >.

Definition at line 130 of file Matrix_Base.cxx.

template<class T , class Allocator >
int Seldon::Matrix_Base< T, Allocator >::GetN ( const Seldon::SeldonTranspose status  )  const [inherited]

Returns the number of columns of the matrix possibly transposed.

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

Reimplemented in Seldon::SubMatrix_Base< T, Prop, M, Allocator >.

Definition at line 145 of file Matrix_Base.cxx.

template<class T , class Allocator >
int Seldon::Matrix_Base< T, Allocator >::GetSize (  )  const [inherited]

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