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)
 
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 386 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 391 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 390 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 389 of file Types.h.

Constructor & Destructor Documentation

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

Definition at line 394 of file Types.h.

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

Definition at line 395 of file Types.h.

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

Definition at line 396 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 397 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 548 of file Types.h.

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

Definition at line 549 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 559 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 562 of file Types.h.

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

Definition at line 551 of file Types.h.

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

Definition at line 552 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 410 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 572 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 569 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 406 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 474 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 512 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 484 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 523 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 440 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 450 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 457 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 467 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 491 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 531 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 501 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 538 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 403 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 430 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 433 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 577 of file Types.h.


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