AMDiS  0.1 The Adaptive Multi-Dimensional Simulation Toolbox
LinearSolverInterface.hpp
1 #pragma once
2
3 #include <amdis/Output.hpp>
4 #include <amdis/linearalgebra/RunnerInterface.hpp>
5
15 namespace AMDiS
16 {
17  class SolverInfo;
18
19  template <class T, template <class> class MatrixImpl>
21
22  template <class T, template <class> class VectorImpl>
24
26  template <class Mat, class Vec>
28  {
29  public:
31  virtual ~LinearSolverInterface() = default;
32
34
43  template <class TA, class TX, class TY, template <class> class MI, template <class> class VI>
45  {
46  solveImpl(A.impl(), x.impl(), b.impl(), solverInfo);
47  }
48
49  virtual RunnerInterface<Mat,Vec>* runner()
50  {
51  error_exit("Must be implemented by derived class.");
52  return nullptr;
53  }
54
55  protected:
57  virtual void solveImpl(Mat const& A, Vec& x, Vec const& b, SolverInfo& solverInfo) = 0;
58  };
59
60 } // end namespace AMDiS
virtual ~LinearSolverInterface()=default
Destructor.
The basic container that stores a base vector and a corresponding basis.
Definition: LinearSolverInterface.hpp:23
void error_exit(std::string const &str, Args &&... args)
print a message and exit
Definition: Output.hpp:142
void solve(MatrixFacade< TA, MI > const &A, VectorFacade< TX, VI > &x, VectorFacade< TY, VI > const &b, SolverInfo &solverInfo)
Public method to call in order to solve a linear system Ax = b.
Definition: LinearSolverInterface.hpp:44
virtual void solveImpl(Mat const &A, Vec &x, Vec const &b, SolverInfo &solverInfo)=0
main methods that all solvers must implement
Contains all classes needed for solving linear and non linear equation systems.