Hermitian matrix stored in a full matrix. More...
#include <Matrix_Hermitian.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 Allocator::value_type | entry_type |
typedef Allocator::value_type | access_type |
typedef Allocator::value_type | const_access_type |
Public Member Functions | |
Matrix_Hermitian () | |
Default constructor. | |
Matrix_Hermitian (int i, int j=0) | |
Main constructor. | |
Matrix_Hermitian (const Matrix_Hermitian< T, Prop, Storage, Allocator > &A) | |
Copy constructor. | |
~Matrix_Hermitian () | |
Destructor. | |
void | Clear () |
Clears the matrix. | |
int | GetDataSize () const |
Returns the number of elements stored in memory. | |
void | Reallocate (int i, int j) |
Reallocates memory to resize the matrix. | |
void | SetData (int i, int j, pointer data) |
void | Nullify () |
Clears the matrix without releasing memory. | |
void | Resize (int i, int j) |
Reallocates memory to resize the matrix and keeps previous entries. | |
value_type | operator() (int i, int j) |
Access operator. | |
value_type | operator() (int i, int j) const |
Access operator. | |
const_reference | Val (int i, int j) const |
Access operator. | |
reference | Val (int i, int j) |
Access operator. | |
reference | operator[] (int i) |
Access to elements of the data array. | |
const_reference | operator[] (int i) const |
Access to elements of the data array. | |
Matrix_Hermitian< T, Prop, Storage, Allocator > & | operator= (const Matrix_Hermitian< T, Prop, Storage, Allocator > &A) |
Duplicates a matrix (assignement operator). | |
void | Copy (const Matrix_Hermitian< T, Prop, Storage, Allocator > &A) |
Duplicates a matrix. | |
void | Zero () |
Sets all elements to zero. | |
void | SetIdentity () |
Sets the matrix to the identity. | |
void | Fill () |
Fills the matrix with 0, 1, 2, ... | |
template<class T0 > | |
void | Fill (const T0 &x) |
Fills a matrix with a given value. | |
template<class T0 > | |
Matrix_Hermitian< T, Prop, Storage, Allocator > & | operator= (const T0 &x) |
Fills a matrix with a given value. | |
void | FillRand () |
Fills the matrix randomly. | |
void | Print () const |
Displays the matrix on the standard output. | |
void | Print (int a, int b, int m, int n) const |
Displays a sub-matrix on the standard output. | |
void | Print (int l) const |
Displays a square sub-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. | |
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 | |
pointer * | me_ |
int | m_ |
int | n_ |
pointer | data_ |
Static Protected Attributes | |
static Allocator | allocator_ |
Hermitian matrix stored in a full matrix.
Definition at line 38 of file Matrix_Hermitian.hxx.
Seldon::Matrix_Hermitian< T, Prop, Storage, Allocator >::Matrix_Hermitian | ( | ) | [inline] |
Default constructor.
On exit, the matrix is an empty 0x0 matrix.
Definition at line 37 of file Matrix_Hermitian.cxx.
Seldon::Matrix_Hermitian< T, Prop, Storage, Allocator >::Matrix_Hermitian | ( | int | i, | |
int | j = 0 | |||
) | [inline] |
Main constructor.
Builds a i x j full matrix.
i | number of rows. | |
j | number of columns. |
Definition at line 52 of file Matrix_Hermitian.cxx.
void Seldon::Matrix_Hermitian< T, Prop, Storage, Allocator >::Clear | ( | ) | [inline] |
Clears the matrix.
Destructs the matrix.
Definition at line 203 of file Matrix_Hermitian.cxx.
void Seldon::Matrix_Hermitian< T, Prop, Storage, Allocator >::Copy | ( | const Matrix_Hermitian< T, Prop, Storage, Allocator > & | A | ) | [inline] |
Duplicates a matrix.
A | matrix to be copied. |
Definition at line 658 of file Matrix_Hermitian.cxx.
void Seldon::Matrix_Hermitian< T, Prop, Storage, Allocator >::Fill | ( | ) |
Fills the matrix with 0, 1, 2, ...
On exit, the matrix is filled with 0, 1, 2, 3, ... The order of those numbers depends on the storage.
Definition at line 706 of file Matrix_Hermitian.cxx.
void Seldon::Matrix_Hermitian< T, Prop, Storage, Allocator >::Fill | ( | const T0 & | x | ) |
Fills a matrix with a given value.
x | the value to fill the matrix with. |
Definition at line 719 of file Matrix_Hermitian.cxx.
void Seldon::Matrix_Hermitian< T, Prop, Storage, Allocator >::FillRand | ( | ) |
Fills the matrix randomly.
Definition at line 746 of file Matrix_Hermitian.cxx.
Allocator & Seldon::Matrix_Base< T, Allocator >::GetAllocator | ( | ) | [inherited] |
Returns the allocator of the matrix.
Definition at line 257 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 207 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 220 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 246 of file Matrix_Base.cxx.
int Seldon::Matrix_Hermitian< 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 number of rows multiplied by the number of columns because the matrix is full.
Definition at line 224 of file Matrix_Hermitian.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 233 of file Matrix_Base.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 106 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 129 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 117 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 144 of file Matrix_Base.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 194 of file Matrix_Base.cxx.
void Seldon::Matrix_Hermitian< 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 401 of file Matrix_Hermitian.cxx.
Matrix_Hermitian< T, Prop, Storage, Allocator >::value_type Seldon::Matrix_Hermitian< 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 509 of file Matrix_Hermitian.cxx.
Matrix_Hermitian< T, Prop, Storage, Allocator >::value_type Seldon::Matrix_Hermitian< T, Prop, Storage, Allocator >::operator() | ( | int | i, | |
int | j | |||
) | [inline] |
Access operator.
Returns the value of element (i, j).
i | row index. | |
j | column index. |
Definition at line 478 of file Matrix_Hermitian.cxx.
Matrix_Hermitian< T, Prop, Storage, Allocator > & Seldon::Matrix_Hermitian< T, Prop, Storage, Allocator >::operator= | ( | const T0 & | x | ) |
Fills a matrix with a given value.
x | the value to fill the matrix with. |
Reimplemented in Seldon::Matrix< T, Prop, ColHerm, Allocator >, and Seldon::Matrix< T, Prop, RowHerm, Allocator >.
Definition at line 733 of file Matrix_Hermitian.cxx.
Matrix_Hermitian< T, Prop, Storage, Allocator > & Seldon::Matrix_Hermitian< T, Prop, Storage, Allocator >::operator= | ( | const Matrix_Hermitian< T, Prop, Storage, Allocator > & | A | ) | [inline] |
Duplicates a matrix (assignement operator).
A | matrix to be copied. |
Definition at line 642 of file Matrix_Hermitian.cxx.
Matrix_Hermitian< T, Prop, Storage, Allocator >::reference Seldon::Matrix_Hermitian< T, Prop, Storage, Allocator >::operator[] | ( | int | i | ) | [inline] |
Access to elements of the data array.
Provides a direct access to the data array.
i | index. |
Definition at line 594 of file Matrix_Hermitian.cxx.
Matrix_Hermitian< T, Prop, Storage, Allocator >::const_reference Seldon::Matrix_Hermitian< T, Prop, Storage, Allocator >::operator[] | ( | int | i | ) | const [inline] |
Access to elements of the data array.
Provides a direct access to the data array.
i | index. |
Definition at line 618 of file Matrix_Hermitian.cxx.
void Seldon::Matrix_Hermitian< T, Prop, Storage, Allocator >::Print | ( | int | l | ) | const |
Displays a square sub-matrix on the standard output.
The sub-matrix is defined by its bottom-right corner (l, l). So, elements with indices in [0, 0] x [l, l] are displayed on the standard output, in text format. Each row is displayed on a single line and elements of a row are delimited by tabulations.
l | dimension of the square matrix to be displayed. |
Definition at line 807 of file Matrix_Hermitian.cxx.
void Seldon::Matrix_Hermitian< 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 761 of file Matrix_Hermitian.cxx.
void Seldon::Matrix_Hermitian< T, Prop, Storage, Allocator >::Print | ( | int | a, | |
int | b, | |||
int | m, | |||
int | n | |||
) | const |
Displays a sub-matrix on the standard output.
The sub-matrix is defined by its upper-left corner (a, b) and its bottom-right corner (m, n). So, elements with indices in [a, m] x [b, n] are displayed on the standard output, in text format. Each row is displayed on a single line and elements of a row are delimited by tabulations.
a | row index of the upper-left corner. | |
b | column index of the upper-left corner. | |
m | row index of the bottom-right corner. | |
n | column index of the bottom-right corner. |
Definition at line 786 of file Matrix_Hermitian.cxx.
void Seldon::Matrix_Hermitian< T, Prop, Storage, Allocator >::Read | ( | istream & | FileStream | ) |
Reads the matrix from an input stream.
Reads a matrix in binary format from an input stream. The number of rows (integer) and the number of columns (integer) are read, and matrix elements are then read in the same order as it should be in memory (e.g. row-major storage).
FileStream | input stream. |
Definition at line 993 of file Matrix_Hermitian.cxx.
void Seldon::Matrix_Hermitian< T, Prop, Storage, Allocator >::Read | ( | string | FileName | ) |
Reads the matrix from a file.
Reads a matrix stored in binary format in a file. The number of rows (integer) and the number of columns (integer) are read, and matrix elements are then read in the same order as it should be in memory (e.g. row-major storage).
FileName | input file name. |
Definition at line 965 of file Matrix_Hermitian.cxx.
void Seldon::Matrix_Hermitian< T, Prop, Storage, Allocator >::ReadText | ( | istream & | FileStream | ) |
Reads the matrix from an input stream.
Reads a matrix in text format from an input stream.
FileStream | input stream. |
Definition at line 1054 of file Matrix_Hermitian.cxx.
void Seldon::Matrix_Hermitian< T, Prop, Storage, Allocator >::ReadText | ( | string | FileName | ) |
Reads the matrix from a file.
Reads a matrix stored in text format in a file.
FileName | input file name. |
Definition at line 1029 of file Matrix_Hermitian.cxx.
void Seldon::Matrix_Hermitian< T, Prop, Storage, Allocator >::Reallocate | ( | int | i, | |
int | j | |||
) | [inline] |
Reallocates memory to resize the matrix.
On exit, the matrix is a i x i matrix.
i | number of rows. | |
j | number of columns. |
Definition at line 244 of file Matrix_Hermitian.cxx.
void Seldon::Matrix_Hermitian< T, Prop, Storage, Allocator >::Resize | ( | int | i, | |
int | j | |||
) | [inline] |
Reallocates memory to resize the matrix and keeps previous entries.
On exit, the matrix is a i x j matrix.
i | new number of rows. | |
j | new number of columns. |
Definition at line 441 of file Matrix_Hermitian.cxx.
void Seldon::Matrix_Hermitian< T, Prop, Storage, Allocator >::SetIdentity | ( | ) |
Sets the matrix to the identity.
Definition at line 690 of file Matrix_Hermitian.cxx.
Matrix_Hermitian< T, Prop, Storage, Allocator >::const_reference Seldon::Matrix_Hermitian< T, Prop, Storage, Allocator >::Val | ( | int | i, | |
int | j | |||
) | const [inline] |
Access operator.
Returns the value of element (i, j).
i | row index. | |
j | column index. |
Definition at line 541 of file Matrix_Hermitian.cxx.
Matrix_Hermitian< T, Prop, Storage, Allocator >::reference Seldon::Matrix_Hermitian< T, Prop, Storage, Allocator >::Val | ( | int | i, | |
int | j | |||
) | [inline] |
Access operator.
Returns the value of element (i, j).
i | row index. | |
j | column index. |
Definition at line 568 of file Matrix_Hermitian.cxx.
void Seldon::Matrix_Hermitian< T, Prop, Storage, Allocator >::Write | ( | ostream & | FileStream | ) | const |
Writes the matrix to an output stream.
Writes the matrix to an output stream in binary format. The number of rows (integer) and the number of columns (integer) are written, and matrix elements are then written in the same order as in memory (e.g. row-major storage).
FileStream | output stream. |
Definition at line 856 of file Matrix_Hermitian.cxx.
void Seldon::Matrix_Hermitian< T, Prop, Storage, Allocator >::Write | ( | string | FileName | ) | const |
Writes the matrix in a file.
Stores the matrix in a file in binary format. The number of rows (integer) and the number of columns (integer) are written, and matrix elements are then written in the same order as in memory (e.g. row-major storage).
FileName | output file name. |
Definition at line 828 of file Matrix_Hermitian.cxx.
void Seldon::Matrix_Hermitian< T, Prop, Storage, Allocator >::WriteText | ( | string | FileName | ) | const |
Writes the matrix in a file.
Stores the matrix in a file in text format. Only matrix elements are written (not dimensions). Each row is written on a single line and elements of a row are delimited by tabulations.
FileName | output file name. |
Definition at line 896 of file Matrix_Hermitian.cxx.
void Seldon::Matrix_Hermitian< T, Prop, Storage, Allocator >::WriteText | ( | ostream & | FileStream | ) | const |
Writes the matrix to an output stream.
Writes the matrix to an output stream in text format. Only matrix elements are written (not dimensions). Each row is written on a single line and elements of a row are delimited by tabulations.
FileStream | output stream. |
Definition at line 926 of file Matrix_Hermitian.cxx.
void Seldon::Matrix_Hermitian< T, Prop, Storage, Allocator >::Zero | ( | ) |
Sets all elements to zero.
Definition at line 677 of file Matrix_Hermitian.cxx.