CubbyFlow::MatrixDenseBase< T, Rows, Cols, Derived > Class Template Reference

#include <Core/Matrix/MatrixDenseBase.hpp>

Inheritance diagram for CubbyFlow::MatrixDenseBase< T, Rows, Cols, Derived >:
CubbyFlow::Matrix< double > CubbyFlow::Matrix< double, N > CubbyFlow::Matrix< ScalarType, N > CubbyFlow::Matrix< size_t > CubbyFlow::Matrix< size_t, N > CubbyFlow::Matrix< ssize_t, N >

Public Types

using ValueType = T
 
using Reference = T &
 
using ConstReference = const T &
 

Public Member Functions

template<size_t R, size_t C, typename E >
void CopyFrom (const MatrixExpression< T, R, C, E > &expression)
 Copies from generic expression. More...
 
void SetDiagonal (ConstReference val)
 Sets diagonal elements with input scalar. More...
 
void SetOffDiagonal (ConstReference val)
 Sets off-diagonal elements with input scalar. More...
 
template<size_t R, size_t C, typename E >
void SetRow (size_t i, const MatrixExpression< T, R, C, E > &row)
 Sets i-th row with input column vector. More...
 
template<size_t R, size_t C, typename E >
void SetColumn (size_t j, const MatrixExpression< T, R, C, E > &col)
 Sets j-th column with input vector. More...
 
void Normalize ()
 
void Transpose ()
 Transposes this matrix. More...
 
void Invert ()
 Inverts this matrix. More...
 
Reference operator() (size_t i, size_t j)
 
ConstReference operator() (size_t i, size_t j) const
 
template<size_t R, size_t C, typename E >
MatrixDenseBaseoperator= (const MatrixExpression< T, R, C, E > &expression)
 Copies from generic expression. More...
 
template<size_t R, size_t C, typename E >
MatrixDenseBase< T, Rows, Cols, D > & operator= (const MatrixExpression< T, R, C, E > &expression)
 

Static Public Member Functions

template<typename D = Derived>
static std::enable_if_t< IsMatrixSizeStatic< Rows, Cols >), D > MakeZero ()
 Makes a static matrix with zero entries. More...
 
template<typename D = Derived>
static std::enable_if_t< IsMatrixSizeDynamic< Rows, Cols >), D > MakeZero (size_t rows, size_t cols)
 Makes a dynamic matrix with zero entries. More...
 
template<typename D = Derived>
static std::enable_if_t< IsMatrixSizeStatic< Rows, Cols >), D > MakeConstant (ValueType val)
 Makes a static matrix with constant entries. More...
 
template<typename D = Derived>
static std::enable_if_t< IsMatrixSizeDynamic< Rows, Cols >), D > MakeConstant (size_t rows, size_t cols, ValueType val)
 Makes a dynamic matrix with constant entries. More...
 
template<typename D = Derived>
static std::enable_if_t< IsMatrixStaticSquare< Rows, Cols >), D > MakeIdentity ()
 Makes a static identity matrix. More...
 
template<typename D = Derived>
static std::enable_if_t< IsMatrixSizeDynamic< Rows, Cols >), D > MakeIdentity (size_t rows)
 Makes a dynamic identity matrix. More...
 
template<typename... Args, typename D = Derived>
static std::enable_if_t< IsMatrixStaticSquare< Rows, Cols >), D > MakeScaleMatrix (ValueType first, Args... rest)
 Makes scale matrix. More...
 
template<size_t R, size_t C, typename E , typename D = Derived>
static std::enable_if_t< IsMatrixStaticSquare< Rows, Cols >), D > MakeScaleMatrix (const MatrixExpression< T, R, C, E > &expression)
 Makes scale matrix. More...
 
template<typename D = Derived>
static std::enable_if_t< IsMatrixStaticSquare< Rows, Cols >) &&(Rows==2), D > MakeRotationMatrix (T rad)
 
template<size_t R, size_t C, typename E , typename D = Derived>
static std::enable_if_t< IsMatrixStaticSquare< Rows, Cols >) &&(Rows==3||Rows==4), D > MakeRotationMatrix (const MatrixExpression< T, R, C, E > &axis, T rad)
 
template<size_t R, size_t C, typename E , typename D = Derived>
static std::enable_if_t< IsMatrixStaticSquare< Rows, Cols >) &&(Rows==4), D > MakeTranslationMatrix (const MatrixExpression< T, R, C, E > &t)
 Makes translation matrix. More...
 

Protected Member Functions

 MatrixDenseBase ()=default
 

Member Typedef Documentation

◆ ConstReference

template<typename T, size_t Rows, size_t Cols, typename Derived>
using CubbyFlow::MatrixDenseBase< T, Rows, Cols, Derived >::ConstReference = const T&

◆ Reference

template<typename T, size_t Rows, size_t Cols, typename Derived>
using CubbyFlow::MatrixDenseBase< T, Rows, Cols, Derived >::Reference = T&

◆ ValueType

template<typename T, size_t Rows, size_t Cols, typename Derived>
using CubbyFlow::MatrixDenseBase< T, Rows, Cols, Derived >::ValueType = T

Constructor & Destructor Documentation

◆ MatrixDenseBase()

template<typename T, size_t Rows, size_t Cols, typename Derived>
CubbyFlow::MatrixDenseBase< T, Rows, Cols, Derived >::MatrixDenseBase ( )
protecteddefault

Member Function Documentation

◆ CopyFrom()

template<typename T, size_t Rows, size_t Cols, typename D >
template<size_t R, size_t C, typename E >
void CubbyFlow::MatrixDenseBase< T, Rows, Cols, D >::CopyFrom ( const MatrixExpression< T, R, C, E > &  expression)

Copies from generic expression.

◆ Invert()

template<typename T , size_t Rows, size_t Cols, typename D >
void CubbyFlow::MatrixDenseBase< T, Rows, Cols, D >::Invert ( )

Inverts this matrix.

◆ MakeConstant() [1/2]

template<typename T , size_t Rows, size_t Cols, typename Derived >
template<typename D >
std::enable_if_t< IsMatrixSizeStatic< Rows, Cols >), D > CubbyFlow::MatrixDenseBase< T, Rows, Cols, Derived >::MakeConstant ( ValueType  val)
static

Makes a static matrix with constant entries.

◆ MakeConstant() [2/2]

template<typename T , size_t Rows, size_t Cols, typename Derived >
template<typename D >
std::enable_if_t< IsMatrixSizeDynamic< Rows, Cols >), D > CubbyFlow::MatrixDenseBase< T, Rows, Cols, Derived >::MakeConstant ( size_t  rows,
size_t  cols,
ValueType  val 
)
static

Makes a dynamic matrix with constant entries.

◆ MakeIdentity() [1/2]

template<typename T , size_t Rows, size_t Cols, typename Derived >
template<typename D >
std::enable_if_t< IsMatrixStaticSquare< Rows, Cols >), D > CubbyFlow::MatrixDenseBase< T, Rows, Cols, Derived >::MakeIdentity ( )
static

Makes a static identity matrix.

◆ MakeIdentity() [2/2]

template<typename T , size_t Rows, size_t Cols, typename Derived >
template<typename D >
std::enable_if_t< IsMatrixSizeDynamic< Rows, Cols >), D > CubbyFlow::MatrixDenseBase< T, Rows, Cols, Derived >::MakeIdentity ( size_t  rows)
static

Makes a dynamic identity matrix.

◆ MakeRotationMatrix() [1/2]

template<typename T, size_t Rows, size_t Cols, typename Derived >
template<typename D >
std::enable_if_t< IsMatrixStaticSquare< Rows, Cols >) &&(Rows==2), D > CubbyFlow::MatrixDenseBase< T, Rows, Cols, Derived >::MakeRotationMatrix ( rad)
static

Makes rotation matrix.

Warning
Input angle should be radian.

◆ MakeRotationMatrix() [2/2]

template<typename T, size_t Rows, size_t Cols, typename Derived >
template<size_t R, size_t C, typename E , typename D >
std::enable_if_t< IsMatrixStaticSquare< Rows, Cols >) &&(Rows==3||Rows==4), D > CubbyFlow::MatrixDenseBase< T, Rows, Cols, Derived >::MakeRotationMatrix ( const MatrixExpression< T, R, C, E > &  axis,
rad 
)
static

Makes rotation matrix.

Warning
Input angle should be radian.

◆ MakeScaleMatrix() [1/2]

template<typename T , size_t Rows, size_t Cols, typename Derived >
template<typename... Args, typename D >
std::enable_if_t< IsMatrixStaticSquare< Rows, Cols >), D > CubbyFlow::MatrixDenseBase< T, Rows, Cols, Derived >::MakeScaleMatrix ( ValueType  first,
Args...  rest 
)
static

Makes scale matrix.

◆ MakeScaleMatrix() [2/2]

template<typename T, size_t Rows, size_t Cols, typename Derived >
template<size_t R, size_t C, typename E , typename D >
std::enable_if_t< IsMatrixStaticSquare< Rows, Cols >), D > CubbyFlow::MatrixDenseBase< T, Rows, Cols, Derived >::MakeScaleMatrix ( const MatrixExpression< T, R, C, E > &  expression)
static

Makes scale matrix.

◆ MakeTranslationMatrix()

template<typename T, size_t Rows, size_t Cols, typename Derived >
template<size_t R, size_t C, typename E , typename D >
std::enable_if_t< IsMatrixStaticSquare< Rows, Cols >) &&(Rows==4), D > CubbyFlow::MatrixDenseBase< T, Rows, Cols, Derived >::MakeTranslationMatrix ( const MatrixExpression< T, R, C, E > &  t)
static

Makes translation matrix.

◆ MakeZero() [1/2]

template<typename T , size_t Rows, size_t Cols, typename Derived >
template<typename D >
std::enable_if_t< IsMatrixSizeStatic< Rows, Cols >), D > CubbyFlow::MatrixDenseBase< T, Rows, Cols, Derived >::MakeZero ( )
static

Makes a static matrix with zero entries.

◆ MakeZero() [2/2]

template<typename T , size_t Rows, size_t Cols, typename Derived >
template<typename D >
std::enable_if_t< IsMatrixSizeDynamic< Rows, Cols >), D > CubbyFlow::MatrixDenseBase< T, Rows, Cols, Derived >::MakeZero ( size_t  rows,
size_t  cols 
)
static

Makes a dynamic matrix with zero entries.

◆ Normalize()

template<typename T , size_t Rows, size_t Cols, typename D >
void CubbyFlow::MatrixDenseBase< T, Rows, Cols, D >::Normalize ( )

◆ operator()() [1/2]

template<typename T , size_t Rows, size_t Cols, typename D >
MatrixDenseBase< T, Rows, Cols, D >::Reference CubbyFlow::MatrixDenseBase< T, Rows, Cols, D >::operator() ( size_t  i,
size_t  j 
)

◆ operator()() [2/2]

template<typename T , size_t Rows, size_t Cols, typename D >
MatrixDenseBase< T, Rows, Cols, D >::ConstReference CubbyFlow::MatrixDenseBase< T, Rows, Cols, D >::operator() ( size_t  i,
size_t  j 
) const

◆ operator=() [1/2]

template<typename T, size_t Rows, size_t Cols, typename Derived>
template<size_t R, size_t C, typename E >
MatrixDenseBase& CubbyFlow::MatrixDenseBase< T, Rows, Cols, Derived >::operator= ( const MatrixExpression< T, R, C, E > &  expression)

Copies from generic expression.

◆ operator=() [2/2]

template<typename T, size_t Rows, size_t Cols, typename Derived>
template<size_t R, size_t C, typename E >
MatrixDenseBase<T, Rows, Cols, D>& CubbyFlow::MatrixDenseBase< T, Rows, Cols, Derived >::operator= ( const MatrixExpression< T, R, C, E > &  expression)

◆ SetColumn()

template<typename T, size_t Rows, size_t Cols, typename D >
template<size_t R, size_t C, typename E >
void CubbyFlow::MatrixDenseBase< T, Rows, Cols, D >::SetColumn ( size_t  j,
const MatrixExpression< T, R, C, E > &  col 
)

Sets j-th column with input vector.

◆ SetDiagonal()

template<typename T , size_t Rows, size_t Cols, typename D >
void CubbyFlow::MatrixDenseBase< T, Rows, Cols, D >::SetDiagonal ( ConstReference  val)

Sets diagonal elements with input scalar.

◆ SetOffDiagonal()

template<typename T , size_t Rows, size_t Cols, typename D >
void CubbyFlow::MatrixDenseBase< T, Rows, Cols, D >::SetOffDiagonal ( ConstReference  val)

Sets off-diagonal elements with input scalar.

◆ SetRow()

template<typename T, size_t Rows, size_t Cols, typename D >
template<size_t R, size_t C, typename E >
void CubbyFlow::MatrixDenseBase< T, Rows, Cols, D >::SetRow ( size_t  i,
const MatrixExpression< T, R, C, E > &  row 
)

Sets i-th row with input column vector.

◆ Transpose()

template<typename T , size_t Rows, size_t Cols, typename D >
void CubbyFlow::MatrixDenseBase< T, Rows, Cols, D >::Transpose ( )

Transposes this matrix.


The documentation for this class was generated from the following files: