Simple Application Framework  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Protected Types
Saf::Math::Algebra::Matrix< N, M, T > Class Template Reference

Class representing general matrix object from linear algebra. More...

#include <Matrix.h>

Inheritance diagram for Saf::Math::Algebra::Matrix< N, M, T >:
Saf::Collection::StaticArray< N *M, T >

List of all members.

Public Member Functions

 Matrix ()
 Default constructor.
 Matrix (const T &v)
 Constructor.
 Matrix (const MyType &m)
 Copy constructor.
Vector< N, T > Column (Size c) const
 Get selected column.
Size Columns () const
 Get number of columns.
template<Size K>
Matrix< N, K, T > Mul (const Matrix< M, K, T > &m) const
 Matrix multiplication.
Vector< N, T > Mul (const Vector< M, T > &v) const
 Multiply matrix by a vector.
T & operator() (Size i, Size j)
 Get element at given position.
const T & operator() (Size i, Size j) const
 Get element at given position.
MyType operator* (const MyType &m) const
 Pointwise multiplication.
MyType operator* (T v) const
 Multiplication by scalar.
MyTypeoperator*= (const MyType &m)
 Pointwise multiplication.
MyTypeoperator*= (T v)
 Multiplication by scalar.
MyType operator+ (const MyType &m) const
 Pointwise addition.
MyTypeoperator+= (const MyType &m)
 Pointwise addition.
MyType operator- (const MyType &m) const
 Pointwise substraction.
MyTypeoperator-= (const MyType &m)
 Pointwise substraction.
MyType operator/ (const MyType &m) const
 Pointwise division.
MyType operator/ (T v) const
 Division by scalar.
MyTypeoperator/= (const MyType &m)
 Pointwise division.
MyTypeoperator/= (T v)
 Division by scalar.
MyTypeoperator= (const MyType &m)
 Assignment operator.
Product () const
 Get the product of matrix elements.
Vector< M, T > Row (Size r) const
 Get selected row.
Size Rows () const
 Get number of rows.
MyTypeSetColumn (Size c, const Vector< N, T > &v)
 Set selected column.
MyTypeSetRow (Size r, const Vector< M, T > &v)
 Set selected row.
MyTypeSetZero ()
 Set all matrix elements to zero.
Sum () const
 Get sum of matrix elements.
Matrix< M, N, T > Transpose () const
 Transpose matrix.

Protected Types

typedef
Collection::StaticArray< N *M,
T > 
BaseType
typedef Matrix< N, M, T > MyType

Detailed Description

template<Size N, Size M, class T>
class Saf::Math::Algebra::Matrix< N, M, T >

Class representing general matrix object from linear algebra.

Template Parameters:
NNumber of rows.
MNumber of columns.
TData type.

Member Typedef Documentation

template<Size N, Size M, class T>
typedef Collection::StaticArray<N*M,T> Saf::Math::Algebra::Matrix< N, M, T >::BaseType [protected]
template<Size N, Size M, class T>
typedef Matrix<N,M,T> Saf::Math::Algebra::Matrix< N, M, T >::MyType [protected]

Constructor & Destructor Documentation

template<Size N, Size M, class T>
Saf::Math::Algebra::Matrix< N, M, T >::Matrix ( ) [inline]

Default constructor.

No initialization of the data is done.

template<Size N, Size M, class T>
Saf::Math::Algebra::Matrix< N, M, T >::Matrix ( const T &  v) [inline, explicit]

Constructor.

Initializes all elements with given value.

template<Size N, Size M, class T>
Saf::Math::Algebra::Matrix< N, M, T >::Matrix ( const MyType m) [inline]

Copy constructor.


Member Function Documentation

template<Size N, Size M, class T>
Vector<N,T> Saf::Math::Algebra::Matrix< N, M, T >::Column ( Size  c) const [inline]

Get selected column.

template<Size N, Size M, class T>
Size Saf::Math::Algebra::Matrix< N, M, T >::Columns ( ) const [inline]

Get number of columns.

template<Size N, Size M, class T>
template<Size K>
Matrix<N,K,T> Saf::Math::Algebra::Matrix< N, M, T >::Mul ( const Matrix< M, K, T > &  m) const [inline]

Matrix multiplication.

template<Size N, Size M, class T>
Vector<N,T> Saf::Math::Algebra::Matrix< N, M, T >::Mul ( const Vector< M, T > &  v) const [inline]

Multiply matrix by a vector.

template<Size N, Size M, class T>
T& Saf::Math::Algebra::Matrix< N, M, T >::operator() ( Size  i,
Size  j 
) [inline]

Get element at given position.

Parameters:
[in]iRow number.
[in]jColumn number.
template<Size N, Size M, class T>
const T& Saf::Math::Algebra::Matrix< N, M, T >::operator() ( Size  i,
Size  j 
) const [inline]

Get element at given position.

Parameters:
[in]iRow number.
[in]jColumn number.
template<Size N, Size M, class T>
MyType Saf::Math::Algebra::Matrix< N, M, T >::operator* ( const MyType m) const [inline]

Pointwise multiplication.

template<Size N, Size M, class T>
MyType Saf::Math::Algebra::Matrix< N, M, T >::operator* ( v) const [inline]

Multiplication by scalar.

template<Size N, Size M, class T>
MyType& Saf::Math::Algebra::Matrix< N, M, T >::operator*= ( const MyType m) [inline]

Pointwise multiplication.

template<Size N, Size M, class T>
MyType& Saf::Math::Algebra::Matrix< N, M, T >::operator*= ( v) [inline]

Multiplication by scalar.

template<Size N, Size M, class T>
MyType Saf::Math::Algebra::Matrix< N, M, T >::operator+ ( const MyType m) const [inline]

Pointwise addition.

template<Size N, Size M, class T>
MyType& Saf::Math::Algebra::Matrix< N, M, T >::operator+= ( const MyType m) [inline]

Pointwise addition.

template<Size N, Size M, class T>
MyType Saf::Math::Algebra::Matrix< N, M, T >::operator- ( const MyType m) const [inline]

Pointwise substraction.

template<Size N, Size M, class T>
MyType& Saf::Math::Algebra::Matrix< N, M, T >::operator-= ( const MyType m) [inline]

Pointwise substraction.

template<Size N, Size M, class T>
MyType Saf::Math::Algebra::Matrix< N, M, T >::operator/ ( const MyType m) const [inline]

Pointwise division.

template<Size N, Size M, class T>
MyType Saf::Math::Algebra::Matrix< N, M, T >::operator/ ( v) const [inline]

Division by scalar.

template<Size N, Size M, class T>
MyType& Saf::Math::Algebra::Matrix< N, M, T >::operator/= ( const MyType m) [inline]

Pointwise division.

template<Size N, Size M, class T>
MyType& Saf::Math::Algebra::Matrix< N, M, T >::operator/= ( v) [inline]

Division by scalar.

template<Size N, Size M, class T>
MyType& Saf::Math::Algebra::Matrix< N, M, T >::operator= ( const MyType m) [inline]

Assignment operator.

template<Size N, Size M, class T>
T Saf::Math::Algebra::Matrix< N, M, T >::Product ( ) const [inline]

Get the product of matrix elements.

template<Size N, Size M, class T>
Vector<M,T> Saf::Math::Algebra::Matrix< N, M, T >::Row ( Size  r) const [inline]

Get selected row.

template<Size N, Size M, class T>
Size Saf::Math::Algebra::Matrix< N, M, T >::Rows ( ) const [inline]

Get number of rows.

template<Size N, Size M, class T>
MyType& Saf::Math::Algebra::Matrix< N, M, T >::SetColumn ( Size  c,
const Vector< N, T > &  v 
) [inline]

Set selected column.

template<Size N, Size M, class T>
MyType& Saf::Math::Algebra::Matrix< N, M, T >::SetRow ( Size  r,
const Vector< M, T > &  v 
) [inline]

Set selected row.

template<Size N, Size M, class T>
MyType& Saf::Math::Algebra::Matrix< N, M, T >::SetZero ( ) [inline]

Set all matrix elements to zero.

template<Size N, Size M, class T>
T Saf::Math::Algebra::Matrix< N, M, T >::Sum ( ) const [inline]

Get sum of matrix elements.

template<Size N, Size M, class T>
Matrix<M,N,T> Saf::Math::Algebra::Matrix< N, M, T >::Transpose ( ) const [inline]

Transpose matrix.


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