Stan  2.10.0
probability, sampling & optimization
dense_e_point.hpp
Go to the documentation of this file.
1 #ifndef STAN_MCMC_HMC_HAMILTONIANS_DENSE_E_POINT_HPP
2 #define STAN_MCMC_HMC_HAMILTONIANS_DENSE_E_POINT_HPP
3 
6 
7 namespace stan {
8  namespace mcmc {
13  class dense_e_point: public ps_point {
14  public:
15  explicit dense_e_point(int n)
16  : ps_point(n), mInv(n, n) {
17  mInv.setIdentity();
18  }
19 
20  Eigen::MatrixXd mInv;
21 
23  : ps_point(z), mInv(z.mInv.rows(), z.mInv.cols()) {
24  fast_matrix_copy_<double>(mInv, z.mInv);
25  }
26 
27  void
29  writer("Elements of inverse mass matrix:");
30  std::stringstream mInv_ss;
31  for (int i = 0; i < mInv.rows(); ++i) {
32  mInv_ss.str("");
33  mInv_ss << mInv(i, 0);
34  for (int j = 1; j < mInv.cols(); ++j)
35  mInv_ss << ", " << mInv(i, j);
36  writer(mInv_ss.str());
37  }
38  }
39  };
40 
41  } // mcmc
42 } // stan
43 
44 #endif
Probability, optimization and sampling library.
Point in a generic phase space.
Definition: ps_point.hpp:17
dense_e_point(const dense_e_point &z)
void write_metric(stan::interface_callbacks::writer::base_writer &writer)
Writes the metric.
base_writer is an abstract base class defining the interface for Stan writer callbacks.
Definition: base_writer.hpp:20
Point in a phase space with a base Euclidean manifold with dense metric.

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