artec::sdk::base::GenericMatrix< rows, cols, Type > Class Template Reference

#include <artec/sdk/base/GenericMatrix.h>

Public Types

typedef Type value_type
 

Public Member Functions

 GenericMatrix ()
 
template<typename Type2 , std::size_t sizeOfArray>
 GenericMatrix (const Type2(&values)[sizeOfArray])
 
template<typename Type2 >
 GenericMatrix (const Type2 *values, int rows2, int cols2)
 
 GenericMatrix (const GenericMatrix &second)
 Copying constructor. More...
 
template<typename Type2 >
 GenericMatrix (const GenericMatrix< rows, cols, Type2 > &second)
 Copying constructor with type conversion. More...
 
template<int rows2, int cols2, typename Type2 >
 GenericMatrix (const GenericMatrix< rows2, cols2, Type2 > &second)
 Copying constructor with size conversion. More...
 
void fill (const Type &value)
 Fill matrix with value. More...
 
template<int cols2>
GenericMatrix< rows, cols2, Type > operator* (const GenericMatrix< cols, cols2, Type > &mat) const
 Matrix - matrix multiplication. More...
 
GenericMatrix operator- () const
 Unary minus. More...
 
bool operator== (const GenericMatrix &m) const
 check matrices are equal More...
 
bool operator!= (const GenericMatrix &m) const
 check matrices are not equal More...
 
Type & operator() (int row, int col)
 
const Type & operator() (int row, int col) const
 
void setToIdentity ()
 Make current matrix to identity. More...
 
bool isIdentity () const
 Check if matrix is an identity matrix. More...
 
GenericMatrix< cols, rows, Type > transposed () const
 Return transposed matrix copy. More...
 
int size () const
 
template<int rows2, int cols2>
GenericMatrixoperator= (const GenericMatrix< rows2, cols2, Type > &second)
 
GenericMatrixoperator= (const GenericMatrix &second)
 
GenericMatrixoperator+= (const GenericMatrix &mat)
 
GenericMatrixoperator-= (const GenericMatrix &mat)
 
GenericMatrixoperator*= (const GenericMatrix &other)
 
GenericMatrix operator+ (const GenericMatrix &mat) const
 
GenericMatrix operator- (const GenericMatrix &mat) const
 
GenericMatrixoperator*= (const Type &val)
 
GenericMatrixoperator/= (const Type &val)
 
GenericMatrix operator* (const Type &val) const
 
GenericMatrix operator/ (const Type &val) const
 
 operator Type * ()
 
 operator const Type * () const
 

Static Public Member Functions

static GenericMatrix< rows, cols, Type > identity ()
 Identity matrix. More...
 

Public Attributes

union {
   struct {
      Type   m [rows][cols]
 
   } 
 
   Type   data [rows *cols]
 
}; 
 matrix data More...
 

Detailed Description

template<int rows, int cols, typename Type = double>
class artec::sdk::base::GenericMatrix< rows, cols, Type >

Definition at line 25 of file GenericMatrix.h.

Member Typedef Documentation

template<int rows, int cols, typename Type = double>
typedef Type artec::sdk::base::GenericMatrix< rows, cols, Type >::value_type

Definition at line 28 of file GenericMatrix.h.

Constructor & Destructor Documentation

template<int rows, int cols, typename Type = double>
artec::sdk::base::GenericMatrix< rows, cols, Type >::GenericMatrix ( )
inline

Definition at line 30 of file GenericMatrix.h.

template<int rows, int cols, typename Type = double>
template<typename Type2 , std::size_t sizeOfArray>
artec::sdk::base::GenericMatrix< rows, cols, Type >::GenericMatrix ( const Type2(&)  values[sizeOfArray])
inlineexplicit

Definition at line 33 of file GenericMatrix.h.

template<int rows, int cols, typename Type = double>
template<typename Type2 >
artec::sdk::base::GenericMatrix< rows, cols, Type >::GenericMatrix ( const Type2 *  values,
int  rows2,
int  cols2 
)
inline

Definition at line 42 of file GenericMatrix.h.

template<int rows, int cols, typename Type = double>
artec::sdk::base::GenericMatrix< rows, cols, Type >::GenericMatrix ( const GenericMatrix< rows, cols, Type > &  second)
inline

Copying constructor.

Definition at line 57 of file GenericMatrix.h.

template<int rows, int cols, typename Type = double>
template<typename Type2 >
artec::sdk::base::GenericMatrix< rows, cols, Type >::GenericMatrix ( const GenericMatrix< rows, cols, Type2 > &  second)
inlineexplicit

Copying constructor with type conversion.

Definition at line 61 of file GenericMatrix.h.

template<int rows, int cols, typename Type = double>
template<int rows2, int cols2, typename Type2 >
artec::sdk::base::GenericMatrix< rows, cols, Type >::GenericMatrix ( const GenericMatrix< rows2, cols2, Type2 > &  second)
inlineexplicit

Copying constructor with size conversion.

Definition at line 68 of file GenericMatrix.h.

Member Function Documentation

template<int rows, int cols, typename Type = double>
void artec::sdk::base::GenericMatrix< rows, cols, Type >::fill ( const Type &  value)
inline

Fill matrix with value.

Definition at line 96 of file GenericMatrix.h.

template<int rows, int cols, typename Type >
GenericMatrix< rows, cols, Type > artec::sdk::base::GenericMatrix< rows, cols, Type >::identity ( )
static

Identity matrix.

Definition at line 291 of file GenericMatrix.h.

template<int rows, int cols, typename Type = double>
bool artec::sdk::base::GenericMatrix< rows, cols, Type >::isIdentity ( ) const
inline

Check if matrix is an identity matrix.

Definition at line 225 of file GenericMatrix.h.

template<int rows, int cols, typename Type = double>
artec::sdk::base::GenericMatrix< rows, cols, Type >::operator const Type * ( ) const
inline

Conversion to plain data pointer operator

Definition at line 250 of file GenericMatrix.h.

template<int rows, int cols, typename Type = double>
artec::sdk::base::GenericMatrix< rows, cols, Type >::operator Type * ( )
inline

Conversion to plain data pointer operator

Definition at line 249 of file GenericMatrix.h.

template<int rows, int cols, typename Type = double>
bool artec::sdk::base::GenericMatrix< rows, cols, Type >::operator!= ( const GenericMatrix< rows, cols, Type > &  m) const
inline

check matrices are not equal

Definition at line 198 of file GenericMatrix.h.

template<int rows, int cols, typename Type = double>
Type& artec::sdk::base::GenericMatrix< rows, cols, Type >::operator() ( int  row,
int  col 
)
inline

Definition at line 203 of file GenericMatrix.h.

template<int rows, int cols, typename Type = double>
const Type& artec::sdk::base::GenericMatrix< rows, cols, Type >::operator() ( int  row,
int  col 
) const
inline

Definition at line 208 of file GenericMatrix.h.

template<int rows, int cols, typename Type = double>
template<int cols2>
GenericMatrix< rows, cols2, Type > artec::sdk::base::GenericMatrix< rows, cols, Type >::operator* ( const GenericMatrix< cols, cols2, Type > &  mat) const
inline

Matrix - matrix multiplication.

Definition at line 138 of file GenericMatrix.h.

template<int rows, int cols, typename Type = double>
GenericMatrix artec::sdk::base::GenericMatrix< rows, cols, Type >::operator* ( const Type &  val) const
inline

Matrix - Scalar

Definition at line 166 of file GenericMatrix.h.

template<int rows, int cols, typename Type = double>
GenericMatrix& artec::sdk::base::GenericMatrix< rows, cols, Type >::operator*= ( const GenericMatrix< rows, cols, Type > &  other)
inline

Arithmetical operations Matrix - Matrix (element-wise)

Definition at line 115 of file GenericMatrix.h.

template<int rows, int cols, typename Type = double>
GenericMatrix& artec::sdk::base::GenericMatrix< rows, cols, Type >::operator*= ( const Type &  val)
inline

Matrix - Scalar

Definition at line 155 of file GenericMatrix.h.

template<int rows, int cols, typename Type = double>
GenericMatrix artec::sdk::base::GenericMatrix< rows, cols, Type >::operator+ ( const GenericMatrix< rows, cols, Type > &  mat) const
inline

Arithmetical operations Matrix - Matrix (element-wise)

Definition at line 121 of file GenericMatrix.h.

template<int rows, int cols, typename Type = double>
GenericMatrix& artec::sdk::base::GenericMatrix< rows, cols, Type >::operator+= ( const GenericMatrix< rows, cols, Type > &  mat)
inline

Arithmetical operations Matrix - Matrix (element-wise)

Definition at line 105 of file GenericMatrix.h.

template<int rows, int cols, typename Type = double>
GenericMatrix artec::sdk::base::GenericMatrix< rows, cols, Type >::operator- ( const GenericMatrix< rows, cols, Type > &  mat) const
inline

Arithmetical operations Matrix - Matrix (element-wise)

Definition at line 128 of file GenericMatrix.h.

template<int rows, int cols, typename Type = double>
GenericMatrix artec::sdk::base::GenericMatrix< rows, cols, Type >::operator- ( ) const
inline

Unary minus.

Definition at line 181 of file GenericMatrix.h.

template<int rows, int cols, typename Type = double>
GenericMatrix& artec::sdk::base::GenericMatrix< rows, cols, Type >::operator-= ( const GenericMatrix< rows, cols, Type > &  mat)
inline

Arithmetical operations Matrix - Matrix (element-wise)

Definition at line 110 of file GenericMatrix.h.

template<int rows, int cols, typename Type = double>
GenericMatrix artec::sdk::base::GenericMatrix< rows, cols, Type >::operator/ ( const Type &  val) const
inline

Matrix - Scalar

Definition at line 172 of file GenericMatrix.h.

template<int rows, int cols, typename Type = double>
GenericMatrix& artec::sdk::base::GenericMatrix< rows, cols, Type >::operator/= ( const Type &  val)
inline

Matrix - Scalar

Definition at line 160 of file GenericMatrix.h.

template<int rows, int cols, typename Type = double>
template<int rows2, int cols2>
GenericMatrix& artec::sdk::base::GenericMatrix< rows, cols, Type >::operator= ( const GenericMatrix< rows2, cols2, Type > &  second)
inline

Assignment operators

Definition at line 73 of file GenericMatrix.h.

template<int rows, int cols, typename Type = double>
GenericMatrix& artec::sdk::base::GenericMatrix< rows, cols, Type >::operator= ( const GenericMatrix< rows, cols, Type > &  second)
inline

Assignment operators

Definition at line 88 of file GenericMatrix.h.

template<int rows, int cols, typename Type = double>
bool artec::sdk::base::GenericMatrix< rows, cols, Type >::operator== ( const GenericMatrix< rows, cols, Type > &  m) const
inline

check matrices are equal

Definition at line 189 of file GenericMatrix.h.

template<int rows, int cols, typename Type = double>
void artec::sdk::base::GenericMatrix< rows, cols, Type >::setToIdentity ( )
inline

Make current matrix to identity.

Definition at line 216 of file GenericMatrix.h.

template<int rows, int cols, typename Type = double>
int artec::sdk::base::GenericMatrix< rows, cols, Type >::size ( ) const
inline

Returns the number of elements in the matrix

Definition at line 253 of file GenericMatrix.h.

template<int rows, int cols, typename Type = double>
GenericMatrix< cols, rows, Type > artec::sdk::base::GenericMatrix< rows, cols, Type >::transposed ( ) const
inline

Return transposed matrix copy.

Definition at line 237 of file GenericMatrix.h.

Member Data Documentation

union { ... }

matrix data

template<int rows, int cols, typename Type = double>
Type artec::sdk::base::GenericMatrix< rows, cols, Type >::data[rows *cols]

Definition at line 263 of file GenericMatrix.h.

template<int rows, int cols, typename Type = double>
Type artec::sdk::base::GenericMatrix< rows, cols, Type >::m[rows][cols]

Definition at line 260 of file GenericMatrix.h.


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