mlpack
copy_visitor_impl.hpp
Go to the documentation of this file.
1 
12 #ifndef MLPACK_METHODS_ANN_VISITOR_COPY_VISITOR_IMPL_HPP
13 #define MLPACK_METHODS_ANN_VISITOR_COPY_VISITOR_IMPL_HPP
14 
16 #include <boost/variant.hpp>
17 
18 namespace mlpack {
19 namespace ann {
20 
21 template <typename... CustomLayers>
22 template <typename LayerType>
23 inline LayerTypes<CustomLayers...>
24 CopyVisitor<CustomLayers...>::operator()(LayerType* layer) const
25 {
26  return new LayerType(*layer);
27 }
28 
29 template <typename... CustomLayers>
30 inline LayerTypes<CustomLayers...>
31 CopyVisitor<CustomLayers...>::operator()(MoreTypes layer) const
32 {
33  return layer.apply_visitor(*this);
34 }
35 
36 } // namespace ann
37 } // namespace mlpack
38 
39 #endif
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1