From 43f0c0cbb31dff81402ffda22cf9dd3856d499e6 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Sat, 30 Jan 2010 09:02:18 +0100 Subject: fix triangular view assignment --- Eigen/src/Core/SolveTriangular.h | 2 +- Eigen/src/Core/TriangularMatrix.h | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Eigen/src/Core/SolveTriangular.h b/Eigen/src/Core/SolveTriangular.h index 73cf77387..cac1e2554 100644 --- a/Eigen/src/Core/SolveTriangular.h +++ b/Eigen/src/Core/SolveTriangular.h @@ -254,7 +254,7 @@ void TriangularView::solveInPlace(const MatrixBase::type, - Side, Mode>::run(_expression(), otherCopy); + Side, Mode>::run(nestedExpression(), otherCopy); if (copy) other = otherCopy; diff --git a/Eigen/src/Core/TriangularMatrix.h b/Eigen/src/Core/TriangularMatrix.h index e51be366b..8bea0aa68 100644 --- a/Eigen/src/Core/TriangularMatrix.h +++ b/Eigen/src/Core/TriangularMatrix.h @@ -204,8 +204,8 @@ template class TriangularView return m_matrix.const_cast_derived().coeffRef(row, col); } - /** \internal */ - const MatrixType& _expression() const { return m_matrix; } + const MatrixType& nestedExpression() const { return m_matrix; } + MatrixType& nestedExpression() { return const_cast(m_matrix); } /** Assigns a triangular matrix to a triangular part of a dense matrix */ template @@ -215,7 +215,7 @@ template class TriangularView TriangularView& operator=(const MatrixBase& other); TriangularView& operator=(const TriangularView& other) - { return *this = other._expression(); } + { return *this = other.nestedExpression(); } template void lazyAssign(const TriangularBase& other); @@ -510,15 +510,15 @@ template inline TriangularView& TriangularView::operator=(const TriangularBase& other) { - ei_assert(Mode == OtherDerived::Mode); + ei_assert(Mode == int(OtherDerived::Mode)); if(ei_traits::Flags & EvalBeforeAssigningBit) { typename OtherDerived::DenseMatrixType other_evaluated(other.rows(), other.cols()); - other_evaluated.template triangularView().lazyAssign(other.derived()); + other_evaluated.template triangularView().lazyAssign(other.derived().nestedExpression()); lazyAssign(other_evaluated); } else - lazyAssign(other.derived()); + lazyAssign(other.derived().nestedExpression()); return *this; } @@ -534,7 +534,7 @@ void TriangularView::lazyAssign(const TriangularBase::run(m_matrix.const_cast_derived(), other.derived()._expression()); + >::run(m_matrix.const_cast_derived(), other.derived().nestedExpression()); } /*************************************************************************** @@ -571,7 +571,7 @@ void TriangularBase::evalToLazy(MatrixBase &other) const ::ExpressionType, Derived::Mode, unroll ? int(DenseDerived::SizeAtCompileTime) : Dynamic, true // clear the opposite triangular part - >::run(other.derived(), derived()._expression()); + >::run(other.derived(), derived().nestedExpression()); } /*************************************************************************** -- cgit v1.2.3