linbox
|
Sparse matrix, Coordinate storage. More...
#include <sparse-ell-matrix.h>
Public Types | |
typedef _Field | Field |
Field. | |
typedef _Field::Element | Element |
Element. | |
typedef const Element | constElement |
const Element | |
typedef SparseMatrixFormat::ELL | Storage |
Matrix Storage Format. | |
typedef SparseMatrix< _Field, Storage > | Self_t |
Self type. | |
typedef Vector< Field >::SparseSeq | Row |
Public Member Functions | |
void | transposeIn () |
In place transpose. More... | |
Self_t & | transpose (Self_t &S) const |
Transpose the matrix. More... | |
size_t | rowdim () const |
number of rows. More... | |
size_t | coldim () const |
number of columns. More... | |
size_t | size () const |
Number of non zero elements in the matrix. More... | |
constElement & | getEntry (const size_t &i, const size_t &j) const |
Get a read-only individual entry from the matrix. More... | |
void | finalize () |
make matrix ready to use after a sequence of setEntry calls. | |
const Element & | setEntry (const size_t &i, const size_t &j, const Element &e) |
Set an individual entry. More... | |
std::ostream & | write (std::ostream &os, Tag::FileFormat format=Tag::FileFormat::MatrixMarket) const |
Write a matrix to the given output stream using field read/write. More... | |
std::istream & | read (std::istream &is, Tag::FileFormat format=Tag::FileFormat::Detect) |
Read a matrix from the given input stream using field read/write. More... | |
bool | consistent () const |
SparseMatrix (const _Field &F) | |
Constructors. More... | |
SparseMatrix (const _Field &F, size_t m, size_t n) | |
Constructors. More... | |
SparseMatrix (const _Field &F, size_t m, size_t n, size_t z) | |
Constructors. More... | |
SparseMatrix (const SparseMatrix< _Field, SparseMatrixFormat::CSR > &S) | |
Constructors. More... | |
template<typename _Tp1 , typename _Rw1 > | |
SparseMatrix (const SparseMatrix< _Tp1, _Rw1 > &S, const Field &F) | |
Constructors. More... | |
template<class VectStream > | |
SparseMatrix (const _Field &F, VectStream &stream) | |
SparseMatrix (MatrixStream< Field > &ms) | |
Constructors. More... | |
void | resize (const size_t mm, const size_t nn, const size_t zz=0, const size_t ll=0) |
Constructors. More... | |
template<class _OtherStorage > | |
SparseMatrix (const SparseMatrix< _Field, _OtherStorage > &S) | |
Default converter. More... | |
void | importe (const SparseMatrix< _Field, SparseMatrixFormat::CSR > &S) |
Conversions. More... | |
void | importe (const SparseMatrix< _Field, SparseMatrixFormat::ELL > &S) |
Import a matrix in CSR format to CSR. More... | |
template<class _OtherStorage > | |
void | importe (const SparseMatrix< _Field, _OtherStorage > &S) |
Conversions. More... | |
SparseMatrix< _Field, SparseMatrixFormat::CSR > & | exporte (SparseMatrix< _Field, SparseMatrixFormat::CSR > &S) const |
Export a matrix in CSR format from COO. More... | |
Protected Attributes | |
size_t | _maxc |
longest row | |
std::vector< size_t > | _colid |
_colid is _rownb x _maxc in RowMajor | |
std::vector< Element > | _data |
_data is _rownb x _maxc in RowMajor | |
Sparse matrix, Coordinate storage.
|
inline |
Constructors.
|
inline |
Constructors.
|
inline |
Constructors.
|
inline |
Constructors.
|
inline |
Constructors.
|
inline |
|
inline |
Constructors.
|
inline |
Default converter.
S | a sparse matrix in any storage. |
|
inline |
Constructors.
|
inline |
Conversions.
Any sparse matrix has a converter to/from CSR. A specialisation can skip the temporary CSR matrix created.
Import a matrix in COO format to CSR.
S | COO matrix to be converted in CSR |
|
inline |
Import a matrix in CSR format to CSR.
S | CSR matrix to be converted in CSR |
|
inline |
Conversions.
Any sparse matrix has a converter to/from CSR. A specialisation can skip the temporary CSR matrix created.
Import a matrix in COO format to CSR.
S | COO matrix to be converted in CSR |
|
inline |
Export a matrix in CSR format from COO.
S | CSR matrix to be converted from COO |
|
inline |
In place transpose.
Not quite...
|
inline |
number of rows.
|
inline |
number of columns.
|
inline |
Number of non zero elements in the matrix.
or at least the size of the _data if
|
inline |
Get a read-only individual entry from the matrix.
i | Row _colid |
j | Column _colid |
Set an individual entry.
Setting the entry to 0 will not remove it from the matrix
i | Row _colid of entry |
j | Column _colid of entry |
value | Value of the new entry |
|
inline |
Write a matrix to the given output stream using field read/write.
os | Output stream to which to write the matrix |
format | Format with which to write |
|
inline |
Read a matrix from the given input stream using field read/write.
is | Input stream from which to read the matrix |
format | Format of input matrix |
is
.
|
inline |
We could end up a line with a marker. A field F would contain an element that does not belong to it. eg a nan for a Givaro::Modular<double>. It could act as a marker.