From f28e6d45671035d39dcfc25070c72f6e120032e1 Mon Sep 17 00:00:00 2001 From: graehl Date: Tue, 20 Jul 2010 00:11:45 +0000 Subject: Score::TimesEquals for vlad-mira, intrusive refcount for Score, shared_ptr compile fixes for decoder progs git-svn-id: https://ws10smt.googlecode.com/svn/trunk@331 ec762483-ff6d-05da-a07a-a48fb63a330f --- vest/fast_score.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'vest/fast_score.cc') diff --git a/vest/fast_score.cc b/vest/fast_score.cc index 0d611d56..5ee264a6 100644 --- a/vest/fast_score.cc +++ b/vest/fast_score.cc @@ -41,7 +41,7 @@ int main(int argc, char** argv) { cerr << "Loaded " << ds.size() << " references for scoring with " << loss_function << endl; ReadFile rf(conf["in_file"].as()); - Score* acc = NULL; + ScoreP acc; istream& in = *rf.stream(); int lc = 0; while(in) { @@ -50,10 +50,9 @@ int main(int argc, char** argv) { if (line.empty() && !in) break; vector sent; TD::ConvertSentence(line, &sent); - Score* sentscore = ds[lc]->ScoreCandidate(sent); + ScoreP sentscore = ds[lc]->ScoreCandidate(sent); if (!acc) { acc = sentscore->GetZero(); } acc->PlusEquals(*sentscore); - delete sentscore; ++lc; } assert(lc > 0); @@ -67,7 +66,6 @@ int main(int argc, char** argv) { float score = acc->ComputeScore(); string details; acc->ScoreDetails(&details); - delete acc; cerr << details << endl; cout << score << endl; return 0; -- cgit v1.2.3