21 for (
int i=0;
i<=20; ++
i) {
27 C = Apow(std::ldexp(angle,1) /
T(
EIGEN_PI));
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) {
44 angle = std::ldexp(static_cast<T>(
i-10), -1);
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>();
Matrix< SCALARB, Dynamic, Dynamic, opt_B > B
const StorageIndex & col() const
void testGeneral(const MatrixType &m, const typename MatrixType::RealScalar &tol)
#define CALL_SUBTEST_12(FUNC)
ComplexSchur< MatrixXcf > schur(4)
void test3dRotation(const T &tol)
#define CALL_SUBTEST_9(FUNC)
#define CALL_SUBTEST_6(FUNC)
#define CALL_SUBTEST_4(FUNC)
Class for computing matrix powers.
Jet< T, N > cos(const Jet< T, N > &f)
#define CALL_SUBTEST_3(FUNC)
Matrix< double, 3, 3, RowMajor > Matrix3dRowMajor
#define CALL_SUBTEST_7(FUNC)
#define CALL_SUBTEST_11(FUNC)
Jet< T, N > sin(const Jet< T, N > &f)
const Eigen::CwiseBinaryOp< Eigen::internal::scalar_pow_op< typename Derived::Scalar, typename ExponentDerived::Scalar >, const Derived, const ExponentDerived > pow(const Eigen::ArrayBase< Derived > &x, const Eigen::ArrayBase< ExponentDerived > &exponents)
Holds information about the various numeric (i.e. scalar) types allowed by Eigen. ...
Matrix< SCALARA, Dynamic, Dynamic, opt_A > A
Matrix< long double, 3, 3 > Matrix3e
Derived::RealScalar relerr(const MatrixBase< Derived > &A, const MatrixBase< OtherDerived > &B)
EIGEN_DEVICE_FUNC const SinhReturnType sinh() const
void test2dHyperbolicRotation(const T &tol)
#define CALL_SUBTEST_10(FUNC)
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 ExpReturnType exp() const
#define CALL_SUBTEST_1(FUNC)
Array< int, Dynamic, 1 > v
Eigen::Triplet< double > T
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
#define CALL_SUBTEST_8(FUNC)
Array< double, 1, 3 > e(1./3., 0.5, 2.)
NumTraits< Scalar >::Real RealScalar
Matrix< Scalar, Dynamic, Dynamic > C
#define CALL_SUBTEST_5(FUNC)
void test2dRotation(const T &tol)
#define CALL_SUBTEST_2(FUNC)
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())
EIGEN_DEVICE_FUNC const CoshReturnType cosh() const
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
EIGEN_DECLARE_TEST(matrix_power)
Represents a 3D rotation as a rotation angle around an arbitrary 3D axis.