32 #ifndef VSMC_SMP_ADAPTER_HPP
33 #define VSMC_SMP_ADAPTER_HPP
42 template <
typename T,
template <
typename,
typename>
class Impl,
typename F>
43 class InitializeAdapter :
44 public InitializeAdapterBase<T, F,
45 Impl<T, InitializeAdapter<T, Impl, F> > >
48 Impl<T, InitializeAdapter<T, Impl, F> > > base;
62 template <
typename T,
template <
typename,
typename>
class Impl,
typename F>
64 public MoveAdapterBase<T, F,
65 Impl<T, MoveAdapter<T, Impl, F> > >
68 Impl<T, MoveAdapter<T, Impl, F> > > base;
82 template <
typename T,
template <
typename,
typename>
class Impl,
typename F>
83 class MonitorEvalAdapter :
84 public MonitorEvalAdapterBase<T, F,
85 Impl<T, MonitorEvalAdapter<T, Impl, F> > >
88 Impl<T, MonitorEvalAdapter<T, Impl, F> > > base;
103 template <
typename T,
template <
typename,
typename>
class Impl,
typename F>
104 class PathEvalAdapter :
105 public PathEvalAdapterBase<T, F,
106 Impl<T, PathEvalAdapter<T, Impl, F> > >
109 Impl<T, PathEvalAdapter<T, Impl, F> > > base;
123 template <
typename T,
template <
typename,
typename>
class Impl>
126 Impl<T, InitializeAdapter<T, Impl, NullType> > >
129 Impl<T, InitializeAdapter<T, Impl, NullType> > >
base;
133 typedef cxx11::function<std::size_t (SingleParticle<T>)>
140 const initialize_param_type &init_param = initialize_param_type(),
141 const pre_processor_type &pre = pre_processor_type(),
142 const post_processor_type &post = post_processor_type()) :
143 base(init_param, pre, post), initialize_state_(init_state) {}
146 {
return initialize_state_(part);}
150 const initialize_state_type initialize_state_;
155 template <
typename T,
template <
typename,
typename>
class Impl>
158 Impl<T, MoveAdapter<T, Impl, NullType> > >
161 Impl<T, MoveAdapter<T, Impl, NullType> > > base;
165 typedef cxx11::function<std::size_t (std::size_t, SingleParticle<T>)>
171 const pre_processor_type &pre = pre_processor_type(),
172 const post_processor_type &post = post_processor_type()) :
173 base(pre, post), move_state_(move_state) {}
176 {
return move_state_(iter, part);}
180 const move_state_type move_state_;
185 template <
typename T,
template <
typename,
typename>
class Impl>
188 Impl<T, MonitorEvalAdapter<T, Impl, NullType> > >
191 Impl<T, MonitorEvalAdapter<T, Impl, NullType> > > base;
195 typedef cxx11::function<
202 const pre_processor_type &pre = pre_processor_type(),
203 const post_processor_type &post = post_processor_type()) :
204 base(pre, post), monitor_state_(monitor_state) {}
208 {monitor_state_(iter, dim, part, res);}
212 const monitor_state_type monitor_state_;
217 template <
typename T,
template <
typename,
typename>
class Impl>
220 Impl<T, PathEvalAdapter<T, Impl, NullType> > >
223 Impl<T, PathEvalAdapter<T, Impl, NullType> > > base;
227 typedef cxx11::function<double (std::size_t, ConstSingleParticle<T>)>
235 const pre_processor_type &pre = pre_processor_type(),
236 const post_processor_type &post = post_processor_type()) :
237 base(path_grid, pre, post), path_state_(path_state) {}
240 {
return path_state_(iter, part);}
244 const path_state_type path_state_;
249 #endif // VSMC_SMP_ADAPTER_HPP
std::size_t move_state(std::size_t iter, SingleParticle< T > part)
cxx11::function< void(std::size_t, std::size_t, ConstSingleParticle< T >, double *)> monitor_state_type
base::post_processor_type post_processor_type
InitializeAdapter(const F &f)
cxx11::function< std::size_t(std::size_t, SingleParticle< T >)> move_state_type
cxx11::function< double(std::size_t, ConstSingleParticle< T >)> path_state_type
MonitorEvalAdapter(const monitor_state_type &monitor_state, const pre_processor_type &pre=pre_processor_type(), const post_processor_type &post=post_processor_type())
double path_state(std::size_t iter, ConstSingleParticle< T > part)
std::size_t initialize_state(SingleParticle< T > part)
Path evaluation class base.
Initialize class adapter base.
Path evaluation class adapter.
void monitor_state(std::size_t iter, std::size_t dim, ConstSingleParticle< T > part, double *res)
InitializeAdapter(const initialize_state_type &init_state, const initialize_param_type &init_param=initialize_param_type(), const pre_processor_type &pre=pre_processor_type(), const post_processor_type &post=post_processor_type())
base::initialize_param_type initialize_param_type
base::post_processor_type post_processor_type
PathEvalAdapter(const path_state_type &path_state, const path_grid_type &path_grid, const pre_processor_type &pre=pre_processor_type(), const post_processor_type &post=post_processor_type())
PathEvalAdapter(const F &f)
MoveAdapter(const move_state_type &move_state, const pre_processor_type &pre=pre_processor_type(), const post_processor_type &post=post_processor_type())
MonitorEvalAdapter(const F &f)
base::post_processor_type post_processor_type
base::pre_processor_type pre_processor_type
double path_grid(std::size_t iter, const Particle< T > &particle)
double path_state(std::size_t iter, ConstSingleParticle< T > part)
std::size_t initialize_state(SingleParticle< T > part)
cxx11::function< std::size_t(SingleParticle< T >)> initialize_state_type
base::pre_processor_type pre_processor_type
base::path_grid_type path_grid_type
void monitor_state(std::size_t iter, std::size_t dim, ConstSingleParticle< T > part, double *res)
base::pre_processor_type pre_processor_type
Monitor evaluation class adapter.
A thin wrapper over a complete Particle.
base::pre_processor_type pre_processor_type
base::post_processor_type post_processor_type
Initialize class adapter.
A const variant to SingleParticle.
std::size_t move_state(std::size_t iter, SingleParticle< T > part)