MOAB
4.9.3pre
|
#include <XprHelper.h>
Public Types | |
enum | { ScalarReadCost = NumTraits<typename traits<T>::Scalar>::ReadCost, CoeffReadCost = evaluator<T>::CoeffReadCost, NAsInteger = n == Dynamic ? HugeCost : n, CostEval = (NAsInteger+1) * ScalarReadCost + CoeffReadCost, CostNoEval = NAsInteger * CoeffReadCost } |
Determines how a given expression should be nested when evaluated multiple times. For example, when you do a * (b+c), Eigen will determine how the expression b+c should be evaluated into the bigger product expression. The choice is between nesting the expression b+c as-is, or evaluating that expression b+c into a temporary variable d, and nest d so that the resulting expression is a*d. Evaluating can be beneficial for example if every coefficient access in the resulting expression causes many coefficient accesses in the nested expressions -- as is the case with matrix product for example.
T | the type of the expression being nested. |
n | the number of coefficient accesses in the nested expression for each coefficient access in the bigger expression. |
PlainObject | the type of the temporary if needed. |
Definition at line 397 of file XprHelper.h.
anonymous enum |
Definition at line 399 of file XprHelper.h.
{ ScalarReadCost = NumTraits<typename traits<T>::Scalar>::ReadCost, CoeffReadCost = evaluator<T>::CoeffReadCost, // NOTE What if an evaluator evaluate itself into a tempory? // Then CoeffReadCost will be small (e.g., 1) but we still have to evaluate, especially if n>1. // This situation is already taken care by the EvalBeforeNestingBit flag, which is turned ON // for all evaluator creating a temporary. This flag is then propagated by the parent evaluators. // Another solution could be to count the number of temps? NAsInteger = n == Dynamic ? HugeCost : n, CostEval = (NAsInteger+1) * ScalarReadCost + CoeffReadCost, CostNoEval = NAsInteger * CoeffReadCost };