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
commitd5d7820830c2a2beda775a674f39fc8506f8a8f6 (patch)
treefdef74a7642aab8014f5080bf2a6623bc5a0736f /gi/pyp-topics/src/pyp.hh
parent22340bd468b90a0179ed14d3c3181ec4a7c5418a (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