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();
18  VERIFY_IS_APPROX(sqrtA * sqrtA, A);
19 }
20 
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()));
28  CALL_SUBTEST_5(testMatrixSqrt(Matrix<float,1,1>()));
29  CALL_SUBTEST_5(testMatrixSqrt(Matrix<std::complex<float>,1,1>()));
30  }
31 }
Matrix3f m
MatrixXf MatrixType
Matrix< SCALARA, Dynamic, Dynamic > A
Definition: bench_gemm.cpp:35
#define VERIFY_IS_APPROX(a, b)
static int g_repeat
Definition: main.h:144
void testMatrixSqrt(const MatrixType &m)
void test_matrix_square_root()
The matrix class, also used for vectors and row-vectors.
void run(Expr &expr, Dev &dev)
Definition: TensorSyclRun.h:33


gtsam
Author(s):
autogenerated on Sat May 8 2021 02:42:50