21 for (
int i=0;
i<=20; ++
i) {
28 std::cout <<
"test2dRotation: i = " <<
i <<
" error powerm = " <<
relerr(C,B) <<
'\n';
29 VERIFY(C.isApprox(B, tol));
40 A << ch, ish, -ish, ch;
43 for (
int i=0;
i<=20; ++
i) {
46 ish = std::complex<T>(0,
std::sinh(angle));
47 B << ch, ish, -ish, ch;
50 std::cout <<
"test2dHyperbolicRotation: i = " <<
i <<
" error powerm = " <<
relerr(C,B) <<
'\n';
51 VERIFY(C.isApprox(B, tol));
61 for (
int i=0;
i<=20; ++
i) {
69 template<
typename MatrixType>
80 x = internal::random<RealScalar>();
81 y = internal::random<RealScalar>();
86 m5.noalias() = m2 * m3;
87 VERIFY(m4.isApprox(m5, tol));
91 VERIFY(m4.isApprox(m5, tol));
95 VERIFY(m4.isApprox(m5, tol));
99 template<
typename MatrixType>
107 typedef typename internal::conditional<IsComplex, TriangularView<MatrixType,Upper>,
const MatrixType&>
::type TriangularType;
122 VERIFY(mpow(0.5
L).
isApprox(U * (TriangularType(T) * U.adjoint()), tol));
125 VERIFY(mpow(0.25
L).
isApprox(U * (TriangularType(T) * U.adjoint()), tol));
128 VERIFY(mpow(0.125
L).
isApprox(U * (TriangularType(T) * U.adjoint()), tol));
132 template<
typename MatrixType>
144 x = internal::random<Scalar>();
155 CALL_SUBTEST_2(test2dRotation<double>(1
e-13));
156 CALL_SUBTEST_1(test2dRotation<float>(2
e-5));
157 CALL_SUBTEST_9(test2dRotation<long double>(1
e-13
L));
158 CALL_SUBTEST_2(test2dHyperbolicRotation<double>(1
e-14));
159 CALL_SUBTEST_1(test2dHyperbolicRotation<float>(1
e-5));
160 CALL_SUBTEST_9(test2dHyperbolicRotation<long double>(1
e-14
L));
162 CALL_SUBTEST_10(test3dRotation<double>(1
e-13));
163 CALL_SUBTEST_11(test3dRotation<float>(1
e-5));
164 CALL_SUBTEST_12(test3dRotation<long double>(1
e-13
L));
void testGeneral(const MatrixType &m, const typename MatrixType::RealScalar &tol)
ComplexSchur< MatrixXcf > schur(4)
void test3dRotation(const T &tol)
Class for computing matrix powers.
EIGEN_DEVICE_FUNC const ExpReturnType exp() const
Matrix< double, 3, 3, RowMajor > Matrix3dRowMajor
const mpreal ldexp(const mpreal &v, mp_exp_t exp)
EIGEN_DEVICE_FUNC const CoshReturnType cosh() const
Holds information about the various numeric (i.e. scalar) types allowed by Eigen. ...
Matrix< SCALARA, Dynamic, Dynamic > A
Matrix< long double, 3, 3 > Matrix3e
Derived::RealScalar relerr(const MatrixBase< Derived > &A, const MatrixBase< OtherDerived > &B)
Matrix< SCALARB, Dynamic, Dynamic > B
void test2dHyperbolicRotation(const T &tol)
void testSingular(const MatrixType &m_const, const typename MatrixType::RealScalar &tol)
void testLogThenExp(const MatrixType &m_const, const typename MatrixType::RealScalar &tol)
EIGEN_DEVICE_FUNC const CosReturnType cos() const
const StorageIndex & col() const
internal::enable_if< !(internal::is_same< typename Derived::Scalar, ScalarExponent >::value)&&EIGEN_SCALAR_BINARY_SUPPORTED(pow, typename Derived::Scalar, ScalarExponent), const EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(Derived, ScalarExponent, pow) >::type pow(const Eigen::ArrayBase< Derived > &x, const ScalarExponent &exponent)
EIGEN_DEVICE_FUNC const SinhReturnType sinh() const
Eigen::Triplet< double > T
Array< double, 1, 3 > e(1./3., 0.5, 2.)
NumTraits< Scalar >::Real RealScalar
Matrix< Scalar, Dynamic, Dynamic > C
void test2dRotation(const T &tol)
EIGEN_DEVICE_FUNC const SinReturnType sin() const
static void run(MatrixType &, MatrixType &, const MatrixType &)
Jet< T, N > pow(const Jet< T, N > &f, double g)
Matrix< long double, Dynamic, Dynamic > MatrixXe
Map< Matrix< T, Dynamic, Dynamic, ColMajor >, 0, OuterStride<> > matrix(T *data, int rows, int cols, int stride)
The matrix class, also used for vectors and row-vectors.
EIGEN_DEVICE_FUNC bool isApprox(const Scalar &x, const Scalar &y, const typename NumTraits< Scalar >::Real &precision=NumTraits< Scalar >::dummy_precision())
void run(Expr &expr, Dev &dev)
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
Represents a 3D rotation as a rotation angle around an arbitrary 3D axis.