v2.0.0
Loading...
Searching...
No Matches
fiff_named_matrix.cpp
Go to the documentation of this file.
1//=============================================================================================================
18
19//=============================================================================================================
20// INCLUDES
21//=============================================================================================================
22
23#include "fiff_named_matrix.h"
24
25//=============================================================================================================
26// USED NAMESPACES
27//=============================================================================================================
28
29using namespace FIFFLIB;
30using namespace Eigen;
31
32//=============================================================================================================
33// DEFINE MEMBER METHODS
34//=============================================================================================================
35
37: nrow(-1)
38, ncol(-1)
39{
40}
41
42//=============================================================================================================
43
44FiffNamedMatrix::FiffNamedMatrix(fiff_int_t p_nrow, fiff_int_t p_ncol, const QStringList& p_row_names, const QStringList& p_col_names, const MatrixXd& p_data)
45: nrow(p_nrow)
46, ncol(p_ncol)
47, row_names(p_row_names)
48, col_names(p_col_names)
49, data(p_data)
50{
51}
52
53//=============================================================================================================
54
56: QSharedData(p_FiffNamedMatrix)
57, nrow(p_FiffNamedMatrix.nrow)
58, ncol(p_FiffNamedMatrix.ncol)
59, row_names(p_FiffNamedMatrix.row_names)
60, col_names(p_FiffNamedMatrix.col_names)
61, data(p_FiffNamedMatrix.data)
62{
63}
64
65//=============================================================================================================
66
68{
69 nrow = -1;
70 ncol = -1;
71 row_names.clear();
72 col_names.clear();
73 data = MatrixXd();
74}
75
76//=============================================================================================================
77
79{
80 QStringList col_names_old = this->col_names;
81 this->col_names = this->row_names;
82 this->row_names = col_names_old;
83
84 this->data.transposeInPlace();
85
86 this->nrow = this->data.rows();
87 this->ncol = this->data.cols();
88}
Matrix paired with row and column name lists, the on-disk form of FIFFB_PROJ_ITEM / FIFFB_MNE_NAMED_M...
FIFF file I/O, in-memory data structures and high-level readers/writers.