last small fixes, this is alpha6, eigen2 is now ready for eigen1 apps to

port to.
This commit is contained in:
Benoit Jacob
2008-08-12 02:14:02 +00:00
parent f04c1cb774
commit 13ad88736e
10 changed files with 33 additions and 19 deletions

View File

@@ -1,10 +1,5 @@
Matrix2d m; m << 1,2,3,4;
Matrix2d n;
n = (m*m).lazy(); // if we did "n = m*m;" then m*m would first be evaluated into
// a temporary, because the Product expression has the EvalBeforeAssigningBit.
// This temporary would then be copied into n. Introducing this temporary is
// useless here and wastes time. Doing "n = (m*m).lazy();" evaluates m*m directly
// into n, which is faster. But, beware! This is only correct because m and n
// are two distinct matrices. Doing "m = (m*m).lazy();" would not produce the
// expected result.
cout << n << endl;
cout << (m*m).lazy().row(0) << endl;
// this computes only one row of the product. By contrast,
// if we did "(m*m).row(0);" then m*m would first be evaluated into
// a temporary, because the Product expression has the EvalBeforeNestingBit.