Simple Application Framework
1
|
Class representing general matrix object from linear algebra. More...
#include <Matrix.h>
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. | |
MyType & | operator*= (const MyType &m) |
Pointwise multiplication. | |
MyType & | operator*= (T v) |
Multiplication by scalar. | |
MyType | operator+ (const MyType &m) const |
Pointwise addition. | |
MyType & | operator+= (const MyType &m) |
Pointwise addition. | |
MyType | operator- (const MyType &m) const |
Pointwise substraction. | |
MyType & | operator-= (const MyType &m) |
Pointwise substraction. | |
MyType | operator/ (const MyType &m) const |
Pointwise division. | |
MyType | operator/ (T v) const |
Division by scalar. | |
MyType & | operator/= (const MyType &m) |
Pointwise division. | |
MyType & | operator/= (T v) |
Division by scalar. | |
MyType & | operator= (const MyType &m) |
Assignment operator. | |
T | 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. | |
MyType & | SetColumn (Size c, const Vector< N, T > &v) |
Set selected column. | |
MyType & | SetRow (Size r, const Vector< M, T > &v) |
Set selected row. | |
MyType & | SetZero () |
Set all matrix elements to zero. | |
T | 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 |
Class representing general matrix object from linear algebra.
N | Number of rows. |
M | Number of columns. |
T | Data type. |
typedef Collection::StaticArray<N*M,T> Saf::Math::Algebra::Matrix< N, M, T >::BaseType [protected] |
typedef Matrix<N,M,T> Saf::Math::Algebra::Matrix< N, M, T >::MyType [protected] |
Reimplemented from Saf::Collection::StaticArray< N *M, T >.
Saf::Math::Algebra::Matrix< N, M, T >::Matrix | ( | ) | [inline] |
Default constructor.
No initialization of the data is done.
Saf::Math::Algebra::Matrix< N, M, T >::Matrix | ( | const T & | v | ) | [inline, explicit] |
Constructor.
Initializes all elements with given value.
Saf::Math::Algebra::Matrix< N, M, T >::Matrix | ( | const MyType & | m | ) | [inline] |
Copy constructor.
Vector<N,T> Saf::Math::Algebra::Matrix< N, M, T >::Column | ( | Size | c | ) | const [inline] |
Get selected column.
Size Saf::Math::Algebra::Matrix< N, M, T >::Columns | ( | ) | const [inline] |
Get number of columns.
Matrix<N,K,T> Saf::Math::Algebra::Matrix< N, M, T >::Mul | ( | const Matrix< M, K, T > & | m | ) | const [inline] |
Matrix multiplication.
Vector<N,T> Saf::Math::Algebra::Matrix< N, M, T >::Mul | ( | const Vector< M, T > & | v | ) | const [inline] |
Multiply matrix by a vector.
T& Saf::Math::Algebra::Matrix< N, M, T >::operator() | ( | Size | i, |
Size | j | ||
) | [inline] |
Get element at given position.
[in] | i | Row number. |
[in] | j | Column number. |
const T& Saf::Math::Algebra::Matrix< N, M, T >::operator() | ( | Size | i, |
Size | j | ||
) | const [inline] |
Get element at given position.
[in] | i | Row number. |
[in] | j | Column number. |
MyType Saf::Math::Algebra::Matrix< N, M, T >::operator* | ( | const MyType & | m | ) | const [inline] |
Pointwise multiplication.
MyType Saf::Math::Algebra::Matrix< N, M, T >::operator* | ( | T | v | ) | const [inline] |
Multiplication by scalar.
MyType& Saf::Math::Algebra::Matrix< N, M, T >::operator*= | ( | const MyType & | m | ) | [inline] |
Pointwise multiplication.
MyType& Saf::Math::Algebra::Matrix< N, M, T >::operator*= | ( | T | v | ) | [inline] |
Multiplication by scalar.
MyType Saf::Math::Algebra::Matrix< N, M, T >::operator+ | ( | const MyType & | m | ) | const [inline] |
Pointwise addition.
MyType& Saf::Math::Algebra::Matrix< N, M, T >::operator+= | ( | const MyType & | m | ) | [inline] |
Pointwise addition.
MyType Saf::Math::Algebra::Matrix< N, M, T >::operator- | ( | const MyType & | m | ) | const [inline] |
Pointwise substraction.
MyType& Saf::Math::Algebra::Matrix< N, M, T >::operator-= | ( | const MyType & | m | ) | [inline] |
Pointwise substraction.
MyType Saf::Math::Algebra::Matrix< N, M, T >::operator/ | ( | const MyType & | m | ) | const [inline] |
Pointwise division.
MyType Saf::Math::Algebra::Matrix< N, M, T >::operator/ | ( | T | v | ) | const [inline] |
Division by scalar.
MyType& Saf::Math::Algebra::Matrix< N, M, T >::operator/= | ( | const MyType & | m | ) | [inline] |
Pointwise division.
MyType& Saf::Math::Algebra::Matrix< N, M, T >::operator/= | ( | T | v | ) | [inline] |
Division by scalar.
MyType& Saf::Math::Algebra::Matrix< N, M, T >::operator= | ( | const MyType & | m | ) | [inline] |
Assignment operator.
T Saf::Math::Algebra::Matrix< N, M, T >::Product | ( | ) | const [inline] |
Get the product of matrix elements.
Vector<M,T> Saf::Math::Algebra::Matrix< N, M, T >::Row | ( | Size | r | ) | const [inline] |
Get selected row.
Size Saf::Math::Algebra::Matrix< N, M, T >::Rows | ( | ) | const [inline] |
Get number of rows.
MyType& Saf::Math::Algebra::Matrix< N, M, T >::SetColumn | ( | Size | c, |
const Vector< N, T > & | v | ||
) | [inline] |
Set selected column.
MyType& Saf::Math::Algebra::Matrix< N, M, T >::SetRow | ( | Size | r, |
const Vector< M, T > & | v | ||
) | [inline] |
Set selected row.
MyType& Saf::Math::Algebra::Matrix< N, M, T >::SetZero | ( | ) | [inline] |
Set all matrix elements to zero.
T Saf::Math::Algebra::Matrix< N, M, T >::Sum | ( | ) | const [inline] |
Get sum of matrix elements.
Matrix<M,N,T> Saf::Math::Algebra::Matrix< N, M, T >::Transpose | ( | ) | const [inline] |
Transpose matrix.