Warning: this documentation for the development version is under construction.
Complex sparse-matrix class. More...
#include <Matrix_ComplexSparse.hxx>
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 |
typedef complex< value_type > | entry_type |
typedef complex< value_type > | access_type |
typedef complex< value_type > | const_access_type |
Public Member Functions | |
Matrix_ComplexSparse () | |
Default constructor. | |
Matrix_ComplexSparse (int i, int j) | |
Constructor. | |
Matrix_ComplexSparse (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_ComplexSparse (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_ComplexSparse (const Matrix_ComplexSparse< T, Prop, Storage, Allocator > &A) | |
Copy constructor. | |
~Matrix_ComplexSparse () | |
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) |
void | Nullify () |
Clears the matrix without releasing memory. | |
void | Reallocate (int i, int j) |
Initialization of an empty matrix i x j. | |
void | Reallocate (int i, int j, int real_nz, int 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. | |
void | Resize (int i, int j, int real_nz, int imag_nz) |
Changing the number of rows, columns and non-zero entries. | |
void | Copy (const Matrix_ComplexSparse< T, Prop, Storage, Allocator > &A) |
Copies a 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 |
Returns (row or column) indices of non-zero entries //! for the imaginary part. | |
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 |
Returns the length of the array of (column or row) indices //! for the real part. | |
int | GetImagIndSize () const |
Returns the length of the array of (column or row) indices //! for the imaginary part. | |
int | GetRealDataSize () const |
Returns the length of the array of (column or row) indices //! for the real part. | |
int | GetImagDataSize () const |
Returns the length of the array of (column or row) indices //! for the imaginary part. | |
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. | |
value_type & | ValReal (int i, int j) |
Access method. | |
const value_type & | ValReal (int i, int j) const |
Access method. | |
value_type & | ValImag (int i, int j) |
Access method. | |
const value_type & | ValImag (int i, int j) const |
Access method. | |
value_type & | GetReal (int i, int j) |
Access method. | |
const value_type & | GetReal (int i, int j) const |
Access method. | |
value_type & | GetImag (int i, int j) |
Access method. | |
const value_type & | GetImag (int i, int j) const |
Access method. | |
void | Set (int i, int j, const complex< T > &x) |
Sets an element (i, j) to a value. | |
void | AddInteraction (int i, int j, const complex< T > &x) |
Add a value to a non-zero entry. | |
Matrix_ComplexSparse< T, Prop, Storage, Allocator > & | operator= (const Matrix_ComplexSparse< T, Prop, Storage, Allocator > &A) |
Duplicates a matrix (assignment operator). | |
void | Zero () |
Resets all non-zero entries to 0-value. | |
void | SetIdentity () |
Sets the matrix to identity. | |
void | Fill () |
Fills the non-zero entries with 0, 1, 2, ... | |
void | Fill (const complex< T > &x) |
Fills the non-zero entries with a given value. | |
void | FillRand () |
Fills the non-zero entries randomly. | |
void | Print () const |
Displays the matrix on the standard output. | |
void | Write (string FileName) const |
Writes the matrix in a file. | |
void | Write (ostream &FileStream) const |
Writes the matrix to an output stream. | |
void | WriteText (string FileName) const |
Writes the matrix in a file. | |
void | WriteText (ostream &FileStream) const |
Writes the matrix to an output stream. | |
void | Read (string FileName) |
Reads the matrix from a file. | |
void | Read (istream &FileStream) |
Reads the matrix from an input stream. | |
void | ReadText (string FileName) |
Reads the matrix from a file. | |
void | ReadText (istream &FileStream) |
Reads the matrix from an input stream. | |
template<class T , class Prop , class Storage , class Allocator > | |
void | SetData (int i, int j, int real_nz, typename Matrix_ComplexSparse< T, Prop, Storage, Allocator >::pointer real_values, int *real_ptr, int *real_ind, int imag_nz, typename Matrix_ComplexSparse< T, Prop, Storage, Allocator >::pointer imag_values, int *imag_ptr, int *imag_ind) |
Redefines 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. | |
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_ |
Complex sparse-matrix class.
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.
Definition at line 48 of file Matrix_ComplexSparse.hxx.
Seldon::Matrix_ComplexSparse< T, Prop, Storage, Allocator >::Matrix_ComplexSparse | ( | ) | [inline] |
Default constructor.
Builds an empty 0x0 matrix.
Definition at line 38 of file Matrix_ComplexSparse.cxx.
Seldon::Matrix_ComplexSparse< T, Prop, Storage, Allocator >::Matrix_ComplexSparse | ( | int | i, | |
int | j | |||
) | [inline] |
Constructor.
Builds a i by j sparse matrix.
i | number of rows. | |
j | number of columns. |
Definition at line 59 of file Matrix_ComplexSparse.cxx.
Seldon::Matrix_ComplexSparse< T, Prop, Storage, Allocator >::Matrix_ComplexSparse | ( | 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 elements in the real part of the matrix and imag_nz non-zero elements in the imaginary part of the matrix.
i | number of rows. | |
j | number of columns. | |
real_nz | number of non-zero elements in the real part. | |
imag_nz | number of non-zero elements in the imaginary part. |
Definition at line 87 of file Matrix_ComplexSparse.cxx.
Seldon::Matrix_ComplexSparse< T, Prop, Storage, Allocator >::Matrix_ComplexSparse | ( | 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.
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. |
Definition at line 127 of file Matrix_ComplexSparse.cxx.
void Seldon::Matrix_ComplexSparse< T, Prop, Storage, Allocator >::AddInteraction | ( | int | i, | |
int | j, | |||
const complex< T > & | val | |||
) | [inline] |
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.
[in] | i | row index. |
[in] | j | column index. |
[in] | val | value to be added to the element (i, j). |
Definition at line 2471 of file Matrix_ComplexSparse.cxx.
void Seldon::Matrix_ComplexSparse< T, Prop, Storage, Allocator >::Clear | ( | ) | [inline] |
Clears the matrix.
This methods is equivalent to the destructor. On exit, the matrix is empty (0x0).
Definition at line 447 of file Matrix_ComplexSparse.cxx.
void Seldon::Matrix_ComplexSparse< T, Prop, Storage, Allocator >::Fill | ( | ) |
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 2573 of file Matrix_ComplexSparse.cxx.
void Seldon::Matrix_ComplexSparse< T, Prop, Storage, Allocator >::Fill | ( | const complex< T > & | x | ) |
Fills the non-zero entries with a given value.
x | the value to set the non-zero entries to. |
Definition at line 2589 of file Matrix_ComplexSparse.cxx.
void Seldon::Matrix_ComplexSparse< T, Prop, Storage, Allocator >::FillRand | ( | ) |
Fills the non-zero entries randomly.
Definition at line 2604 of file Matrix_ComplexSparse.cxx.
Allocator & Seldon::Matrix_Base< T, Allocator >::GetAllocator | ( | ) | [inherited] |
Returns the allocator of the matrix.
Definition at line 258 of file Matrix_Base.cxx.
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_'.
Definition at line 208 of file Matrix_Base.cxx.
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_'.
Definition at line 221 of file Matrix_Base.cxx.
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_'.
Definition at line 247 of file Matrix_Base.cxx.
int Seldon::Matrix_ComplexSparse< 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.
Definition at line 1814 of file Matrix_ComplexSparse.cxx.
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_'.
Definition at line 234 of file Matrix_Base.cxx.
const Matrix_ComplexSparse< T, Prop, Storage, Allocator >::value_type & Seldon::Matrix_ComplexSparse< T, Prop, Storage, Allocator >::GetImag | ( | int | i, | |
int | j | |||
) | const [inline] |
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
[in] | i | row index. |
[in] | j | column index. |
Definition at line 2455 of file Matrix_ComplexSparse.cxx.
Matrix_ComplexSparse< T, Prop, Storage, Allocator >::value_type & Seldon::Matrix_ComplexSparse< T, Prop, Storage, Allocator >::GetImag | ( | int | i, | |
int | j | |||
) | [inline] |
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
[in] | i | row index. |
[in] | j | column index. |
Definition at line 2390 of file Matrix_ComplexSparse.cxx.
T * Seldon::Matrix_ComplexSparse< T, Prop, Storage, Allocator >::GetImagData | ( | ) | const |
Returns the array of values of the imaginary part.
Definition at line 1991 of file Matrix_ComplexSparse.cxx.
int Seldon::Matrix_ComplexSparse< T, Prop, Storage, Allocator >::GetImagDataSize | ( | ) | const |
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 for the imaginary part. This array defines non-zero entries indices if coupled with (column or row) start indices.
Definition at line 1969 of file Matrix_ComplexSparse.cxx.
int * Seldon::Matrix_ComplexSparse< T, Prop, Storage, Allocator >::GetImagInd | ( | ) | const |
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.
Definition at line 1869 of file Matrix_ComplexSparse.cxx.
int Seldon::Matrix_ComplexSparse< T, Prop, Storage, Allocator >::GetImagIndSize | ( | ) | const |
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 for the imaginary part. This array defines non-zero entries indices if coupled with (column or row) start indices.
Definition at line 1931 of file Matrix_ComplexSparse.cxx.
int * Seldon::Matrix_ComplexSparse< 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.
Definition at line 1838 of file Matrix_ComplexSparse.cxx.
int Seldon::Matrix_ComplexSparse< T, Prop, Storage, Allocator >::GetImagPtrSize | ( | ) | const |
Returns the length of the array of start indices for the imaginary part.
Definition at line 1893 of file Matrix_ComplexSparse.cxx.
int Seldon::Matrix_Base< T, Allocator >::GetM | ( | ) | const [inherited] |
Returns the number of rows.
Reimplemented in Seldon::HeterogeneousMatrixCollection< Prop0, Storage0, Prop1, Storage1, Allocator >, Seldon::MatrixCollection< T, Prop, Storage, Allocator >, Seldon::SubMatrix_Base< T, Prop, M, Allocator >, Seldon::HeterogeneousMatrixCollection< General, RowMajor, General, RowSparse, Allocator >, Seldon::MatrixCollection< T, Prop, RowMajor, Allocator >, Seldon::MatrixCollection< T, Prop, ColMajor, Allocator >, Seldon::MatrixCollection< T, Prop, ColSymPacked, Allocator >, and Seldon::MatrixCollection< T, Prop, RowSymPacked, Allocator >.
Definition at line 107 of file Matrix_Base.cxx.
int Seldon::Matrix_Base< T, Allocator >::GetM | ( | const Seldon::SeldonTranspose & | status | ) | const [inherited] |
Returns the number of rows of the matrix possibly transposed.
status | assumed status about the transposition of the matrix. |
Reimplemented in Seldon::SubMatrix_Base< T, Prop, M, Allocator >.
Definition at line 130 of file Matrix_Base.cxx.
int Seldon::Matrix_Base< T, Allocator >::GetN | ( | ) | const [inherited] |
Returns the number of columns.
Reimplemented in Seldon::HeterogeneousMatrixCollection< Prop0, Storage0, Prop1, Storage1, Allocator >, Seldon::MatrixCollection< T, Prop, Storage, Allocator >, Seldon::SubMatrix_Base< T, Prop, M, Allocator >, Seldon::HeterogeneousMatrixCollection< General, RowMajor, General, RowSparse, Allocator >, Seldon::MatrixCollection< T, Prop, RowMajor, Allocator >, Seldon::MatrixCollection< T, Prop, ColMajor, Allocator >, Seldon::MatrixCollection< T, Prop, ColSymPacked, Allocator >, and Seldon::MatrixCollection< T, Prop, RowSymPacked, Allocator >.
Definition at line 118 of file Matrix_Base.cxx.
int Seldon::Matrix_Base< T, Allocator >::GetN | ( | const Seldon::SeldonTranspose & | status | ) | const [inherited] |
Returns the number of columns of the matrix possibly transposed.
status | assumed status about the transposition of the matrix. |
Reimplemented in Seldon::SubMatrix_Base< T, Prop, M, Allocator >.
Definition at line 145 of file Matrix_Base.cxx.
Matrix_ComplexSparse< T, Prop, Storage, Allocator >::value_type & Seldon::Matrix_ComplexSparse< T, Prop, Storage, Allocator >::GetReal | ( | int | i, | |
int | j | |||
) | [inline] |
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
[in] | i | row index. |
[in] | j | column index. |
Definition at line 2308 of file Matrix_ComplexSparse.cxx.
const Matrix_ComplexSparse< T, Prop, Storage, Allocator >::value_type & Seldon::Matrix_ComplexSparse< T, Prop, Storage, Allocator >::GetReal | ( | int | i, | |
int | j | |||
) | const [inline] |
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
[in] | i | row index. |
[in] | j | column index. |
Definition at line 2373 of file Matrix_ComplexSparse.cxx.
T * Seldon::Matrix_ComplexSparse< T, Prop, Storage, Allocator >::GetRealData | ( | ) | const |
Returns the array of values of the real part.
Definition at line 1980 of file Matrix_ComplexSparse.cxx.
int Seldon::Matrix_ComplexSparse< T, Prop, Storage, Allocator >::GetRealDataSize | ( | ) | const |
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 for the real part. This array defines non-zero entries indices if coupled with (column or row) start indices.
Definition at line 1950 of file Matrix_ComplexSparse.cxx.
int * Seldon::Matrix_ComplexSparse< 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.
Definition at line 1853 of file Matrix_ComplexSparse.cxx.
int Seldon::Matrix_ComplexSparse< T, Prop, Storage, Allocator >::GetRealIndSize | ( | ) | const |
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 for the real part. This array defines non-zero entries indices if coupled with (column or row) start indices.
Definition at line 1912 of file Matrix_ComplexSparse.cxx.
int * Seldon::Matrix_ComplexSparse< 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.
Definition at line 1826 of file Matrix_ComplexSparse.cxx.
int Seldon::Matrix_ComplexSparse< T, Prop, Storage, Allocator >::GetRealPtrSize | ( | ) | const |
Returns the length of the array of start indices for the real part.
Definition at line 1881 of file Matrix_ComplexSparse.cxx.
int Seldon::Matrix_Base< T, Allocator >::GetSize | ( | ) | const [inherited] |
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.
Reimplemented in Seldon::HeterogeneousMatrixCollection< Prop0, Storage0, Prop1, Storage1, Allocator >, Seldon::MatrixCollection< T, Prop, Storage, Allocator >, Seldon::HeterogeneousMatrixCollection< General, RowMajor, General, RowSparse, Allocator >, Seldon::MatrixCollection< T, Prop, RowMajor, Allocator >, Seldon::MatrixCollection< T, Prop, ColMajor, Allocator >, Seldon::MatrixCollection< T, Prop, ColSymPacked, Allocator >, and Seldon::MatrixCollection< T, Prop, RowSymPacked, Allocator >.
Definition at line 195 of file Matrix_Base.cxx.
void Seldon::Matrix_ComplexSparse< T, Prop, Storage, Allocator >::Nullify | ( | ) | [inline] |
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 692 of file Matrix_ComplexSparse.cxx.
complex< typename Matrix_ComplexSparse< T, Prop, Storage, Allocator >::value_type > Seldon::Matrix_ComplexSparse< T, Prop, Storage, Allocator >::operator() | ( | int | i, | |
int | j | |||
) | const [inline] |
Access operator.
Returns the value of element (i, j).
i | row index. | |
j | column index. |
Definition at line 2013 of file Matrix_ComplexSparse.cxx.
Matrix_ComplexSparse< T, Prop, Storage, Allocator > & Seldon::Matrix_ComplexSparse< T, Prop, Storage, Allocator >::operator= | ( | const Matrix_ComplexSparse< T, Prop, Storage, Allocator > & | A | ) | [inline] |
Duplicates a matrix (assignment operator).
A | matrix to be copied. |
Definition at line 2505 of file Matrix_ComplexSparse.cxx.
void Seldon::Matrix_ComplexSparse< 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.
Definition at line 2622 of file Matrix_ComplexSparse.cxx.
void Seldon::Matrix_ComplexSparse< T, Prop, Storage, Allocator >::Read | ( | istream & | FileStream | ) |
Reads the matrix from an input stream.
Reads a matrix in binary format from an input stream.
FileStream | input stream |
Definition at line 2791 of file Matrix_ComplexSparse.cxx.
void Seldon::Matrix_ComplexSparse< T, Prop, Storage, Allocator >::Read | ( | string | FileName | ) |
Reads the matrix from a file.
Reads a matrix stored in binary format in a file.
FileName | input file name. |
Definition at line 2766 of file Matrix_ComplexSparse.cxx.
void Seldon::Matrix_ComplexSparse< T, Prop, Storage, Allocator >::ReadText | ( | istream & | FileStream | ) |
Reads the matrix from an input stream.
Reads a matrix from a stream in text format.
FileStream | input stream. |
Definition at line 2863 of file Matrix_ComplexSparse.cxx.
void Seldon::Matrix_ComplexSparse< T, Prop, Storage, Allocator >::ReadText | ( | string | FileName | ) |
Reads the matrix from a file.
Reads the matrix from a file in text format.
FileName | input file name. |
Definition at line 2838 of file Matrix_ComplexSparse.cxx.
void Seldon::Matrix_ComplexSparse< T, Prop, Storage, Allocator >::Resize | ( | int | i, | |
int | j, | |||
int | real_nz, | |||
int | imag_nz | |||
) |
Changing the number of rows, columns and non-zero entries.
i | number of rows | |
j | number of columns Previous entries are kept during the operation |
Definition at line 1155 of file Matrix_ComplexSparse.cxx.
void Seldon::Matrix_ComplexSparse< T, Prop, Storage, Allocator >::Resize | ( | int | i, | |
int | j | |||
) |
Changing the number of rows and columns.
i | number of rows | |
j | number of columns |
Definition at line 1137 of file Matrix_ComplexSparse.cxx.
void Seldon::Matrix_ComplexSparse< T, Prop, Storage, Allocator >::Set | ( | int | i, | |
int | j, | |||
const complex< T > & | val | |||
) | [inline] |
Sets an element (i, j) to a value.
This function sets val to the element (i, j)
[in] | i | row index. |
[in] | j | column index. |
[in] | val | A(i, j) = val |
Definition at line 2489 of file Matrix_ComplexSparse.cxx.
void Seldon::Matrix_ComplexSparse< 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.
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. |
Definition at line 481 of file Matrix_ComplexSparse.cxx.
void Seldon::Matrix_ComplexSparse< T, Prop, Storage, Allocator >::SetData | ( | int | i, | |
int | j, | |||
int | real_nz, | |||
typename Matrix_ComplexSparse< T, Prop, Storage, Allocator >::pointer | real_values, | |||
int * | real_ptr, | |||
int * | real_ind, | |||
int | imag_nz, | |||
typename Matrix_ComplexSparse< 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).
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. |
Definition at line 661 of file Matrix_ComplexSparse.cxx.
void Seldon::Matrix_ComplexSparse< T, Prop, Storage, Allocator >::SetIdentity | ( | ) |
Sets the matrix to identity.
This method fills the diagonal of the matrix with ones. It can be applied to non square matrix.
Definition at line 2536 of file Matrix_ComplexSparse.cxx.
const Matrix_ComplexSparse< T, Prop, Storage, Allocator >::value_type & Seldon::Matrix_ComplexSparse< T, Prop, Storage, Allocator >::ValImag | ( | int | i, | |
int | j | |||
) | const [inline] |
Access method.
Returns the imaginary part of element (i, j) if it can be returned as a reference.
[in] | i | row index. |
[in] | j | column index. |
WrongArgument | No reference can be returned because the element is a zero entry (not stored in the matrix). |
Definition at line 2257 of file Matrix_ComplexSparse.cxx.
Matrix_ComplexSparse< T, Prop, Storage, Allocator >::value_type & Seldon::Matrix_ComplexSparse< T, Prop, Storage, Allocator >::ValImag | ( | int | i, | |
int | j | |||
) | [inline] |
Access method.
Returns the imaginary part of element (i, j) if it can be returned as a reference.
[in] | i | row index. |
[in] | j | column index. |
WrongArgument | No reference can be returned because the element is a zero entry (not stored in the matrix). |
Definition at line 2205 of file Matrix_ComplexSparse.cxx.
Matrix_ComplexSparse< T, Prop, Storage, Allocator >::value_type & Seldon::Matrix_ComplexSparse< T, Prop, Storage, Allocator >::ValReal | ( | int | i, | |
int | j | |||
) | [inline] |
Access method.
Returns the real value of element (i, j) if it can be returned as a reference.
[in] | i | row index. |
[in] | j | column index. |
WrongArgument | No reference can be returned because the element is a zero entry (not stored in the matrix). |
Definition at line 2101 of file Matrix_ComplexSparse.cxx.
const Matrix_ComplexSparse< T, Prop, Storage, Allocator >::value_type & Seldon::Matrix_ComplexSparse< T, Prop, Storage, Allocator >::ValReal | ( | int | i, | |
int | j | |||
) | const [inline] |
Access method.
Returns the real value of element (i, j) if it can be returned as a reference.
[in] | i | row index. |
[in] | j | column index. |
WrongArgument | No reference can be returned because the element is a zero entry (not stored in the matrix). |
Definition at line 2153 of file Matrix_ComplexSparse.cxx.
void Seldon::Matrix_ComplexSparse< T, Prop, Storage, Allocator >::Write | ( | string | FileName | ) | const |
Writes the matrix in a file.
Stores the matrix in a file in binary format.
FileName | output file name. |
Definition at line 2640 of file Matrix_ComplexSparse.cxx.
void Seldon::Matrix_ComplexSparse< T, Prop, Storage, Allocator >::Write | ( | ostream & | FileStream | ) | const |
Writes the matrix to an output stream.
Stores the matrix in an output stream in binary format.
FileStream | output stream. |
Definition at line 2665 of file Matrix_ComplexSparse.cxx.
void Seldon::Matrix_ComplexSparse< T, Prop, Storage, Allocator >::WriteText | ( | string | FileName | ) | const |
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
FileName | output file name. |
Definition at line 2708 of file Matrix_ComplexSparse.cxx.
void Seldon::Matrix_ComplexSparse< T, Prop, Storage, Allocator >::WriteText | ( | ostream & | FileStream | ) | const |
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
FileStream | output stream. |
Definition at line 2735 of file Matrix_ComplexSparse.cxx.
void Seldon::Matrix_ComplexSparse< T, Prop, Storage, Allocator >::Zero | ( | ) |
Resets all non-zero entries to 0-value.
The sparsity pattern remains unchanged.
Definition at line 2521 of file Matrix_ComplexSparse.cxx.