molecular
|
Generic matrix template class. More...
#include <Matrix.h>
Public Types | |
using | ValueType = T |
Public Member Functions | |
Matrix ()=default | |
Default constructor. More... | |
Matrix (const T values[rows *cols]) | |
Construct matrix from an array in row-major order. More... | |
Matrix (const T values[rows][cols]) | |
Construct matrix from two-dimensional array. More... | |
Matrix (std::initializer_list< T > init) | |
template<typename OtherDerived > | |
Matrix (const Eigen::MatrixBase< OtherDerived > &other) | |
Construct from Eigen expression. More... | |
template<typename OtherDerived > | |
Matrix & | operator= (const Eigen::MatrixBase< OtherDerived > &other) |
Assign from Eigen expression. More... | |
const T * | Get () const |
Returns array of matrix elements in row-major order. More... | |
T * | operator[] (int row) |
const T * | operator[] (int row) const |
T | operator() (int row, int col) const |
T & | operator() (int row, int col) |
auto | ToEigen () |
auto | ToEigen () const |
template<class M > | |
Matrix< rows, M::kCols, T > | operator* (const M &mat) const |
Matrix-matrix multiplication. More... | |
Matrix | operator* (ValueType s) const |
Matrix-scalar multiplication. More... | |
Matrix | operator+ (const Matrix &mat) const |
Matrix & | operator+= (const Matrix &mat) |
Matrix & | operator*= (const Matrix &mat) |
Matrix & | operator*= (ValueType s) |
Matrix & | operator/= (ValueType s) |
void | SetIdentity () |
template<class M > | |
Matrix< M::kRows, M::kCols+cols, T > | Augmented (const M &mat) const |
Returns the matrix with mat concatenated to the right side. More... | |
template<int newcols> | |
Matrix< rows, newcols, T > | SubMatrixRight () const |
Returns the right portion of the matrix with the given width. More... | |
template<int newcols> | |
Matrix< rows, newcols, T > | SubMatrixLeft () const |
Returns the left portion of the matrix with the given width. More... | |
void | Print () const |
Matrix< rows, cols, T > | Inverse () const |
Returns the inverse of the matrix. More... | |
Matrix< cols, rows, T > | Transposed () const |
Returns the transposed of the matrix. More... | |
T | Trace () const |
Returns the sum of the diagonal elements. More... | |
Static Public Member Functions | |
static Matrix | Identity () |
static Matrix | Zeros () |
Static Public Attributes | |
static const int | kRows = rows |
static const int | kCols = cols |
Protected Attributes | |
T | m [rows][cols] |
Generic matrix template class.
using molecular::util::Matrix< rows, cols, T >::ValueType = T |
|
default |
Default constructor.
|
inline |
Construct matrix from an array in row-major order.
|
inline |
Construct matrix from two-dimensional array.
|
inline |
|
inline |
Construct from Eigen expression.
|
inline |
Returns the matrix with mat concatenated to the right side.
Both matrices must have the same number of rows. The resulting matrix has as many columns as both input matrices together.
|
inline |
Returns array of matrix elements in row-major order.
OpenGL wants column-major order.
|
inlinestatic |
Matrix< rows, cols, T > molecular::util::Matrix< rows, cols, T >::Inverse | ( | ) | const |
Returns the inverse of the matrix.
|
inline |
Eigen compatibility.
|
inline |
Eigen compatibility.
|
inline |
Matrix-matrix multiplication.
|
inline |
Matrix-scalar multiplication.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Assign from Eigen expression.
|
inline |
|
inline |
|
inline |
|
inline |
Matrix< rows, newcols, T > molecular::util::Matrix< rows, cols, T >::SubMatrixLeft | ( | ) | const |
Returns the left portion of the matrix with the given width.
Matrix< rows, newcols, T > molecular::util::Matrix< rows, cols, T >::SubMatrixRight | ( | ) | const |
Returns the right portion of the matrix with the given width.
|
inline |
|
inline |
|
inline |
Returns the sum of the diagonal elements.
|
inline |
Returns the transposed of the matrix.
|
inlinestatic |
|
static |
|
static |
|
protected |
Row-major order.