OpenMS
|
A class representing a thin wrapper around an Eigen matrix. More...
#include <OpenMS/DATASTRUCTURES/Matrix.h>
Public Types | |
using | EigenMatrixType = Eigen::Matrix< Value, Eigen::Dynamic, Eigen::Dynamic > |
Eigen matrix type. More... | |
Public Member Functions | |
Matrix ()=default | |
~Matrix ()=default | |
Matrix (const Matrix &other)=default | |
Matrix & | operator= (const Matrix &other)=default |
Matrix (Matrix &&other) noexcept=default | |
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. More... | |
const Value & | getValue (size_t const i, size_t const j) const |
Value & | getValue (size_t const i, size_t const j) |
void | setValue (size_t const i, size_t const j, const Value &value) |
void | resize (size_t rows, size_t cols) |
int | innerStride () const |
int | outerStride () const |
bool | rowMajor () const |
template<typename T , long int ROWS, long int COLS> | |
void | setMatrix (T const (&array)[ROWS][COLS]) |
Sets the matrix values using a 2D array. More... | |
bool | operator== (const Matrix &rhs) const |
Equality operator. Compares two matrices for equality. More... | |
const EigenMatrixType & | getEigenMatrix () const |
Get a const reference to the underlying Eigen matrix. More... | |
EigenMatrixType & | getEigenMatrix () |
Get a reference to the underlying Eigen matrix. More... | |
Friends | |
std::ostream & | operator<< (std::ostream &os, const Matrix< Value > &matrix) |
Friend function to output the matrix to an output stream. More... | |
A class representing a thin wrapper around an Eigen matrix.
The Matrix class provides functionality for creating, manipulating, and accessing matrices. It is implemented using the Eigen library and supports various operations such as resizing, clearing, accessing elements, setting values, and comparing matrices.
using EigenMatrixType = Eigen::Matrix<Value, Eigen::Dynamic, Eigen::Dynamic> |
Eigen matrix type.
|
default |
|
default |
Constructor to create a matrix with specified dimensions and fill value.
rows | Number of rows in the matrix. |
cols | Number of columns in the matrix. |
value | Initial value to fill the matrix. |
|
inline |
|
inline |
Get a const reference to the underlying Eigen matrix.
Referenced by BilinearInterpolation< Key, Value >::empty().
|
inline |
|
inline |
|
inline |
|
inline |
Equality operator. Compares two matrices for equality.
rhs | The matrix to be compared. |
References OpenMS::Internal::operator==().
|
inline |
|
inline |
Referenced by Matrix< Value >::setMatrix().
|
inline |
|
inline |
Sets the matrix values using a 2D array.
This function resizes the matrix to the specified number of rows and columns, and then assigns the values from the 2D array to the corresponding elements in the matrix.
T | The type of the matrix elements. |
ROWS | The number of rows in the matrix. |
COLS | The number of columns in the matrix. |
array | The 2D array containing the values to be assigned to the matrix. |
References Matrix< Value >::resize().
|
inline |