diff options
author | graehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-07-19 22:51:33 +0000 |
---|---|---|
committer | graehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-07-19 22:51:33 +0000 |
commit | a2e4142d6a737bff040c3f2a583da6e8244db01a (patch) | |
tree | dce70b212c143f3149c8280698ee5abce7fd6cda /vest/line_optimizer.cc | |
parent | 1b606343b7368aa4c61d5088b22b8916486f0073 (diff) |
shared_ptr for scores. todo: intrusive.
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@327 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'vest/line_optimizer.cc')
-rw-r--r-- | vest/line_optimizer.cc | 5 |
1 files changed, 2 insertions, 3 deletions
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<float>::max() : numeric_limits<float>::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<SparseVector<double> >* dirs , bool include_orthogonal ) { - const int num_directions = features_to_optimize.size() + additional_random_directions; dirs->clear(); typedef SparseVector<double> Dir; vector<Dir> &out=*dirs; |