PreconditionerInterface.hpp 862 Bytes
Newer Older
1
2
3
4
#pragma once

namespace AMDiS
{
5
6
  /// Interface for Preconditioner types
  template <class Matrix, class VectorX, class VectorB = VectorX>
7
8
9
10
11
12
13
14
15
16
17
  struct PreconditionerInterface
  {
    /// Virtual destructor.
    virtual ~PreconditionerInterface() {}
    
    /// Is called a the beginning of a solution procedure
    virtual void init(Matrix const& fullMatrix) = 0;
    
    /// Is called at the end of a solution procedure
    virtual void exit() = 0;

18
19
    /// Apply the preconditioner to a vector \p b and store the result in \p x
    virtual void solve(VectorB const& b, VectorX& x) const = 0;
20
    
21
22
    /// Apply the transposed preconditioner to a vector \p b and store the result in \p x
    virtual void adjointSolve(VectorB const& b, VectorX& x) const
23
24
25
    {
      AMDIS_ERROR_EXIT("Must be implemented by derived class.");
    }
26
27
28
  };

} // end namespace AMDiS