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...
 
M & operator+= (const M &rhs)
 Component-wise addition of two matrices. More...
 
operator- (const M &rhs) const
 Component-wise subtraction of two matrices. More...
 
M & operator-= (const M &rhs)
 Component-wise subtraction of two matrices. More...
 
operator* (S s) const
 Component-wise multiplication of a matrix and a scalar. More...
 
M & operator*= (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...
 
M & operator/= (S s)
 Component-wise division of a matrix by a scalar. More...
 
Matrix Algebra
operator* (const M &rhs) const
 Compute the matrix product. More...
 
M & operator*= (const M &rhs)
 Compute the matrix product. More...
 
operator/ (const M &rhs) const
 
M & operator/= (const M &rhs)
 
operator- () const
 Unary negation of a matrix. More...
 
operator+ () const
 Unary plus of a 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 395 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 400 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 399 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 398 of file Types.h.

Constructor & Destructor Documentation

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

Definition at line 403 of file Types.h.

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

Definition at line 404 of file Types.h.

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

Definition at line 405 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 406 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 577 of file Types.h.

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

Definition at line 578 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 588 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 591 of file Types.h.

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

Definition at line 580 of file Types.h.

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

Definition at line 581 of file Types.h.

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 419 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 601 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 598 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 415 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 483 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 521 of file Types.h.

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

Component-wise multiplication of a matrix and a scalar.

Definition at line 493 of file Types.h.

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

Compute the matrix product.

Definition at line 532 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 449 of file Types.h.

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

Unary plus of a matrix.

Definition at line 564 of file Types.h.

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

Component-wise addition of two matrices.

Definition at line 459 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 466 of file Types.h.

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

Unary negation of a matrix.

Definition at line 554 of file Types.h.

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

Component-wise subtraction of two matrices.

Definition at line 476 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 500 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 540 of file Types.h.

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

Component-wise division of a matrix by a scalar.

Definition at line 510 of file Types.h.

template<class M, class S, size_t N>
M& 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 547 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 412 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 439 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 442 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 606 of file Types.h.


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