Make products always eval into expressions. Improves performance

in benchmark. Still not as fasts as explicit eval(), strangely.
This commit is contained in:
Benoit Jacob 2008-05-02 08:53:23 +00:00
parent ef5b20bc50
commit 890a8de962
3 changed files with 3 additions and 2 deletions

View File

@ -114,6 +114,7 @@ Derived& MatrixBase<Derived>
{
// std::cout << typeid(OtherDerived).name() << "\n";
// std::cout << "lazyAssign = " << (Derived::Flags&VectorizableBit) << " " << (OtherDerived::Flags&VectorizableBit) << "\n";
// std::cout << __PRETTY_FUNCTION__ << std::endl;
ei_assignment_impl<Derived, OtherDerived>::execute(derived(),other.derived());
return derived();
}

View File

@ -141,7 +141,7 @@ struct ei_traits<Product<Lhs, Rhs, EvalMode> >
| ((RowsAtCompileTime == Dynamic || ColsAtCompileTime == Dynamic) ? 0 : LargeBit)),
Flags = ((unsigned int)(LhsFlags | RhsFlags) & _LostBits)
| EvalBeforeAssigningBit
| ((int)EvalMode == (int)CacheOptimalProduct ? EvalBeforeNestingBit : 0)
| EvalBeforeNestingBit
| (_Vectorizable ? VectorizableBit : 0),
CoeffReadCost
= Lhs::ColsAtCompileTime == Dynamic

View File

@ -39,7 +39,7 @@ int main(int argc, char *argv[])
asm("#begin");
for(int a = 0; a < REPEAT; a++)
{
m = I + 0.00005 * (m + m*m);
m = Matrix<SCALAR,MATSIZE,MATSIZE>::ones() + 0.00005 * (m + m*m);
}
asm("#end");
cout << m << endl;