bug #298 - let normalize() return a reference to *this

This commit is contained in:
Andy Somerville 2011-06-15 00:30:11 -04:00
parent 40287d2fd9
commit 842881cfb1
2 changed files with 3 additions and 2 deletions

View File

@ -159,9 +159,10 @@ MatrixBase<Derived>::normalized() const
* \sa norm(), normalized()
*/
template<typename Derived>
inline void MatrixBase<Derived>::normalize()
inline Derived& MatrixBase<Derived>::normalize()
{
*this /= norm();
return derived();
}
//---------- implementation of other norms ----------

View File

@ -218,7 +218,7 @@ template<typename Derived> class MatrixBase
RealScalar blueNorm() const;
RealScalar hypotNorm() const;
const PlainObject normalized() const;
void normalize();
Derived& normalize();
const AdjointReturnType adjoint() const;
void adjointInPlace();