13 #include <Eigen/Dense>
30 template <
typename Value>
38 using EigenMatrixType::fill;
39 using EigenMatrixType::innerStride;
40 using EigenMatrixType::outerStride;
76 const Value&
getValue(
size_t const i,
size_t const j)
const
85 Value&
getValue(
size_t const i,
size_t const j)
87 return this->operator()(i, j);
94 void setValue(
size_t const i,
size_t const j,
const Value& value)
96 this->operator()(i, j) = value;
102 EigenMatrixType::resize(rows, cols);
107 return EigenMatrixType::innerStride();
112 return EigenMatrixType::outerStride();
117 return EigenMatrixType::IsRowMajor;
132 template <
typename T,
long int ROWS,
long int COLS>
136 for (
int i = 0; i < ROWS; ++i)
138 for (
int j = 0; j < COLS; ++j)
140 this->operator()(i, j) = array[i][j];
164 for (
long int i = 0; i < matrix.rows(); ++i)
166 for (
long int j = 0; j < matrix.cols(); ++j)
168 os << std::setprecision(6) << std::setw(6) << matrix(i, j) <<
' ';
Definition: IsobaricIsotopeCorrector.h:17
A class representing a thin wrapper around an Eigen matrix.
Definition: Matrix.h:32
bool operator==(const Matrix &rhs) const
Equality operator. Compares two matrices for equality.
Definition: Matrix.h:151
void resize(size_t rows, size_t cols)
Definition: Matrix.h:100
Matrix(const Matrix &other)=default
const Value & getValue(size_t const i, size_t const j) const
Definition: Matrix.h:76
void setValue(size_t const i, size_t const j, const Value &value)
Definition: Matrix.h:94
Matrix & operator=(Matrix &&other) noexcept=default
Matrix(Size rows, Size cols, Value value=Value())
Constructor to create a matrix with specified dimensions and fill value.
Definition: Matrix.h:67
int innerStride() const
Definition: Matrix.h:105
void setMatrix(T const (&array)[ROWS][COLS])
Sets the matrix values using a 2D array.
Definition: Matrix.h:133
int outerStride() const
Definition: Matrix.h:110
EigenMatrixType & getEigenMatrix()
Get a reference to the underlying Eigen matrix.
Definition: Matrix.h:190
Matrix & operator=(const Matrix &other)=default
Value & getValue(size_t const i, size_t const j)
Definition: Matrix.h:85
const EigenMatrixType & getEigenMatrix() const
Get a const reference to the underlying Eigen matrix.
Definition: Matrix.h:180
friend std::ostream & operator<<(std::ostream &os, const Matrix< Value > &matrix)
Friend function to output the matrix to an output stream.
Definition: Matrix.h:162
Matrix(Matrix &&other) noexcept=default
bool rowMajor() const
Definition: Matrix.h:115
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:97
bool operator==(const IDBoostGraph::ProteinGroup &lhs, const IDBoostGraph::ProteinGroup &rhs)
Main OpenMS namespace.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19