PFASST++
encapsulation.hpp
Go to the documentation of this file.
1 
5 #ifndef _PFASST_ENCAPSULATED_HPP_
6 #define _PFASST_ENCAPSULATED_HPP_
7 
8 #include <memory>
9 #include <vector>
10 using namespace std;
11 
12 #include <Eigen/Dense>
13 
14 template<typename scalar>
15 using Matrix = Eigen::Matrix<scalar, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor>;
16 
17 #include "pfasst/interfaces.hpp"
18 
19 
20 namespace pfasst
21 {
27  namespace encap
28  {
30  typedef enum EncapType { solution, function } EncapType;
31 
40  template<typename time = time_precision>
42  {
43  public:
45  virtual ~Encapsulation();
47 
49  // required for host based encap helpers
53  virtual void zero();
54 
60  virtual void copy(shared_ptr<const Encapsulation<time>> other);
62 
64 
69  virtual time norm0() const;
71 
73 
83  virtual void saxpy(time a, shared_ptr<const Encapsulation<time>> x);
84 
103  virtual void mat_apply(vector<shared_ptr<Encapsulation<time>>> dst,
104  time a, Matrix<time> mat,
105  vector<shared_ptr<Encapsulation<time>>> src,
106  bool zero = true);
108 
110  // required for time-parallel communications
117  virtual void post(ICommunicator* comm, int tag);
118 
126  virtual void send(ICommunicator* comm, int tag, bool blocking);
127 
135  virtual void recv(ICommunicator* comm, int tag, bool blocking);
136 
142  virtual void broadcast(ICommunicator* comm);
144  };
145 
146 
160  template<typename time = time_precision>
162  {
163  public:
169  virtual shared_ptr<Encapsulation<time>> create(const EncapType type) = 0;
170  };
171  } // ::pfasst::encap
172 } // ::pfasst
173 
175 
176 #endif
static void zero(vector< precision > &data)
enum pfasst::encap::EncapType EncapType
STL namespace.
Abstract interface of factory for creating Encapsulation objects.
interfaces for SDC/MLSDC/PFASST algorithms.
Data/solution encapsulation.
Abstract interface for communicators.
Definition: interfaces.hpp:70
Eigen::Matrix< scalar, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > Matrix
static precision norm0(const vector< precision > &data)