PARALUTION  1.0.0
PARALUTION
preconditioner_as.hpp
Go to the documentation of this file.
1 #ifndef PARALUTION_PRECONDITIONER_AS_HPP_
2 #define PARALUTION_PRECONDITIONER_AS_HPP_
3 
4 #include "preconditioner.hpp"
5 
6 namespace paralution {
7 
9 template <class OperatorType, class VectorType, typename ValueType>
10 class AS : public Preconditioner<OperatorType, VectorType, ValueType> {
11 
12 public:
13 
14  AS();
15  virtual ~AS();
16 
17  virtual void Print(void) const;
18  virtual void Set(const int nb, const int overlap,
20 
21  virtual void Solve(const VectorType &rhs,
22  VectorType *x);
23 
24 
25  virtual void Build(void);
26  virtual void Clear(void);
27 
28 protected:
29 
30  virtual void MoveToHostLocalData_(void);
31  virtual void MoveToAcceleratorLocalData_(void) ;
32 
34  int overlap_;
35  int *pos_;
36  int *sizes_; // with overlap
37 
39 
40  OperatorType **local_mat_;
41  VectorType **r_;
42  VectorType **z_;
43  VectorType weight_;
44 
45 };
46 
48 template <class OperatorType, class VectorType, typename ValueType>
49 class RAS : public AS<OperatorType, VectorType, ValueType> {
50 
51 public:
52 
53  RAS();
54  virtual ~RAS();
55 
56  virtual void Print(void) const;
57 
58  virtual void Solve(const VectorType &rhs,
59  VectorType *x);
60 
61 };
62 
63 
64 }
65 
66 #endif // PARALUTION_PRECONDITIONER_AS_HPP_
int overlap_
Definition: preconditioner_as.hpp:34
virtual void Solve(const VectorType &rhs, VectorType *x)
Solve Operator x = rhs.
Definition: preconditioner_as.cpp:215
int * sizes_
Definition: preconditioner_as.hpp:36
VectorType weight_
Definition: preconditioner_as.hpp:43
virtual void MoveToHostLocalData_(void)
Move all local data to the host.
Definition: preconditioner_as.cpp:258
virtual ~RAS()
Definition: preconditioner_as.cpp:308
virtual void Print(void) const
Print information about the solver.
Definition: preconditioner_as.cpp:316
VectorType ** z_
Definition: preconditioner_as.hpp:42
OperatorType ** local_mat_
Definition: preconditioner_as.hpp:40
virtual void MoveToAcceleratorLocalData_(void)
Move all local data to the accelerator.
Definition: preconditioner_as.cpp:279
VectorType ** r_
Definition: preconditioner_as.hpp:41
int num_blocks_
Definition: preconditioner_as.hpp:33
Solver< OperatorType, VectorType, ValueType > ** local_precond_
Definition: preconditioner_as.hpp:38
AS preconditioner.
Definition: preconditioner_as.hpp:49
Base preconditioner class.
Definition: preconditioner.hpp:10
virtual void Print(void) const
Print information about the solver.
Definition: preconditioner_as.cpp:41
AS preconditioner.
Definition: preconditioner_as.hpp:10
virtual void Solve(const VectorType &rhs, VectorType *x)
Solve Operator x = rhs.
Definition: preconditioner_as.cpp:334
virtual ~AS()
Definition: preconditioner_as.cpp:31
Definition: backend_manager.cpp:43
RAS()
Definition: preconditioner_as.cpp:300
const IndexType const IndexType const IndexType const ValueType const ValueType const ValueType * x
Definition: cuda_kernels_coo.hpp:91
virtual void Clear(void)
Clear (free all local data) the solver.
Definition: preconditioner_as.cpp:166
The base class for all solvers and preconditioners.
Definition: solver.hpp:12
virtual void Build(void)
Build the solver (data allocation, structure computation, numerical computation)
Definition: preconditioner_as.cpp:84
AS()
Definition: preconditioner_as.cpp:16
int * pos_
Definition: preconditioner_as.hpp:35
virtual void Set(const int nb, const int overlap, Solver< OperatorType, VectorType, ValueType > **preconds)
Definition: preconditioner_as.cpp:58