PFASST++
encapsulation_impl.hpp
Go to the documentation of this file.
2 
3 #include "pfasst/globals.hpp"
4 
5 
6 namespace pfasst
7 {
8  namespace encap
9  {
10  template<typename time>
12  {}
13 
17  template<typename time>
19  {
20  throw NotImplementedYet("encap");
21  }
22 
26  template<typename time>
28  {
29  throw NotImplementedYet("encap");
30  }
31 
35  template<typename time>
37  {
38  throw NotImplementedYet("encap");
39  }
40 
44  template<typename time>
45  void Encapsulation<time>::saxpy(time a, shared_ptr<const Encapsulation<time>> x)
46  {
47  UNUSED(a); UNUSED(x);
48  throw NotImplementedYet("encap");
49  }
50 
59  template<typename time>
61  time a, Matrix<time> mat,
62  vector<shared_ptr<Encapsulation<time>>> src,
63  bool zero)
64  {
65  size_t ndst = dst.size();
66  size_t nsrc = src.size();
67 
68  if (zero) {
69  for (auto elem : dst) { elem->zero(); }
70  }
71 
72  for (size_t n = 0; n < ndst; n++) {
73  for (size_t m = 0; m < nsrc; m++) {
74  auto s = mat(n, m);
75  if (s != 0.0) {
76  dst[n]->saxpy(a*s, src[m]);
77  }
78  }
79  }
80  }
81 
82  template<typename time>
84  {
85  UNUSED(comm); UNUSED(tag);
86  }
87 
91  template<typename time>
92  void Encapsulation<time>::send(ICommunicator* comm, int tag, bool blocking)
93  {
94  UNUSED(comm); UNUSED(tag); UNUSED(blocking);
95  throw NotImplementedYet("pfasst");
96  }
97 
101  template<typename time>
102  void Encapsulation<time>::recv(ICommunicator* comm, int tag, bool blocking)
103  {
104  UNUSED(comm); UNUSED(tag); UNUSED(blocking);
105  throw NotImplementedYet("pfasst");
106  }
107 
111  template<typename time>
113  {
114  UNUSED(comm);
115  throw NotImplementedYet("pfasst");
116  }
117  } // ::pfasst::encap
118 } // ::pfasst
static void zero(vector< precision > &data)
virtual void broadcast(ICommunicator *comm)
Broadcasting this data structure to all processes in comm.
virtual void saxpy(time a, shared_ptr< const Encapsulation< time >> x)
Provides basic mathematical operation \( y+=ax \).
Not implemented yet exception.
Definition: interfaces.hpp:29
virtual void zero()
Zeroes out all values of this data structure.
virtual void copy(shared_ptr< const Encapsulation< time >> other)
Copies values from other into this data structure.
virtual void mat_apply(vector< shared_ptr< Encapsulation< time >>> dst, time a, Matrix< time > mat, vector< shared_ptr< Encapsulation< time >>> src, bool zero=true)
Defines matrix-vector multiplication for this data type.
virtual void recv(ICommunicator *comm, int tag, bool blocking)
Receive values to store in this data structure.
virtual void send(ICommunicator *comm, int tag, bool blocking)
Send values stored in this data structure.
Data/solution encapsulation.
#define UNUSED(expr)
Denoting unused function parameters for omitting compiler warnings.
Definition: globals.hpp:32
Abstract interface for communicators.
Definition: interfaces.hpp:70
Eigen::Matrix< scalar, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > Matrix
virtual void post(ICommunicator *comm, int tag)
virtual time norm0() const
Computes the \( 0 \)-norm of the data structure's values.