summaryrefslogtreecommitdiff
path: root/dtrain/dtrain.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 /dtrain/dtrain.cc
parent953ec50e659084c13433ea311f6a07e7e1b292f8 (diff)
add non-const iterators to sparse vector, speed up model1 code
Diffstat (limited to 'dtrain/dtrain.cc')
-rw-r--r--dtrain/dtrain.cc4
1 files changed, 2 insertions, 2 deletions
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<weight_t>::const_iterator it = w_average.begin(); it != w_average.end(); ++it) {
+ for (SparseVector<weight_t>::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<weight_t>::const_iterator it = lambdas.begin(); it != lambdas.end(); ++it) {
+ for (SparseVector<weight_t>::iterator it = lambdas.begin(); it != lambdas.end(); ++it) {
if (it->second == 0) continue;
o << FD::Convert(it->first) << '\t' << it->second << endl;
}