smooth
A C++ library for Lie theory
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | List of all members
StaticMatrix< _Scalar, _Rows, _Cols > Struct Template Reference

Elementary structure for compile-time matrix algebra. More...

#include <static_matrix.hpp>

Inheritance diagram for StaticMatrix< _Scalar, _Rows, _Cols >:
Inheritance graph
[legend]

Public Member Functions

constexpr StaticMatrix ()
 Construct matrix filled with zeros.
 
template<std::size_t _NRows, std::size_t _NCols>
constexpr StaticMatrix< _Scalar, _NRows, _NCols > block (std::size_t row0, std::size_t col0) const
 Extract sub-block of size _NRows x _NCols anchored at (row0, col0)
 
constexpr StaticMatrix< _Scalar, _Rows, _Cols > operator+ (const StaticMatrix< _Scalar, _Rows, _Cols > &o) const
 Matrix addition.
 
constexpr StaticMatrix< _Scalar, _Rows, _Cols > transpose () const
 Matrix transpose.
 
template<std::size_t _NCols>
constexpr StaticMatrix< _Scalar, _Rows, _NCols > operator* (const StaticMatrix< _Scalar, _Cols, _NCols > &o) const
 Matrix multiplication.
 

Static Public Attributes

static constexpr std::size_t Rows = _Rows
 Number of rows in matrix.
 
static constexpr std::size_t Cols = _Cols
 Number of columns in matrix.
 

Detailed Description

template<typename _Scalar, std::size_t _Rows, std::size_t _Cols>
struct StaticMatrix< _Scalar, _Rows, _Cols >

Elementary structure for compile-time matrix algebra.

Matrix is stored in memory in row-major order.

Definition at line 22 of file static_matrix.hpp.

Constructor & Destructor Documentation

◆ StaticMatrix()

template<typename _Scalar , std::size_t _Rows, std::size_t _Cols>
constexpr StaticMatrix< _Scalar, _Rows, _Cols >::StaticMatrix ( )
inlineconstexpr

Construct matrix filled with zeros.

Definition at line 34 of file static_matrix.hpp.

Member Function Documentation

◆ block()

template<typename _Scalar , std::size_t _Rows, std::size_t _Cols>
template<std::size_t _NRows, std::size_t _NCols>
constexpr StaticMatrix< _Scalar, _NRows, _NCols > StaticMatrix< _Scalar, _Rows, _Cols >::block ( std::size_t  row0,
std::size_t  col0 
) const
inlineconstexpr

Extract sub-block of size _NRows x _NCols anchored at (row0, col0)

Definition at line 43 of file static_matrix.hpp.

◆ operator*()

template<typename _Scalar , std::size_t _Rows, std::size_t _Cols>
template<std::size_t _NCols>
constexpr StaticMatrix< _Scalar, _Rows, _NCols > StaticMatrix< _Scalar, _Rows, _Cols >::operator* ( const StaticMatrix< _Scalar, _Cols, _NCols > &  o) const
inlineconstexpr

Matrix multiplication.

Definition at line 80 of file static_matrix.hpp.

◆ operator+()

template<typename _Scalar , std::size_t _Rows, std::size_t _Cols>
constexpr StaticMatrix< _Scalar, _Rows, _Cols > StaticMatrix< _Scalar, _Rows, _Cols >::operator+ ( const StaticMatrix< _Scalar, _Rows, _Cols > &  o) const
inlineconstexpr

Matrix addition.

Definition at line 55 of file static_matrix.hpp.

◆ transpose()

template<typename _Scalar , std::size_t _Rows, std::size_t _Cols>
constexpr StaticMatrix< _Scalar, _Rows, _Cols > StaticMatrix< _Scalar, _Rows, _Cols >::transpose ( ) const
inlineconstexpr

Matrix transpose.

Definition at line 67 of file static_matrix.hpp.

Member Data Documentation

◆ Cols

template<typename _Scalar , std::size_t _Rows, std::size_t _Cols>
constexpr std::size_t StaticMatrix< _Scalar, _Rows, _Cols >::Cols = _Cols
staticconstexpr

Number of columns in matrix.

Definition at line 27 of file static_matrix.hpp.

◆ Rows

template<typename _Scalar , std::size_t _Rows, std::size_t _Cols>
constexpr std::size_t StaticMatrix< _Scalar, _Rows, _Cols >::Rows = _Rows
staticconstexpr

Number of rows in matrix.

Definition at line 25 of file static_matrix.hpp.


The documentation for this struct was generated from the following file: