HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MatrixN< M, S, N > Class Template Reference

#include <Types.h>

+ Inheritance diagram for MatrixN< M, S, N >:

Public Types

using RowArray = typename std::array< S, N >
 
using Iterator = typename std::array< RowArray, N >::iterator
 
using ConstIterator = typename std::array< RowArray, N >::const_iterator
 

Public Member Functions

 MatrixN ()
 
 MatrixN (Uninit)
 
 MatrixN (S s)
 
 MatrixN (const S *begin, const S *end)
 
Comparison Operators
bool operator== (const M &rhs) const
 Return true if the given matrix is identical to this one. More...
 
bool operator!= (const M &rhs) const
 Return true if the given matrix differs from this one. More...
 
bool isEquivalent (const M &rhs, S tolerance) const
 
Indexing Operators
RowArrayoperator[] (size_t i)
 Return the row array at the given index. More...
 
const RowArrayoperator[] (size_t i) const
 Return the const row array at the given index. More...
 
Component-wise Operators
operator+ (const M &rhs) const
 Component-wise addition of two matrices. More...
 
MatrixNoperator+= (const M &rhs)
 Component-wise addition of two matrices. More...
 
operator- (const M &rhs) const
 Component-wise subtraction of two matrices. More...
 
MatrixNoperator-= (const M &rhs)
 Component-wise subtraction of two matrices. More...
 
operator* (S s) const
 Component-wise multiplication of a matrix and a scalar. More...
 
MatrixNoperator*= (S s)
 Component-wise multiplication of a matrix and a scalar. More...
 
operator/ (S s) const
 Component-wise division of a matrix by a scalar. More...
 
MatrixNoperator/= (S s)
 Component-wise division of a matrix by a scalar. More...
 
Matrix Algebra
operator* (const M &rhs) const
 Compute the matrix product. More...
 
MatrixNoperator*= (const M &rhs)
 Compute the matrix product. More...
 
operator/ (const M &rhs) const
 
MatrixNoperator/= (const M &rhs)
 
getTranspose () const
 Return the transpose of the matrix. More...
 
S getDeterminant () const
 Return the determinant of the matrix. More...
 
getAdjugate () const
 Return the adjugate of the matrix. More...
 
getInverse () const
 Return the inverse of the matrix. More...
 
Iterators
Iterator begin ()
 
ConstIterator begin () const
 
Iterator end ()
 
ConstIterator end () const
 
Utility
Sdata ()
 Return a pointer to the underlying data array. More...
 
const Sdata () const
 Return a const pointer to the underlying data array. More...
 

Static Public Member Functions

Static Methods
static constexpr size_t numRows ()
 Return the number of rows in this matrix. More...
 
static constexpr size_t numColumns ()
 Return the number of columns in this matrix. More...
 

Protected Attributes

std::array< RowArray, N > _arr
 

Detailed Description

template<class M, class S, size_t N>
class MatrixN< M, S, N >

The class template for square matrices of scalar values. Inherited by Matrix33 and Matrix44.

The elements of a MatrixN are stored in row-major order, and may be accessed using the syntax matrix[row][column].

Template parameter M is the matrix subclass, S is the scalar element type, and N is the number of rows and columns in the matrix.

Definition at line 375 of file Types.h.

Member Typedef Documentation

template<class M, class S, size_t N>
using MatrixN< M, S, N >::ConstIterator = typename std::array<RowArray, N>::const_iterator

Definition at line 380 of file Types.h.

template<class M, class S, size_t N>
using MatrixN< M, S, N >::Iterator = typename std::array<RowArray, N>::iterator

Definition at line 379 of file Types.h.

template<class M, class S, size_t N>
using MatrixN< M, S, N >::RowArray = typename std::array<S, N>

Definition at line 378 of file Types.h.

Constructor & Destructor Documentation

template<class M, class S, size_t N>
MatrixN< M, S, N >::MatrixN ( )
inline

Definition at line 383 of file Types.h.

template<class M, class S, size_t N>
MatrixN< M, S, N >::MatrixN ( Uninit  )
inlineexplicit

Definition at line 384 of file Types.h.

template<class M, class S, size_t N>
MatrixN< M, S, N >::MatrixN ( S  s)
inlineexplicit

Definition at line 385 of file Types.h.

template<class M, class S, size_t N>
MatrixN< M, S, N >::MatrixN ( const S begin,
const S end 
)
inlineexplicit

Definition at line 386 of file Types.h.

Member Function Documentation

template<class M, class S, size_t N>
Iterator MatrixN< M, S, N >::begin ( void  )
inline

Definition at line 552 of file Types.h.

template<class M, class S, size_t N>
ConstIterator MatrixN< M, S, N >::begin ( void  ) const
inline

Definition at line 553 of file Types.h.

template<class M, class S, size_t N>
S* MatrixN< M, S, N >::data ( )
inline

Return a pointer to the underlying data array.

Definition at line 563 of file Types.h.

template<class M, class S, size_t N>
const S* MatrixN< M, S, N >::data ( ) const
inline

Return a const pointer to the underlying data array.

Definition at line 566 of file Types.h.

template<class M, class S, size_t N>
Iterator MatrixN< M, S, N >::end ( void  )
inline

Definition at line 555 of file Types.h.

template<class M, class S, size_t N>
ConstIterator MatrixN< M, S, N >::end ( void  ) const
inline

Definition at line 556 of file Types.h.

template<class M, class S, size_t N>
M MatrixN< M, S, N >::getAdjugate ( ) const

Return the adjugate of the matrix.

template<class M, class S, size_t N>
S MatrixN< M, S, N >::getDeterminant ( ) const

Return the determinant of the matrix.

template<class M, class S, size_t N>
M MatrixN< M, S, N >::getInverse ( ) const
inline

Return the inverse of the matrix.

Definition at line 543 of file Types.h.

template<class M, class S, size_t N>
M MatrixN< M, S, N >::getTranspose ( ) const

Return the transpose of the matrix.

template<class M, class S, size_t N>
bool MatrixN< M, S, N >::isEquivalent ( const M &  rhs,
S  tolerance 
) const
inline

Return true if the given matrix is equivalent to this one within a given floating-point tolerance.

Definition at line 399 of file Types.h.

template<class M, class S, size_t N>
static constexpr size_t MatrixN< M, S, N >::numColumns ( )
inlinestatic

Return the number of columns in this matrix.

Definition at line 576 of file Types.h.

template<class M, class S, size_t N>
static constexpr size_t MatrixN< M, S, N >::numRows ( )
inlinestatic

Return the number of rows in this matrix.

Definition at line 573 of file Types.h.

template<class M, class S, size_t N>
bool MatrixN< M, S, N >::operator!= ( const M &  rhs) const
inline

Return true if the given matrix differs from this one.

Definition at line 395 of file Types.h.

template<class M, class S, size_t N>
M MatrixN< M, S, N >::operator* ( S  s) const
inline

Component-wise multiplication of a matrix and a scalar.

Definition at line 463 of file Types.h.

template<class M, class S, size_t N>
M MatrixN< M, S, N >::operator* ( const M &  rhs) const
inline

Compute the matrix product.

Definition at line 501 of file Types.h.

template<class M, class S, size_t N>
MatrixN& MatrixN< M, S, N >::operator*= ( S  s)
inline

Component-wise multiplication of a matrix and a scalar.

Definition at line 473 of file Types.h.

template<class M, class S, size_t N>
MatrixN& MatrixN< M, S, N >::operator*= ( const M &  rhs)
inline

Compute the matrix product.

Definition at line 512 of file Types.h.

template<class M, class S, size_t N>
M MatrixN< M, S, N >::operator+ ( const M &  rhs) const
inline

Component-wise addition of two matrices.

Definition at line 429 of file Types.h.

template<class M, class S, size_t N>
MatrixN& MatrixN< M, S, N >::operator+= ( const M &  rhs)
inline

Component-wise addition of two matrices.

Definition at line 439 of file Types.h.

template<class M, class S, size_t N>
M MatrixN< M, S, N >::operator- ( const M &  rhs) const
inline

Component-wise subtraction of two matrices.

Definition at line 446 of file Types.h.

template<class M, class S, size_t N>
MatrixN& MatrixN< M, S, N >::operator-= ( const M &  rhs)
inline

Component-wise subtraction of two matrices.

Definition at line 456 of file Types.h.

template<class M, class S, size_t N>
M MatrixN< M, S, N >::operator/ ( S  s) const
inline

Component-wise division of a matrix by a scalar.

Definition at line 480 of file Types.h.

template<class M, class S, size_t N>
M MatrixN< M, S, N >::operator/ ( const M &  rhs) const
inline

Divide the first matrix by the second (computed as the product of the first matrix and the inverse of the second).

Definition at line 520 of file Types.h.

template<class M, class S, size_t N>
MatrixN& MatrixN< M, S, N >::operator/= ( S  s)
inline

Component-wise division of a matrix by a scalar.

Definition at line 490 of file Types.h.

template<class M, class S, size_t N>
MatrixN& MatrixN< M, S, N >::operator/= ( const M &  rhs)
inline

Divide the first matrix by the second (computed as the product of the first matrix and the inverse of the second).

Definition at line 527 of file Types.h.

template<class M, class S, size_t N>
bool MatrixN< M, S, N >::operator== ( const M &  rhs) const
inline

Return true if the given matrix is identical to this one.

Definition at line 392 of file Types.h.

template<class M, class S, size_t N>
RowArray& MatrixN< M, S, N >::operator[] ( size_t  i)
inline

Return the row array at the given index.

Definition at line 419 of file Types.h.

template<class M, class S, size_t N>
const RowArray& MatrixN< M, S, N >::operator[] ( size_t  i) const
inline

Return the const row array at the given index.

Definition at line 422 of file Types.h.

Member Data Documentation

template<class M, class S, size_t N>
std::array<RowArray, N> MatrixN< M, S, N >::_arr
protected

Definition at line 581 of file Types.h.


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