27 #ifndef SRC_ENV_MATRIX_HPP_ 28 #define SRC_ENV_MATRIX_HPP_ 37 template<
class ScalarT>
78 const ScalarT &
operator() (std::size_t row, std::size_t col)
const;
86 ScalarT &
operator() (std::size_t row, std::size_t col);
99 const ScalarT *
data()
const;
119 void resize(std::size_t num_rows, std::size_t num_cols);
129 void power(std::size_t n);
184 Eigen::Matrix<ScalarT, Eigen::Dynamic, Eigen::Dynamic> &
matrix();
189 const Eigen::Matrix<ScalarT, Eigen::Dynamic, Eigen::Dynamic> &
matrix()
const;
192 Eigen::Matrix<ScalarT, Eigen::Dynamic, Eigen::Dynamic> matrix_;
213 template<
typename ScalarT>
214 std::ostream & operator<<(std::ostream & os, const Matrix<ScalarT> &
matrix);
A matrix class with basic functionality.
void power(std::size_t n)
Takes the matrix to the power of n.
ScalarT max() const
Returns the maximal coefficient.
void resize(std::size_t num_rows, std::size_t num_cols)
Resizes the matrix.
void swap(Matrix &matrix)
Swaps the matrix with another matrix.
ged::Matrix class definition.
Matrix< ScalarT > operator-(const Matrix< ScalarT > &matrix) const
Matrix-matrix addition.
Matrix< ScalarT > operator*(const ScalarT &scalar) const
Matrix-scalar multiplication.
Matrix< ScalarT > operator+(const Matrix< ScalarT > &matrix) const
Matrix-matrix addition.
Matrix< ScalarT > & operator*=(const ScalarT &scalar)
Matrix-scalar multiplication assignment.
ScalarT min() const
Returns the minimal coefficient.
const ScalarT & operator()(std::size_t row, std::size_t col) const
Provides access to a cell.
Matrix< ScalarT > & operator-=(const Matrix< ScalarT > &matrix)
Matrix-matrix substraction assignment.
std::size_t num_cols() const
Returns the number of columns.
Matrix< double > DMatrix
Matrix with double entries.
Matrix()
Constructs an empty cost matrix.
Matrix< ScalarT > transposed() const
Returns the transposed matrix.
Matrix< ScalarT > & operator+=(const Matrix< ScalarT > &matrix)
Matrix-matrix addition assignment.
Matrix< int > IMatrix
Matrix with int entries.
Eigen::Matrix< ScalarT, Eigen::Dynamic, Eigen::Dynamic > & matrix()
Returns reference to the internal Eigen matrix.
Type declarations used by various classes.
Global namespace for GEDLIB.
void operator=(const Matrix &matrix)
Assignment operator.
void set_to_val(const ScalarT &val)
Sets all cells to val.
void transpose()
Transposes the matrix.
ScalarT * data()
Provides access to internal data.
std::size_t num_rows() const
Returns the number of rows.