diff options
author | 2014-02-21 15:22:08 +0100 | |
---|---|---|
committer | 2014-02-21 15:22:08 +0100 | |
commit | af31b6c37a3b4b32c8075d94b39a78108f12fd31 (patch) | |
tree | 12d4bf3e52272f65c67e0ea17ee981539130e606 /Eigen/src/LU | |
parent | 93125e372df80f07bb7d74abdebb592425ddba7b (diff) |
Generalize evaluator<Inverse<>> such that there is no need to specialize it
Diffstat (limited to 'Eigen/src/LU')
-rw-r--r-- | Eigen/src/LU/Inverse.h | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/Eigen/src/LU/Inverse.h b/Eigen/src/LU/Inverse.h index 593ce6f8f..db053406e 100644 --- a/Eigen/src/LU/Inverse.h +++ b/Eigen/src/LU/Inverse.h @@ -351,7 +351,7 @@ struct traits<Inverse<XprType> > * * \tparam XprType the type of the expression we are taking the inverse * - * This class represents an expression of A.inverse() + * This class represents an abstract expression of A.inverse() * and most of the time this is the only way it is used. * */ @@ -377,7 +377,11 @@ protected: XprTypeNested &m_xpr; }; -// Specialization of the Inverse expression for dense expressions +/** \internal + * Specialization of the Inverse expression for dense expressions. + * Direct access to the coefficients are discared. + * FIXME this intermediate class is probably not needed anymore. + */ template<typename XprType> class InverseImpl<XprType,Dense> : public MatrixBase<Inverse<XprType> > @@ -397,7 +401,16 @@ private: namespace internal { -// Evaluator of Inverse -> eval into a temporary +/** \internal + * \brief Default evaluator for Inverse expression. + * + * This default evaluator for Inverse expression simply evaluate the inverse into a temporary + * by a call to internal::call_assignment_no_alias. + * Therefore, inverse implementers only have to specialize Assignment<Dst,Inverse<...>, ...> for + * there own nested expression. + * + * \sa class Inverse + */ template<typename XprType> struct evaluator<Inverse<XprType> > : public evaluator<typename Inverse<XprType>::PlainObject>::type @@ -413,13 +426,7 @@ struct evaluator<Inverse<XprType> > : m_result(inv_xpr.rows(), inv_xpr.cols()) { ::new (static_cast<Base*>(this)) Base(m_result); - - typedef typename internal::nested_eval<XprType,XprType::ColsAtCompileTime>::type ActualXprType; - typedef typename internal::remove_all<ActualXprType>::type ActualXprTypeCleanded; - - ActualXprType actual_xpr(inv_xpr.nestedExpression()); - - compute_inverse<ActualXprTypeCleanded, PlainObject>::run(actual_xpr, m_result); + internal::call_assignment_no_alias(m_result, inv_xpr); } protected: |