From 44861dcbfeee041223c4aac1ee075e92fa4daa01 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 18 Sep 2016 12:42:15 +0200 Subject: update --- eigen/test/conjugate_gradient.cpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 eigen/test/conjugate_gradient.cpp (limited to 'eigen/test/conjugate_gradient.cpp') diff --git a/eigen/test/conjugate_gradient.cpp b/eigen/test/conjugate_gradient.cpp new file mode 100644 index 0000000..019cc4d --- /dev/null +++ b/eigen/test/conjugate_gradient.cpp @@ -0,0 +1,32 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2011 Gael Guennebaud +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#include "sparse_solver.h" +#include + +template void test_conjugate_gradient_T() +{ + ConjugateGradient, Lower > cg_colmajor_lower_diag; + ConjugateGradient, Upper > cg_colmajor_upper_diag; + ConjugateGradient, Lower|Upper> cg_colmajor_loup_diag; + ConjugateGradient, Lower, IdentityPreconditioner> cg_colmajor_lower_I; + ConjugateGradient, Upper, IdentityPreconditioner> cg_colmajor_upper_I; + + CALL_SUBTEST( check_sparse_spd_solving(cg_colmajor_lower_diag) ); + CALL_SUBTEST( check_sparse_spd_solving(cg_colmajor_upper_diag) ); + CALL_SUBTEST( check_sparse_spd_solving(cg_colmajor_loup_diag) ); + CALL_SUBTEST( check_sparse_spd_solving(cg_colmajor_lower_I) ); + CALL_SUBTEST( check_sparse_spd_solving(cg_colmajor_upper_I) ); +} + +void test_conjugate_gradient() +{ + CALL_SUBTEST_1(test_conjugate_gradient_T()); + CALL_SUBTEST_2(test_conjugate_gradient_T >()); +} -- cgit v1.2.3