diff options
author | John Langford <jl@hunch.net> | 2014-01-22 22:06:36 +0400 |
---|---|---|
committer | John Langford <jl@hunch.net> | 2014-01-22 22:06:36 +0400 |
commit | d3b2ed2ae9b13ad61bcd158a36fd96f8ccf14b03 (patch) | |
tree | 326d9a8d9aac03b19bb72fd71d41797bd42e1ece /vowpalwabbit/csoaa.cc | |
parent | d9dc5a66fac5d62468079257008c5f3c3f371860 (diff) |
more pointer to ref conversion
Diffstat (limited to 'vowpalwabbit/csoaa.cc')
-rw-r--r-- | vowpalwabbit/csoaa.cc | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/vowpalwabbit/csoaa.cc b/vowpalwabbit/csoaa.cc index 42d0f04c..72db9c5d 100644 --- a/vowpalwabbit/csoaa.cc +++ b/vowpalwabbit/csoaa.cc @@ -314,8 +314,8 @@ namespace CSOAA { } template <bool is_learn> - void predict_or_learn(csoaa* c, learner& base, example& ec) { - vw* all = c->all; + void predict_or_learn(csoaa& c, learner& base, example& ec) { + vw* all = c.all; label* ld = (label*)ec.ld; size_t prediction = 1; @@ -1060,42 +1060,42 @@ namespace LabelDict { } template <bool is_learn> - void predict_or_learn(ldf* l, learner& base, example &ec) { - vw* all = l->all; - l->base = &base; + void predict_or_learn(ldf& l, learner& base, example &ec) { + vw* all = l.all; + l.base = &base; bool is_test = CSOAA::example_is_test(ec) || !all->training; if (is_test) - make_single_prediction(*all, *l, base, ec, NULL, NULL, NULL, NULL); + make_single_prediction(*all, l, base, ec, NULL, NULL, NULL, NULL); - bool need_to_break = l->ec_seq.size() >= all->p->ring_size - 2; + bool need_to_break = l.ec_seq.size() >= all->p->ring_size - 2; - if (l->is_singleline) + if (l.is_singleline) assert(is_test); else if (example_is_newline(ec) || need_to_break) { - if (need_to_break && l->first_pass) + if (need_to_break && l.first_pass) cerr << "warning: length of sequence at " << ec.example_counter << " exceeds ring size; breaking apart" << endl; - do_actual_learning<is_learn>(*all, *l, base); - l->need_to_clear = true; + do_actual_learning<is_learn>(*all, l, base); + l.need_to_clear = true; } else if (LabelDict::ec_is_label_definition(ec)) { - if (l->ec_seq.size() > 0) { + if (l.ec_seq.size() > 0) { cerr << "error: label definition encountered in data block" << endl; throw exception(); } if (! is_test) { - l->ec_seq.push_back(&ec); - do_actual_learning<is_learn>(*all, *l, base); - l->need_to_clear = true; + l.ec_seq.push_back(&ec); + do_actual_learning<is_learn>(*all, l, base); + l.need_to_clear = true; } } else { - if (l->need_to_clear) { // should only happen if we're NOT driving - l->ec_seq.erase(); - l->need_to_clear = false; + if (l.need_to_clear) { // should only happen if we're NOT driving + l.ec_seq.erase(); + l.need_to_clear = false; } - l->ec_seq.push_back(&ec); + l.ec_seq.push_back(&ec); } } |