From 34b4752a1eefc002166e95782c2c52747bb08b3a Mon Sep 17 00:00:00 2001 From: Chris Dyer Date: Tue, 20 Mar 2012 15:37:54 -0400 Subject: make c++11 compatible --- mira/kbest_mira.cc | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'mira') diff --git a/mira/kbest_mira.cc b/mira/kbest_mira.cc index 904eba74..dc0200d6 100644 --- a/mira/kbest_mira.cc +++ b/mira/kbest_mira.cc @@ -3,10 +3,10 @@ #include #include #include +#include #include "config.h" -#include #include #include @@ -27,11 +27,10 @@ #include "sampler.h" using namespace std; -using boost::shared_ptr; namespace po = boost::program_options; bool invert_score; -boost::shared_ptr rng; +std::tr1::shared_ptr rng; void RandomPermutation(int len, vector* p_ids) { vector& ids = *p_ids; @@ -89,15 +88,15 @@ struct HypothesisInfo { }; struct GoodBadOracle { - shared_ptr good; - shared_ptr bad; + std::tr1::shared_ptr good; + std::tr1::shared_ptr bad; }; struct TrainingObserver : public DecoderObserver { TrainingObserver(const int k, const DocScorer& d, bool sf, vector* o) : ds(d), oracles(*o), kbest_size(k), sample_forest(sf) {} const DocScorer& ds; vector& oracles; - shared_ptr cur_best; + std::tr1::shared_ptr cur_best; const int kbest_size; const bool sample_forest; @@ -109,16 +108,16 @@ struct TrainingObserver : public DecoderObserver { UpdateOracles(smeta.GetSentenceID(), *hg); } - shared_ptr MakeHypothesisInfo(const SparseVector& feats, const double score) { - shared_ptr h(new HypothesisInfo); + std::tr1::shared_ptr MakeHypothesisInfo(const SparseVector& feats, const double score) { + std::tr1::shared_ptr h(new HypothesisInfo); h->features = feats; h->mt_metric = score; return h; } void UpdateOracles(int sent_id, const Hypergraph& forest) { - shared_ptr& cur_good = oracles[sent_id].good; - shared_ptr& cur_bad = oracles[sent_id].bad; + std::tr1::shared_ptr& cur_good = oracles[sent_id].good; + std::tr1::shared_ptr& cur_bad = oracles[sent_id].bad; cur_bad.reset(); // TODO get rid of?? if (sample_forest) { -- cgit v1.2.3