summaryrefslogtreecommitdiff
path: root/gi/pf/learn_cfg.cc
diff options
context:
space:
mode:
authorChris Dyer <cdyer@cs.cmu.edu>2012-03-05 16:06:45 -0500
committerChris Dyer <cdyer@cs.cmu.edu>2012-03-05 16:06:45 -0500
commit4c007d48d5829233d0ae3c3c8b48f8c25631bf81 (patch)
treede540fa94cd96ac3721f52e3c9095bd2036b19b3 /gi/pf/learn_cfg.cc
parent1d5a0055a948663d799b4c5b1380ce1d9742bf6b (diff)
use template parameter inference to figure out what type to use for probability computations, templatatize number of floors in MFCR rather than compile-time set
Diffstat (limited to 'gi/pf/learn_cfg.cc')
-rw-r--r--gi/pf/learn_cfg.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/gi/pf/learn_cfg.cc b/gi/pf/learn_cfg.cc
index bf157828..ed1772bf 100644
--- a/gi/pf/learn_cfg.cc
+++ b/gi/pf/learn_cfg.cc
@@ -127,20 +127,20 @@ struct HieroLMModel {
nts(num_nts, CCRP<TRule>(1,1,1,1)) {}
prob_t Prob(const TRule& r) const {
- return nts[nt_id_to_index[-r.lhs_]].probT<prob_t>(r, p0(r));
+ return nts[nt_id_to_index[-r.lhs_]].prob(r, p0(r));
}
inline prob_t p0(const TRule& r) const {
if (kHIERARCHICAL_PRIOR)
- return q0.probT<prob_t>(r, base(r));
+ return q0.prob(r, base(r));
else
return base(r);
}
int Increment(const TRule& r, MT19937* rng) {
- const int delta = nts[nt_id_to_index[-r.lhs_]].incrementT<prob_t>(r, p0(r), rng);
+ const int delta = nts[nt_id_to_index[-r.lhs_]].increment(r, p0(r), rng);
if (kHIERARCHICAL_PRIOR && delta)
- q0.incrementT<prob_t>(r, base(r), rng);
+ q0.increment(r, base(r), rng);
return delta;
// return x.increment(r);
}