summaryrefslogtreecommitdiff
path: root/training/mpi_flex_optimize.cc
diff options
context:
space:
mode:
authorChris Dyer <cdyer@cs.cmu.edu>2012-06-18 20:28:42 -0400
committerChris Dyer <cdyer@cs.cmu.edu>2012-06-18 20:28:42 -0400
commitb89a1d3cb72ac36c137d6ae342f48ab9b8ee6655 (patch)
tree74dbff7519a3f3fe6906fff44128563300fec19b /training/mpi_flex_optimize.cc
parent953ec50e659084c13433ea311f6a07e7e1b292f8 (diff)
add non-const iterators to sparse vector, speed up model1 code
Diffstat (limited to 'training/mpi_flex_optimize.cc')
-rw-r--r--training/mpi_flex_optimize.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/training/mpi_flex_optimize.cc b/training/mpi_flex_optimize.cc
index a9ead018..b52decdc 100644
--- a/training/mpi_flex_optimize.cc
+++ b/training/mpi_flex_optimize.cc
@@ -356,7 +356,7 @@ int main(int argc, char** argv) {
gg.clear();
gg.resize(FD::NumFeats());
if (gg.size() != cur_weights.size()) { cur_weights.resize(gg.size()); }
- for (SparseVector<double>::const_iterator it = g.begin(); it != g.end(); ++it)
+ for (SparseVector<double>::iterator it = g.begin(); it != g.end(); ++it)
if (it->first) { gg[it->first] = it->second; }
g.clear();
double r = ApplyRegularizationTerms(regularization_strength,