* solveTriangularInPlace(): take a const ref and const_cast it, to allow passing temporary xprs.

* improvements, simplifications in LU::solve()
* remove remnant of old norm2()
This commit is contained in:
Benoit Jacob
2009-01-25 23:46:51 +00:00
parent 414ee1db4b
commit 00d7f8e567
3 changed files with 17 additions and 24 deletions

View File

@@ -221,13 +221,17 @@ 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));