LinearSolverInterface.hpp 1.4 KB
 Praetorius, Simon committed Mar 21, 2016 1 2 3 4 5 6 7 8 9 10 11 12 13 ``````#pragma once /** \file LinearSolverInterface.h */ /** * \defgroup Solver Solver module * @{ @} * * \brief * Contains all classes needed for solving linear and non linear equation * systems. */ `````` Praetorius, Simon committed Mar 22, 2016 14 15 ``````#include #include `````` Praetorius, Simon committed Mar 21, 2016 16 `````` `````` Praetorius, Simon committed Mar 22, 2016 17 18 19 ``````namespace AMDiS { /// Abstract base class for linear solvers `````` Praetorius, Simon committed Mar 21, 2016 20 21 `````` template class LinearSolverInterface `````` Praetorius, Simon committed Mar 22, 2016 22 `````` { `````` Praetorius, Simon committed Mar 21, 2016 23 24 25 26 27 28 29 30 31 32 33 34 35 36 `````` /// Destructor. virtual ~LinearSolverInterface() {} /// Public method to call in order to solve a linear system Ax = b. /** * The method redirects to the specific linear solver and prints statistics * and error estimations at the end. * * The parameters correspond to * \p A A block-matrix that represents the system-matrix. * \p x A block-vector for the unknown components. * \p b A block-vector for the right-hand side of the linear system. **/ void solve(Matrix const& A, VectorX& x, VectorB const& b, `````` Praetorius, Simon committed Mar 22, 2016 37 `````` SolverStatistics& statistics) `````` Praetorius, Simon committed Mar 21, 2016 38 `````` { `````` Praetorius, Simon committed Mar 22, 2016 39 `````` solveImpl(A, x, b, statistics); `````` Praetorius, Simon committed Mar 21, 2016 40 41 42 43 44 45 `````` } private: /// main methods that all solvers must implement virtual void solveImpl(Matrix const& A, VectorX& x, VectorB const& b, `````` Praetorius, Simon committed Mar 22, 2016 46 `````` SolverStatistics& statistics) = 0; `````` Praetorius, Simon committed Mar 21, 2016 47 48 49 50 `````` }; } // end namespace AMDiS ``````