mlpack
run_set_visitor.hpp
Go to the documentation of this file.
1 
14 #ifndef MLPACK_METHODS_ANN_VISITOR_RUN_SET_VISITOR_HPP
15 #define MLPACK_METHODS_ANN_VISITOR_RUN_SET_VISITOR_HPP
16 
18 
19 #include <boost/variant.hpp>
20 
21 namespace mlpack {
22 namespace ann {
23 
28 class RunSetVisitor : public boost::static_visitor<void>
29 {
30  public:
32  RunSetVisitor(const bool run = true);
33 
35  template<typename LayerType>
36  void operator()(LayerType* layer) const;
37 
38  void operator()(MoreTypes layer) const;
39 
40  private:
42  const bool run;
43 
46  template<typename T>
47  typename std::enable_if<
48  HasRunCheck<T, bool&(T::*)(void)>::value &&
49  HasModelCheck<T>::value, void>::type
50  LayerRun(T* layer) const;
51 
54  template<typename T>
55  typename std::enable_if<
56  !HasRunCheck<T, bool&(T::*)(void)>::value &&
57  HasModelCheck<T>::value, void>::type
58  LayerRun(T* layer) const;
59 
62  template<typename T>
63  typename std::enable_if<
64  HasRunCheck<T, bool&(T::*)(void)>::value &&
65  !HasModelCheck<T>::value, void>::type
66  LayerRun(T* layer) const;
67 
70  template<typename T>
71  typename std::enable_if<
72  !HasRunCheck<T, bool&(T::*)(void)>::value &&
73  !HasModelCheck<T>::value, void>::type
74  LayerRun(T* layer) const;
75 };
76 
77 } // namespace ann
78 } // namespace mlpack
79 
80 // Include implementation.
81 #include "run_set_visitor_impl.hpp"
82 
83 #endif
RunSetVisitor set the run parameter given the run value.
Definition: run_set_visitor.hpp:28
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1
void operator()(LayerType *layer) const
Set the run parameter.
Definition: run_set_visitor_impl.hpp:29
RunSetVisitor(const bool run=true)
Set the run parameter given the current run value.
Definition: run_set_visitor_impl.hpp:22