Stan  2.5.0
probability, sampling & optimization
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
diag_e_point.hpp
Go to the documentation of this file.
1 #ifndef STAN__MCMC__DIAG__E__POINT__BETA
2 #define STAN__MCMC__DIAG__E__POINT__BETA
3 
5 
6 namespace stan {
7 
8  namespace mcmc {
9 
10  // Point in a phase space with a base
11  // Euclidean manifold with diagonal metric
12  class diag_e_point: public ps_point {
13 
14  public:
15 
16  diag_e_point(int n): ps_point(n), mInv(n) {
17  mInv.setOnes();
18  };
19 
20  Eigen::VectorXd mInv;
21 
23  fast_vector_copy_<double>(mInv, z.mInv);
24  }
25 
26  void write_metric(std::ostream* o) {
27  if(!o) return;
28  *o << "# Diagonal elements of inverse mass matrix:" << std::endl;
29  *o << "# " << mInv(0) << std::flush;
30  for (int i = 1; i < mInv.size(); ++i)
31  *o << ", " << mInv(i) << std::flush;
32  *o << std::endl;
33  };
34 
35  };
36 
37  } // mcmc
38 
39 } // stan
40 
41 
42 #endif
void write_metric(std::ostream *o)
diag_e_point(const diag_e_point &z)
int size(const std::vector< T > &x)
Definition: size.hpp:11

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