| 119 | */ |
| 120 | template<typename Derived> |
| 121 | inline typename MatrixBase<Derived>::RealScalar |
| 122 | MatrixBase<Derived>::operatorNorm() const |
| 123 | { |
| 124 | using std::sqrt; |
| 125 | typename Derived::PlainObject m_eval(derived()); |
| 126 | // FIXME if it is really guaranteed that the eigenvalues are already sorted, |
| 127 | // then we don't need to compute a maxCoeff() here, comparing the 1st and last ones is enough. |
| 128 | return sqrt((m_eval*m_eval.adjoint()) |
| 129 | .eval() |
| 130 | .template selfadjointView<Lower>() |
| 131 | .eigenvalues() |
| 132 | .maxCoeff() |
| 133 | ); |
| 134 | } |
| 135 | |
| 136 | /** \brief Computes the L2 operator norm |
| 137 | * \returns Operator norm of the matrix. |
nothing calls this directly
no test coverage detected