library of assembled shared sources |
http://lass.cocamware.com |
#include <matrix.h>
Data Structures | |
class | Column |
class | ConstColumn |
class | ConstRow |
struct | Rebind |
class | Row |
Public Types | |
typedef Matrix< T, S > | TSelf |
typedef S | TStorage |
typedef TStorage::TSize | TSize |
typedef util::CallTraits< T > ::TValue | TValue |
typedef util::CallTraits< T > ::TParam | TParam |
typedef util::CallTraits< T > ::TReference | TReference |
typedef util::CallTraits< T > ::TConstReference | TConstReference |
typedef num::NumTraits< T > | TNumTraits |
typedef TValue * | TPointer |
Public Member Functions | |
Matrix () | |
constructs an empty matrix | |
Matrix (TSize iRows, TSize iCols) | |
Construct a matrix of dimension iRows x iColumns. | |
Matrix (const TStorage &iStorage) | |
template<typename T2 , typename S2 > | |
Matrix (const Matrix< T2, S2 > &iOther) | |
assign storage/expression matrix to this (this should be a storage matrix). | |
template<typename T2 , typename S2 > | |
Matrix< T, S > & | operator= (const Matrix< T2, S2 > &iOther) |
assign storage/expression matrix to this (this should be a storage matrix). | |
const TSize | rows () const |
return number of rows in matrix. | |
const TSize | columns () const |
return number of columns in matrix. | |
const TValue | operator() (TSize iRow, TSize iCol) const |
return the component value at position (iRow, iColumn) | |
TReference | operator() (TSize iRow, TSize iCol) |
access the component value at position (iRow, iColumn) | |
const TValue | at (signed iRow, signed iCol) const |
return the component value at position (iRow, iColumn) (iRow, iColumn) will be wrapped to range [0, this->rows()) x [0, this->columns()] by using a modulus operator | |
TReference | at (signed iRow, signed iCol) |
access the component value at position (iRow, iColumn) (iRow, iColumn) will be wrapped to range [0, this->rows()) x [0, this->columns()] by using a modulus operator | |
ConstRow | row (signed iRow) const |
return a row of matrix. | |
Row | row (signed iRow) |
return a row of matrix. | |
ConstColumn | column (signed iColumn) const |
return a column of matrix. | |
Column | column (signed iColumn) |
return a column of matrix. | |
const Matrix< T, S > & | operator+ () const |
A weird way to get back the same object. | |
const Matrix< T, impl::MNeg< T, S > > | operator- () const |
return a vector with all components negated (-a)(i, j) == -(a(i, j)). | |
template<typename S2 > | |
Matrix< T, S > & | operator+= (const Matrix< T, S2 > &iB) |
componentswise addition assignment of two matrices | |
template<typename S2 > | |
Matrix< T, S > & | operator-= (const Matrix< T, S2 > &iB) |
componentswise subtraction assignment of two matrices This method is equivalent to this+=(-iB) . | |
Matrix< T, S > & | operator*= (TParam iB) |
scalar multiplication assignment of matrix | |
Matrix< T, S > & | operator/= (TParam iB) |
scalar multiplication assignment of matrix | |
void | setZero (TSize iRows, TSize iCols) |
set this to a zero matrix of iRows rows and iColumns columns. | |
void | setIdentity (TSize iSize) |
set matrix to an identity matrix of size iSize. | |
bool | isEmpty () const |
return true if this is a (0×0) matrix | |
bool | isZero () const |
test if this matrix equals a zero matrix. | |
bool | isIdentity () const |
test if this matrix equals a identity matrix | |
bool | isDiagonal () const |
test if this matrix is an diagonal matrix | |
bool | isSquare () const |
return true if matrix has as many rows as columns | |
const Matrix< T, impl::MTrans < T, S > > | transpose () const |
return transposed matrix | |
bool | invert () |
replace matrix by its inverse. | |
const TStorage & | storage () const |
TStorage & | storage () |
void | swap (Matrix< T, S > &iOther) |
swap two matrices | |
Private Attributes | |
TStorage | storage_ |
Related Functions | |
(Note that these are not member functions.) | |
template<typename T , typename S1 , typename S2 > | |
bool | operator== (const Matrix< T, S1 > &iA, const Matrix< T, S2 > &iB) |
template<typename T , typename S1 , typename S2 > | |
bool | operator!= (const Matrix< T, S1 > &iA, const Matrix< T, S2 > &iB) |
template<typename T , typename S1 , typename S2 > | |
const Matrix< T, impl::MAdd< T, S1, S2 > > | operator+ (const Matrix< T, S1 > &iA, const Matrix< T, S2 > &iB) |
componentwise addition | |
template<typename T , typename S1 , typename S2 > | |
const Matrix< T, impl::MSub< T, S1, S2 > > | operator- (const Matrix< T, S1 > &iA, const Matrix< T, S2 > &iB) |
componentwise addition | |
template<typename T , typename S1 , typename S2 > | |
const Matrix< T, impl::MProd < T, S1, S2 > > | operator* (const Matrix< T, S1 > &iA, const Matrix< T, S2 > &iB) |
Matrix multiplication. | |
template<typename T , typename S > | |
const Matrix< T, impl::MAdd< T, impl::MScalar< T >, S > > | operator+ (const T &iA, const Matrix< T, S > &iB) |
add iA to all components of iB | |
template<typename T , typename S > | |
const Matrix< T, impl::MSub< T, impl::MScalar< T >, S > > | operator- (const T &iA, const Matrix< T, S > &iB) |
add iA to all negated components of iB | |
template<typename T , typename S > | |
const Matrix< T, impl::MMul< T, impl::MScalar< T >, S > > | operator* (const T &iA, const Matrix< T, S > &iB) |
multiply iA with all components of iB | |
template<typename T , typename S > | |
const Matrix< T, impl::MAdd< T, S, impl::MScalar< T > > > | operator+ (const Matrix< T, S > &iA, const T &iB) |
add iB to all components of iA | |
template<typename T , typename S > | |
const Matrix< T, impl::MAdd< T, S, impl::MScalar< T > > > | operator- (const Matrix< T, S > &iA, const T &iB) |
subtract iB from all components of iA | |
template<typename T , typename S > | |
const Matrix< T, impl::MMul< T, S, impl::MScalar< T > > > | operator* (const Matrix< T, S > &iA, const T &iB) |
multiply all components of iA with iB. | |
template<typename T , typename S > | |
const Matrix< T, impl::MMul< T, S, impl::MScalar< T > > > | operator/ (const Matrix< T, S > &iA, const T &iB) |
divide all components of iA by iB. | |
template<typename T , typename S , typename S2 > | |
bool | solve (const Matrix< T, S > &iA, Matrix< T, S2 > &ioB) |
solve equation A * X = B | |
template<typename T , typename S , typename Char , typename Traits > | |
std::basic_ostream< Char, Traits > & | operator<< (std::basic_ostream< Char, Traits > &oOStream, const Matrix< T, S > &iB) |
Definition at line 69 of file matrix.h.
typedef Matrix<T, S> lass::num::Matrix< T, S >::TSelf |
typedef S lass::num::Matrix< T, S >::TStorage |
typedef TStorage::TSize lass::num::Matrix< T, S >::TSize |
typedef util::CallTraits<T>::TValue lass::num::Matrix< T, S >::TValue |
typedef util::CallTraits<T>::TParam lass::num::Matrix< T, S >::TParam |
typedef util::CallTraits<T>::TReference lass::num::Matrix< T, S >::TReference |
typedef util::CallTraits<T>::TConstReference lass::num::Matrix< T, S >::TConstReference |
typedef num::NumTraits<T> lass::num::Matrix< T, S >::TNumTraits |
typedef TValue* lass::num::Matrix< T, S >::TPointer |
lass::num::Matrix< T, S >::Matrix | ( | ) | [inline] |
constructs an empty matrix
Definition at line 82 of file matrix.inl.
lass::num::Matrix< T, S >::Matrix | ( | TSize | iRows, | |
TSize | iColumns | |||
) | [inline, explicit] |
Construct a matrix of dimension iRows x iColumns.
Can be used as default constructor for storage in containers.
iRows | the number of rows of the matrix to be created. | |
iColumns | the number of columns of the matrix to be created. By default both iRows and iColumns are zero, what creates an empty matrix. Not very usefull though, except as place holder. So, it's safe to pass zero as arguments, but you shouldn't pass negative values. |
Definition at line 104 of file matrix.inl.
lass::num::Matrix< T, S >::Matrix | ( | const TStorage & | iStorage | ) | [inline, explicit] |
Definition at line 112 of file matrix.inl.
lass::num::Matrix< T, S >::Matrix | ( | const Matrix< T2, S2 > & | iOther | ) | [inline] |
assign storage/expression matrix to this (this should be a storage matrix).
this
must be an l-value (storage matrix).Definition at line 131 of file matrix.inl.
References lass::num::Matrix< T, S >::columns(), LASS_META_ASSERT, lass::num::Matrix< T, S >::rows(), lass::num::Matrix< T, S >::storage(), and lass::num::Matrix< T, S >::storage_.
Matrix< T, S > & lass::num::Matrix< T, S >::operator= | ( | const Matrix< T2, S2 > & | iOther | ) | [inline] |
assign storage/expression matrix to this (this should be a storage matrix).
this
must be an l-value (storage matrix).Definition at line 162 of file matrix.inl.
References LASS_META_ASSERT, lass::num::Matrix< T, S >::storage(), and lass::num::Matrix< T, S >::storage_.
const Matrix< T, S >::TSize lass::num::Matrix< T, S >::rows | ( | ) | const [inline] |
return number of rows in matrix.
Definition at line 194 of file matrix.inl.
References lass::num::Matrix< T, S >::storage_.
Referenced by lass::num::Matrix< T, S >::at(), lass::num::Matrix< T, S >::invert(), lass::num::Matrix< T, S >::isDiagonal(), lass::num::Matrix< T, S >::isIdentity(), lass::num::Matrix< T, S >::isZero(), lass::num::Matrix< T, S >::Matrix(), lass::num::Matrix< T, S >::operator()(), lass::num::Matrix< T, S >::operator*(), lass::num::Matrix< T, S >::operator*=(), lass::num::Matrix< T, S >::operator+(), lass::num::Matrix< T, S >::operator+=(), lass::num::Matrix< T, S >::operator-(), lass::num::Matrix< T, S >::operator-=(), lass::num::Matrix< T, S >::operator/(), lass::num::Matrix< T, S >::operator/=(), lass::num::Matrix< T, S >::operator==(), lass::num::Matrix< T, S >::row(), and lass::num::Matrix< T, S >::solve().
const Matrix< T, S >::TSize lass::num::Matrix< T, S >::columns | ( | ) | const [inline] |
return number of columns in matrix.
Definition at line 213 of file matrix.inl.
References lass::num::Matrix< T, S >::storage_.
Referenced by lass::num::Matrix< T, S >::at(), lass::num::Matrix< T, S >::column(), lass::num::Matrix< T, S >::isDiagonal(), lass::num::Matrix< T, S >::isIdentity(), lass::num::Matrix< T, S >::isZero(), lass::num::Matrix< T, S >::Matrix(), lass::num::Matrix< T, S >::operator()(), lass::num::Matrix< T, S >::operator*=(), lass::num::Matrix< T, S >::operator+=(), lass::num::Matrix< T, S >::operator-=(), lass::num::Matrix< T, S >::operator/=(), lass::num::Matrix< T, S >::operator==(), and lass::num::Matrix< T, S >::solve().
const Matrix< T, S >::TValue lass::num::Matrix< T, S >::operator() | ( | TSize | iRow, | |
TSize | iColumn | |||
) | const [inline] |
return the component value at position (iRow, iColumn)
Definition at line 227 of file matrix.inl.
References lass::num::Matrix< T, S >::columns(), LASS_ASSERT, lass::num::Matrix< T, S >::rows(), and lass::num::Matrix< T, S >::storage_.
util::CallTraits< T >::TReference lass::num::Matrix< T, S >::operator() | ( | TSize | iRow, | |
TSize | iColumn | |||
) | [inline] |
access the component value at position (iRow, iColumn)
this
must be an l-value (storage matrix).
Definition at line 244 of file matrix.inl.
References lass::num::Matrix< T, S >::columns(), LASS_ASSERT, LASS_META_ASSERT, lass::num::Matrix< T, S >::rows(), and lass::num::Matrix< T, S >::storage_.
const Matrix< T, S >::TValue lass::num::Matrix< T, S >::at | ( | signed | iRow, | |
signed | iCol | |||
) | const [inline] |
return the component value at position (iRow, iColumn) (iRow, iColumn) will be wrapped to range [0, this->rows()) x [0, this->columns()] by using a modulus operator
Definition at line 259 of file matrix.inl.
References lass::num::Matrix< T, S >::columns(), lass::num::mod(), lass::num::Matrix< T, S >::rows(), and lass::num::Matrix< T, S >::storage_.
util::CallTraits< T >::TReference lass::num::Matrix< T, S >::at | ( | signed | iRow, | |
signed | iColumn | |||
) | [inline] |
access the component value at position (iRow, iColumn) (iRow, iColumn) will be wrapped to range [0, this->rows()) x [0, this->columns()] by using a modulus operator
this
must be an l-value (storage matrix). Definition at line 274 of file matrix.inl.
References lass::num::Matrix< T, S >::columns(), LASS_META_ASSERT, lass::num::mod(), lass::num::Matrix< T, S >::rows(), and lass::num::Matrix< T, S >::storage_.
Matrix< T, S >::ConstRow lass::num::Matrix< T, S >::row | ( | signed | iRow | ) | const [inline] |
return a row of matrix.
iRow will be wrapped to range [0, this->rows()) by using a modulus operator
Definition at line 287 of file matrix.inl.
References lass::num::mod(), and lass::num::Matrix< T, S >::rows().
Matrix< T, S >::Row lass::num::Matrix< T, S >::row | ( | signed | iRow | ) | [inline] |
return a row of matrix.
iRow will be wrapped to range [0, this->rows()) by using a modulus operator. THIS MUST BE LVALUE (storage matrix).
Definition at line 300 of file matrix.inl.
References lass::num::mod(), and lass::num::Matrix< T, S >::rows().
Matrix< T, S >::ConstColumn lass::num::Matrix< T, S >::column | ( | signed | iColumn | ) | const [inline] |
return a column of matrix.
iColumn will be wrapped to range [0, this->columns()) by using a modulus operator
Definition at line 312 of file matrix.inl.
References lass::num::Matrix< T, S >::columns(), and lass::num::mod().
Referenced by lass::num::Matrix< T, S >::invert(), and lass::num::Matrix< T, S >::solve().
Matrix< T, S >::Column lass::num::Matrix< T, S >::column | ( | signed | iColumn | ) | [inline] |
return a column of matrix.
iColumn will be wrapped to range [0, this->columns()) by using a modulus operator THIS MUST BE LVALUE (storage matrix).
Definition at line 325 of file matrix.inl.
References lass::num::Matrix< T, S >::columns(), and lass::num::mod().
const Matrix< T, S > & lass::num::Matrix< T, S >::operator+ | ( | ) | const [inline] |
A weird way to get back the same object.
Definition at line 341 of file matrix.inl.
const Matrix< T, impl::MNeg< T, S > > lass::num::Matrix< T, S >::operator- | ( | ) | const [inline] |
return a vector with all components negated (-a)(i, j) == -(a(i, j)).
Definition at line 359 of file matrix.inl.
References lass::num::Matrix< T, S >::storage_.
Matrix< T, S > & lass::num::Matrix< T, S >::operator+= | ( | const Matrix< T, S2 > & | iB | ) | [inline] |
componentswise addition assignment of two matrices
Matrix Addition: Denote the sum of two matrices
A and
B (of the same dimensions) by
C=A+B. The sum is defined by adding entries with the same indices
Cij=Aij+Bij over all
i and
j. http://mathworld.wolfram.com/MatrixAddition.html
This method implements the assignment addition what reduces to
Aij+=Bij over all
i and
j.
this
must be an l-value (storage matrix).an | exception is thrown if *this and iB are not of the same dimensions |
Definition at line 386 of file matrix.inl.
References lass::num::Matrix< T, S >::columns(), LASS_META_ASSERT, LASS_NUM_MATRIX_ENFORCE_EQUAL_DIMENSION, lass::num::Matrix< T, S >::rows(), lass::num::Matrix< T, S >::storage(), and lass::num::Matrix< T, S >::storage_.
Matrix< T, S > & lass::num::Matrix< T, S >::operator-= | ( | const Matrix< T, S2 > & | iB | ) | [inline] |
componentswise subtraction assignment of two matrices This method is equivalent to
this+=(-iB) .
this
must be an l-value (storage matrix).an | exception is thrown if *this and iB are not of the same dimensions |
Definition at line 419 of file matrix.inl.
References lass::num::Matrix< T, S >::columns(), LASS_META_ASSERT, LASS_NUM_MATRIX_ENFORCE_EQUAL_DIMENSION, lass::num::Matrix< T, S >::rows(), lass::num::Matrix< T, S >::storage(), and lass::num::Matrix< T, S >::storage_.
Matrix< T, S > & lass::num::Matrix< T, S >::operator*= | ( | TParam | iB | ) | [inline] |
scalar multiplication assignment of matrix
this
must be an l-value (storage matrix).Definition at line 446 of file matrix.inl.
References lass::num::Matrix< T, S >::columns(), LASS_META_ASSERT, lass::num::Matrix< T, S >::rows(), and lass::num::Matrix< T, S >::storage_.
Matrix< T, S > & lass::num::Matrix< T, S >::operator/= | ( | TParam | iB | ) | [inline] |
scalar multiplication assignment of matrix
this
must be an l-value (storage matrix). Definition at line 469 of file matrix.inl.
References lass::num::Matrix< T, S >::columns(), LASS_META_ASSERT, lass::num::Matrix< T, S >::rows(), and lass::num::Matrix< T, S >::storage_.
void lass::num::Matrix< T, S >::setZero | ( | TSize | iRows, | |
TSize | iColumns | |||
) | [inline] |
set this to a zero matrix of iRows rows and iColumns columns.
Definition at line 495 of file matrix.inl.
References LASS_META_ASSERT, lass::num::Matrix< T, S >::storage_, and lass::num::NumTraits< C >::zero.
Referenced by lass::num::Matrix< T, S >::invert(), and lass::num::Matrix< T, S >::solve().
void lass::num::Matrix< T, S >::setIdentity | ( | TSize | iSize | ) | [inline] |
set matrix to an identity matrix of size iSize.
Definition at line 519 of file matrix.inl.
References LASS_META_ASSERT, lass::num::NumTraits< C >::one, lass::num::Matrix< T, S >::storage_, and lass::num::NumTraits< C >::zero.
Referenced by lass::num::Matrix< T, S >::invert().
bool lass::num::Matrix< T, S >::isEmpty | ( | ) | const [inline] |
return true if this is a (0×0) matrix
Definition at line 543 of file matrix.inl.
References lass::num::Matrix< T, S >::storage_.
bool lass::num::Matrix< T, S >::isZero | ( | ) | const [inline] |
test if this matrix equals a zero matrix.
A zero matrix is an
m×n matrix consisting of all 0s (MacDuffee 1943, p. 27), denoted
0. Zero matrices are sometimes also known as null matrices (Akivis and Goldberg 1972, p. 71). http://mathworld.wolfram.com/ZeroMatrix.html
an empty matrix is also a zero matrix.
Definition at line 562 of file matrix.inl.
References lass::num::Matrix< T, S >::columns(), lass::num::Matrix< T, S >::rows(), lass::num::Matrix< T, S >::storage_, and lass::num::NumTraits< C >::zero.
bool lass::num::Matrix< T, S >::isIdentity | ( | ) | const [inline] |
test if this matrix equals a identity matrix
The identity matrix is a the simplest nontrivial diagonal matrix, defined such that
I(X)=X for all vectors
X. An identity matrix may be denoted
1,
I, or
E (the latter being an abbreviation for the German term "Einheitsmatrix"; Courant and Hilbert 1989, p. 7). Identity matrices are sometimes also known as unit matrices (Akivis and Goldberg 1972, p. 71). The
n×n identity matrix is given explicitly by
Iij=dij for
i,
j = 1, 2, ..., n, where
dij is the Kronecker delta. http://mathworld.wolfram.com/IdentityMatrix.html
an empty matrix is also an identity matrix.
Definition at line 597 of file matrix.inl.
References lass::num::Matrix< T, S >::columns(), lass::num::Matrix< T, S >::isSquare(), lass::num::NumTraits< C >::one, lass::num::Matrix< T, S >::rows(), lass::num::Matrix< T, S >::storage_, and lass::num::NumTraits< C >::zero.
bool lass::num::Matrix< T, S >::isDiagonal | ( | ) | const [inline] |
test if this matrix is an diagonal matrix
A diagonal matrix is a square matrix
A of the form
Aij=Ci*dij where
dij is the Kronecker delta,
Ci are constants, and
i,
j = 1, 2, ..., n, with is no implied summation over indices. http://mathworld.wolfram.com/DiagonalMatrix.html
Definition at line 633 of file matrix.inl.
References lass::num::Matrix< T, S >::columns(), lass::num::Matrix< T, S >::isSquare(), lass::num::Matrix< T, S >::rows(), lass::num::Matrix< T, S >::storage_, and lass::num::NumTraits< C >::zero.
bool lass::num::Matrix< T, S >::isSquare | ( | ) | const [inline] |
return true if matrix has as many rows as columns
Definition at line 662 of file matrix.inl.
References lass::num::Matrix< T, S >::storage_.
Referenced by lass::num::Matrix< T, S >::invert(), lass::num::Matrix< T, S >::isDiagonal(), lass::num::Matrix< T, S >::isIdentity(), and lass::num::Matrix< T, S >::solve().
const Matrix< T, impl::MTrans< T, S > > lass::num::Matrix< T, S >::transpose | ( | ) | const [inline] |
return transposed matrix
Definition at line 676 of file matrix.inl.
References lass::num::Matrix< T, S >::storage_.
bool lass::num::Matrix< T, S >::invert | ( | ) | [inline] |
replace matrix by its inverse.
If matrix has no inverse (this is singular), no exception is thrown. Instead, an empty matrix is made.
this
must be an l-value (storage matrix).an | exception is thrown if this is not a square matrix |
Definition at line 695 of file matrix.inl.
References lass::num::Matrix< T, S >::column(), lass::num::Matrix< T, S >::isSquare(), LASS_ENFORCE, LASS_META_ASSERT, lass::num::impl::ludecomp(), lass::num::impl::lusolve(), lass::num::Matrix< T, S >::rows(), lass::num::Matrix< T, S >::setIdentity(), lass::num::Matrix< T, S >::setZero(), and lass::num::Matrix< T, S >::storage().
const Matrix< T, S >::TStorage & lass::num::Matrix< T, S >::storage | ( | ) | const [inline] |
Definition at line 724 of file matrix.inl.
References lass::num::Matrix< T, S >::storage_.
Referenced by lass::num::Matrix< T, S >::invert(), lass::num::Matrix< T, S >::Matrix(), lass::num::operator*(), lass::num::Matrix< T, S >::operator*(), lass::num::Matrix< T, S >::operator+(), lass::num::Matrix< T, S >::operator+=(), lass::num::Matrix< T, S >::operator-(), lass::num::Matrix< T, S >::operator-=(), lass::num::Matrix< T, S >::operator/(), lass::num::Matrix< T, S >::operator=(), and lass::num::Matrix< T, S >::solve().
Matrix< T, S >::TStorage & lass::num::Matrix< T, S >::storage | ( | ) | [inline] |
void lass::num::Matrix< T, S >::swap | ( | Matrix< T, S > & | iOther | ) | [inline] |
swap two matrices
this
and iOther must be an l-value (storage matrix).Definition at line 751 of file matrix.inl.
References LASS_META_ASSERT, and lass::num::Matrix< T, S >::storage_.
bool operator== | ( | const Matrix< T, S1 > & | iA, | |
const Matrix< T, S2 > & | iB | |||
) | [related] |
Definition at line 775 of file matrix.inl.
References lass::num::Matrix< T, S >::columns(), and lass::num::Matrix< T, S >::rows().
const Matrix< T, impl::MAdd< T, S1, S2 > > operator+ | ( | const Matrix< T, S1 > & | iA, | |
const Matrix< T, S2 > & | iB | |||
) | [related] |
componentwise addition
Definition at line 820 of file matrix.inl.
References LASS_NUM_MATRIX_ENFORCE_EQUAL_DIMENSION, and lass::num::Matrix< T, S >::storage().
const Matrix< T, impl::MSub< T, S1, S2 > > operator- | ( | const Matrix< T, S1 > & | iA, | |
const Matrix< T, S2 > & | iB | |||
) | [related] |
componentwise addition
Definition at line 837 of file matrix.inl.
References LASS_NUM_MATRIX_ENFORCE_EQUAL_DIMENSION, and lass::num::Matrix< T, S >::storage().
const Matrix< T, impl::MProd< T, S1, S2 > > operator* | ( | const Matrix< T, S1 > & | iA, | |
const Matrix< T, S2 > & | iB | |||
) | [related] |
Matrix multiplication.
The product
C of two matrices
A and
B is defined by
Cik=Aij*Bjk, where
j is summed over for all possible values of
i and
k. The implied summation over repeated indices without the presence of an explicit sum sign is called Einstein summation, and is commonly used in both matrix and tensor analysis. Therefore, in order for matrix multiplication to be defined, the dimensions of the matrices must satisfy
(n×m)*(m×p)=(n×p) where
(a×b) denotes a matrix with
a rows and
b columns. http://mathworld.wolfram.com/MatrixMultiplication.html
an | exception is throw in iA and iB don't meet the requirement iA.columns()==iB.rows() . |
Definition at line 865 of file matrix.inl.
References LASS_NUM_MATRIX_ENFORCE_ADJACENT_DIMENSION, and lass::num::Matrix< T, S >::storage().
const Matrix< T, impl::MAdd< T, impl::MScalar< T >, S > > operator+ | ( | const T & | iA, | |
const Matrix< T, S > & | iB | |||
) | [related] |
add iA to all components of iB
Definition at line 882 of file matrix.inl.
References lass::num::Matrix< T, S >::rows(), and lass::num::Matrix< T, S >::storage().
const Matrix< T, impl::MSub< T, impl::MScalar< T >, S > > operator- | ( | const T & | iA, | |
const Matrix< T, S > & | iB | |||
) | [related] |
add iA to all negated components of iB
Definition at line 899 of file matrix.inl.
References lass::num::Matrix< T, S >::rows(), and lass::num::Matrix< T, S >::storage().
const Matrix< T, impl::MMul< T, impl::MScalar< T >, S > > operator* | ( | const T & | iA, | |
const Matrix< T, S > & | iB | |||
) | [related] |
multiply iA with all components of iB
Definition at line 916 of file matrix.inl.
References lass::num::Matrix< T, S >::rows(), and lass::num::Matrix< T, S >::storage().
const Matrix< T, impl::MAdd< T, S, impl::MScalar< T > > > operator+ | ( | const Matrix< T, S > & | iA, | |
const T & | iB | |||
) | [related] |
add iB to all components of iA
Definition at line 933 of file matrix.inl.
References lass::num::Matrix< T, S >::rows(), and lass::num::Matrix< T, S >::storage().
const Matrix< T, impl::MAdd< T, S, impl::MScalar< T > > > operator- | ( | const Matrix< T, S > & | iA, | |
const T & | iB | |||
) | [related] |
subtract iB from all components of iA
Definition at line 950 of file matrix.inl.
References lass::num::Matrix< T, S >::rows(), and lass::num::Matrix< T, S >::storage().
const Matrix< T, impl::MMul< T, S, impl::MScalar< T > > > operator* | ( | const Matrix< T, S > & | iA, | |
const T & | iB | |||
) | [related] |
multiply all components of iA with iB.
Definition at line 967 of file matrix.inl.
References lass::num::Matrix< T, S >::rows(), and lass::num::Matrix< T, S >::storage().
const Matrix< T, impl::MMul< T, S, impl::MScalar< T > > > operator/ | ( | const Matrix< T, S > & | iA, | |
const T & | iB | |||
) | [related] |
divide all components of iA by iB.
Definition at line 984 of file matrix.inl.
References lass::num::Matrix< T, S >::rows(), and lass::num::Matrix< T, S >::storage().
bool solve | ( | const Matrix< T, S > & | iA, | |
Matrix< T, S2 > & | ioB | |||
) | [related] |
solve equation A * X = B
an | exception is thrown if dimensions don't match (this->isSquare() && this->columns() == ioB.rows()) |
Definition at line 1003 of file matrix.inl.
References lass::num::Matrix< T, S >::column(), lass::num::Matrix< T, S >::columns(), lass::num::Matrix< T, S >::isSquare(), LASS_ASSERT, LASS_ENFORCE, LASS_META_ASSERT, LASS_NUM_MATRIX_ENFORCE_ADJACENT_DIMENSION, lass::num::Matrix< T, S >::rows(), lass::num::Matrix< T, S >::setZero(), and lass::num::Matrix< T, S >::storage().
std::basic_ostream< Char, Traits > & operator<< | ( | std::basic_ostream< Char, Traits > & | oOStream, | |
const Matrix< T, S > & | iB | |||
) | [related] |
TStorage lass::num::Matrix< T, S >::storage_ [private] |
Definition at line 194 of file matrix.h.
Referenced by lass::num::Matrix< T, S >::at(), lass::num::Matrix< T, S >::columns(), lass::num::Matrix< T, S >::isDiagonal(), lass::num::Matrix< T, S >::isEmpty(), lass::num::Matrix< T, S >::isIdentity(), lass::num::Matrix< T, S >::isSquare(), lass::num::Matrix< T, S >::isZero(), lass::num::Matrix< T, S >::Matrix(), lass::num::Matrix< T, S >::operator()(), lass::num::Matrix< T, S >::operator*=(), lass::num::Matrix< T, S >::operator+=(), lass::num::Matrix< T, S >::operator-(), lass::num::Matrix< T, S >::operator-=(), lass::num::Matrix< T, S >::operator/=(), lass::num::Matrix< T, S >::operator=(), lass::num::Matrix< T, S >::rows(), lass::num::Matrix< T, S >::setIdentity(), lass::num::Matrix< T, S >::setZero(), lass::num::Matrix< T, S >::storage(), lass::num::Matrix< T, S >::swap(), and lass::num::Matrix< T, S >::transpose().
Generated on Mon Nov 10 14:22:10 2008 for Library of Assembled Shared Sources by 1.5.7.1 |