mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-09-24 07:13:16 +08:00
evaluator<Replicate> must evaluate its argument to avoid redundant evaluations
This commit is contained in:
parent
b1ab6a8e0b
commit
95b0a6707b
@ -815,7 +815,8 @@ struct evaluator<Replicate<ArgType, RowFactor, ColFactor> >
|
|||||||
typedef Replicate<ArgType, RowFactor, ColFactor> XprType;
|
typedef Replicate<ArgType, RowFactor, ColFactor> XprType;
|
||||||
|
|
||||||
evaluator(const XprType& replicate)
|
evaluator(const XprType& replicate)
|
||||||
: m_argImpl(replicate.nestedExpression()),
|
: m_arg(replicate.nestedExpression()),
|
||||||
|
m_argImpl(m_arg),
|
||||||
m_rows(replicate.nestedExpression().rows()),
|
m_rows(replicate.nestedExpression().rows()),
|
||||||
m_cols(replicate.nestedExpression().cols())
|
m_cols(replicate.nestedExpression().cols())
|
||||||
{ }
|
{ }
|
||||||
@ -851,7 +852,14 @@ struct evaluator<Replicate<ArgType, RowFactor, ColFactor> >
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
typename evaluator<ArgType>::nestedType m_argImpl;
|
enum {
|
||||||
|
Factor = (RowFactor==Dynamic || ColFactor==Dynamic) ? Dynamic : RowFactor*ColFactor
|
||||||
|
};
|
||||||
|
typedef typename internal::nested_eval<ArgType,Factor>::type ArgTypeNested;
|
||||||
|
typedef typename internal::remove_all<ArgTypeNested>::type ArgTypeNestedCleaned;
|
||||||
|
|
||||||
|
const ArgTypeNested m_arg; // FIXME is it OK to store both the argument and its evaluator?? (we have the same situation in evalautor_product)
|
||||||
|
typename evaluator<ArgTypeNestedCleaned>::nestedType m_argImpl;
|
||||||
const variable_if_dynamic<Index, ArgType::RowsAtCompileTime> m_rows;
|
const variable_if_dynamic<Index, ArgType::RowsAtCompileTime> m_rows;
|
||||||
const variable_if_dynamic<Index, ArgType::ColsAtCompileTime> m_cols;
|
const variable_if_dynamic<Index, ArgType::ColsAtCompileTime> m_cols;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user