Stan  2.10.0
probability, sampling & optimization
deep_copy.hpp
Go to the documentation of this file.
1 #ifndef STAN_MODEL_INDEXING_DEEP_COPY_HPP
2 #define STAN_MODEL_INDEXING_DEEP_COPY_HPP
3 
4 #include <Eigen/Dense>
5 #include <vector>
6 
7 namespace stan {
8 
9  namespace model {
10 
23  template <typename T>
24  inline const T& deep_copy(const T& x) {
25  return x;
26  }
27 
42  template <typename T, int R, int C>
43  inline Eigen::Matrix<T, R, C> deep_copy(const Eigen::Matrix<T, R, C>& a) {
44  Eigen::Matrix<T, R, C> result(a);
45  return result;
46  }
47 
60  template <typename T>
61  inline std::vector<T> deep_copy(const std::vector<T>& v) {
62  std::vector<T> result(v);
63  return result;
64  }
65 
66  }
67 }
68 #endif
Probability, optimization and sampling library.
const T & deep_copy(const T &x)
Return the specified argument as a constant reference.
Definition: deep_copy.hpp:24

     [ Stan Home Page ] © 2011–2016, Stan Development Team.