matrix_square_root.cpp
Go to the documentation of this file.
00001 // This file is part of Eigen, a lightweight C++ template library
00002 // for linear algebra.
00003 //
00004 // Copyright (C) 2011 Jitse Niesen <jitse@maths.leeds.ac.uk>
00005 //
00006 // This Source Code Form is subject to the terms of the Mozilla
00007 // Public License v. 2.0. If a copy of the MPL was not distributed
00008 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
00009 
00010 #include "matrix_functions.h"
00011 
00012 template<typename MatrixType>
00013 void testMatrixSqrt(const MatrixType& m)
00014 {
00015   MatrixType A;
00016   generateTestMatrix<MatrixType>::run(A, m.rows());
00017   MatrixType sqrtA = A.sqrt();
00018   VERIFY_IS_APPROX(sqrtA * sqrtA, A);
00019 }
00020 
00021 void test_matrix_square_root()
00022 {
00023   for (int i = 0; i < g_repeat; i++) {
00024     CALL_SUBTEST_1(testMatrixSqrt(Matrix3cf()));
00025     CALL_SUBTEST_2(testMatrixSqrt(MatrixXcd(12,12)));
00026     CALL_SUBTEST_3(testMatrixSqrt(Matrix4f()));
00027     CALL_SUBTEST_4(testMatrixSqrt(Matrix<double,Dynamic,Dynamic,RowMajor>(9, 9)));
00028     CALL_SUBTEST_5(testMatrixSqrt(Matrix<float,1,1>()));
00029     CALL_SUBTEST_5(testMatrixSqrt(Matrix<std::complex<float>,1,1>()));
00030   }
00031 }


shape_reconstruction
Author(s): Roberto Martín-Martín
autogenerated on Sat Jun 8 2019 18:33:02