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

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

#include <Matrix_ArrayComplexSparse.hxx>

Inheritance diagram for Seldon::Matrix< T, Prop, ArrayRowSymComplexSparse, Allocator >:
Seldon::Matrix_ArrayComplexSparse< T, Prop, ArrayRowSymComplexSparse, Allocator >

List of all members.

Public Types

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

Public Member Functions

 Matrix ()
 Default constructor.
 Matrix (int i, int j)
 Constructor.
complex< T > operator() (int i, int j) const
 Access operator.
T & ValReal (int i, int j)
 Returns access to real part of element (i, j).
const T & ValReal (int i, int j) const
 Returns access to real part element (i, j).
T & ValImag (int i, int j)
 Returns access to imaginary part of element (i, j).
const T & ValImag (int i, int j) const
 Returns access to imaginary part of element (i, j).
T & GetReal (int i, int j)
 Returns access to real part element (i, j).
const T & GetReal (int i, int j) const
 Returns access to real part of element (i, j).
T & GetImag (int i, int j)
 Returns access to imaginary part of element (i, j).
const T & GetImag (int i, int j) const
 Returns access to imaginary part element (i, j).
void Set (int i, int j, const complex< T > &x)
 Sets element (i, j) of the matrix.
void ClearRealRow (int i)
 Clears a row.
void ClearImagRow (int i)
 Clears a row.
void ReallocateRealRow (int i, int j)
 Reallocates row i.
void ReallocateImagRow (int i, int j)
 Reallocates row i.
void ResizeRealRow (int i, int j)
 Reallocates row i.
void ResizeImagRow (int i, int j)
 Reallocates row i.
void SwapRealRow (int i, int i_)
 Swaps two rows.
void SwapImagRow (int i, int i_)
 Swaps two rows.
void ReplaceRealIndexRow (int i, IVect &new_index)
 Sets column numbers of non-zero entries of a row.
void ReplaceImagIndexRow (int i, IVect &new_index)
 Sets column numbers of non-zero entries of a row.
int GetRealRowSize (int i) const
 Returns the number of non-zero entries of a row.
int GetImagRowSize (int i) const
 Returns the number of non-zero entries of a row.
void PrintRealRow (int i) const
 Displays non-zero values of a column.
void PrintImagRow (int i) const
 Displays non-zero values of a column.
void AssembleRealRow (int i)
 Assembles a column.
void AssembleImagRow (int i)
 Assembles a column.
void AddInteraction (int i, int j, const complex< T > &val)
 Adds a coefficient in the matrix.
template<class Alloc1 >
void AddInteractionRow (int i, int nb, const IVect &col, const Vector< complex< T >, VectFull, Alloc1 > &val)
 Adds coefficients in a row.
template<class Alloc1 >
void AddInteractionColumn (int i, int nb, const IVect &row, const Vector< complex< T >, VectFull, Alloc1 > &val)
 Adds coefficients in a column.
void Clear ()
void Reallocate (int i, int j)
void Resize (int i, int j)
int GetM () const
int GetM (const SeldonTranspose &status) const
int GetN () const
int GetN (const SeldonTranspose &status) const
int GetRealNonZeros () const
int GetImagNonZeros () const
int GetRealDataSize () const
int GetImagDataSize () const
int GetDataSize () const
int * GetRealInd (int i) const
int * GetImagInd (int i) const
T * GetRealData (int i) const
Vector< T, VectSparse,
Allocator > * 
GetRealData () const
T * GetImagData (int i) const
Vector< T, VectSparse,
Allocator > * 
GetImagData () const
complex< T > & Val (int i, int j)
const complex< T > & Val (int i, int j) const
complex< T > & Get (int i, int j)
const complex< T > & Get (int i, int j) const
const T & ValueReal (int num_row, int i) const
T & ValueReal (int num_row, int i)
int IndexReal (int num_row, int i) const
int & IndexReal (int num_row, int i)
const T & ValueImag (int num_row, int i) const
T & ValueImag (int num_row, int i)
int IndexImag (int num_row, int i) const
int & IndexImag (int num_row, int i)
void SetRealData (int, int, Vector< T, VectSparse, Allocator > *)
void SetRealData (int, int, T *, int *)
void SetImagData (int, int, Vector< T, VectSparse, Allocator > *)
void SetImagData (int, int, T *, int *)
void NullifyReal (int i)
void NullifyReal ()
void NullifyImag (int i)
void NullifyImag ()
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)
void Assemble ()
void RemoveSmallEntry (const T0 &epsilon)
void SetIdentity ()
void Zero ()
void Fill ()
void Fill (const complex< T0 > &x)
void FillRand ()

Protected Attributes

int m_
 Number of rows.
int n_
 Number of columns.
Vector< Vector< T, VectSparse,
Allocator >, VectFull,
NewAlloc< Vector< T,
VectSparse, Allocator > > > 
val_real_
 real part rows or columns
Vector< Vector< T, VectSparse,
Allocator >, VectFull,
NewAlloc< Vector< T,
VectSparse, Allocator > > > 
val_imag_
 imaginary part rows or columns

Detailed Description

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

Row-major symmetric sparse-matrix class.

Definition at line 314 of file Matrix_ArrayComplexSparse.hxx.


Constructor & Destructor Documentation

template<class T , class Prop , class Allocator >
Seldon::Matrix< T, Prop, ArrayRowSymComplexSparse, Allocator >::Matrix (  )  [inline]

Default constructor.

Builds an empty matrix.

Definition at line 2565 of file Matrix_ArrayComplexSparse.cxx.

template<class T , class Prop , class Allocator >
Seldon::Matrix< T, Prop, ArrayRowSymComplexSparse, Allocator >::Matrix ( int  i,
int  j 
) [inline]

Constructor.

Builds a i by j matrix

Parameters:
i number of rows.
j number of columns.
Note:
Matrix values are not initialized.

Definition at line 2579 of file Matrix_ArrayComplexSparse.cxx.


Member Function Documentation

template<class T , class Prop , class Allocator >
void Seldon::Matrix< T, Prop, ArrayRowSymComplexSparse, Allocator >::AddInteraction ( int  i,
int  j,
const complex< T > &  val 
) [inline]

Adds a coefficient in the matrix.

Parameters:
[in] i row number.
[in] j column number.
[in] val coefficient to add.

Definition at line 3111 of file Matrix_ArrayComplexSparse.cxx.

template<class T , class Prop , class Allocator >
template<class Alloc1 >
void Seldon::Matrix< T, Prop, ArrayRowSymComplexSparse, Allocator >::AddInteractionColumn ( int  i,
int  nb,
const IVect row,
const Vector< complex< T >, VectFull, Alloc1 > &  val 
) [inline]

Adds coefficients in a column.

Parameters:
[in] i column number.
[in] nb number of coefficients to add.
[in] row row numbers of coefficients.
[in] val values of coefficients.

Definition at line 3172 of file Matrix_ArrayComplexSparse.cxx.

template<class T , class Prop , class Allocator >
template<class Alloc1 >
void Seldon::Matrix< T, Prop, ArrayRowSymComplexSparse, Allocator >::AddInteractionRow ( int  i,
int  nb,
const IVect col,
const Vector< complex< T >, VectFull, Alloc1 > &  val 
) [inline]

Adds coefficients in a row.

Parameters:
[in] i row number.
[in] nb number of coefficients to add.
[in] col column numbers of coefficients.
[in] val values of coefficients.

Definition at line 3133 of file Matrix_ArrayComplexSparse.cxx.

template<class T , class Prop , class Allocator >
void Seldon::Matrix< T, Prop, ArrayRowSymComplexSparse, Allocator >::AssembleImagRow ( int  i  )  [inline]

Assembles a column.

Parameters:
[in] i column number.
Warning:
If you are using the methods AddInteraction, you don't need to call that method.

Definition at line 3097 of file Matrix_ArrayComplexSparse.cxx.

template<class T , class Prop , class Allocator >
void Seldon::Matrix< T, Prop, ArrayRowSymComplexSparse, Allocator >::AssembleRealRow ( int  i  )  [inline]

Assembles a column.

Parameters:
[in] i column number.
Warning:
If you are using the methods AddInteraction, you don't need to call that method.

Definition at line 3083 of file Matrix_ArrayComplexSparse.cxx.

template<class T , class Prop , class Allocator >
T & Seldon::Matrix< T, Prop, ArrayRowSymComplexSparse, Allocator >::GetImag ( int  i,
int  j 
) [inline]

Returns access to imaginary part of element (i, j).

Parameters:
i row index.
j column index.
Returns:
imaginary part of element (i, j) of the matrix.

Reimplemented from Seldon::Matrix_ArrayComplexSparse< T, Prop, ArrayRowSymComplexSparse, Allocator >.

Definition at line 2808 of file Matrix_ArrayComplexSparse.cxx.

template<class T , class Prop , class Allocator >
const T & Seldon::Matrix< T, Prop, ArrayRowSymComplexSparse, Allocator >::GetImag ( int  i,
int  j 
) const [inline]

Returns access to imaginary part element (i, j).

Parameters:
i row index.
j column index.
Returns:
imaginary part of element (i, j) of the matrix.

Reimplemented from Seldon::Matrix_ArrayComplexSparse< T, Prop, ArrayRowSymComplexSparse, Allocator >.

Definition at line 2837 of file Matrix_ArrayComplexSparse.cxx.

template<class T , class Prop , class Allocator >
int Seldon::Matrix< T, Prop, ArrayRowSymComplexSparse, Allocator >::GetImagRowSize ( int  i  )  const [inline]

Returns the number of non-zero entries of a row.

Parameters:
[in] i row number.
Returns:
The number of non-zero entries of the row i.

Definition at line 3051 of file Matrix_ArrayComplexSparse.cxx.

template<class T , class Prop , class Allocator >
T & Seldon::Matrix< T, Prop, ArrayRowSymComplexSparse, Allocator >::GetReal ( int  i,
int  j 
) [inline]

Returns access to real part element (i, j).

Returns the value of element (i, j).

Parameters:
i row index.
j column index.
Returns:
real part of element (i, j) of the matrix.

Reimplemented from Seldon::Matrix_ArrayComplexSparse< T, Prop, ArrayRowSymComplexSparse, Allocator >.

Definition at line 2690 of file Matrix_ArrayComplexSparse.cxx.

template<class T , class Prop , class Allocator >
const T & Seldon::Matrix< T, Prop, ArrayRowSymComplexSparse, Allocator >::GetReal ( int  i,
int  j 
) const [inline]

Returns access to real part of element (i, j).

Returns the value of element (i, j).

Parameters:
i row index.
j column index.
Returns:
real part of element (i, j) of the matrix.

Reimplemented from Seldon::Matrix_ArrayComplexSparse< T, Prop, ArrayRowSymComplexSparse, Allocator >.

Definition at line 2720 of file Matrix_ArrayComplexSparse.cxx.

template<class T , class Prop , class Allocator >
int Seldon::Matrix< T, Prop, ArrayRowSymComplexSparse, Allocator >::GetRealRowSize ( int  i  )  const [inline]

Returns the number of non-zero entries of a row.

Parameters:
[in] i row number.
Returns:
The number of non-zero entries of the row i.

Definition at line 3037 of file Matrix_ArrayComplexSparse.cxx.

template<class T , class Prop , class Allocator >
complex< T > Seldon::Matrix< T, Prop, ArrayRowSymComplexSparse, 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.

Reimplemented from Seldon::Matrix_ArrayComplexSparse< T, Prop, ArrayRowSymComplexSparse, Allocator >.

Definition at line 2599 of file Matrix_ArrayComplexSparse.cxx.

template<class T , class Prop , class Allocator >
void Seldon::Matrix< T, Prop, ArrayRowSymComplexSparse, Allocator >::ReallocateImagRow ( int  i,
int  j 
) [inline]

Reallocates row i.

Parameters:
[in] i row number.
[in] j new number of non-zero entries in the row.
Warning:
Data may be lost.

Definition at line 2944 of file Matrix_ArrayComplexSparse.cxx.

template<class T , class Prop , class Allocator >
void Seldon::Matrix< T, Prop, ArrayRowSymComplexSparse, Allocator >::ReallocateRealRow ( int  i,
int  j 
) [inline]

Reallocates row i.

Parameters:
[in] i row number.
[in] j new number of non-zero entries in the row.
Warning:
Data may be lost.

Definition at line 2930 of file Matrix_ArrayComplexSparse.cxx.

template<class T , class Prop , class Allocator >
void Seldon::Matrix< T, Prop, ArrayRowSymComplexSparse, Allocator >::ReplaceImagIndexRow ( int  i,
IVect new_index 
) [inline]

Sets column numbers of non-zero entries of a row.

Parameters:
[in] i row number.
[in] new_index new column numbers.

Definition at line 3023 of file Matrix_ArrayComplexSparse.cxx.

template<class T , class Prop , class Allocator >
void Seldon::Matrix< T, Prop, ArrayRowSymComplexSparse, Allocator >::ReplaceRealIndexRow ( int  i,
IVect new_index 
) [inline]

Sets column numbers of non-zero entries of a row.

Parameters:
[in] i row number.
[in] new_index new column numbers.

Definition at line 3009 of file Matrix_ArrayComplexSparse.cxx.

template<class T , class Prop , class Allocator >
void Seldon::Matrix< T, Prop, ArrayRowSymComplexSparse, Allocator >::ResizeImagRow ( int  i,
int  j 
) [inline]

Reallocates row i.

Parameters:
[in] i column number.
[in] j new number of non-zero entries in the row.

Definition at line 2970 of file Matrix_ArrayComplexSparse.cxx.

template<class T , class Prop , class Allocator >
void Seldon::Matrix< T, Prop, ArrayRowSymComplexSparse, Allocator >::ResizeRealRow ( int  i,
int  j 
) [inline]

Reallocates row i.

Parameters:
[in] i column number.
[in] j new number of non-zero entries in the row.

Definition at line 2957 of file Matrix_ArrayComplexSparse.cxx.

template<class T , class Prop , class Allocator >
void Seldon::Matrix< T, Prop, ArrayRowSymComplexSparse, Allocator >::Set ( int  i,
int  j,
const complex< T > &  x 
) [inline]

Sets element (i, j) of the matrix.

Parameters:
i row index
j column index
x A(i, j) = x

Reimplemented from Seldon::Matrix_ArrayComplexSparse< T, Prop, ArrayRowSymComplexSparse, Allocator >.

Definition at line 2865 of file Matrix_ArrayComplexSparse.cxx.

template<class T , class Prop , class Allocator >
void Seldon::Matrix< T, Prop, ArrayRowSymComplexSparse, Allocator >::SwapImagRow ( int  i,
int  j 
) [inline]

Swaps two rows.

Parameters:
[in] i first row number.
[in] j second row number.

Definition at line 2996 of file Matrix_ArrayComplexSparse.cxx.

template<class T , class Prop , class Allocator >
void Seldon::Matrix< T, Prop, ArrayRowSymComplexSparse, Allocator >::SwapRealRow ( int  i,
int  j 
) [inline]

Swaps two rows.

Parameters:
[in] i first row number.
[in] j second row number.

Definition at line 2983 of file Matrix_ArrayComplexSparse.cxx.

template<class T , class Prop , class Allocator >
T & Seldon::Matrix< T, Prop, ArrayRowSymComplexSparse, Allocator >::ValImag ( int  i,
int  j 
) [inline]

Returns access to imaginary part of element (i, j).

Returns the value of element (i, j).

Parameters:
i row index.
j column index.
Returns:
imaginary part of element (i, j) of the matrix.

Reimplemented from Seldon::Matrix_ArrayComplexSparse< T, Prop, ArrayRowSymComplexSparse, Allocator >.

Definition at line 2749 of file Matrix_ArrayComplexSparse.cxx.

template<class T , class Prop , class Allocator >
const T & Seldon::Matrix< T, Prop, ArrayRowSymComplexSparse, Allocator >::ValImag ( int  i,
int  j 
) const [inline]

Returns access to imaginary part of element (i, j).

Parameters:
i row index.
j column index.
Returns:
imaginary part of element (i, j) of the matrix.

Reimplemented from Seldon::Matrix_ArrayComplexSparse< T, Prop, ArrayRowSymComplexSparse, Allocator >.

Definition at line 2779 of file Matrix_ArrayComplexSparse.cxx.

template<class T , class Prop , class Allocator >
T & Seldon::Matrix< T, Prop, ArrayRowSymComplexSparse, Allocator >::ValReal ( int  i,
int  j 
) [inline]

Returns access to real part of element (i, j).

Parameters:
i row index.
j column index.
Returns:
real part of element (i, j) of the matrix.

Reimplemented from Seldon::Matrix_ArrayComplexSparse< T, Prop, ArrayRowSymComplexSparse, Allocator >.

Definition at line 2629 of file Matrix_ArrayComplexSparse.cxx.

template<class T , class Prop , class Allocator >
const T & Seldon::Matrix< T, Prop, ArrayRowSymComplexSparse, Allocator >::ValReal ( int  i,
int  j 
) const [inline]

Returns access to real part element (i, j).

Returns the value of element (i, j).

Parameters:
i row index.
j column index.
Returns:
real part of element (i, j) of the matrix.

Reimplemented from Seldon::Matrix_ArrayComplexSparse< T, Prop, ArrayRowSymComplexSparse, Allocator >.

Definition at line 2660 of file Matrix_ArrayComplexSparse.cxx.


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