| 131 | |
| 132 | template<typename MatrixType> |
| 133 | void testLogThenExp(const MatrixType& m_const, const typename MatrixType::RealScalar& tol) |
| 134 | { |
| 135 | // we need to pass by reference in order to prevent errors with |
| 136 | // MSVC for aligned data types ... |
| 137 | MatrixType& m = const_cast<MatrixType&>(m_const); |
| 138 | |
| 139 | typedef typename MatrixType::Scalar Scalar; |
| 140 | Scalar x; |
| 141 | |
| 142 | for (int i=0; i < g_repeat; ++i) { |
| 143 | generateTestMatrix<MatrixType>::run(m, m.rows()); |
| 144 | x = internal::random<Scalar>(); |
| 145 | VERIFY(m.pow(x).isApprox((x * m.log()).exp(), tol)); |
| 146 | } |
| 147 | } |
| 148 | |
| 149 | typedef Matrix<double,3,3,RowMajor> Matrix3dRowMajor; |
| 150 | typedef Matrix<long double,3,3> Matrix3e; |