From 4d3b7e2a1351d60b9ee26d0fe3442cd5b3a1f8a9 Mon Sep 17 00:00:00 2001 From: Desire NUENTSA Date: Mon, 6 Aug 2012 14:55:02 +0200 Subject: Add support for Metis fill-reducing ordering ; it is generally more efficient than COLAMD ordering --- bench/spbench/CMakeLists.txt | 6 ++++++ bench/spbench/test_sparseLU.cpp | 8 ++++++++ 2 files changed, 14 insertions(+) (limited to 'bench/spbench') diff --git a/bench/spbench/CMakeLists.txt b/bench/spbench/CMakeLists.txt index a093cc5d9..2eb0befa9 100644 --- a/bench/spbench/CMakeLists.txt +++ b/bench/spbench/CMakeLists.txt @@ -66,5 +66,11 @@ target_link_libraries (spbenchsolver ${SPARSE_LIBS}) add_executable(spsolver sp_solver.cpp) target_link_libraries (spsolver ${SPARSE_LIBS}) +if(METIS_FOUND) + include_directories(${METIS_INCLUDES}) + set (SPARSE_LIBS ${SPARSE_LIBS} ${METIS_LIBRARIES}) + add_definitions("-DEIGEN_METIS_SUPPORT") +endif(METIS_FOUND) + add_executable(test_sparseLU test_sparseLU.cpp) target_link_libraries (test_sparseLU ${SPARSE_LIBS}) diff --git a/bench/spbench/test_sparseLU.cpp b/bench/spbench/test_sparseLU.cpp index 59f8252d0..8c78b0c9b 100644 --- a/bench/spbench/test_sparseLU.cpp +++ b/bench/spbench/test_sparseLU.cpp @@ -7,6 +7,9 @@ #include #include #include +#ifdef EIGEN_METIS_SUPPORT +#include +#endif using namespace std; using namespace Eigen; @@ -21,7 +24,12 @@ int main(int argc, char **args) typedef Matrix DenseRhs; Matrix b, x, tmp; // SparseLU, AMDOrdering > solver; +#ifdef EIGEN_METIS_SUPPORT + SparseLU, MetisOrdering > solver; +#else SparseLU, COLAMDOrdering > solver; +#endif + ifstream matrix_file; string line; int n; -- cgit v1.2.3