summaryrefslogtreecommitdiff
path: root/gi/pyp-topics/src/pyp.hh
diff options
context:
space:
mode:
authorphilblunsom@gmail.com <philblunsom@gmail.com@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-07-16 04:50:35 +0000
committerphilblunsom@gmail.com <philblunsom@gmail.com@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-07-16 04:50:35 +0000
commit027d89091bfec53c700101ddfa9ab174a48923e1 (patch)
tree4b728e3e60046be2808072b03be443137be0991f /gi/pyp-topics/src/pyp.hh
parent178c49b9f457d3f04c06750763eb7c32bb0bc7b8 (diff)
working on mpi implementation.
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@283 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'gi/pyp-topics/src/pyp.hh')
-rw-r--r--gi/pyp-topics/src/pyp.hh9
1 files changed, 4 insertions, 5 deletions
diff --git a/gi/pyp-topics/src/pyp.hh b/gi/pyp-topics/src/pyp.hh
index 26f6ab2e..84decb0f 100644
--- a/gi/pyp-topics/src/pyp.hh
+++ b/gi/pyp-topics/src/pyp.hh
@@ -1,6 +1,7 @@
#ifndef _pyp_hh
#define _pyp_hh
+#include "slice-sampler.h"
#include <math.h>
#include <map>
#include <tr1/unordered_map>
@@ -11,7 +12,6 @@
#include <boost/random/mersenne_twister.hpp>
#include "log_add.h"
-#include "slice-sampler.h"
#include "mt19937ar.h"
//
@@ -63,7 +63,7 @@ public:
double b() const { return _b; }
void set_b(double b) { _b = b; }
- void clear();
+ virtual void clear();
std::ostream& debug_info(std::ostream& os) const;
double log_restaurant_prob() const;
@@ -75,13 +75,12 @@ public:
void resample_prior_a();
void resample_prior_b();
-private:
+protected:
double _a, _b; // parameters of the Pitman-Yor distribution
double _a_beta_a, _a_beta_b; // parameters of Beta prior on a
double _b_gamma_s, _b_gamma_c; // parameters of Gamma prior on b
- struct TableCounter
- {
+ struct TableCounter {
TableCounter() : tables(0) {};
int tables;
std::map<int, int> table_histogram; // num customers at table -> number tables