From 0d8466d3178f8dc42d2bf7c55667468b94680864 Mon Sep 17 00:00:00 2001 From: Desire NUENTSA Date: Thu, 8 Mar 2012 18:59:08 +0100 Subject: Adding an interface to PaStiX, the multithreaded and distributed linear solver --- test/pastix_support.cpp | 61 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 test/pastix_support.cpp (limited to 'test/pastix_support.cpp') diff --git a/test/pastix_support.cpp b/test/pastix_support.cpp new file mode 100644 index 000000000..80c5bbf27 --- /dev/null +++ b/test/pastix_support.cpp @@ -0,0 +1,61 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2008-2012 Gael Guennebaud +// Copyright (C) 2012 Désiré Nuentsa-Wakam +// +// Eigen is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 3 of the License, or (at your option) any later version. +// +// Alternatively, you can redistribute it and/or +// modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation; either version 2 of +// the License, or (at your option) any later version. +// +// Eigen is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License or the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License and a copy of the GNU General Public License along with +// Eigen. If not, see . +#include "sparse_solver.h" +#include +#include + + +template void test_pastix_T() +{ + PastixLLT< SparseMatrix, Eigen::Lower > pastix_llt_lower; + PastixLDLT< SparseMatrix, Eigen::Lower > pastix_ldlt_lower; + PastixLLT< SparseMatrix, Eigen::Upper > pastix_llt_upper; + PastixLDLT< SparseMatrix, Eigen::Upper > pastix_ldlt_upper; + PastixLU< SparseMatrix > pastix_lu; + + check_sparse_spd_solving(pastix_llt_lower); + check_sparse_spd_solving(pastix_ldlt_lower); + check_sparse_spd_solving(pastix_llt_upper); + check_sparse_spd_solving(pastix_ldlt_upper); + check_sparse_square_solving(pastix_lu); +} + +// There is no support for selfadjoint matrices with PaStiX. +// Complex symmetric matrices should pass though +template void test_pastix_T_LU() +{ + PastixLU< SparseMatrix > pastix_lu; + check_sparse_square_solving(pastix_lu); +} + +void test_pastix_support() +{ + for(int i = 0; i < g_repeat; i++) { + CALL_SUBTEST_1(test_pastix_T()); + CALL_SUBTEST_2(test_pastix_T()); + CALL_SUBTEST_3( (test_pastix_T_LU >()) ); + CALL_SUBTEST_4(test_pastix_T_LU >()); + } +} \ No newline at end of file -- cgit v1.2.3