| 143 | */ |
| 144 | template<typename Derived> |
| 145 | EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void MatrixBase<Derived>::normalize() |
| 146 | { |
| 147 | RealScalar z = squaredNorm(); |
| 148 | // NOTE: after extensive benchmarking, this conditional does not impact performance, at least on recent x86 CPU |
| 149 | if(z>RealScalar(0)) |
| 150 | derived() /= numext::sqrt(z); |
| 151 | } |
| 152 | |
| 153 | /** \returns an expression of the quotient of \c *this by its own norm while avoiding underflow and overflow. |
| 154 | * |
no test coverage detected