![]() |
Shadowrun: Awakened 29 September 2011 - Build 871
|
#include <Matrix.hpp>
Public Types | |
| typedef Matrix< ROWS, COLS, Scalar > | mytype |
Public Member Functions | |
| void | loadIdentity () |
| void | loadZero () |
| Matrix (const mytype &u) | |
| Matrix () | |
| Scalar & | operator() (int ii) |
| const Scalar & | operator() (int ii) const |
| Scalar & | operator() (int row, int col) |
| const Scalar & | operator() (int row, int col) const |
| template<int OTHER_COLS> | |
| Matrix< ROWS, OTHER_COLS, Scalar > | operator* (const Matrix< COLS, OTHER_COLS, Scalar > &u) |
| mytype & | operator*= (Scalar u) |
| mytype & | operator+= (const mytype &u) |
| mytype & | operator-= (const mytype &u) |
| mytype & | operator/= (Scalar u) |
| mytype & | operator= (const mytype &u) |
Protected Attributes | |
| Scalar | _elements [ROWS *COLS] |
Static Protected Attributes | |
| static const int | ELEMENTS = ROWS * COLS |
Definition at line 56 of file Matrix.hpp.
| typedef Matrix<ROWS, COLS, Scalar> cat::Matrix< ROWS, COLS, Scalar >::mytype |
Definition at line 64 of file Matrix.hpp.
| cat::Matrix< ROWS, COLS, Scalar >::Matrix | ( | ) | [inline] |
Definition at line 67 of file Matrix.hpp.
{
}
| cat::Matrix< ROWS, COLS, Scalar >::Matrix | ( | const mytype & | u | ) | [inline] |
Definition at line 72 of file Matrix.hpp.
References cat::Matrix< ROWS, COLS, Scalar >::_elements.
| void cat::Matrix< ROWS, COLS, Scalar >::loadIdentity | ( | ) | [inline] |
Definition at line 90 of file Matrix.hpp.
References cat::Matrix< ROWS, COLS, Scalar >::_elements.
| void cat::Matrix< ROWS, COLS, Scalar >::loadZero | ( | ) | [inline] |
Definition at line 84 of file Matrix.hpp.
References cat::Matrix< ROWS, COLS, Scalar >::_elements.
{
OBJCLR(_elements);
}
| Scalar& cat::Matrix< ROWS, COLS, Scalar >::operator() | ( | int | row, |
| int | col | ||
| ) | [inline] |
Definition at line 158 of file Matrix.hpp.
References cat::Matrix< ROWS, COLS, Scalar >::_elements.
{ return _elements[col * ROWS + row]; }
| Scalar& cat::Matrix< ROWS, COLS, Scalar >::operator() | ( | int | ii | ) | [inline] |
Definition at line 155 of file Matrix.hpp.
References cat::Matrix< ROWS, COLS, Scalar >::_elements.
{ return _elements[ii]; }
| const Scalar& cat::Matrix< ROWS, COLS, Scalar >::operator() | ( | int | ii | ) | const [inline] |
Definition at line 156 of file Matrix.hpp.
References cat::Matrix< ROWS, COLS, Scalar >::_elements.
{ return _elements[ii]; }
| const Scalar& cat::Matrix< ROWS, COLS, Scalar >::operator() | ( | int | row, |
| int | col | ||
| ) | const [inline] |
Definition at line 159 of file Matrix.hpp.
References cat::Matrix< ROWS, COLS, Scalar >::_elements.
{ return _elements[col * ROWS + row]; }
| Matrix<ROWS, OTHER_COLS, Scalar> cat::Matrix< ROWS, COLS, Scalar >::operator* | ( | const Matrix< COLS, OTHER_COLS, Scalar > & | u | ) | [inline] |
Definition at line 127 of file Matrix.hpp.
{
Matrix<ROWS, OTHER_COLS, Scalar> result;
// For each row of the matrix product,
for (int r = 0; r < ROWS; ++r)
{
// For each column of the matrix product,
for (int c = 0; c < OTHER_COLS; ++c)
{
Scalar x = static_cast<Scalar>( 0 );
// For each row of the right operand (u),
for (int ii = 0; ii < COLS; ++ii)
{
// Accumulate sum of products
x += (*this)(r, ii) * u(ii, c);
}
// Write the sum
result(r, c) = x;
}
}
return result;
}
| mytype& cat::Matrix< ROWS, COLS, Scalar >::operator*= | ( | Scalar | u | ) | [inline] |
Definition at line 114 of file Matrix.hpp.
References cat::Matrix< ROWS, COLS, Scalar >::_elements, and FOR_EACH_ELEMENT.
{
FOR_EACH_ELEMENT(ii) _elements[ii] *= u;
}
| mytype& cat::Matrix< ROWS, COLS, Scalar >::operator+= | ( | const mytype & | u | ) | [inline] |
Definition at line 102 of file Matrix.hpp.
References cat::Matrix< ROWS, COLS, Scalar >::_elements, and FOR_EACH_ELEMENT.
{
FOR_EACH_ELEMENT(ii) _elements[ii] += u._elements[ii];
}
| mytype& cat::Matrix< ROWS, COLS, Scalar >::operator-= | ( | const mytype & | u | ) | [inline] |
Definition at line 108 of file Matrix.hpp.
References cat::Matrix< ROWS, COLS, Scalar >::_elements, and FOR_EACH_ELEMENT.
{
FOR_EACH_ELEMENT(ii) _elements[ii] -= u._elements[ii];
}
| mytype& cat::Matrix< ROWS, COLS, Scalar >::operator/= | ( | Scalar | u | ) | [inline] |
Definition at line 120 of file Matrix.hpp.
References cat::Matrix< ROWS, COLS, Scalar >::_elements, and FOR_EACH_ELEMENT.
{
FOR_EACH_ELEMENT(ii) _elements[ii] /= u;
}
| mytype& cat::Matrix< ROWS, COLS, Scalar >::operator= | ( | const mytype & | u | ) | [inline] |
Definition at line 78 of file Matrix.hpp.
References cat::Matrix< ROWS, COLS, Scalar >::_elements.
Scalar cat::Matrix< ROWS, COLS, Scalar >::_elements[ROWS *COLS] [protected] |
Definition at line 60 of file Matrix.hpp.
Referenced by cat::Matrix< ROWS, COLS, Scalar >::loadIdentity(), cat::Matrix< ROWS, COLS, Scalar >::loadZero(), cat::Matrix< ROWS, COLS, Scalar >::Matrix(), cat::Matrix< ROWS, COLS, Scalar >::operator()(), cat::Matrix< ROWS, COLS, Scalar >::operator*=(), cat::Matrix< ROWS, COLS, Scalar >::operator+=(), cat::Matrix< ROWS, COLS, Scalar >::operator-=(), cat::Matrix< ROWS, COLS, Scalar >::operator/=(), and cat::Matrix< ROWS, COLS, Scalar >::operator=().
const int cat::Matrix< ROWS, COLS, Scalar >::ELEMENTS = ROWS * COLS [static, protected] |
Definition at line 59 of file Matrix.hpp.
Copyright © 2007-2010 by The Shadowrun: Awakened Team. This work is licensed under the GNU Lesser General Public License 3.