FIFF sparse matrix storage. 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 (const FiffSparseMatrix &mat)=default | |
| FiffSparseMatrix (FiffSparseMatrix &&mat)=default | |
| FiffSparseMatrix & | operator= (const FiffSparseMatrix &)=default |
| FiffSparseMatrix & | operator= (FiffSparseMatrix &&)=default |
| ~FiffSparseMatrix ()=default | |
| 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) |
Public Attributes | |
| FIFFLIB::fiff_int_t | coding |
| FIFFLIB::fiff_int_t | m |
| FIFFLIB::fiff_int_t | n |
| FIFFLIB::fiff_int_t | nz |
| Eigen::VectorXf | data |
| Eigen::VectorXi | inds |
| Eigen::VectorXi | ptrs |
FIFF sparse matrix storage.
Implements a FIFF sparse matrix.
Definition at line 81 of file fiff_sparse_matrix.h.
| using FIFFLIB::FiffSparseMatrix::ConstSPtr = QSharedPointer<const FiffSparseMatrix> |
Const shared pointer type for FiffSparseMatrix.
Definition at line 85 of file fiff_sparse_matrix.h.
| using FIFFLIB::FiffSparseMatrix::ConstUPtr = std::unique_ptr<const FiffSparseMatrix> |
Const unique pointer type for FiffSparseMatrix.
Definition at line 87 of file fiff_sparse_matrix.h.
| using FIFFLIB::FiffSparseMatrix::SPtr = QSharedPointer<FiffSparseMatrix> |
Shared pointer type for FiffSparseMatrix.
Definition at line 84 of file fiff_sparse_matrix.h.
| using FIFFLIB::FiffSparseMatrix::UPtr = std::unique_ptr<FiffSparseMatrix> |
Unique pointer type for FiffSparseMatrix.
Definition at line 86 of file fiff_sparse_matrix.h.
| FiffSparseMatrix::FiffSparseMatrix | ( | ) |
Constructs the FiffSparseMatrix
Definition at line 145 of file fiff_sparse_matrix.cpp.
|
default |
Copies a FiffSparseMatrix (default — Eigen vectors handle deep copy).
|
default |
Default move constructor.
|
default |
Destroys the FiffSparseMatrix (default — Eigen vectors clean up automatically).
|
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 226 of file fiff_sparse_matrix.cpp.
|
static |
Conversion of tag data into the standard sparse representation.
| [in] | tag | The tag containing sparse matrix data. |
Definition at line 162 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 155 of file fiff_sparse_matrix.cpp.
|
static |
Create a FiffSparseMatrix from an Eigen::SparseMatrix. Stores in RCS (row-compressed) format.
| [in] | mat | The Eigen sparse matrix to convert. |
Definition at line 370 of file fiff_sparse_matrix.cpp.
|
inline |
Check whether this sparse matrix is empty (no non-zero elements).
Definition at line 218 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 274 of file fiff_sparse_matrix.cpp.
|
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 421 of file fiff_sparse_matrix.cpp.
| Eigen::SparseMatrix< double > FiffSparseMatrix::toEigenSparse | ( | ) | const |
Convert this FiffSparseMatrix to an Eigen::SparseMatrix<double>. Supports both RCS and CCS coding.
Definition at line 337 of file fiff_sparse_matrix.cpp.
| FIFFLIB::fiff_int_t FIFFLIB::FiffSparseMatrix::coding |
coding (storage) type of the sparse matrix.
Definition at line 204 of file fiff_sparse_matrix.h.
| Eigen::VectorXf FIFFLIB::FiffSparseMatrix::data |
Non-zero values (nz elements).
Definition at line 208 of file fiff_sparse_matrix.h.
| Eigen::VectorXi FIFFLIB::FiffSparseMatrix::inds |
Index array (nz elements).
Definition at line 209 of file fiff_sparse_matrix.h.
| FIFFLIB::fiff_int_t FIFFLIB::FiffSparseMatrix::m |
m rows.
Definition at line 205 of file fiff_sparse_matrix.h.
| FIFFLIB::fiff_int_t FIFFLIB::FiffSparseMatrix::n |
n columns.
Definition at line 206 of file fiff_sparse_matrix.h.
| FIFFLIB::fiff_int_t FIFFLIB::FiffSparseMatrix::nz |
nz nonzeros.
Definition at line 207 of file fiff_sparse_matrix.h.
| Eigen::VectorXi FIFFLIB::FiffSparseMatrix::ptrs |
Pointer array (m+1 for RCS, n+1 for CCS).
Definition at line 210 of file fiff_sparse_matrix.h.