make matrix multiplication do immediate evaluation; add lazyMul() for the old behaviour

some reorganization, especially in MatrixStorage
start playing with loop unrolling, always_inline, and __restrict__
This commit is contained in:
Benoit Jacob
2007-09-29 08:28:36 +00:00
parent 51e29ae4bd
commit ee63e15e2c
10 changed files with 113 additions and 50 deletions

View File

@@ -44,22 +44,22 @@ class EiMatrix : public EiObject<_Scalar, EiMatrix<_Scalar, _Rows, _Cols> >,
static const int RowsAtCompileTime = _Rows, ColsAtCompileTime = _Cols;
const Scalar* array() const
const Scalar* EI_RESTRICT array() const
{ return Storage::m_array; }
Scalar* array()
Scalar* EI_RESTRICT array()
{ return Storage::m_array; }
private:
Ref _ref() const { return Ref(*const_cast<EiMatrix*>(this)); }
const Scalar& _read(int row, int col = 0) const
const Scalar& EI_RESTRICT _read(int row, int col = 0) const
{
EI_CHECK_RANGES(*this, row, col);
return array()[row + col * Storage::_rows()];
}
Scalar& _write(int row, int col = 0)
Scalar& EI_RESTRICT _write(int row, int col = 0)
{
EI_CHECK_RANGES(*this, row, col);
return array()[row + col * Storage::_rows()];