Gromacs  2022.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Typedefs | Functions
matrix.h File Reference
#include <array>
#include "gromacs/math/multidimarray.h"
#include "gromacs/math/utilities.h"
#include "gromacs/math/vec.h"
#include "gromacs/utility/real.h"
+ Include dependency graph for matrix.h:
+ This graph shows which files directly or indirectly include this file:


Declares special case of 3x3 matrix frequently used, and associated functions.

Christian Blau


template<class ElementType >
using gmx::BasicMatrix3x3 = MultiDimArray< std::array< ElementType, 3 *3 >, extents< 3, 3 >>
 Three-by-three matrix of ElementType. More...
using gmx::Matrix3x3 = BasicMatrix3x3< real >
 Three-by-three real number matrix. More...
using gmx::Matrix3x3Span = Matrix3x3::view_type
 Convenience alias for a matrix view.
using gmx::Matrix3x3ConstSpan = Matrix3x3::const_view_type
 Convenience alias for a const matrix view.


constexpr real gmx::determinant (Matrix3x3ConstSpan matrix)
 Determinant of a 3x3 matrix.
constexpr real gmx::trace (Matrix3x3ConstSpan matrixView)
 Calculates the trace of a 3x3 matrix view.
template<typename ElementType , int N, int M = N>
MultiDimArray< std::array
< ElementType, N *M >, extents
< N, M > > 
gmx::identityMatrix ()
 Create an identity matrix of ElementType with N * M elements. More...
Matrix3x3 gmx::transpose (Matrix3x3ConstSpan matrixView)
 Calculate the transpose of a 3x3 matrix, from its view.
void gmx::matrixVectorMultiply (Matrix3x3ConstSpan matrix, RVec *v)
 Multiply matrix with vector.
static Matrix3x3 gmx::createMatrix3x3FromLegacyMatrix (const matrix legacyMatrix)
 Create new matrix type from legacy type.
static void gmx::fillLegacyMatrix (Matrix3x3ConstSpan newMatrix, matrix legacyMatrix)
 Fill legacy matrix from new matrix type.