spbenchsolver.h
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) 2012 Désiré Nuentsa-Wakam <desire.nuentsa_wakam@inria.fr>
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 <iostream>
11 #include <fstream>
12 #include <Eigen/SparseCore>
13 #include <bench/BenchTimer.h>
14 #include <cstdlib>
15 #include <string>
16 #include <Eigen/Cholesky>
17 #include <Eigen/Jacobi>
18 #include <Eigen/Householder>
19 #include <Eigen/IterativeLinearSolvers>
20 #include <unsupported/Eigen/IterativeSolvers>
21 #include <Eigen/LU>
22 #include <unsupported/Eigen/SparseExtra>
23 #include <Eigen/SparseLU>
24 
25 #include "spbenchstyle.h"
26 
27 #ifdef EIGEN_METIS_SUPPORT
28 #include <Eigen/MetisSupport>
29 #endif
30 
31 #ifdef EIGEN_CHOLMOD_SUPPORT
32 #include <Eigen/CholmodSupport>
33 #endif
34 
35 #ifdef EIGEN_UMFPACK_SUPPORT
36 #include <Eigen/UmfPackSupport>
37 #endif
38 
39 #ifdef EIGEN_KLU_SUPPORT
40 #include <Eigen/KLUSupport>
41 #endif
42 
43 #ifdef EIGEN_PARDISO_SUPPORT
44 #include <Eigen/PardisoSupport>
45 #endif
46 
47 #ifdef EIGEN_SUPERLU_SUPPORT
48 #include <Eigen/SuperLUSupport>
49 #endif
50 
51 #ifdef EIGEN_PASTIX_SUPPORT
52 #include <Eigen/PaStiXSupport>
53 #endif
54 
55 // CONSTANTS
56 #define EIGEN_UMFPACK 10
57 #define EIGEN_KLU 11
58 #define EIGEN_SUPERLU 20
59 #define EIGEN_PASTIX 30
60 #define EIGEN_PARDISO 40
61 #define EIGEN_SPARSELU_COLAMD 50
62 #define EIGEN_SPARSELU_METIS 51
63 #define EIGEN_BICGSTAB 60
64 #define EIGEN_BICGSTAB_ILUT 61
65 #define EIGEN_GMRES 70
66 #define EIGEN_GMRES_ILUT 71
67 #define EIGEN_SIMPLICIAL_LDLT 80
68 #define EIGEN_CHOLMOD_LDLT 90
69 #define EIGEN_PASTIX_LDLT 100
70 #define EIGEN_PARDISO_LDLT 110
71 #define EIGEN_SIMPLICIAL_LLT 120
72 #define EIGEN_CHOLMOD_SUPERNODAL_LLT 130
73 #define EIGEN_CHOLMOD_SIMPLICIAL_LLT 140
74 #define EIGEN_PASTIX_LLT 150
75 #define EIGEN_PARDISO_LLT 160
76 #define EIGEN_CG 170
77 #define EIGEN_CG_PRECOND 180
78 
79 using namespace Eigen;
80 using namespace std;
81 
82 // Global variables for input parameters
83 int MaximumIters; // Maximum number of iterations
84 double RelErr; // Relative error of the computed solution
85 double best_time_val; // Current best time overall solvers
86 int best_time_id; // id of the best solver for the current system
87 
88 template <typename T>
91 }
92 template <>
93 inline float test_precision<float>() {
94  return 1e-3f;
95 }
96 template <>
97 inline double test_precision<double>() {
98  return 1e-6;
99 }
100 template <>
101 inline float test_precision<std::complex<float> >() {
102  return test_precision<float>();
103 }
104 template <>
105 inline double test_precision<std::complex<double> >() {
106  return test_precision<double>();
107 }
108 
109 void printStatheader(std::ofstream& out) {
110  // Print XML header
111  // NOTE It would have been much easier to write these XML documents using external libraries like tinyXML or
112  // Xerces-C++.
113 
114  out << "<?xml version='1.0' encoding='UTF-8'?> \n";
115  out << "<?xml-stylesheet type='text/xsl' href='#stylesheet' ?> \n";
116  out << "<!DOCTYPE BENCH [\n<!ATTLIST xsl:stylesheet\n id\t ID #REQUIRED>\n]>";
117  out << "\n\n<!-- Generated by the Eigen library -->\n";
118 
119  out << "\n<BENCH> \n"; // root XML element
120  // Print the xsl style section
122  // List all available solvers
123  out << " <AVAILSOLVER> \n";
124 #ifdef EIGEN_UMFPACK_SUPPORT
125  out << " <SOLVER ID='" << EIGEN_UMFPACK << "'>\n";
126  out << " <TYPE> LU </TYPE> \n";
127  out << " <PACKAGE> UMFPACK </PACKAGE> \n";
128  out << " </SOLVER> \n";
129 #endif
130 #ifdef EIGEN_KLU_SUPPORT
131  out << " <SOLVER ID='" << EIGEN_KLU << "'>\n";
132  out << " <TYPE> LU </TYPE> \n";
133  out << " <PACKAGE> KLU </PACKAGE> \n";
134  out << " </SOLVER> \n";
135 #endif
136 #ifdef EIGEN_SUPERLU_SUPPORT
137  out << " <SOLVER ID='" << EIGEN_SUPERLU << "'>\n";
138  out << " <TYPE> LU </TYPE> \n";
139  out << " <PACKAGE> SUPERLU </PACKAGE> \n";
140  out << " </SOLVER> \n";
141 #endif
142 #ifdef EIGEN_CHOLMOD_SUPPORT
143  out << " <SOLVER ID='" << EIGEN_CHOLMOD_SIMPLICIAL_LLT << "'>\n";
144  out << " <TYPE> LLT SP</TYPE> \n";
145  out << " <PACKAGE> CHOLMOD </PACKAGE> \n";
146  out << " </SOLVER> \n";
147 
148  out << " <SOLVER ID='" << EIGEN_CHOLMOD_SUPERNODAL_LLT << "'>\n";
149  out << " <TYPE> LLT</TYPE> \n";
150  out << " <PACKAGE> CHOLMOD </PACKAGE> \n";
151  out << " </SOLVER> \n";
152 
153  out << " <SOLVER ID='" << EIGEN_CHOLMOD_LDLT << "'>\n";
154  out << " <TYPE> LDLT </TYPE> \n";
155  out << " <PACKAGE> CHOLMOD </PACKAGE> \n";
156  out << " </SOLVER> \n";
157 #endif
158 #ifdef EIGEN_PARDISO_SUPPORT
159  out << " <SOLVER ID='" << EIGEN_PARDISO << "'>\n";
160  out << " <TYPE> LU </TYPE> \n";
161  out << " <PACKAGE> PARDISO </PACKAGE> \n";
162  out << " </SOLVER> \n";
163 
164  out << " <SOLVER ID='" << EIGEN_PARDISO_LLT << "'>\n";
165  out << " <TYPE> LLT </TYPE> \n";
166  out << " <PACKAGE> PARDISO </PACKAGE> \n";
167  out << " </SOLVER> \n";
168 
169  out << " <SOLVER ID='" << EIGEN_PARDISO_LDLT << "'>\n";
170  out << " <TYPE> LDLT </TYPE> \n";
171  out << " <PACKAGE> PARDISO </PACKAGE> \n";
172  out << " </SOLVER> \n";
173 #endif
174 #ifdef EIGEN_PASTIX_SUPPORT
175  out << " <SOLVER ID='" << EIGEN_PASTIX << "'>\n";
176  out << " <TYPE> LU </TYPE> \n";
177  out << " <PACKAGE> PASTIX </PACKAGE> \n";
178  out << " </SOLVER> \n";
179 
180  out << " <SOLVER ID='" << EIGEN_PASTIX_LLT << "'>\n";
181  out << " <TYPE> LLT </TYPE> \n";
182  out << " <PACKAGE> PASTIX </PACKAGE> \n";
183  out << " </SOLVER> \n";
184 
185  out << " <SOLVER ID='" << EIGEN_PASTIX_LDLT << "'>\n";
186  out << " <TYPE> LDLT </TYPE> \n";
187  out << " <PACKAGE> PASTIX </PACKAGE> \n";
188  out << " </SOLVER> \n";
189 #endif
190 
191  out << " <SOLVER ID='" << EIGEN_BICGSTAB << "'>\n";
192  out << " <TYPE> BICGSTAB </TYPE> \n";
193  out << " <PACKAGE> EIGEN </PACKAGE> \n";
194  out << " </SOLVER> \n";
195 
196  out << " <SOLVER ID='" << EIGEN_BICGSTAB_ILUT << "'>\n";
197  out << " <TYPE> BICGSTAB_ILUT </TYPE> \n";
198  out << " <PACKAGE> EIGEN </PACKAGE> \n";
199  out << " </SOLVER> \n";
200 
201  out << " <SOLVER ID='" << EIGEN_GMRES_ILUT << "'>\n";
202  out << " <TYPE> GMRES_ILUT </TYPE> \n";
203  out << " <PACKAGE> EIGEN </PACKAGE> \n";
204  out << " </SOLVER> \n";
205 
206  out << " <SOLVER ID='" << EIGEN_SIMPLICIAL_LDLT << "'>\n";
207  out << " <TYPE> LDLT </TYPE> \n";
208  out << " <PACKAGE> EIGEN </PACKAGE> \n";
209  out << " </SOLVER> \n";
210 
211  out << " <SOLVER ID='" << EIGEN_SIMPLICIAL_LLT << "'>\n";
212  out << " <TYPE> LLT </TYPE> \n";
213  out << " <PACKAGE> EIGEN </PACKAGE> \n";
214  out << " </SOLVER> \n";
215 
216  out << " <SOLVER ID='" << EIGEN_CG << "'>\n";
217  out << " <TYPE> CG </TYPE> \n";
218  out << " <PACKAGE> EIGEN </PACKAGE> \n";
219  out << " </SOLVER> \n";
220 
221  out << " <SOLVER ID='" << EIGEN_SPARSELU_COLAMD << "'>\n";
222  out << " <TYPE> LU_COLAMD </TYPE> \n";
223  out << " <PACKAGE> EIGEN </PACKAGE> \n";
224  out << " </SOLVER> \n";
225 
226 #ifdef EIGEN_METIS_SUPPORT
227  out << " <SOLVER ID='" << EIGEN_SPARSELU_METIS << "'>\n";
228  out << " <TYPE> LU_METIS </TYPE> \n";
229  out << " <PACKAGE> EIGEN </PACKAGE> \n";
230  out << " </SOLVER> \n";
231 #endif
232  out << " </AVAILSOLVER> \n";
233 }
234 
235 template <typename Solver, typename Scalar>
236 void call_solver(Solver& solver, const int solver_id, const typename Solver::MatrixType& A,
237  const Matrix<Scalar, Dynamic, 1>& b, const Matrix<Scalar, Dynamic, 1>& refX, std::ofstream& statbuf) {
238  double total_time;
239  double compute_time;
240  double solve_time;
241  double rel_error;
244  timer.reset();
245  timer.start();
246  solver.compute(A);
247  if (solver.info() != Success) {
248  std::cerr << "Solver failed ... \n";
249  return;
250  }
251  timer.stop();
252  compute_time = timer.value();
253  statbuf << " <TIME>\n";
254  statbuf << " <COMPUTE> " << timer.value() << "</COMPUTE>\n";
255  std::cout << "COMPUTE TIME : " << timer.value() << std::endl;
256 
257  timer.reset();
258  timer.start();
259  x = solver.solve(b);
260  if (solver.info() == NumericalIssue) {
261  std::cerr << "Solver failed ... \n";
262  return;
263  }
264  timer.stop();
265  solve_time = timer.value();
266  statbuf << " <SOLVE> " << timer.value() << "</SOLVE>\n";
267  std::cout << "SOLVE TIME : " << timer.value() << std::endl;
268 
269  total_time = solve_time + compute_time;
270  statbuf << " <TOTAL> " << total_time << "</TOTAL>\n";
271  std::cout << "TOTAL TIME : " << total_time << std::endl;
272  statbuf << " </TIME>\n";
273 
274  // Verify the relative error
275  if (refX.size() != 0)
276  rel_error = (refX - x).norm() / refX.norm();
277  else {
278  // Compute the relative residual norm
280  temp = A * x;
281  rel_error = (b - temp).norm() / b.norm();
282  }
283  statbuf << " <ERROR> " << rel_error << "</ERROR>\n";
284  std::cout << "REL. ERROR : " << rel_error << "\n\n";
285  if (rel_error <= RelErr) {
286  // check the best time if convergence
287  if (!best_time_val || (best_time_val > total_time)) {
288  best_time_val = total_time;
289  best_time_id = solver_id;
290  }
291  }
292 }
293 
294 template <typename Solver, typename Scalar>
295 void call_directsolver(Solver& solver, const int solver_id, const typename Solver::MatrixType& A,
297  std::string& statFile) {
298  std::ofstream statbuf(statFile.c_str(), std::ios::app);
299  statbuf << " <SOLVER_STAT ID='" << solver_id << "'>\n";
300  call_solver(solver, solver_id, A, b, refX, statbuf);
301  statbuf << " </SOLVER_STAT>\n";
302  statbuf.close();
303 }
304 
305 template <typename Solver, typename Scalar>
306 void call_itersolver(Solver& solver, const int solver_id, const typename Solver::MatrixType& A,
308  std::string& statFile) {
309  solver.setTolerance(RelErr);
310  solver.setMaxIterations(MaximumIters);
311 
312  std::ofstream statbuf(statFile.c_str(), std::ios::app);
313  statbuf << " <SOLVER_STAT ID='" << solver_id << "'>\n";
314  call_solver(solver, solver_id, A, b, refX, statbuf);
315  statbuf << " <ITER> " << solver.iterations() << "</ITER>\n";
316  statbuf << " </SOLVER_STAT>\n";
317  std::cout << "ITERATIONS : " << solver.iterations() << "\n\n\n";
318 }
319 
320 template <typename Scalar>
322  const Matrix<Scalar, Dynamic, 1>& refX, std::string& statFile) {
324  // First, deal with Nonsymmetric and symmetric matrices
325  best_time_id = 0;
326  best_time_val = 0.0;
327 // UMFPACK
328 #ifdef EIGEN_UMFPACK_SUPPORT
329  {
330  cout << "Solving with UMFPACK LU ... \n";
332  call_directsolver(solver, EIGEN_UMFPACK, A, b, refX, statFile);
333  }
334 #endif
335 // KLU
336 #ifdef EIGEN_KLU_SUPPORT
337  {
338  cout << "Solving with KLU LU ... \n";
340  call_directsolver(solver, EIGEN_KLU, A, b, refX, statFile);
341  }
342 #endif
343  // SuperLU
344 #ifdef EIGEN_SUPERLU_SUPPORT
345  {
346  cout << "\nSolving with SUPERLU ... \n";
348  call_directsolver(solver, EIGEN_SUPERLU, A, b, refX, statFile);
349  }
350 #endif
351 
352  // PaStix LU
353 #ifdef EIGEN_PASTIX_SUPPORT
354  {
355  cout << "\nSolving with PASTIX LU ... \n";
357  call_directsolver(solver, EIGEN_PASTIX, A, b, refX, statFile);
358  }
359 #endif
360 
361  // PARDISO LU
362 #ifdef EIGEN_PARDISO_SUPPORT
363  {
364  cout << "\nSolving with PARDISO LU ... \n";
366  call_directsolver(solver, EIGEN_PARDISO, A, b, refX, statFile);
367  }
368 #endif
369 
370  // Eigen SparseLU METIS
371  cout << "\n Solving with Sparse LU AND COLAMD ... \n";
373  call_directsolver(solver, EIGEN_SPARSELU_COLAMD, A, b, refX, statFile);
374 // Eigen SparseLU METIS
375 #ifdef EIGEN_METIS_SUPPORT
376  {
377  cout << "\n Solving with Sparse LU AND METIS ... \n";
379  call_directsolver(solver, EIGEN_SPARSELU_METIS, A, b, refX, statFile);
380  }
381 #endif
382 
383  // BiCGSTAB
384  {
385  cout << "\nSolving with BiCGSTAB ... \n";
387  call_itersolver(solver, EIGEN_BICGSTAB, A, b, refX, statFile);
388  }
389  // BiCGSTAB+ILUT
390  {
391  cout << "\nSolving with BiCGSTAB and ILUT ... \n";
393  call_itersolver(solver, EIGEN_BICGSTAB_ILUT, A, b, refX, statFile);
394  }
395 
396  // GMRES
397  // {
398  // cout << "\nSolving with GMRES ... \n";
399  // GMRES<SpMat> solver;
400  // call_itersolver(solver, EIGEN_GMRES, A, b, refX,statFile);
401  // }
402  // GMRES+ILUT
403  {
404  cout << "\nSolving with GMRES and ILUT ... \n";
406  call_itersolver(solver, EIGEN_GMRES_ILUT, A, b, refX, statFile);
407  }
408 
409  // Hermitian and not necessarily positive-definites
410  if (sym != NonSymmetric) {
411  // Internal Cholesky
412  {
413  cout << "\nSolving with Simplicial LDLT ... \n";
415  call_directsolver(solver, EIGEN_SIMPLICIAL_LDLT, A, b, refX, statFile);
416  }
417 
418 // CHOLMOD
419 #ifdef EIGEN_CHOLMOD_SUPPORT
420  {
421  cout << "\nSolving with CHOLMOD LDLT ... \n";
423  solver.setMode(CholmodLDLt);
424  call_directsolver(solver, EIGEN_CHOLMOD_LDLT, A, b, refX, statFile);
425  }
426 #endif
427 
428 // PASTIX LLT
429 #ifdef EIGEN_PASTIX_SUPPORT
430  {
431  cout << "\nSolving with PASTIX LDLT ... \n";
433  call_directsolver(solver, EIGEN_PASTIX_LDLT, A, b, refX, statFile);
434  }
435 #endif
436 
437 // PARDISO LLT
438 #ifdef EIGEN_PARDISO_SUPPORT
439  {
440  cout << "\nSolving with PARDISO LDLT ... \n";
442  call_directsolver(solver, EIGEN_PARDISO_LDLT, A, b, refX, statFile);
443  }
444 #endif
445  }
446 
447  // Now, symmetric POSITIVE DEFINITE matrices
448  if (sym == SPD) {
449  // Internal Sparse Cholesky
450  {
451  cout << "\nSolving with SIMPLICIAL LLT ... \n";
453  call_directsolver(solver, EIGEN_SIMPLICIAL_LLT, A, b, refX, statFile);
454  }
455 
456 // CHOLMOD
457 #ifdef EIGEN_CHOLMOD_SUPPORT
458  {
459  // CholMOD SuperNodal LLT
460  cout << "\nSolving with CHOLMOD LLT (Supernodal)... \n";
462  solver.setMode(CholmodSupernodalLLt);
464  // CholMod Simplicial LLT
465  cout << "\nSolving with CHOLMOD LLT (Simplicial) ... \n";
466  solver.setMode(CholmodSimplicialLLt);
468  }
469 #endif
470 
471 // PASTIX LLT
472 #ifdef EIGEN_PASTIX_SUPPORT
473  {
474  cout << "\nSolving with PASTIX LLT ... \n";
476  call_directsolver(solver, EIGEN_PASTIX_LLT, A, b, refX, statFile);
477  }
478 #endif
479 
480 // PARDISO LLT
481 #ifdef EIGEN_PARDISO_SUPPORT
482  {
483  cout << "\nSolving with PARDISO LLT ... \n";
485  call_directsolver(solver, EIGEN_PARDISO_LLT, A, b, refX, statFile);
486  }
487 #endif
488 
489  // Internal CG
490  {
491  cout << "\nSolving with CG ... \n";
493  call_itersolver(solver, EIGEN_CG, A, b, refX, statFile);
494  }
495  // CG+IdentityPreconditioner
496  // {
497  // cout << "\nSolving with CG and IdentityPreconditioner ... \n";
498  // ConjugateGradient<SpMat, Lower, IdentityPreconditioner> solver;
499  // call_itersolver(solver,EIGEN_CG_PRECOND, A, b, refX,statFile);
500  // }
501  } // End SPD matrices
502 }
503 
504 /* Browse all the matrices available in the specified folder
505  * and solve the associated linear system.
506  * The results of each solve are printed in the standard output
507  * and optionally in the provided html file
508  */
509 template <typename Scalar>
510 void Browse_Matrices(const string folder, bool statFileExists, std::string& statFile, int maxiters, double tol) {
511  MaximumIters = maxiters; // Maximum number of iterations, global variable
512  RelErr = tol; // Relative residual error as stopping criterion for iterative solvers
513  MatrixMarketIterator<Scalar> it(folder);
514  for (; it; ++it) {
515  // print the infos for this linear system
516  if (statFileExists) {
517  std::ofstream statbuf(statFile.c_str(), std::ios::app);
518  statbuf << "<LINEARSYSTEM> \n";
519  statbuf << " <MATRIX> \n";
520  statbuf << " <NAME> " << it.matname() << " </NAME>\n";
521  statbuf << " <SIZE> " << it.matrix().rows() << " </SIZE>\n";
522  statbuf << " <ENTRIES> " << it.matrix().nonZeros() << "</ENTRIES>\n";
523  if (it.sym() != NonSymmetric) {
524  statbuf << " <SYMMETRY> Symmetric </SYMMETRY>\n";
525  if (it.sym() == SPD)
526  statbuf << " <POSDEF> YES </POSDEF>\n";
527  else
528  statbuf << " <POSDEF> NO </POSDEF>\n";
529 
530  } else {
531  statbuf << " <SYMMETRY> NonSymmetric </SYMMETRY>\n";
532  statbuf << " <POSDEF> NO </POSDEF>\n";
533  }
534  statbuf << " </MATRIX> \n";
535  statbuf.close();
536  }
537 
538  cout << "\n\n===================================================== \n";
539  cout << " ====== SOLVING WITH MATRIX " << it.matname() << " ====\n";
540  cout << " =================================================== \n\n";
542  if (it.hasrefX()) refX = it.refX();
543  // Call all suitable solvers for this linear system
544  SelectSolvers<Scalar>(it.matrix(), it.sym(), it.rhs(), refX, statFile);
545 
546  if (statFileExists) {
547  std::ofstream statbuf(statFile.c_str(), std::ios::app);
548  statbuf << " <BEST_SOLVER ID='" << best_time_id << "'></BEST_SOLVER>\n";
549  statbuf << " </LINEARSYSTEM> \n";
550  statbuf.close();
551  }
552  }
553 }
554 
555 bool get_options(int argc, char** args, string option, string* value = 0) {
556  int idx = 1, found = false;
557  while (idx < argc && !found) {
558  if (option.compare(args[idx]) == 0) {
559  found = true;
560  if (value) *value = args[idx + 1];
561  }
562  idx += 2;
563  }
564  return found;
565 }
BiCGSTAB< SparseMatrix< double > > solver
Definition: BiCGSTAB_simple.cpp:5
Array< double, 1, 3 > e(1./3., 0.5, 2.)
Eigen::SparseMatrix< double > SpMat
Definition: Tutorial_sparse_example.cpp:5
Scalar * b
Definition: benchVecAdd.cpp:17
MatrixXf MatrixType
Definition: benchmark-blocking-sizes.cpp:52
Definition: BenchTimer.h:55
A bi conjugate gradient stabilized solver for sparse square problems.
Definition: BiCGSTAB.h:153
A general Cholesky factorization and solver based on Cholmod.
Definition: CholmodSupport.h:689
A conjugate gradient solver for sparse (or dense) self-adjoint problems.
Definition: ConjugateGradient.h:152
A GMRES solver for sparse square problems.
Definition: GMRES.h:255
Definition: KLUSupport.h:70
Iterator to browse matrices from a specified folder.
Definition: MatrixMarketIterator.h:42
bool hasrefX()
Definition: MatrixMarketIterator.h:152
VectorType & refX()
Definition: MatrixMarketIterator.h:132
std::string & matname()
Definition: MatrixMarketIterator.h:147
VectorType & rhs()
Definition: MatrixMarketIterator.h:103
MatrixType & matrix()
Definition: MatrixMarketIterator.h:70
int sym()
Definition: MatrixMarketIterator.h:149
The matrix class, also used for vectors and row-vectors.
Definition: Eigen/Eigen/src/Core/Matrix.h:186
A sparse direct Cholesky (LDLT) factorization and solver based on the PARDISO library.
Definition: PardisoSupport.h:467
A sparse direct Cholesky (LLT) factorization and solver based on the PARDISO library.
Definition: PardisoSupport.h:413
A sparse direct LU factorization and solver based on the PARDISO library.
Definition: PardisoSupport.h:365
A sparse direct supernodal Cholesky (LLT) factorization and solver based on the PaStiX library.
Definition: PaStiXSupport.h:572
A sparse direct supernodal Cholesky (LLT) factorization and solver based on the PaStiX library.
Definition: PaStiXSupport.h:497
Interface to the PaStix solver.
Definition: PaStiXSupport.h:398
A direct sparse LDLT Cholesky factorizations without square root.
Definition: SimplicialCholesky.h:453
A direct sparse LLT Cholesky factorizations.
Definition: SimplicialCholesky.h:371
Sparse supernodal LU factorization for general matrices.
Definition: SparseLU.h:151
Index nonZeros() const
Definition: SparseCompressedBase.h:64
Index rows() const
Definition: SparseMatrix.h:159
A sparse direct LU factorization and solver based on the SuperLU library.
Definition: SuperLUSupport.h:431
A sparse LU factorization and solver based on UmfPack.
Definition: UmfPackSupport.h:302
@ NumericalIssue
Definition: Constants.h:442
@ Success
Definition: Constants.h:440
Namespace containing all symbols from the Eigen library.
Definition: bench_norm.cpp:70
NumTraits< T >::Real test_precision()
Definition: main.h:412
squared absolute value
Definition: GlobalFunctions.h:87
@ NonSymmetric
Definition: MatrixMarketIterator.h:19
@ SPD
Definition: MatrixMarketIterator.h:19
float test_precision< float >()
Definition: main.h:416
double test_precision< double >()
Definition: main.h:420
@ CholmodSimplicialLLt
Definition: CholmodSupport.h:237
@ CholmodLDLt
Definition: CholmodSupport.h:237
@ CholmodSupernodalLLt
Definition: CholmodSupport.h:237
bool found
Definition: MergeRestartFiles.py:24
args
Definition: compute_granudrum_aor.py:143
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286
list x
Definition: plotDoE.py:28
double timer
Definition: oomph_metis_from_parmetis_3.1.1/struct.h:210
#define EIGEN_PASTIX_LLT
Definition: spbenchsolver.h:74
void call_itersolver(Solver &solver, const int solver_id, const typename Solver::MatrixType &A, const Matrix< Scalar, Dynamic, 1 > &b, const Matrix< Scalar, Dynamic, 1 > &refX, std::string &statFile)
Definition: spbenchsolver.h:306
void call_directsolver(Solver &solver, const int solver_id, const typename Solver::MatrixType &A, const Matrix< Scalar, Dynamic, 1 > &b, const Matrix< Scalar, Dynamic, 1 > &refX, std::string &statFile)
Definition: spbenchsolver.h:295
#define EIGEN_KLU
Definition: spbenchsolver.h:57
bool get_options(int argc, char **args, string option, string *value=0)
Definition: spbenchsolver.h:555
#define EIGEN_PASTIX_LDLT
Definition: spbenchsolver.h:69
#define EIGEN_CHOLMOD_SUPERNODAL_LLT
Definition: spbenchsolver.h:72
#define EIGEN_CHOLMOD_SIMPLICIAL_LLT
Definition: spbenchsolver.h:73
#define EIGEN_PARDISO
Definition: spbenchsolver.h:60
void call_solver(Solver &solver, const int solver_id, const typename Solver::MatrixType &A, const Matrix< Scalar, Dynamic, 1 > &b, const Matrix< Scalar, Dynamic, 1 > &refX, std::ofstream &statbuf)
Definition: spbenchsolver.h:236
#define EIGEN_PASTIX
Definition: spbenchsolver.h:59
#define EIGEN_SIMPLICIAL_LDLT
Definition: spbenchsolver.h:67
#define EIGEN_SUPERLU
Definition: spbenchsolver.h:58
int MaximumIters
Definition: spbenchsolver.h:83
#define EIGEN_SPARSELU_METIS
Definition: spbenchsolver.h:62
void SelectSolvers(const SparseMatrix< Scalar > &A, unsigned int sym, Matrix< Scalar, Dynamic, 1 > &b, const Matrix< Scalar, Dynamic, 1 > &refX, std::string &statFile)
Definition: spbenchsolver.h:321
double RelErr
Definition: spbenchsolver.h:84
#define EIGEN_BICGSTAB
Definition: spbenchsolver.h:63
#define EIGEN_SPARSELU_COLAMD
Definition: spbenchsolver.h:61
#define EIGEN_CHOLMOD_LDLT
Definition: spbenchsolver.h:68
#define EIGEN_PARDISO_LDLT
Definition: spbenchsolver.h:70
#define EIGEN_SIMPLICIAL_LLT
Definition: spbenchsolver.h:71
#define EIGEN_PARDISO_LLT
Definition: spbenchsolver.h:75
int best_time_id
Definition: spbenchsolver.h:86
#define EIGEN_CG
Definition: spbenchsolver.h:76
double best_time_val
Definition: spbenchsolver.h:85
void printStatheader(std::ofstream &out)
Definition: spbenchsolver.h:109
void Browse_Matrices(const string folder, bool statFileExists, std::string &statFile, int maxiters, double tol)
Definition: spbenchsolver.h:510
#define EIGEN_BICGSTAB_ILUT
Definition: spbenchsolver.h:64
#define EIGEN_GMRES_ILUT
Definition: spbenchsolver.h:66
#define EIGEN_UMFPACK
Definition: spbenchsolver.h:56
void printBenchStyle(std::ofstream &out)
Definition: spbenchstyle.h:13
Holds information about the various numeric (i.e. scalar) types allowed by Eigen.
Definition: NumTraits.h:217
std::ofstream out("Result.txt")