Sparse matrix, Coordinate storage.
More...
#include <sparse-coo-implicit-matrix.h>
|
typedef _Field | Field |
| Field.
|
|
typedef _Field::Element | Element |
| Element.
|
|
typedef const Element | constElement |
| const Element
|
|
typedef SparseMatrixFormat::COO::implicit | Storage |
| Matrix Storage Format.
|
|
typedef SparseMatrix< _Field, Storage > | Self_t |
| Self type.
|
|
|
| SparseMatrix () |
| Constructors.
|
|
template<class _OtherStorage > |
| SparseMatrix (const SparseMatrix< _Field, _OtherStorage > &S) |
| Default converter.
|
|
void | importe (const SparseMatrix< _Field, SparseMatrixFormat::CSR > &S) |
| Conversions.
|
|
SparseMatrix< _Field, SparseMatrixFormat::CSR > & | exporte (SparseMatrix< _Field, SparseMatrixFormat::CSR > &S) |
| Export a matrix in CSR format from COO::implicit.
|
|
void | transposeIn () |
| In place transpose.
|
|
SparseMatrix< _Field, SparseMatrixFormat::COO::implicit > & | transpose (SparseMatrix< _Field, SparseMatrixFormat::COO::implicit > &S) |
| Transpose the matrix.
|
|
size_t | rowdim () const |
| number of rows.
|
|
size_t | coldim () const |
| number of columns.
|
|
size_t | size () const |
| Number of non zero elements in the matrix.
|
|
constElement & | getEntry (const size_t &i, const size_t &j) const |
| Get a read-only individual entry from the matrix.
|
|
const Element & | setEntry (const size_t &i, const size_t &j, const Element &e) |
| Set an individual entry.
|
|
Element & | refEntry (const size_t &i, const size_t &j) |
| Get a writeable reference to an entry in the matrix.
|
|
template<class Format > |
std::ostream & | write (std::ostream &os, Format=SparseFileFormat::CSR()) const |
| Write a matrix to the given output stream using field read/write.
|
|
template<class Format > |
std::istream & | read (std::istream &file, Format=SparseFileFormat::CSR()) |
| Read a matrix from the given input stream using field read/write.
|
|
template<class Vector > |
Vector & | apply (Vector &y, const Vector &x, const Element &a) const |
|
bool | consistent () const |
|
template<class _Field>
class LinBox::SparseMatrix< _Field, SparseMatrixFormat::COO::implicit >
Sparse matrix, Coordinate storage.
◆ SparseMatrix() [1/2]
Constructors.
- Todo:
- convert from other matrix.
◆ SparseMatrix() [2/2]
template<class _Field >
template<class _OtherStorage >
SparseMatrix |
( |
const SparseMatrix< _Field, _OtherStorage > & |
S | ) |
|
|
inline |
Default converter.
- Parameters
-
S | a sparse matrix in any storage. |
◆ importe()
Conversions.
Any sparse matrix has a converter to/from CSR. A specialisation can skip the temporary CSR matrix created.
Import a matrix in CSR format to COO::implicit.
- Parameters
-
S | CSR matrix to be converted in COO::implicit |
◆ exporte()
Export a matrix in CSR format from COO::implicit.
- Parameters
-
S | CSR matrix to be converted from COO::implicit |
◆ transposeIn()
In place transpose.
Not quite...
◆ transpose()
template<class _Field >
SparseMatrix< _Field, SparseMatrixFormat::COO::implicit > & transpose |
( |
SparseMatrix< _Field, SparseMatrixFormat::COO::implicit > & |
S | ) |
|
|
inline |
Transpose the matrix.
- Parameters
-
S | [out] transpose of self. |
- Returns
- a reference to
S
.
◆ rowdim()
number of rows.
- Returns
- row dimension.
◆ coldim()
number of columns.
- Returns
- column dimension
◆ size()
Number of non zero elements in the matrix.
or at least the size of the _data if
- Returns
- size of the _data.
◆ getEntry()
template<class _Field >
constElement & getEntry |
( |
const size_t & |
i, |
|
|
const size_t & |
j |
|
) |
| const |
|
inline |
Get a read-only individual entry from the matrix.
- Parameters
-
i | Row _colid |
j | Column _colid |
- Returns
- Const reference to matrix entry
◆ setEntry()
template<class _Field >
const Element & setEntry |
( |
const size_t & |
i, |
|
|
const size_t & |
j, |
|
|
const Element & |
e |
|
) |
| |
|
inline |
Set an individual entry.
Setting the entry to 0 will not remove it from the matrix
- Parameters
-
i | Row _colid of entry |
j | Column _colid of entry |
value | Value of the new entry |
- Todo:
- make it faster if i is 0 or m-1 ?
◆ refEntry()
template<class _Field >
Element & refEntry |
( |
const size_t & |
i, |
|
|
const size_t & |
j |
|
) |
| |
|
inline |
Get a writeable reference to an entry in the matrix.
If there is no entry at the position (i, j), then a new entry with a value of zero is inserted and a reference to it is returned.
- Parameters
-
i | Row _colid of entry |
j | Column _colid of entry |
- Returns
- Reference to matrix entry
◆ write()
template<class _Field >
template<class Format >
std::ostream & write |
( |
std::ostream & |
os, |
|
|
Format |
= SparseFileFormat::CSR() |
|
) |
| const |
|
inline |
Write a matrix to the given output stream using field read/write.
- Parameters
-
os | Output stream to which to write the matrix |
format | Format with which to write |
◆ read()
template<class _Field >
template<class Format >
std::istream & read |
( |
std::istream & |
file, |
|
|
Format |
= SparseFileFormat::CSR() |
|
) |
| |
|
inline |
Read a matrix from the given input stream using field read/write.
- Parameters
-
file | Input stream from which to read the matrix |
format | Format of input matrix |
- Returns
- ref to
file
.
◆ apply()
◆ consistent()
template<class _Field >
bool consistent |
( |
| ) |
const |
|
inline |
The documentation for this class was generated from the following file: