aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2011-03-24 09:33:36 +0100
committerGravatar Gael Guennebaud <g.gael@free.fr>2011-03-24 09:33:36 +0100
commit42bc1f77be65ec5557c00d53ce988598c47a0c5f (patch)
treed1fdbd89d103d7cb5d9f845eb8c4a8b517bdf64d /Eigen
parentabc8c0821c733cc2a45069495eb198f8b30fcc2c (diff)
impl basic product evaluator on top of previous one
Diffstat (limited to 'Eigen')
-rw-r--r--Eigen/src/Core/CoreEvaluators.h20
1 files changed, 12 insertions, 8 deletions
diff --git a/Eigen/src/Core/CoreEvaluators.h b/Eigen/src/Core/CoreEvaluators.h
index 64ec21a0f..43fc53ccd 100644
--- a/Eigen/src/Core/CoreEvaluators.h
+++ b/Eigen/src/Core/CoreEvaluators.h
@@ -181,12 +181,12 @@ protected:
typename evaluator<Rhs>::type m_rhsImpl;
};
-// products
+// product
-template<typename Lhs, typename Rhs, int ProductType>
-struct evaluator_impl<GeneralProduct<Lhs,Rhs,ProductType> > : public evaluator<typename GeneralProduct<Lhs,Rhs,ProductType>::PlainObject>::type
+template<typename Lhs, typename Rhs>
+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 evaluator<PlainObject>::type evaluator_base;
@@ -195,16 +195,20 @@ struct evaluator_impl<GeneralProduct<Lhs,Rhs,ProductType> > : public evaluator<t
// 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());
- product.evalTo(m_result);
+ m_result.noalias() = product.lhs() * product.rhs();
}
protected:
PlainObject m_result;
- typename evaluator<Lhs>::type m_lhsImpl;
- typename evaluator<Rhs>::type m_rhsImpl;
};
} // namespace internal