From 904130a611019d3ecb7878e21035f6915b4b5702 Mon Sep 17 00:00:00 2001 From: graehl Date: Mon, 19 Jul 2010 22:51:33 +0000 Subject: shared_ptr for scores. todo: intrusive. git-svn-id: https://ws10smt.googlecode.com/svn/trunk@327 ec762483-ff6d-05da-a07a-a48fb63a330f --- vest/line_optimizer.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'vest/line_optimizer.cc') diff --git a/vest/line_optimizer.cc b/vest/line_optimizer.cc index e8b40237..70a00cbc 100644 --- a/vest/line_optimizer.cc +++ b/vest/line_optimizer.cc @@ -32,7 +32,8 @@ double LineOptimizer::LineOptimize( } sort(all_ints.begin(), all_ints.end(), IntervalComp()); double last_boundary = all_ints.front()->x; - Score* acc = all_ints.front()->delta->GetZero(); + ScoreP accp = all_ints.front()->delta->GetZero(); + Score *acc=accp.get(); float& cur_best_score = *best_score; cur_best_score = (type == MAXIMIZE_SCORE ? -numeric_limits::max() : numeric_limits::max()); @@ -72,7 +73,6 @@ double LineOptimizer::LineOptimize( pos = last_boundary + 1000.0; } } - delete acc; return pos; } @@ -92,7 +92,6 @@ void LineOptimizer::CreateOptimizationDirections( vector >* dirs , bool include_orthogonal ) { - const int num_directions = features_to_optimize.size() + additional_random_directions; dirs->clear(); typedef SparseVector Dir; vector &out=*dirs; -- cgit v1.2.3