mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-04-22 09:39:34 +08:00
impl basic product evaluator on top of previous one
This commit is contained in:
parent
abc8c0821c
commit
42bc1f77be
@ -181,12 +181,12 @@ protected:
|
|||||||
typename evaluator<Rhs>::type m_rhsImpl;
|
typename evaluator<Rhs>::type m_rhsImpl;
|
||||||
};
|
};
|
||||||
|
|
||||||
// products
|
// product
|
||||||
|
|
||||||
template<typename Lhs, typename Rhs, int ProductType>
|
template<typename Lhs, typename Rhs>
|
||||||
struct evaluator_impl<GeneralProduct<Lhs,Rhs,ProductType> > : public evaluator<typename GeneralProduct<Lhs,Rhs,ProductType>::PlainObject>::type
|
struct evaluator_impl<Product<Lhs,Rhs> > : public evaluator<typename Product<Lhs,Rhs>::PlainObject>::type
|
||||||
{
|
{
|
||||||
typedef GeneralProduct<Lhs,Rhs,ProductType> XprType;
|
typedef Product<Lhs,Rhs> XprType;
|
||||||
typedef typename XprType::PlainObject PlainObject;
|
typedef typename XprType::PlainObject PlainObject;
|
||||||
typedef typename evaluator<PlainObject>::type evaluator_base;
|
typedef typename evaluator<PlainObject>::type evaluator_base;
|
||||||
|
|
||||||
@ -195,16 +195,20 @@ struct evaluator_impl<GeneralProduct<Lhs,Rhs,ProductType> > : public evaluator<t
|
|||||||
// EvaluateRhs = ;
|
// EvaluateRhs = ;
|
||||||
// };
|
// };
|
||||||
|
|
||||||
evaluator_impl(const XprType& product) : evaluator_base(m_result), m_lhsImpl(product.lhs()), m_rhsImpl(product.rhs())
|
evaluator_impl(const XprType& product) : evaluator_base(m_result)
|
||||||
{
|
{
|
||||||
|
// here we process the left and right hand sides with a specialized evaluator
|
||||||
|
// perhaps this step should be done by the TreeOptimizer to get a canonical tree and reduce evaluator instanciations
|
||||||
|
// typename product_operand_evaluator<Lhs>::type m_lhsImpl(product.lhs());
|
||||||
|
// typename product_operand_evaluator<Rhs>::type m_rhsImpl(product.rhs());
|
||||||
|
|
||||||
|
// TODO do not rely on previous product mechanism !!
|
||||||
m_result.resize(product.rows(), product.cols());
|
m_result.resize(product.rows(), product.cols());
|
||||||
product.evalTo(m_result);
|
m_result.noalias() = product.lhs() * product.rhs();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
PlainObject m_result;
|
PlainObject m_result;
|
||||||
typename evaluator<Lhs>::type m_lhsImpl;
|
|
||||||
typename evaluator<Rhs>::type m_rhsImpl;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace internal
|
} // namespace internal
|
||||||
|
Loading…
x
Reference in New Issue
Block a user