Ion
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ion::math::Matrix< Dimension, T > Class Template Reference

The Matrix class defines a square N-dimensional matrix. More...

#include "matrix.h"

Public Types

enum  { kDimension = Dimension }
 The dimension of the matrix (number of elements in a row or column). More...
 
typedef T ValueType
 

Public Member Functions

 Matrix ()
 The default constructor zero-initializes all elements. More...
 
 Matrix (T m00, T m01, T m10, T m11)
 Dimension-specific constructors that are passed individual element values. More...
 
 Matrix (T m00, T m01, T m02, T m10, T m11, T m12, T m20, T m21, T m22)
 
 Matrix (T m00, T m01, T m02, T m03, T m10, T m11, T m12, T m13, T m20, T m21, T m22, T m23, T m30, T m31, T m32, T m33)
 
 Matrix (const T array[Dimension *Dimension])
 Constructor that reads elements from a linear array of the correct size. More...
 
template<typename U >
 Matrix (const Matrix< Dimension, U > &other)
 Copy constructor from an instance of the same Dimension and any value type that is compatible (via static_cast) with this instance's type. More...
 
Toperator() (int row, int col)
 Mutable element accessors. More...
 
Toperator[] (int row)
 
const Toperator() (int row, int col) const
 Read-only element accessors. More...
 
const Toperator[] (int row) const
 
TData ()
 Return a pointer to the data for interfacing with libraries. More...
 
const TData () const
 
void operator*= (T s)
 Self-modifying multiplication operators. More...
 
void operator*= (const Matrix &m)
 
Matrix operator- () const
 Unary operators. More...
 

Static Public Member Functions

static Matrix Zero ()
 Returns a Matrix containing all zeroes. More...
 
static Matrix Identity ()
 Returns an identity Matrix. More...
 

Friends

Matrix operator* (const Matrix &m, T s)
 Binary scale operators. More...
 
Matrix operator* (T s, const Matrix &m)
 
Matrix operator+ (const Matrix &lhs, const Matrix &rhs)
 Binary matrix addition. More...
 
Matrix operator- (const Matrix &lhs, const Matrix &rhs)
 Binary matrix subtraction. More...
 
Matrix operator* (const Matrix &m0, const Matrix &m1)
 Binary multiplication operator. More...
 
bool operator== (const Matrix &m0, const Matrix &m1)
 Exact equality and inequality comparisons. More...
 
bool operator!= (const Matrix &m0, const Matrix &m1)
 

Detailed Description

template<int Dimension, typename T>
class ion::math::Matrix< Dimension, T >

The Matrix class defines a square N-dimensional matrix.

Elements are stored in row-major order.

Definition at line 35 of file matrix.h.

Member Typedef Documentation

template<int Dimension, typename T>
typedef T ion::math::Matrix< Dimension, T >::ValueType

Definition at line 39 of file matrix.h.

Member Enumeration Documentation

template<int Dimension, typename T>
anonymous enum

The dimension of the matrix (number of elements in a row or column).

Enumerator
kDimension 

Definition at line 38 of file matrix.h.

Constructor & Destructor Documentation

template<int Dimension, typename T>
ion::math::Matrix< Dimension, T >::Matrix ( )
inline

The default constructor zero-initializes all elements.

Definition at line 42 of file matrix.h.

template<int Dimension, typename T >
ion::math::Matrix< Dimension, T >::Matrix ( T  m00,
T  m01,
T  m10,
T  m11 
)

Dimension-specific constructors that are passed individual element values.

Implementation.

Definition at line 190 of file matrix.h.

References ION_STATIC_ASSERT.

template<int Dimension, typename T >
ion::math::Matrix< Dimension, T >::Matrix ( T  m00,
T  m01,
T  m02,
T  m10,
T  m11,
T  m12,
T  m20,
T  m21,
T  m22 
)

Definition at line 199 of file matrix.h.

References ION_STATIC_ASSERT.

template<int Dimension, typename T >
ion::math::Matrix< Dimension, T >::Matrix ( T  m00,
T  m01,
T  m02,
T  m03,
T  m10,
T  m11,
T  m12,
T  m13,
T  m20,
T  m21,
T  m22,
T  m23,
T  m30,
T  m31,
T  m32,
T  m33 
)

Definition at line 215 of file matrix.h.

References ION_STATIC_ASSERT.

template<int Dimension, typename T >
ion::math::Matrix< Dimension, T >::Matrix ( const T  array[Dimension *Dimension])
explicit

Constructor that reads elements from a linear array of the correct size.

Definition at line 239 of file matrix.h.

template<int Dimension, typename T >
template<typename U >
ion::math::Matrix< Dimension, T >::Matrix ( const Matrix< Dimension, U > &  other)
explicit

Copy constructor from an instance of the same Dimension and any value type that is compatible (via static_cast) with this instance's type.

Definition at line 258 of file matrix.h.

Member Function Documentation

template<int Dimension, typename T>
T* ion::math::Matrix< Dimension, T >::Data ( )
inline

Return a pointer to the data for interfacing with libraries.

Definition at line 88 of file matrix.h.

template<int Dimension, typename T>
const T* ion::math::Matrix< Dimension, T >::Data ( ) const
inline

Definition at line 89 of file matrix.h.

template<int Dimension, typename T >
Matrix< Dimension, T > ion::math::Matrix< Dimension, T >::Identity ( )
static
template<int Dimension, typename T>
T& ion::math::Matrix< Dimension, T >::operator() ( int  row,
int  col 
)
inline

Mutable element accessors.

Definition at line 68 of file matrix.h.

template<int Dimension, typename T>
const T& ion::math::Matrix< Dimension, T >::operator() ( int  row,
int  col 
) const
inline

Read-only element accessors.

Definition at line 78 of file matrix.h.

template<int Dimension, typename T>
void ion::math::Matrix< Dimension, T >::operator*= ( T  s)
inline

Self-modifying multiplication operators.

Definition at line 92 of file matrix.h.

template<int Dimension, typename T>
void ion::math::Matrix< Dimension, T >::operator*= ( const Matrix< Dimension, T > &  m)
inline

Definition at line 93 of file matrix.h.

template<int Dimension, typename T>
Matrix ion::math::Matrix< Dimension, T >::operator- ( ) const
inline

Unary operators.

Definition at line 96 of file matrix.h.

template<int Dimension, typename T>
T* ion::math::Matrix< Dimension, T >::operator[] ( int  row)
inline

Definition at line 72 of file matrix.h.

template<int Dimension, typename T>
const T* ion::math::Matrix< Dimension, T >::operator[] ( int  row) const
inline

Definition at line 82 of file matrix.h.

template<int Dimension, typename T >
Matrix< Dimension, T > ion::math::Matrix< Dimension, T >::Zero ( )
static

Returns a Matrix containing all zeroes.

Definition at line 266 of file matrix.h.

Referenced by ion::math::InverseWithDeterminant().

Friends And Related Function Documentation

template<int Dimension, typename T>
bool operator!= ( const Matrix< Dimension, T > &  m0,
const Matrix< Dimension, T > &  m1 
)
friend

Definition at line 121 of file matrix.h.

template<int Dimension, typename T>
Matrix operator* ( const Matrix< Dimension, T > &  m,
T  s 
)
friend

Binary scale operators.

Definition at line 99 of file matrix.h.

template<int Dimension, typename T>
Matrix operator* ( T  s,
const Matrix< Dimension, T > &  m 
)
friend

Definition at line 100 of file matrix.h.

template<int Dimension, typename T>
Matrix operator* ( const Matrix< Dimension, T > &  m0,
const Matrix< Dimension, T > &  m1 
)
friend

Binary multiplication operator.

Definition at line 113 of file matrix.h.

template<int Dimension, typename T>
Matrix operator+ ( const Matrix< Dimension, T > &  lhs,
const Matrix< Dimension, T > &  rhs 
)
friend

Binary matrix addition.

Definition at line 103 of file matrix.h.

template<int Dimension, typename T>
Matrix operator- ( const Matrix< Dimension, T > &  lhs,
const Matrix< Dimension, T > &  rhs 
)
friend

Binary matrix subtraction.

Definition at line 108 of file matrix.h.

template<int Dimension, typename T>
bool operator== ( const Matrix< Dimension, T > &  m0,
const Matrix< Dimension, T > &  m1 
)
friend

Exact equality and inequality comparisons.

Definition at line 118 of file matrix.h.


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