summaryrefslogtreecommitdiff
path: root/dtrain
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
commit67456f9f7af754750faeea6f1e66b14b910d8751 (patch)
treed4c647f455e0a2b9fe102843fd0a060264867c44 /dtrain
parentc3fddf01ebfa8f523ab2d6bb2db5e2be1a929ee2 (diff)
add non-const iterators to sparse vector, speed up model1 code
Diffstat (limited to 'dtrain')
-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;
}