reset_cell_visitor.hpp
Go to the documentation of this file.
1 
12 #ifndef MLPACK_METHODS_ANN_VISITOR_RESET_CELL_VISITOR_HPP
13 #define MLPACK_METHODS_ANN_VISITOR_RESET_CELL_VISITOR_HPP
14 
17 
18 #include <boost/variant.hpp>
19 
20 namespace mlpack {
21 namespace ann {
22 
26 class ResetCellVisitor : public boost::static_visitor<void>
27 {
28  public:
30  ResetCellVisitor(const size_t size);
31 
33  template<typename LayerType>
34  void operator()(LayerType* layer) const;
35 
36  private:
37  size_t size;
38 
41  template<typename T>
42  typename std::enable_if<
43  HasResetCellCheck<T, void(T::*)(const size_t)>::value, void>::type
44  ResetCell(T* layer) const;
45 
47  // the Reset() or Model() function.
48  template<typename T>
49  typename std::enable_if<
50  !HasResetCellCheck<T, void(T::*)(const size_t)>::value, void>::type
51  ResetCell(T* layer) const;
52 };
53 
54 } // namespace ann
55 } // namespace mlpack
56 
57 // Include implementation.
58 #include "reset_cell_visitor_impl.hpp"
59 
60 #endif
ResetCellVisitor executes the ResetCell() function.
.hpp
Definition: add_to_po.hpp:21
ResetCellVisitor(const size_t size)
Reset the cell using the given size.
void operator()(LayerType *layer) const
Execute the ResetCell() function.