aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2010-01-30 09:02:18 +0100
committerGravatar Gael Guennebaud <g.gael@free.fr>2010-01-30 09:02:18 +0100
commit43f0c0cbb31dff81402ffda22cf9dd3856d499e6 (patch)
tree885a0498848bd494befaf06c98615580a15844a1 /Eigen
parentb6521b799f6d14761ff8e0000a1911d560a79a0e (diff)
fix triangular view assignment
Diffstat (limited to 'Eigen')
-rw-r--r--Eigen/src/Core/SolveTriangular.h2
-rw-r--r--Eigen/src/Core/TriangularMatrix.h16
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<MatrixType,Mode>::solveInPlace(const MatrixBase<OtherDerived
OtherCopy otherCopy(other);
ei_triangular_solver_selector<MatrixType, typename ei_unref<OtherCopy>::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<typename _MatrixType, unsigned int _Mode> 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<MatrixType&>(m_matrix); }
/** Assigns a triangular matrix to a triangular part of a dense matrix */
template<typename OtherDerived>
@@ -215,7 +215,7 @@ template<typename _MatrixType, unsigned int _Mode> class TriangularView
TriangularView& operator=(const MatrixBase<OtherDerived>& other);
TriangularView& operator=(const TriangularView& other)
- { return *this = other._expression(); }
+ { return *this = other.nestedExpression(); }
template<typename OtherDerived>
void lazyAssign(const TriangularBase<OtherDerived>& other);
@@ -510,15 +510,15 @@ template<typename OtherDerived>
inline TriangularView<MatrixType, Mode>&
TriangularView<MatrixType, Mode>::operator=(const TriangularBase<OtherDerived>& other)
{
- ei_assert(Mode == OtherDerived::Mode);
+ ei_assert(Mode == int(OtherDerived::Mode));
if(ei_traits<OtherDerived>::Flags & EvalBeforeAssigningBit)
{
typename OtherDerived::DenseMatrixType other_evaluated(other.rows(), other.cols());
- other_evaluated.template triangularView<Mode>().lazyAssign(other.derived());
+ other_evaluated.template triangularView<Mode>().lazyAssign(other.derived().nestedExpression());
lazyAssign(other_evaluated);
}
else
- lazyAssign(other.derived());
+ lazyAssign(other.derived().nestedExpression());
return *this;
}
@@ -534,7 +534,7 @@ void TriangularView<MatrixType, Mode>::lazyAssign(const TriangularBase<OtherDeri
<MatrixType, OtherDerived, int(Mode),
unroll ? int(MatrixType::SizeAtCompileTime) : Dynamic,
false // preserve the opposite triangular part
- >::run(m_matrix.const_cast_derived(), other.derived()._expression());
+ >::run(m_matrix.const_cast_derived(), other.derived().nestedExpression());
}
/***************************************************************************
@@ -571,7 +571,7 @@ void TriangularBase<Derived>::evalToLazy(MatrixBase<DenseDerived> &other) const
<DenseDerived, typename ei_traits<Derived>::ExpressionType, Derived::Mode,
unroll ? int(DenseDerived::SizeAtCompileTime) : Dynamic,
true // clear the opposite triangular part
- >::run(other.derived(), derived()._expression());
+ >::run(other.derived(), derived().nestedExpression());
}
/***************************************************************************