mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-12 11:49:02 +08:00
Clarify note in nested_eval for evaluator creating temporaries.
This commit is contained in:
parent
ae38910693
commit
a4cc4c1e5e
@ -396,9 +396,11 @@ template<typename T, int n, typename PlainObject = typename eval<T>::type> struc
|
|||||||
DynamicAsInteger = 10000,
|
DynamicAsInteger = 10000,
|
||||||
ScalarReadCost = NumTraits<typename traits<T>::Scalar>::ReadCost,
|
ScalarReadCost = NumTraits<typename traits<T>::Scalar>::ReadCost,
|
||||||
ScalarReadCostAsInteger = ScalarReadCost == Dynamic ? int(DynamicAsInteger) : int(ScalarReadCost),
|
ScalarReadCostAsInteger = ScalarReadCost == Dynamic ? int(DynamicAsInteger) : int(ScalarReadCost),
|
||||||
CoeffReadCost = evaluator<T>::CoeffReadCost, // TODO What if an evaluator evaluate itself into a tempory?
|
CoeffReadCost = evaluator<T>::CoeffReadCost, // NOTE What if an evaluator evaluate itself into a tempory?
|
||||||
// Then CoeffReadCost will be small but we still have to evaluate if n>1...
|
// Then CoeffReadCost will be small (e.g., 1) but we still have to evaluate, especially if n>1.
|
||||||
// The solution might be to ask the evaluator if it creates a temp. Perhaps we could even ask the number of temps?
|
// 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?
|
||||||
CoeffReadCostAsInteger = CoeffReadCost == Dynamic ? int(DynamicAsInteger) : int(CoeffReadCost),
|
CoeffReadCostAsInteger = CoeffReadCost == Dynamic ? int(DynamicAsInteger) : int(CoeffReadCost),
|
||||||
NAsInteger = n == Dynamic ? int(DynamicAsInteger) : n,
|
NAsInteger = n == Dynamic ? int(DynamicAsInteger) : n,
|
||||||
CostEvalAsInteger = (NAsInteger+1) * ScalarReadCostAsInteger + CoeffReadCostAsInteger,
|
CostEvalAsInteger = (NAsInteger+1) * ScalarReadCostAsInteger + CoeffReadCostAsInteger,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user