diff --git a/Eigen/src/Core/AssignEvaluator.h b/Eigen/src/Core/AssignEvaluator.h index 73f20c1a1..14effd1f2 100644 --- a/Eigen/src/Core/AssignEvaluator.h +++ b/Eigen/src/Core/AssignEvaluator.h @@ -736,7 +736,11 @@ void call_assignment_no_alias(Dst& dst, const Src& src, const Func& func) Assignment::run(actualDst, src, func); } - +template +void call_assignment_no_alias(Dst& dst, const Src& src) +{ + call_assignment_no_alias(dst, src, internal::assign_op()); +} // Generic Dense to Dense assignment template< typename DstXprType, typename SrcXprType, typename Functor, typename Scalar> 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 > * * \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 class InverseImpl : public MatrixBase > @@ -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, ...> for + * there own nested expression. + * + * \sa class Inverse + */ template struct evaluator > : public evaluator::PlainObject>::type @@ -413,13 +426,7 @@ struct evaluator > : m_result(inv_xpr.rows(), inv_xpr.cols()) { ::new (static_cast(this)) Base(m_result); - - typedef typename internal::nested_eval::type ActualXprType; - typedef typename internal::remove_all::type ActualXprTypeCleanded; - - ActualXprType actual_xpr(inv_xpr.nestedExpression()); - - compute_inverse::run(actual_xpr, m_result); + internal::call_assignment_no_alias(m_result, inv_xpr); } protected: