FIFF sparse matrix storage backed by Eigen. More...
#include <fiff_sparse_matrix.h>
Public Types | |
| using | SPtr = QSharedPointer<FiffSparseMatrix> |
| using | ConstSPtr = QSharedPointer<const FiffSparseMatrix> |
| using | UPtr = std::unique_ptr<FiffSparseMatrix> |
| using | ConstUPtr = std::unique_ptr<const FiffSparseMatrix> |
Public Member Functions | |
| FiffSparseMatrix () | |
| FiffSparseMatrix (Eigen::SparseMatrix< float > &&mat, FIFFLIB::fiff_int_t coding=FIFFTS_MC_RCS) | |
| FiffSparseMatrix (const FiffSparseMatrix &mat)=default | |
| FiffSparseMatrix (FiffSparseMatrix &&mat)=default | |
| FiffSparseMatrix & | operator= (const FiffSparseMatrix &)=default |
| FiffSparseMatrix & | operator= (FiffSparseMatrix &&)=default |
| ~FiffSparseMatrix ()=default | |
| Eigen::SparseMatrix< float > & | eigen () |
| const Eigen::SparseMatrix< float > & | eigen () const |
| operator const Eigen::SparseMatrix< float > & () const | |
| int | rows () const |
| int | cols () const |
| int | nonZeros () const |
| FiffSparseMatrix::UPtr | mne_add_upper_triangle_rcs () |
| FiffSparseMatrix::UPtr | pickLowerTriangleRcs () const |
| bool | is_empty () const |
| Eigen::SparseMatrix< double > | toEigenSparse () const |
Static Public Member Functions | |
| static std::vector< int > | fiff_get_matrix_sparse_dims (const FIFFLIB::FiffTag::UPtr &tag) |
| static FiffSparseMatrix::UPtr | fiff_get_float_sparse_matrix (const FIFFLIB::FiffTag::UPtr &tag) |
| static FiffSparseMatrix::UPtr | create_sparse_rcs (int nrow, int ncol, int *nnz, int **colindex, float **vals) |
| static FiffSparseMatrix | fromEigenSparse (const Eigen::SparseMatrix< double > &mat) |
| static FiffSparseMatrix | fromEigenSparse (const Eigen::SparseMatrix< float > &mat) |
Public Attributes | |
| FIFFLIB::fiff_int_t | coding |
FIFF sparse matrix storage backed by Eigen.
FIFF sparse matrix — wraps Eigen::SparseMatrix<float>.
Internally stores data in a single Eigen::SparseMatrix<float>. The coding member records whether the FIFF source was CCS or RCS (used only during serialization / deserialization).
Definition at line 85 of file fiff_sparse_matrix.h.
| using FIFFLIB::FiffSparseMatrix::ConstSPtr = QSharedPointer<const FiffSparseMatrix> |
Const shared pointer type for FiffSparseMatrix.
Definition at line 89 of file fiff_sparse_matrix.h.
| using FIFFLIB::FiffSparseMatrix::ConstUPtr = std::unique_ptr<const FiffSparseMatrix> |
Const unique pointer type for FiffSparseMatrix.
Definition at line 91 of file fiff_sparse_matrix.h.
| using FIFFLIB::FiffSparseMatrix::SPtr = QSharedPointer<FiffSparseMatrix> |
Shared pointer type for FiffSparseMatrix.
Definition at line 88 of file fiff_sparse_matrix.h.
| using FIFFLIB::FiffSparseMatrix::UPtr = std::unique_ptr<FiffSparseMatrix> |
Unique pointer type for FiffSparseMatrix.
Definition at line 90 of file fiff_sparse_matrix.h.
| FiffSparseMatrix::FiffSparseMatrix | ( | ) |
Constructs an empty FiffSparseMatrix.
Definition at line 145 of file fiff_sparse_matrix.cpp.
|
explicit |
Constructs a FiffSparseMatrix wrapping an existing Eigen sparse matrix.
| [in] | mat | Eigen sparse matrix to wrap (moved in). |
| [in] | coding | FIFF storage coding (FIFFTS_MC_RCS or FIFFTS_MC_CCS). |
Definition at line 152 of file fiff_sparse_matrix.cpp.
|
default |
Default copy constructor.
|
default |
Default move constructor.
|
default |
Default destructor.
|
inline |
Number of columns.
Definition at line 166 of file fiff_sparse_matrix.h.
|
static |
Create a sparse RCS matrix from row-based data.
| [in] | nrow | Number of rows. |
| [in] | ncol | Number of columns. |
| [in] | nnz | Number of non-zero elements on each row. |
| [in] | colindex | Column indices of non-zero elements on each row. |
| [in] | vals | Values of non-zero elements on each row. |
Definition at line 244 of file fiff_sparse_matrix.cpp.
|
inline |
Mutable access to the underlying Eigen sparse matrix.
Definition at line 145 of file fiff_sparse_matrix.h.
|
inline |
Const access to the underlying Eigen sparse matrix.
Definition at line 151 of file fiff_sparse_matrix.h.
|
static |
Conversion of tag data into the standard sparse representation.
| [in] | tag | The tag containing sparse matrix data. |
Definition at line 168 of file fiff_sparse_matrix.cpp.
|
static |
Interpret dimensions and nz from matrix data.
| [in] | tag | The tag containing sparse matrix data. |
Definition at line 161 of file fiff_sparse_matrix.cpp.
|
static |
Create a FiffSparseMatrix from an Eigen::SparseMatrix<double>. The data is cast to float for internal storage.
| [in] | mat | The Eigen sparse matrix to convert. |
Definition at line 313 of file fiff_sparse_matrix.cpp.
|
static |
Create a FiffSparseMatrix from an Eigen::SparseMatrix<float>.
| [in] | mat | The Eigen sparse matrix to wrap. |
Definition at line 327 of file fiff_sparse_matrix.cpp.
|
inline |
Check whether this sparse matrix is empty (no non-zero elements).
Definition at line 270 of file fiff_sparse_matrix.h.
| FiffSparseMatrix::UPtr FiffSparseMatrix::mne_add_upper_triangle_rcs | ( | ) |
Add the upper triangle to a lower-triangular sparse RCS matrix.
Definition at line 281 of file fiff_sparse_matrix.cpp.
|
inline |
Number of stored non-zero elements.
Definition at line 171 of file fiff_sparse_matrix.h.
|
inline |
Implicit conversion to const Eigen::SparseMatrix<float>&.
Definition at line 156 of file fiff_sparse_matrix.h.
|
default |
Default copy-assignment operator.
|
default |
Default move-assignment operator.
| FiffSparseMatrix::UPtr FiffSparseMatrix::pickLowerTriangleRcs | ( | ) | const |
Extract only the lower triangle (including diagonal) from a square RCS matrix.
Definition at line 341 of file fiff_sparse_matrix.cpp.
|
inline |
Number of rows.
Definition at line 161 of file fiff_sparse_matrix.h.
|
inline |
Convert to Eigen::SparseMatrix<double> (cast from float).
Definition at line 275 of file fiff_sparse_matrix.h.
| FIFFLIB::fiff_int_t FIFFLIB::FiffSparseMatrix::coding |
FIFF coding type (FIFFTS_MC_RCS or FIFFTS_MC_CCS). Used for serialization only.
Definition at line 260 of file fiff_sparse_matrix.h.