From b89a1d3cb72ac36c137d6ae342f48ab9b8ee6655 Mon Sep 17 00:00:00 2001 From: Chris Dyer Date: Mon, 18 Jun 2012 20:28:42 -0400 Subject: add non-const iterators to sparse vector, speed up model1 code --- dtrain/dtrain.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'dtrain') diff --git a/dtrain/dtrain.cc b/dtrain/dtrain.cc index 8b1fc953..d9bce843 100644 --- a/dtrain/dtrain.cc +++ b/dtrain/dtrain.cc @@ -593,12 +593,12 @@ main(int argc, char** argv) o.precision(17); o << _np; if (average) { - for (SparseVector::const_iterator it = w_average.begin(); it != w_average.end(); ++it) { + for (SparseVector::iterator it = w_average.begin(); it != w_average.end(); ++it) { if (it->second == 0) continue; o << FD::Convert(it->first) << '\t' << it->second << endl; } } else { - for (SparseVector::const_iterator it = lambdas.begin(); it != lambdas.end(); ++it) { + for (SparseVector::iterator it = lambdas.begin(); it != lambdas.end(); ++it) { if (it->second == 0) continue; o << FD::Convert(it->first) << '\t' << it->second << endl; } -- cgit v1.2.3