| 107 | |
| 108 | template<typename MatrixType> |
| 109 | void testMatrixLogarithm(const MatrixType& A) |
| 110 | { |
| 111 | typedef typename internal::traits<MatrixType>::Scalar Scalar; |
| 112 | typedef typename NumTraits<Scalar>::Real RealScalar; |
| 113 | |
| 114 | MatrixType scaledA; |
| 115 | RealScalar maxImagPartOfSpectrum = A.eigenvalues().imag().cwiseAbs().maxCoeff(); |
| 116 | if (maxImagPartOfSpectrum >= RealScalar(0.9L * EIGEN_PI)) |
| 117 | scaledA = A * RealScalar(0.9L * EIGEN_PI) / maxImagPartOfSpectrum; |
| 118 | else |
| 119 | scaledA = A; |
| 120 | |
| 121 | // identity X.exp().log() = X only holds if Im(lambda) < pi for all eigenvalues of X |
| 122 | MatrixType expA = scaledA.exp(); |
| 123 | MatrixType logExpA = expA.log(); |
| 124 | VERIFY_IS_APPROX(logExpA, scaledA); |
| 125 | } |
| 126 | |
| 127 | template<typename MatrixType> |
| 128 | void testHyperbolicFunctions(const MatrixType& A) |
no test coverage detected