RunnerInterface.hpp 813 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#pragma once

#include <dune/amdis/linear_algebra/SolverStatistics.hpp>

namespace AMDiS
{
  /// base-class for Runner / Worker types
  template <class Matrix, class Vector>
  struct RunnerInterface
  {
    // virtual destructor
    virtual ~RunnerInterface() {}

    /// Is called at the beginning of a solution procedure
    virtual void init(Matrix const& A) = 0;

    /// Is called at the end of a solution procedure
    virtual void exit() = 0;

    /// Solve the system A*x = b
    virtual int solve(Matrix const& A, Vector& x, Vector const& b, 
                      SolverStatistics& stat) = 0;

    /// Solve the adjoint system A^T*x = b
    virtual int adjoint_solve(Matrix const& A, Vector& x, Vector const& b, 
                              SolverStatistics& stat) = 0;
  };

} // end namespace AMDiS