diff options
author | 2009-01-25 23:46:51 +0000 | |
---|---|---|
committer | 2009-01-25 23:46:51 +0000 | |
commit | 00d7f8e567667941ffded734dcee800f66b43bae (patch) | |
tree | b824a2a5fce61d797b7deda8430fe14a6c571f5a /Eigen/src/Core/SolveTriangular.h | |
parent | 414ee1db4b3f1a822261d012a7ce04ef5b884550 (diff) |
* solveTriangularInPlace(): take a const ref and const_cast it, to allow passing temporary xprs.
* improvements, simplifications in LU::solve()
* remove remnant of old norm2()
Diffstat (limited to 'Eigen/src/Core/SolveTriangular.h')
-rw-r--r-- | Eigen/src/Core/SolveTriangular.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Eigen/src/Core/SolveTriangular.h b/Eigen/src/Core/SolveTriangular.h index 1c586b865..e39353275 100644 --- a/Eigen/src/Core/SolveTriangular.h +++ b/Eigen/src/Core/SolveTriangular.h @@ -222,12 +222,16 @@ struct ei_solve_triangular_selector<Lhs,Rhs,UpLo,ColMajor|IsDense> /** "in-place" version of MatrixBase::solveTriangular() where the result is written in \a other * + * The parameter is only marked 'const' to make the C++ compiler accept a temporary expression here. + * This function will const_cast it, so constness isn't honored here. + * * See MatrixBase:solveTriangular() for the details. */ template<typename Derived> template<typename OtherDerived> -void MatrixBase<Derived>::solveTriangularInPlace(MatrixBase<OtherDerived>& other) const +void MatrixBase<Derived>::solveTriangularInPlace(const MatrixBase<OtherDerived>& _other) const { + MatrixBase<OtherDerived>& other = _other.const_cast_derived(); ei_assert(derived().cols() == derived().rows()); ei_assert(derived().cols() == other.rows()); ei_assert(!(Flags & ZeroDiagBit)); |