-new: recursive costs system, useful to determine automatically

when to evaluate arguments and when to meta-unroll.
-use it in Product to determine when to eval args. not yet used
 to determine when to unroll. for now, not used anywhere else but
 that'll follow.
-fix badness of my last commit
This commit is contained in:
Benoit Jacob
2008-04-03 11:10:17 +00:00
parent e74fbfb2bc
commit d1a29d6319
28 changed files with 379 additions and 212 deletions

View File

@@ -16,13 +16,8 @@ void echelon(MatrixBase<Derived>& m)
.maxCoeff(&rowOfBiggest, &colOfBiggest);
m.row(k).swap(m.row(k+rowOfBiggest));
m.col(k).swap(m.col(k+colOfBiggest));
// important performance tip:
// in a complex expression such as below it can be very important to fine-tune
// exactly where evaluation occurs. The parentheses and .eval() below ensure
// that the quotient is computed only once, and that the evaluation caused
// by operator* occurs last.
m.corner(BottomRight, cornerRows-1, cornerCols)
-= m.col(k).end(cornerRows-1) * (m.row(k).end(cornerCols) / m(k,k)).eval();
-= m.col(k).end(cornerRows-1) * (m.row(k).end(cornerCols) / m(k,k));
}
}