Input wrapper for matrices. More...
#include <sparseIWrapper.hh>

Public Types | |
| typedef concepts::SparseMatrix < Scalar > | MatrixType |
| This typedef represent the matrix type which will be used for the operation. | |
| typedef ArraySparseWrapper | Type |
Public Member Functions | |
| void | get_matrix () |
| Completes the operation. | |
| void | imagType (const MATtype &imagType) |
| miUINT32_t * | ir () |
| void | isComplex (bool isComplex) |
| miUINT32_t * | jc () |
| void | name (const std::string &) |
| void | nnz (const miUINT32_t &nnz) |
| byte * | pi () |
| byte * | pr () |
| void | realType (const MATtype &realType) |
| void | size (const miUINT32_t &rows, const miUINT32_t &cols) |
| SparseIWrapper (concepts::Array< Scalar > &val, concepts::Array< miUINT32_t > &col, concepts::Array< miUINT32_t > &row) | |
| Constructor. | |
Public Attributes | |
| concepts::Array< miUINT32_t > | CoordType |
| concepts::Array< Scalar > | ValType |
Private Types | |
| typedef std::complex< RealScalar > | ComplexScalar |
| typedef NumTraits< Scalar >::Real | RealScalar |
Private Member Functions | |
| template<class Other > | |
| void | copy (bool real=true) |
Private Attributes | |
| concepts::Array< miUINT32_t > & | CCScol_ |
| concepts::Array< miUINT32_t > & | CCSrow_ |
| concepts::Array< Scalar > & | CCSval_ |
| miUINT32_t | cols_ |
| MATtype | imagType_ |
| bool | isComplex_ |
| bool | matrixReady_ |
| miUINT32_t | nnz_ |
| std::string | piCopy_ |
| std::string | prCopy_ |
| MATtype | realType_ |
| miUINT32_t | rows_ |
Input wrapper for matrices.
This wrapper handles input operations for sparse matrices with Boost objects (compressed_matrix). It treats both real and complex case, with any numeric type, but works only with column-major matrices with 32-bit indices starting from zero. If you need input to row-major matrices or different indices, you'll have to transpose the data and/or change the indices by using the Boost assignement operators, that is simple and fast.
This is a template wrapper: you must explicitely express the requested scalar type as template parameter. The resulting matrix will contain that specified type of data independently of the actual data type stored in the MAT-file. If these types match, and the matrix is real, the performance of the wrapper will be very good; otherwise, a relatively slow copy operation will be performed, resulting in a lost of performance.
Note that if the given scalar type is not complex, only the real part of the matrix will be read and copied. The imaginary part won't be read. Vice versa, if that scalar is complex, but the stored matrix is real, the imaginary part of the resulting matrix will be zero.
Definition at line 38 of file sparseIWrapper.hh.
typedef std::complex<RealScalar> concepts::SparseIWrapper< Scalar >::ComplexScalar [private] |
Definition at line 62 of file sparseIWrapper.hh.
| typedef concepts::SparseMatrix<Scalar> concepts::SparseIWrapper< Scalar >::MatrixType |
This typedef represent the matrix type which will be used for the operation.
The scalar type is given as template paramenter, while the other template informations are fixed.
Definition at line 53 of file sparseIWrapper.hh.
typedef NumTraits<Scalar>::Real concepts::SparseIWrapper< Scalar >::RealScalar [private] |
Definition at line 61 of file sparseIWrapper.hh.
| typedef ArraySparseWrapper concepts::SparseIWrapper< Scalar >::Type |
Definition at line 43 of file sparseIWrapper.hh.
| concepts::SparseIWrapper< Scalar >::SparseIWrapper | ( | concepts::Array< Scalar > & | val, |
| concepts::Array< miUINT32_t > & | col, | ||
| concepts::Array< miUINT32_t > & | row | ||
| ) | [inline] |
Constructor.
This is the only constructor. It takes as parameter a non-const reference to the resulting matrix, where the data will be stored. You don't have to do any preliminary operation on that matrix: it must just exist.
The given matrix has to be an object of the class MatrixType.
| matrix | A non-const reference to the matrix where the data will be stored. |
Definition at line 103 of file sparseIWrapper.hh.
| void concepts::SparseIWrapper< Scalar >::copy | ( | bool | real = true | ) | [inline, private] |
Definition at line 170 of file sparseIWrapper.hh.
| void concepts::SparseIWrapper< Scalar >::get_matrix | ( | ) | [inline] |
Completes the operation.
During the actual operation, some data can be directly written on the matrix, while other data can be stored elsewhere and wait until the end of the operation.
Please make sure to call this method after the read operation (i.e. after InputStream::readArray) and before any other operation on the matrix.
This method does not return anything, it just prepares the matrix by writing any temporary information.
Definition at line 210 of file sparseIWrapper.hh.
| void concepts::SparseIWrapper< Scalar >::imagType | ( | const MATtype & | imagType | ) | [inline] |
Definition at line 156 of file sparseIWrapper.hh.
| miUINT32_t* concepts::SparseIWrapper< Scalar >::ir | ( | ) | [inline] |
Definition at line 129 of file sparseIWrapper.hh.
| void concepts::SparseIWrapper< Scalar >::isComplex | ( | bool | isComplex | ) | [inline] |
Definition at line 109 of file sparseIWrapper.hh.
| miUINT32_t* concepts::SparseIWrapper< Scalar >::jc | ( | ) | [inline] |
Definition at line 134 of file sparseIWrapper.hh.
| void concepts::SparseIWrapper< Scalar >::name | ( | const std::string & | ) | [inline] |
Definition at line 127 of file sparseIWrapper.hh.
| void concepts::SparseIWrapper< Scalar >::nnz | ( | const miUINT32_t & | nnz | ) | [inline] |
Definition at line 113 of file sparseIWrapper.hh.
| byte* concepts::SparseIWrapper< Scalar >::pi | ( | ) | [inline] |
| byte* concepts::SparseIWrapper< Scalar >::pr | ( | ) | [inline] |
| void concepts::SparseIWrapper< Scalar >::realType | ( | const MATtype & | realType | ) | [inline] |
Definition at line 140 of file sparseIWrapper.hh.
| void concepts::SparseIWrapper< Scalar >::size | ( | const miUINT32_t & | rows, |
| const miUINT32_t & | cols | ||
| ) | [inline] |
Definition at line 118 of file sparseIWrapper.hh.
concepts::Array<miUINT32_t>& concepts::SparseIWrapper< Scalar >::CCScol_ [private] |
Definition at line 79 of file sparseIWrapper.hh.
concepts::Array<miUINT32_t>& concepts::SparseIWrapper< Scalar >::CCSrow_ [private] |
Definition at line 80 of file sparseIWrapper.hh.
concepts::Array<Scalar>& concepts::SparseIWrapper< Scalar >::CCSval_ [private] |
Definition at line 78 of file sparseIWrapper.hh.
miUINT32_t concepts::SparseIWrapper< Scalar >::cols_ [private] |
Definition at line 69 of file sparseIWrapper.hh.
| concepts::Array<miUINT32_t> concepts::SparseIWrapper< Scalar >::CoordType |
Definition at line 55 of file sparseIWrapper.hh.
MATtype concepts::SparseIWrapper< Scalar >::imagType_ [private] |
Definition at line 71 of file sparseIWrapper.hh.
bool concepts::SparseIWrapper< Scalar >::isComplex_ [private] |
Definition at line 67 of file sparseIWrapper.hh.
bool concepts::SparseIWrapper< Scalar >::matrixReady_ [private] |
Definition at line 83 of file sparseIWrapper.hh.
miUINT32_t concepts::SparseIWrapper< Scalar >::nnz_ [private] |
Definition at line 68 of file sparseIWrapper.hh.
std::string concepts::SparseIWrapper< Scalar >::piCopy_ [private] |
Definition at line 84 of file sparseIWrapper.hh.
std::string concepts::SparseIWrapper< Scalar >::prCopy_ [private] |
Definition at line 84 of file sparseIWrapper.hh.
MATtype concepts::SparseIWrapper< Scalar >::realType_ [private] |
Definition at line 71 of file sparseIWrapper.hh.
miUINT32_t concepts::SparseIWrapper< Scalar >::rows_ [private] |
Definition at line 70 of file sparseIWrapper.hh.
| concepts::Array<Scalar> concepts::SparseIWrapper< Scalar >::ValType |
Definition at line 54 of file sparseIWrapper.hh.