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>
13 void testMatrixSqrt(const MatrixType& m)
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()));
27  CALL_SUBTEST_4(testMatrixSqrt(Matrix<double,Dynamic,Dynamic,RowMajor>(9, 9)));
28  CALL_SUBTEST_5(testMatrixSqrt(Matrix<float,1,1>()));
29  CALL_SUBTEST_5(testMatrixSqrt(Matrix<std::complex<float>,1,1>()));
30  }
31 }
void testMatrixSqrt(const MatrixType &m)
void test_matrix_square_root()
void run(Expr &expr, Dev &dev)
Definition: TensorSyclRun.h:33


hebiros
Author(s): Xavier Artache , Matthew Tesch
autogenerated on Thu Sep 3 2020 04:08:25