Go to the documentation of this file.
11 #include <unsupported/Eigen/MatrixFunctions>
15 #define VERIFY_IS_APPROX_ABS(a, b) VERIFY(test_isApprox_abs(a, b))
17 template<
typename Type1,
typename Type2>
20 return ((
a-
b).
array().
abs() < test_precision<typename Type1::RealScalar>()).all();
25 template<
typename MatrixType>
48 template<
typename MatrixType>
57 Index randomInt = internal::random<Index>(-1, 1);
58 if (randomInt == 0 ||
i ==
size-1) {
75 template<
typename MatrixType>
82 const Scalar imagUnit(0, 1);
95 template<
typename MatrixType>
100 typedef std::complex<RealScalar> ComplexScalar;
102 VERIFY_IS_APPROX(
A.exp(),
A.matrixFunction(internal::stem_function_exp<ComplexScalar>));
105 template<
typename MatrixType>
112 RealScalar maxImagPartOfSpectrum =
A.eigenvalues().imag().cwiseAbs().maxCoeff();
124 template<
typename MatrixType>
133 template<
typename MatrixType>
138 typedef std::complex<RealScalar> ComplexScalar;
139 typedef Matrix<ComplexScalar, MatrixType::RowsAtCompileTime,
140 MatrixType::ColsAtCompileTime, MatrixType::Options> ComplexMatrix;
142 ComplexScalar imagUnit(0,1);
143 ComplexScalar
two(2,0);
145 ComplexMatrix Ac =
A.template cast<ComplexScalar>();
147 ComplexMatrix exp_iA = (imagUnit * Ac).
exp();
148 ComplexMatrix exp_miA = (-imagUnit * Ac).
exp();
150 ComplexMatrix sinAc =
A.sin().template cast<ComplexScalar>();
153 ComplexMatrix cosAc =
A.cos().template cast<ComplexScalar>();
157 template<
typename MatrixType>
166 template<
typename MatrixType>
180 template<
typename MatrixType>
205 Y =
X.cos() + Rc.cos() + Mc.cos();
206 Y =
X.sin() + Rc.sin() + Mc.sin();
208 Y =
X.cosh() + Rc.cosh() + Mc.cosh();
209 Y =
X.sinh() + Rc.sinh() + Mc.sinh();
bool test_isApprox_abs(const Type1 &a, const Type2 &b)
MatrixType randomMatrixWithRealEivals(const Index size)
static MatrixType run(const Index size)
static MatrixType run(const Index size)
void testMapRef(const MatrixType &A)
GaussianFactorGraphValuePair Y
Matrix diag(const std::vector< Matrix > &Hs)
void testHyperbolicFunctions(const MatrixType &A)
const EIGEN_DEVICE_FUNC ExpReturnType exp() const
EIGEN_DECLARE_TEST(matrix_function)
void testMatrix(const MatrixType &A)
Matrix< SCALARA, Dynamic, Dynamic, opt_A > A
#define CALL_SUBTEST_4(FUNC)
#define CALL_SUBTEST_3(FUNC)
void testMatrixLogarithm(const MatrixType &A)
#define CALL_SUBTEST_1(FUNC)
HouseholderSequenceType householderQ() const
void testMatrixType(const MatrixType &m)
#define CALL_SUBTEST_5(FUNC)
AdjointReturnType inverse() const
Inverse of the Householder sequence (equals the adjoint).
#define CALL_SUBTEST_6(FUNC)
#define CALL_SUBTEST_2(FUNC)
A matrix or vector expression mapping an existing array of data.
#define VERIFY_IS_APPROX(a, b)
NumTraits< Scalar >::Real RealScalar
A matrix or vector expression mapping an existing expression.
#define VERIFY_IS_APPROX_ABS(a, b)
void testMatrixExponential(const MatrixType &A)
The matrix class, also used for vectors and row-vectors.
static MatrixType run(const Index size)
void testGonioFunctions(const MatrixType &A)
#define CALL_SUBTEST_7(FUNC)
Holds information about the various numeric (i.e. scalar) types allowed by Eigen.
internal::nested_eval< T, 1 >::type eval(const T &xpr)
Rot2 R(Rot2::fromAngle(0.1))
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Matrix< RealScalar, Dynamic, Dynamic > M
gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:03:03