matrix_square_root.cpp
Go to the documentation of this file.
1 // This file is part of Eigen, a lightweight C++ template library
2 // for linear algebra.
3 //
4 // Copyright (C) 2011 Jitse Niesen <jitse@maths.leeds.ac.uk>
5 //
6 // This Source Code Form is subject to the terms of the Mozilla
7 // Public License v. 2.0. If a copy of the MPL was not distributed
8 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 
10 #include "matrix_functions.h"
11 
12 template<typename MatrixType>
14 {
15  MatrixType A;
17  MatrixType sqrtA = A.sqrt();
19 }
20 
21 EIGEN_DECLARE_TEST(matrix_square_root)
22 {
23  for (int i = 0; i < g_repeat; i++) {
24  CALL_SUBTEST_1(testMatrixSqrt(Matrix3cf()));
25  CALL_SUBTEST_2(testMatrixSqrt(MatrixXcd(12,12)));
26  CALL_SUBTEST_3(testMatrixSqrt(Matrix4f()));
29  CALL_SUBTEST_5(testMatrixSqrt(Matrix<std::complex<float>,1,1>()));
30  }
31 }
MatrixType
MatrixXf MatrixType
Definition: benchmark-blocking-sizes.cpp:52
EIGEN_DECLARE_TEST
EIGEN_DECLARE_TEST(matrix_square_root)
Definition: matrix_square_root.cpp:21
A
Matrix< SCALARA, Dynamic, Dynamic, opt_A > A
Definition: bench_gemm.cpp:48
CALL_SUBTEST_4
#define CALL_SUBTEST_4(FUNC)
Definition: split_test_helper.h:22
CALL_SUBTEST_3
#define CALL_SUBTEST_3(FUNC)
Definition: split_test_helper.h:16
CALL_SUBTEST_1
#define CALL_SUBTEST_1(FUNC)
Definition: split_test_helper.h:4
CALL_SUBTEST_5
#define CALL_SUBTEST_5(FUNC)
Definition: split_test_helper.h:28
Eigen::g_repeat
static int g_repeat
Definition: main.h:169
gtsam.examples.DogLegOptimizerExample.run
def run(args)
Definition: DogLegOptimizerExample.py:21
m
Matrix3f m
Definition: AngleAxis_mimic_euler.cpp:1
CALL_SUBTEST_2
#define CALL_SUBTEST_2(FUNC)
Definition: split_test_helper.h:10
testMatrixSqrt
void testMatrixSqrt(const MatrixType &m)
Definition: matrix_square_root.cpp:13
matrix_functions.h
VERIFY_IS_APPROX
#define VERIFY_IS_APPROX(a, b)
Definition: integer_types.cpp:15
sqrtA
MatrixXd sqrtA
Definition: SelfAdjointEigenSolver_operatorSqrt.cpp:6
Eigen::Matrix
The matrix class, also used for vectors and row-vectors.
Definition: 3rdparty/Eigen/Eigen/src/Core/Matrix.h:178
i
int i
Definition: BiCGSTAB_step_by_step.cpp:9


gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:03:03