Column-major sparse-matrix class. More...
#include <Matrix_Sparse.hxx>
Public Types | |
typedef Allocator::value_type | value_type |
typedef Prop | property |
typedef ColSparse | 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 value_type | entry_type |
typedef value_type | access_type |
typedef value_type | const_access_type |
Public Member Functions | |
Matrix () | |
Default constructor. | |
Matrix (int i, int j) | |
Constructor. | |
Matrix (int i, int j, int nz) | |
Constructor. | |
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) | |
Constructor. | |
void | Clear () |
void | SetData (int i, int j, Vector< T, Storage0, Allocator0 > &values, Vector< int, Storage1, Allocator1 > &ptr, Vector< int, Storage2, Allocator2 > &ind) |
void | SetData (int i, int j, int nz, pointer values, int *ptr, int *ind) |
void | Nullify () |
void | Reallocate (int i, int j) |
void | Reallocate (int i, int j, int nz) |
void | Resize (int i, int j) |
void | Resize (int i, int j, int nz) |
void | Copy (const Matrix_Sparse< T, Prop, ColSparse, Allocator > &A) |
int | GetNonZeros () const |
int | GetDataSize () const |
int * | GetPtr () const |
int * | GetInd () const |
int | GetPtrSize () const |
int | GetIndSize () const |
value_type | operator() (int i, int j) const |
value_type & | Val (int i, int j) |
const value_type & | Val (int i, int j) const |
value_type & | Get (int i, int j) |
const value_type & | Get (int i, int j) const |
void | AddInteraction (int i, int j, const T &val) |
void | Set (int i, int j, const T &x) |
void | Zero () |
void | SetIdentity () |
void | Fill () |
void | Fill (const T0 &x) |
void | FillRand () |
void | FillRand (int Nelement) |
void | FillRand (int Nelement, const T &x) |
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 | nz_ |
int * | ptr_ |
int * | ind_ |
int | m_ |
int | n_ |
pointer | data_ |
Static Protected Attributes | |
static Allocator | allocator_ |
Column-major sparse-matrix class.
Definition at line 147 of file Matrix_Sparse.hxx.
Seldon::Matrix< T, Prop, ColSparse, Allocator >::Matrix | ( | ) |
Seldon::Matrix< T, Prop, ColSparse, Allocator >::Matrix | ( | int | i, | |
int | j | |||
) |
Constructor.
Builds a i by j matrix.
i | number of rows. | |
j | number of columns. |
Definition at line 1748 of file Matrix_Sparse.cxx.
Seldon::Matrix< T, Prop, ColSparse, Allocator >::Matrix | ( | int | i, | |
int | j, | |||
int | nz | |||
) |
Constructor.
Builds a i by j matrix with nz non-zero elements.
i | number of rows. | |
j | number of columns. | |
nz | number of non-zero elements. |
Definition at line 1762 of file Matrix_Sparse.cxx.
Seldon::Matrix< T, Prop, ColSparse, Allocator >::Matrix | ( | int | i, | |
int | j, | |||
Vector< T, Storage0, Allocator0 > & | values, | |||
Vector< int, Storage1, Allocator1 > & | ptr, | |||
Vector< int, Storage2, Allocator2 > & | ind | |||
) |
Constructor.
Builds a i by j sparse matrix with non-zero values and indices provided by 'values' (values), 'ptr' (pointers) and 'ind' (indices). Input vectors are released and are empty on exit.
i | number of rows. | |
j | number of columns. | |
values | values of non-zero entries. | |
ptr | row start indices. | |
ind | column indices. |
Definition at line 1785 of file Matrix_Sparse.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.
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.
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 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.
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 >::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.