Honeycomb  0.1
Component-Model Framework
Public Types | Public Member Functions | Protected Types | Protected Member Functions | Friends | List of all members
honey::MatrixBase< Subclass > Class Template Reference

Matrix base class. More...

#include <Base.h>

Inheritance diagram for honey::MatrixBase< Subclass >:
Inheritance graph
[legend]
Collaboration diagram for honey::MatrixBase< Subclass >:
Collaboration graph
[legend]

Public Types

typedef Subclass MatrixS
 
typedef Vec< s_rows, RealVecCol
 
typedef Vec< s_cols, Real, matrix::Option::vecRowVecRow
 

Public Member Functions

template<class Num >
MatrixSfromArray (const Num *a, bool rowMajor=true)
 Initialize from array. If the array is in row-major format set rowMajor to true, otherwise set to false for column-major. More...
 
MatrixSfromArray (const Real *a, bool rowMajor=true)
 
MatrixSfromZero ()
 Zero all elements. More...
 
MatrixSfromScalar (Real f)
 Initialize with scalar in every element. More...
 
MatrixSfromIdentity ()
 Make matrix identity. For non-square matrices the identity is in the upper-left square block, the rest is filled with zero. More...
 
template<class T >
matrix::Builder< MatrixSoperator<< (T &&val)
 Initialize matrix elements from scalars and other matrices using the comma operator: Matrix() << 1, 2, vec*5 ... The number of assigned elements must total up to be the matrix size exactly. More...
 
template<class T >
MatrixBaseoperator= (const MatrixBase< T > &rhs)
 Assign to matrix of any size. Asserts that any fixed dimensions in this matrix match those in rhs. More...
 
template<class Matrix >
Matrix cast ()
 Convert to a matrix of another real type. More...
 
template<class T >
bool operator== (const MatrixBase< T > &rhs) const
 
template<class T >
bool operator!= (const MatrixBase< T > &rhs) const
 
template<class T >
bool operator< (const MatrixBase< T > &rhs) const
 
template<class T >
bool operator> (const MatrixBase< T > &rhs) const
 
template<class T >
bool operator<= (const MatrixBase< T > &rhs) const
 
template<class T >
bool operator>= (const MatrixBase< T > &rhs) const
 
template<class T , class Res >
Res && add (const T &rhs, Res &&res) const
 Add another matrix. Stores result in and returns res. res may reference the same matrix as this or rhs. More...
 
MatrixS operator+ () const
 
template<class T >
MatrixS operator+ (const MatrixBase< T > &rhs) const
 
template<class T >
MatrixSoperator+= (const MatrixBase< T > &rhs)
 
template<class T , class Res >
Res && sub (const T &rhs, Res &&res) const
 Subtract another matrix. Stores result in and returns res. res may reference the same matrix as this or rhs. More...
 
MatrixS operator- () const
 
template<class T >
MatrixS operator- (const MatrixBase< T > &rhs) const
 
template<class T >
MatrixSoperator-= (const MatrixBase< T > &rhs)
 
template<class T , class Res >
Res && mul (const T &rhs, Res &&res) const
 Multiply with another matrix. This mat's column size must match rhs' row size. Stores result in and returns res. Complexity: $ O(m n\ rhs_n) $. More...
 
template<class T >
Matrix< s_rows, T::s_cols, Realoperator* (const T &rhs) const
 Multiply with another matrix. Returns a new matrix. More...
 
MatrixS operator* (Real rhs) const
 
template<class T >
MatrixSoperator*= (const MatrixBase< T > &rhs)
 
MatrixSoperator*= (Real rhs)
 
MatrixS operator/ (Real rhs) const
 
MatrixSoperator/= (Real rhs)
 
MatrixS elemAdd (Real rhs) const
 Add rhs to each element. Returns a new matrix with the results. More...
 
MatrixSelemAddEq (Real rhs)
 Add rhs to each element. More...
 
MatrixS elemSub (Real rhs) const
 Subtract rhs from each element. Returns a new matrix with the results. More...
 
MatrixSelemSubEq (Real rhs)
 Subtract rhs from each element. More...
 
template<class T >
MatrixS elemMul (const MatrixBase< T > &rhs) const
 Multiply each element with its corresponding element in rhs. Returns a new matrix with the results. More...
 
template<class T >
MatrixSelemMulEq (const MatrixBase< T > &rhs)
 Multiply each element with its corresponding element in rhs. More...
 
template<class T >
MatrixS elemDiv (const MatrixBase< T > &rhs) const
 Divide each element by its corresponding element in rhs. Returns a new matrix with the results. More...
 
template<class T >
MatrixSelemDivEq (const MatrixBase< T > &rhs)
 Divide each element by its corresponding element in rhs. More...
 
MatrixS elemAbs () const
 Get the absolute value of each element. Returns a new matrix with the results. More...
 
MatrixS elemSqr () const
 Square each element. Returns a new matrix with the results. More...
 
MatrixS elemInverse () const
 Inverse each element. Returns a new matrix with the results. More...
 
template<class T >
MatrixS elemMin (const MatrixBase< T > &rhs) const
 Get the min of each element and its corresponding element in rhs. Returns a new matrix with the results. More...
 
template<class T >
MatrixS elemMax (const MatrixBase< T > &rhs) const
 Get the max of each element and its corresponding element in rhs. Returns a new matrix with the results. More...
 
bool isZero () const
 Check if each element is exactly zero. More...
 
bool isNearZero (Real tol=Real_::zeroTol) const
 Check if each element is close to zero. More...
 
template<class T >
MatrixS clamp (const MatrixBase< T > &min, const MatrixBase< T > &max) const
 Clamp each element between its corresponding elements in min and max. Returns a new matrix with the results. More...
 
Real sum () const
 Get the sum of all elements. More...
 
Real prod () const
 Get the product of all elements. More...
 
Real mean () const
 Get the mean of all elements. More...
 
Real min () const
 Get the minimum element. More...
 
Real max () const
 Get the maximum element. More...
 
template<sdt Rows, sdt Cols>
matrix::Block< MatrixS, Rows, Cols > block (sdt row, sdt col, sdt rows=-1, sdt cols=-1)
 Get block at offset (row,col) with size (Rows, Cols). If Rows or Cols is fixed then rows or cols may be left unspecified. More...
 
template<sdt Rows, sdt Cols>
matrix::Block< const MatrixS, Rows, Cols > block (sdt row, sdt col, sdt rows=-1, sdt cols=-1) const
 
matrix::Block< MatrixSblock (sdt row, sdt col, sdt rows, sdt cols)
 Get dynamic block at offset (row,col) with size (rows, cols) More...
 
matrix::Block< const MatrixSblock (sdt row, sdt col, sdt rows, sdt cols) const
 
matrix::Block< MatrixS, 1, s_cols > row (sdt row)
 Get row as a row vector. More...
 
matrix::Block< const MatrixS, 1, s_cols > row (sdt row) const
 
matrix::Block< MatrixS, s_rows, 1 > col (sdt col)
 Get column as a column vector. More...
 
matrix::Block< const MatrixS, s_rows, 1 > col (sdt col) const
 
MatrixSresize (sdt rows, sdt cols)
 Sets number of rows/columns and reallocates only if the size has changed (rows*cols). All previous data is lost on reallocation. Returns self. More...
 
matrix::Iter< MatrixSbegin ()
 Get an iterator over the elements in row-major order. More...
 
matrix::Iter< const MatrixSbegin () const
 
matrix::Iter< MatrixSend ()
 Get an iterator to the end of the iteration provided by begin() More...
 
matrix::Iter< const MatrixSend () const
 
matrix::Iter< MatrixSiter (sdt i)
 Get an iterator to the element at index. More...
 
matrix::Iter< const MatrixSiter (sdt i) const
 
matrix::Iter< MatrixSiter (sdt row, sdt col)
 Get an iterator to the element at (row, col) More...
 
matrix::Iter< const MatrixSiter (sdt row, sdt col) const
 
template<class Num >
Num * toArray (Num *a, bool rowMajor=true) const
 Copy matrix into array. If the array is in row-major format set rowMajor to true, otherwise set to false for column-major. More...
 
RealtoArray (Real *a, bool rowMajor=true) const
 
template<class Res >
Res && transpose (Res &&res) const
 $ M^T $ transpose and store result in res. Returns res. More...
 
Matrix< s_cols, s_rows, Realtranspose () const
 Returns new matrix. More...
 
void transposeInPlace ()
 transpose and store in this matrix, only valid for square matrices More...
 
template<class T , class Res >
Res && transposeMul (const T &rhs, Res &&res) const
 $ M^T * rhs $ Stores result in and returns res. More...
 
template<class T >
Matrix< s_cols, T::s_cols, RealtransposeMul (const T &rhs) const
 Returns new matrix. More...
 
template<class T , class Res >
Res && mulTranspose (const T &rhs, Res &&res) const
 $ M * rhs^T $ Stores result in and returns res. More...
 
template<class T >
Matrix< s_rows, T::s_rows, RealmulTranspose (const T &rhs) const
 Returns new matrix. More...
 
template<class T , class Res >
Res && transposeMulTranspose (const T &rhs, Res &&res) const
 $ M^T * rhs^T = (rhs*M)^T $ Stores result in and returns res. More...
 
template<class T >
Matrix< s_cols, T::s_rows, RealtransposeMulTranspose (const T &rhs) const
 Returns new matrix. More...
 
auto minor (sdt row, sdt col) const -> Matrix< (s_rows > 0)?s_rows-1:s_rows, (s_cols > 0)?s_cols-1:s_cols, Real >
 Returns a matrix without the selected row and column. More...
 
Matrix< s_cols, s_rows, Realinverse (optional< Real & > det=optnull) const
 Get the pseudo-inverse of this matrix. The pseudo-determinant will be returned in det if specified. More...
 
Real determinant () const
 Get the determinant. Returns the pseudo-determinant if this matrix is not square. More...
 
Real cond () const
 Get the condition value. A high value means the matrix is ill-conditioned and close to singular, so inversion and linear ops will be unreliable. More...
 

Protected Types

typedef matrix::priv::Traits< Subclass >::Storage Storage
 
typedef Numeral< Real >::Real_ Real_
 
typedef Real_::DoubleType Double_
 
typedef Double_::Real Double
 
typedef Alge_< RealAlge
 
typedef Alge_< DoubleAlge_d
 
typedef Trig_< RealTrig
 
typedef Svd< RealSvd
 

Protected Member Functions

const Realm (sdt i) const
 Access matrix element at index. Wrapper for convenience only, more readable than (*this)(i) More...
 
Realm (sdt i)
 
const Realm (sdt row, sdt col) const
 Access matrix element with (row, column) More...
 
Realm (sdt row, sdt col)
 
template<class Num >
MatrixSfromColMajor (const Num *a)
 
template<class Num >
Num * toColMajor (Num *a) const
 

Friends

MatrixS operator* (Real lhs, const MatrixBase &rhs)
 
ostream & operator<< (ostream &os, const MatrixBase &mat)
 

Detailed Description

template<class Subclass>
class honey::MatrixBase< Subclass >

Matrix base class.

Member Typedef Documentation

template<class Subclass>
typedef Alge_<Real> honey::MatrixBase< Subclass >::Alge
protected
template<class Subclass>
typedef Alge_<Double> honey::MatrixBase< Subclass >::Alge_d
protected
template<class Subclass>
typedef Double_::Real honey::MatrixBase< Subclass >::Double
protected
template<class Subclass>
typedef Real_::DoubleType honey::MatrixBase< Subclass >::Double_
protected
template<class Subclass>
typedef Subclass honey::MatrixBase< Subclass >::MatrixS
template<class Subclass>
typedef Numeral<Real>::Real_ honey::MatrixBase< Subclass >::Real_
protected
template<class Subclass>
typedef matrix::priv::Traits<Subclass>::Storage honey::MatrixBase< Subclass >::Storage
protected
template<class Subclass>
typedef Svd<Real> honey::MatrixBase< Subclass >::Svd
protected
template<class Subclass>
typedef Trig_<Real> honey::MatrixBase< Subclass >::Trig
protected
template<class Subclass>
typedef Vec<s_rows, Real> honey::MatrixBase< Subclass >::VecCol
template<class Subclass>
typedef Vec<s_cols, Real, matrix::Option::vecRow> honey::MatrixBase< Subclass >::VecRow

Member Function Documentation

template<class Subclass>
template<class T , class Res >
Res&& honey::MatrixBase< Subclass >::add ( const T &  rhs,
Res &&  res 
) const
inline

Add another matrix. Stores result in and returns res. res may reference the same matrix as this or rhs.

template<class Subclass>
matrix::Iter<MatrixS> honey::MatrixBase< Subclass >::begin ( )
inline

Get an iterator over the elements in row-major order.

template<class Subclass>
matrix::Iter<const MatrixS> honey::MatrixBase< Subclass >::begin ( ) const
inline
template<class Subclass>
template<sdt Rows, sdt Cols>
matrix::Block<MatrixS,Rows,Cols> honey::MatrixBase< Subclass >::block ( sdt  row,
sdt  col,
sdt  rows = -1,
sdt  cols = -1 
)
inline

Get block at offset (row,col) with size (Rows, Cols). If Rows or Cols is fixed then rows or cols may be left unspecified.

Blocks can be used like any other matrix, they access and modify sub-sections:

m4x4.block(...) = m2x2;                 //Assign a 2x2 sub-section of m4x4
m4x4.block(...).fromZero();             //Zero out block
m2x2 = m8x8.block(...).block(...);      //Blocks are fully recursive
template<class Subclass>
template<sdt Rows, sdt Cols>
matrix::Block<const MatrixS,Rows,Cols> honey::MatrixBase< Subclass >::block ( sdt  row,
sdt  col,
sdt  rows = -1,
sdt  cols = -1 
) const
inline
template<class Subclass>
matrix::Block<MatrixS> honey::MatrixBase< Subclass >::block ( sdt  row,
sdt  col,
sdt  rows,
sdt  cols 
)
inline

Get dynamic block at offset (row,col) with size (rows, cols)

template<class Subclass>
matrix::Block<const MatrixS> honey::MatrixBase< Subclass >::block ( sdt  row,
sdt  col,
sdt  rows,
sdt  cols 
) const
inline
template<class Subclass>
template<class Matrix >
Matrix honey::MatrixBase< Subclass >::cast ( )
inline

Convert to a matrix of another real type.

template<class Subclass>
template<class T >
MatrixS honey::MatrixBase< Subclass >::clamp ( const MatrixBase< T > &  min,
const MatrixBase< T > &  max 
) const
inline

Clamp each element between its corresponding elements in min and max. Returns a new matrix with the results.

template<class Subclass>
matrix::Block<MatrixS,s_rows,1> honey::MatrixBase< Subclass >::col ( sdt  col)
inline

Get column as a column vector.

template<class Subclass>
matrix::Block<const MatrixS,s_rows,1> honey::MatrixBase< Subclass >::col ( sdt  col) const
inline
template<class Subclass>
Real honey::MatrixBase< Subclass >::cond ( ) const
inline

Get the condition value. A high value means the matrix is ill-conditioned and close to singular, so inversion and linear ops will be unreliable.

template<class Subclass>
Real honey::MatrixBase< Subclass >::determinant ( ) const
inline

Get the determinant. Returns the pseudo-determinant if this matrix is not square.

template<class Subclass>
MatrixS honey::MatrixBase< Subclass >::elemAbs ( ) const
inline

Get the absolute value of each element. Returns a new matrix with the results.

template<class Subclass>
MatrixS honey::MatrixBase< Subclass >::elemAdd ( Real  rhs) const
inline

Add rhs to each element. Returns a new matrix with the results.

template<class Subclass>
MatrixS& honey::MatrixBase< Subclass >::elemAddEq ( Real  rhs)
inline

Add rhs to each element.

template<class Subclass>
template<class T >
MatrixS honey::MatrixBase< Subclass >::elemDiv ( const MatrixBase< T > &  rhs) const
inline

Divide each element by its corresponding element in rhs. Returns a new matrix with the results.

template<class Subclass>
template<class T >
MatrixS& honey::MatrixBase< Subclass >::elemDivEq ( const MatrixBase< T > &  rhs)
inline

Divide each element by its corresponding element in rhs.

template<class Subclass>
MatrixS honey::MatrixBase< Subclass >::elemInverse ( ) const
inline

Inverse each element. Returns a new matrix with the results.

template<class Subclass>
template<class T >
MatrixS honey::MatrixBase< Subclass >::elemMax ( const MatrixBase< T > &  rhs) const
inline

Get the max of each element and its corresponding element in rhs. Returns a new matrix with the results.

template<class Subclass>
template<class T >
MatrixS honey::MatrixBase< Subclass >::elemMin ( const MatrixBase< T > &  rhs) const
inline

Get the min of each element and its corresponding element in rhs. Returns a new matrix with the results.

template<class Subclass>
template<class T >
MatrixS honey::MatrixBase< Subclass >::elemMul ( const MatrixBase< T > &  rhs) const
inline

Multiply each element with its corresponding element in rhs. Returns a new matrix with the results.

template<class Subclass>
template<class T >
MatrixS& honey::MatrixBase< Subclass >::elemMulEq ( const MatrixBase< T > &  rhs)
inline

Multiply each element with its corresponding element in rhs.

template<class Subclass>
MatrixS honey::MatrixBase< Subclass >::elemSqr ( ) const
inline

Square each element. Returns a new matrix with the results.

template<class Subclass>
MatrixS honey::MatrixBase< Subclass >::elemSub ( Real  rhs) const
inline

Subtract rhs from each element. Returns a new matrix with the results.

template<class Subclass>
MatrixS& honey::MatrixBase< Subclass >::elemSubEq ( Real  rhs)
inline

Subtract rhs from each element.

template<class Subclass>
matrix::Iter<MatrixS> honey::MatrixBase< Subclass >::end ( )
inline

Get an iterator to the end of the iteration provided by begin()

template<class Subclass>
matrix::Iter<const MatrixS> honey::MatrixBase< Subclass >::end ( ) const
inline
template<class Subclass>
template<class Num >
MatrixS& honey::MatrixBase< Subclass >::fromArray ( const Num *  a,
bool  rowMajor = true 
)
inline

Initialize from array. If the array is in row-major format set rowMajor to true, otherwise set to false for column-major.

template<class Subclass>
MatrixS& honey::MatrixBase< Subclass >::fromArray ( const Real a,
bool  rowMajor = true 
)
inline
template<class Subclass>
template<class Num >
MatrixS& honey::MatrixBase< Subclass >::fromColMajor ( const Num *  a)
inlineprotected
template<class Subclass>
MatrixS& honey::MatrixBase< Subclass >::fromIdentity ( )
inline

Make matrix identity. For non-square matrices the identity is in the upper-left square block, the rest is filled with zero.

template<class Subclass>
MatrixS& honey::MatrixBase< Subclass >::fromScalar ( Real  f)
inline

Initialize with scalar in every element.

template<class Subclass>
MatrixS& honey::MatrixBase< Subclass >::fromZero ( )
inline

Zero all elements.

template<class Subclass>
Matrix<s_cols, s_rows, Real> honey::MatrixBase< Subclass >::inverse ( optional< Real & >  det = optnull) const
inline

Get the pseudo-inverse of this matrix. The pseudo-determinant will be returned in det if specified.

template<class Subclass>
bool honey::MatrixBase< Subclass >::isNearZero ( Real  tol = Real_::zeroTol) const
inline

Check if each element is close to zero.

template<class Subclass>
bool honey::MatrixBase< Subclass >::isZero ( ) const
inline

Check if each element is exactly zero.

template<class Subclass>
matrix::Iter<MatrixS> honey::MatrixBase< Subclass >::iter ( sdt  i)
inline

Get an iterator to the element at index.

template<class Subclass>
matrix::Iter<const MatrixS> honey::MatrixBase< Subclass >::iter ( sdt  i) const
inline
template<class Subclass>
matrix::Iter<MatrixS> honey::MatrixBase< Subclass >::iter ( sdt  row,
sdt  col 
)
inline

Get an iterator to the element at (row, col)

template<class Subclass>
matrix::Iter<const MatrixS> honey::MatrixBase< Subclass >::iter ( sdt  row,
sdt  col 
) const
inline
template<class Subclass>
const Real& honey::MatrixBase< Subclass >::m ( sdt  i) const
inlineprotected

Access matrix element at index. Wrapper for convenience only, more readable than (*this)(i)

template<class Subclass>
Real& honey::MatrixBase< Subclass >::m ( sdt  i)
inlineprotected
template<class Subclass>
const Real& honey::MatrixBase< Subclass >::m ( sdt  row,
sdt  col 
) const
inlineprotected

Access matrix element with (row, column)

template<class Subclass>
Real& honey::MatrixBase< Subclass >::m ( sdt  row,
sdt  col 
)
inlineprotected
template<class Subclass>
Real honey::MatrixBase< Subclass >::max ( ) const
inline

Get the maximum element.

template<class Subclass>
Real honey::MatrixBase< Subclass >::mean ( ) const
inline

Get the mean of all elements.

template<class Subclass>
Real honey::MatrixBase< Subclass >::min ( ) const
inline

Get the minimum element.

template<class Subclass>
auto honey::MatrixBase< Subclass >::minor ( sdt  row,
sdt  col 
) const -> Matrix< (s_rows > 0) ? s_rows-1 : s_rows, (s_cols > 0) ? s_cols-1 : s_cols, Real>
inline

Returns a matrix without the selected row and column.

template<class Subclass>
template<class T , class Res >
Res&& honey::MatrixBase< Subclass >::mul ( const T &  rhs,
Res &&  res 
) const
inline

Multiply with another matrix. This mat's column size must match rhs' row size. Stores result in and returns res. Complexity: $ O(m n\ rhs_n) $.

template<class Subclass>
template<class T , class Res >
Res&& honey::MatrixBase< Subclass >::mulTranspose ( const T &  rhs,
Res &&  res 
) const
inline

$ M * rhs^T $ Stores result in and returns res.

template<class Subclass>
template<class T >
Matrix<s_rows, T::s_rows, Real> honey::MatrixBase< Subclass >::mulTranspose ( const T &  rhs) const
inline

Returns new matrix.

template<class Subclass>
template<class T >
bool honey::MatrixBase< Subclass >::operator!= ( const MatrixBase< T > &  rhs) const
inline
template<class Subclass>
template<class T >
Matrix<s_rows, T::s_cols, Real> honey::MatrixBase< Subclass >::operator* ( const T &  rhs) const
inline

Multiply with another matrix. Returns a new matrix.

template<class Subclass>
MatrixS honey::MatrixBase< Subclass >::operator* ( Real  rhs) const
inline
template<class Subclass>
template<class T >
MatrixS& honey::MatrixBase< Subclass >::operator*= ( const MatrixBase< T > &  rhs)
inline
template<class Subclass>
MatrixS& honey::MatrixBase< Subclass >::operator*= ( Real  rhs)
inline
template<class Subclass>
MatrixS honey::MatrixBase< Subclass >::operator+ ( ) const
inline
template<class Subclass>
template<class T >
MatrixS honey::MatrixBase< Subclass >::operator+ ( const MatrixBase< T > &  rhs) const
inline
template<class Subclass>
template<class T >
MatrixS& honey::MatrixBase< Subclass >::operator+= ( const MatrixBase< T > &  rhs)
inline
template<class Subclass>
MatrixS honey::MatrixBase< Subclass >::operator- ( ) const
inline
template<class Subclass>
template<class T >
MatrixS honey::MatrixBase< Subclass >::operator- ( const MatrixBase< T > &  rhs) const
inline
template<class Subclass>
template<class T >
MatrixS& honey::MatrixBase< Subclass >::operator-= ( const MatrixBase< T > &  rhs)
inline
template<class Subclass>
MatrixS honey::MatrixBase< Subclass >::operator/ ( Real  rhs) const
inline
template<class Subclass>
MatrixS& honey::MatrixBase< Subclass >::operator/= ( Real  rhs)
inline
template<class Subclass>
template<class T >
bool honey::MatrixBase< Subclass >::operator< ( const MatrixBase< T > &  rhs) const
inline
template<class Subclass>
template<class T >
matrix::Builder<MatrixS> honey::MatrixBase< Subclass >::operator<< ( T &&  val)
inline

Initialize matrix elements from scalars and other matrices using the comma operator: Matrix() << 1, 2, vec*5 ... The number of assigned elements must total up to be the matrix size exactly.

When used with matrices the initializer works by setting blocks. As the cursor moves along the row, each block is copied in until all columns are filled, then the next row begins. The largest block height determines where the next row begins, so it is impossible to overwrite previous blocks.

Matrix<4,4>() << mat2x2, mat2x2, mat2x2, vec2, vec2;    //Completely filled
Matrix<4,4>() << 5, 10, mat2x2, mat1x2, mat2x2;         //The four elements at (1,0),(1,1),(3,0),(3,1) are not filled.
template<class Subclass>
template<class T >
bool honey::MatrixBase< Subclass >::operator<= ( const MatrixBase< T > &  rhs) const
inline
template<class Subclass>
template<class T >
MatrixBase& honey::MatrixBase< Subclass >::operator= ( const MatrixBase< T > &  rhs)
inline

Assign to matrix of any size. Asserts that any fixed dimensions in this matrix match those in rhs.

template<class Subclass>
template<class T >
bool honey::MatrixBase< Subclass >::operator== ( const MatrixBase< T > &  rhs) const
inline
template<class Subclass>
template<class T >
bool honey::MatrixBase< Subclass >::operator> ( const MatrixBase< T > &  rhs) const
inline
template<class Subclass>
template<class T >
bool honey::MatrixBase< Subclass >::operator>= ( const MatrixBase< T > &  rhs) const
inline
template<class Subclass>
Real honey::MatrixBase< Subclass >::prod ( ) const
inline

Get the product of all elements.

template<class Subclass>
MatrixS& honey::MatrixBase< Subclass >::resize ( sdt  rows,
sdt  cols 
)
inline

Sets number of rows/columns and reallocates only if the size has changed (rows*cols). All previous data is lost on reallocation. Returns self.

Resize with -1 in rows or cols to request no change to that dimension

template<class Subclass>
matrix::Block<MatrixS,1,s_cols> honey::MatrixBase< Subclass >::row ( sdt  row)
inline

Get row as a row vector.

template<class Subclass>
matrix::Block<const MatrixS,1,s_cols> honey::MatrixBase< Subclass >::row ( sdt  row) const
inline
template<class Subclass>
template<class T , class Res >
Res&& honey::MatrixBase< Subclass >::sub ( const T &  rhs,
Res &&  res 
) const
inline

Subtract another matrix. Stores result in and returns res. res may reference the same matrix as this or rhs.

template<class Subclass>
Real honey::MatrixBase< Subclass >::sum ( ) const
inline

Get the sum of all elements.

template<class Subclass>
template<class Num >
Num* honey::MatrixBase< Subclass >::toArray ( Num *  a,
bool  rowMajor = true 
) const
inline

Copy matrix into array. If the array is in row-major format set rowMajor to true, otherwise set to false for column-major.

template<class Subclass>
Real* honey::MatrixBase< Subclass >::toArray ( Real a,
bool  rowMajor = true 
) const
inline
template<class Subclass>
template<class Num >
Num* honey::MatrixBase< Subclass >::toColMajor ( Num *  a) const
inlineprotected
template<class Subclass>
template<class Res >
Res&& honey::MatrixBase< Subclass >::transpose ( Res &&  res) const
inline

$ M^T $ transpose and store result in res. Returns res.

template<class Subclass>
Matrix<s_cols,s_rows,Real> honey::MatrixBase< Subclass >::transpose ( ) const
inline

Returns new matrix.

template<class Subclass>
void honey::MatrixBase< Subclass >::transposeInPlace ( )
inline

transpose and store in this matrix, only valid for square matrices

template<class Subclass>
template<class T , class Res >
Res&& honey::MatrixBase< Subclass >::transposeMul ( const T &  rhs,
Res &&  res 
) const
inline

$ M^T * rhs $ Stores result in and returns res.

template<class Subclass>
template<class T >
Matrix<s_cols, T::s_cols, Real> honey::MatrixBase< Subclass >::transposeMul ( const T &  rhs) const
inline

Returns new matrix.

template<class Subclass>
template<class T , class Res >
Res&& honey::MatrixBase< Subclass >::transposeMulTranspose ( const T &  rhs,
Res &&  res 
) const
inline

$ M^T * rhs^T = (rhs*M)^T $ Stores result in and returns res.

template<class Subclass>
template<class T >
Matrix<s_cols, T::s_rows, Real> honey::MatrixBase< Subclass >::transposeMulTranspose ( const T &  rhs) const
inline

Returns new matrix.

Friends And Related Function Documentation

template<class Subclass>
MatrixS operator* ( Real  lhs,
const MatrixBase< Subclass > &  rhs 
)
friend
template<class Subclass>
ostream& operator<< ( ostream &  os,
const MatrixBase< Subclass > &  mat 
)
friend

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