Public Member Functions | Public Attributes | Static Protected Member Functions | Friends | List of all members
stan::mcmc::ps_point Class Reference

#include "stan/mcmc/hmc/hamiltonians/ps_point.hpp"

Inheritance diagram for stan::mcmc::ps_point:
stan::mcmc::dense_e_point stan::mcmc::diag_e_point stan::mcmc::softabs_point stan::mcmc::unit_e_point

Public Member Functions

 ps_point (int n)
 
 ps_point (const ps_point &z)
 
ps_pointoperator= (const ps_point &z)
 
virtual void get_param_names (std::vector< std::string > &model_names, std::vector< std::string > &names)
 
virtual void get_params (std::vector< double > &values)
 
virtual void write_metric (stan::callbacks::writer &writer)
 

Public Attributes

Eigen::VectorXd q
 
Eigen::VectorXd p
 
double V
 
Eigen::VectorXd g
 

Static Protected Member Functions

template<typename T >
static void fast_vector_copy_ (Eigen::Matrix< T, Dynamic, 1 > &v_to, const Eigen::Matrix< T, Dynamic, 1 > &v_from)
 
template<typename T >
static void fast_matrix_copy_ (Eigen::Matrix< T, Dynamic, Dynamic > &v_to, const Eigen::Matrix< T, Dynamic, Dynamic > &v_from)
 

Friends

class ps_point_test
 

Detailed Description

Point in a generic phase space

Definition at line 18 of file ps_point.hpp.

Constructor & Destructor Documentation

stan::mcmc::ps_point::ps_point ( int  n)
inlineexplicit

Definition at line 22 of file ps_point.hpp.

23  : q(n), p(n), V(0), g(n) {}
Eigen::VectorXd q
Definition: ps_point.hpp:46
Eigen::VectorXd p
Definition: ps_point.hpp:47
Eigen::VectorXd g
Definition: ps_point.hpp:50
stan::mcmc::ps_point::ps_point ( const ps_point z)
inline

Definition at line 25 of file ps_point.hpp.

References g, p, and q.

26  : q(z.q.size()), p(z.p.size()), V(z.V), g(z.g.size()) {
27  fast_vector_copy_<double>(q, z.q);
28  fast_vector_copy_<double>(p, z.p);
29  fast_vector_copy_<double>(g, z.g);
30  }
Eigen::VectorXd q
Definition: ps_point.hpp:46
Eigen::VectorXd p
Definition: ps_point.hpp:47
z
Definition: test.py:28
Eigen::VectorXd g
Definition: ps_point.hpp:50

Member Function Documentation

template<typename T >
static void stan::mcmc::ps_point::fast_matrix_copy_ ( Eigen::Matrix< T, Dynamic, Dynamic > &  v_to,
const Eigen::Matrix< T, Dynamic, Dynamic > &  v_from 
)
inlinestaticprotected

Definition at line 92 of file ps_point.hpp.

References nc.

Referenced by stan::mcmc::ps_point_test::fast_matrix_copy().

93  {
94  int nr = v_from.rows();
95  int nc = v_from.cols();
96  v_to.resize(nr, nc);
97  if (nr > 0 && nc > 0)
98  std::memcpy(&v_to(0), &v_from(0), v_from.size() * sizeof(double));
99  }
enum BeamMode nc
template<typename T >
static void stan::mcmc::ps_point::fast_vector_copy_ ( Eigen::Matrix< T, Dynamic, 1 > &  v_to,
const Eigen::Matrix< T, Dynamic, 1 > &  v_from 
)
inlinestaticprotected

Definition at line 82 of file ps_point.hpp.

Referenced by stan::mcmc::ps_point_test::fast_vector_copy().

83  {
84  int sz = v_from.size();
85  v_to.resize(sz);
86  if (sz > 0)
87  std::memcpy(&v_to(0), &v_from(0), v_from.size() * sizeof(double));
88  }
virtual void stan::mcmc::ps_point::get_param_names ( std::vector< std::string > &  model_names,
std::vector< std::string > &  names 
)
inlinevirtual

Definition at line 52 of file ps_point.hpp.

References MECModelEnuComparisons::i, and string.

53  {
54  for (int i = 0; i < q.size(); ++i)
55  names.push_back(model_names.at(i));
56  for (int i = 0; i < q.size(); ++i)
57  names.push_back(std::string("p_") + model_names.at(i));
58  for (int i = 0; i < q.size(); ++i)
59  names.push_back(std::string("g_") + model_names.at(i));
60  }
Eigen::VectorXd q
Definition: ps_point.hpp:46
enum BeamMode string
virtual void stan::mcmc::ps_point::get_params ( std::vector< double > &  values)
inlinevirtual

Definition at line 62 of file ps_point.hpp.

References MECModelEnuComparisons::i.

62  {
63  for (int i = 0; i < q.size(); ++i)
64  values.push_back(q(i));
65  for (int i = 0; i < q.size(); ++i)
66  values.push_back(p(i));
67  for (int i = 0; i < q.size(); ++i)
68  values.push_back(g(i));
69  }
const char * p
Definition: xmltok.h:285
Eigen::VectorXd q
Definition: ps_point.hpp:46
Eigen::VectorXd g
Definition: ps_point.hpp:50
ps_point& stan::mcmc::ps_point::operator= ( const ps_point z)
inline

Definition at line 32 of file ps_point.hpp.

References g, p, q, and V.

32  {
33  if (this == &z)
34  return *this;
35 
36  fast_vector_copy_<double>(q, z.q);
37 
38  V = z.V;
39 
40  fast_vector_copy_<double>(p, z.p);
41  fast_vector_copy_<double>(g, z.g);
42 
43  return *this;
44  }
Eigen::VectorXd q
Definition: ps_point.hpp:46
Eigen::VectorXd p
Definition: ps_point.hpp:47
z
Definition: test.py:28
Eigen::VectorXd g
Definition: ps_point.hpp:50
virtual void stan::mcmc::ps_point::write_metric ( stan::callbacks::writer writer)
inlinevirtual

Writes the metric

Parameters
writerwriter callback

Reimplemented in stan::mcmc::dense_e_point, stan::mcmc::diag_e_point, and stan::mcmc::softabs_point.

Definition at line 77 of file ps_point.hpp.

Referenced by stan::mcmc::TEST().

77 {}

Friends And Related Function Documentation

friend class ps_point_test
friend

Definition at line 19 of file ps_point.hpp.

Member Data Documentation

Eigen::VectorXd stan::mcmc::ps_point::g
Eigen::VectorXd stan::mcmc::ps_point::p
Eigen::VectorXd stan::mcmc::ps_point::q
double stan::mcmc::ps_point::V

The documentation for this class was generated from the following file: