1 #ifndef STAN_MCMC_HMC_HAMILTONIANS_PS_POINT_HPP
2 #define STAN_MCMC_HMC_HAMILTONIANS_PS_POINT_HPP
5 #include <stan/math/prim/mat/fun/Eigen.hpp>
6 #include <boost/lexical_cast.hpp>
22 :
q(n),
p(n),
V(0),
g(n) {}
25 :
q(z.
q.size()),
p(z.
p.size()),
V(z.
V),
g(z.
g.size()) {
26 fast_vector_copy_<double>(
q, z.
q);
27 fast_vector_copy_<double>(
p, z.
p);
28 fast_vector_copy_<double>(
g, z.
g);
35 fast_vector_copy_<double>(
q, z.
q);
39 fast_vector_copy_<double>(
p, z.
p);
40 fast_vector_copy_<double>(
g, z.
g);
52 std::vector<std::string>& names) {
53 for (
int i = 0; i < q.size(); ++i)
54 names.push_back(model_names.at(i));
55 for (
int i = 0; i < q.size(); ++i)
56 names.push_back(std::string(
"p_") + model_names.at(i));
57 for (
int i = 0; i < q.size(); ++i)
58 names.push_back(std::string(
"g_") + model_names.at(i));
62 for (
int i = 0; i < q.size(); ++i)
63 values.push_back(q(i));
64 for (
int i = 0; i < q.size(); ++i)
65 values.push_back(p(i));
66 for (
int i = 0; i < q.size(); ++i)
67 values.push_back(g(i));
82 const Eigen::Matrix<T, Dynamic, 1>& v_from) {
83 int sz = v_from.size();
86 std::memcpy(&v_to(0), &v_from(0), v_from.size() *
sizeof(double));
92 const Eigen::Matrix<T, Dynamic, Dynamic>& v_from) {
93 int nr = v_from.rows();
94 int nc = v_from.cols();
97 std::memcpy(&v_to(0), &v_from(0), v_from.size() *
sizeof(double));
virtual void get_params(std::vector< double > &values)
ps_point & operator=(const ps_point &z)
Probability, optimization and sampling library.
Point in a generic phase space.
virtual void get_param_names(std::vector< std::string > &model_names, std::vector< std::string > &names)
base_writer is an abstract base class defining the interface for Stan writer callbacks.
virtual void write_metric(stan::interface_callbacks::writer::base_writer &writer)
Writes the metric.
ps_point(const ps_point &z)
friend class ps_point_test
static void fast_matrix_copy_(Eigen::Matrix< T, Dynamic, Dynamic > &v_to, const Eigen::Matrix< T, Dynamic, Dynamic > &v_from)
static void fast_vector_copy_(Eigen::Matrix< T, Dynamic, 1 > &v_to, const Eigen::Matrix< T, Dynamic, 1 > &v_from)