From c5861eda6d781fd4eb397759b8452bff46b1499b Mon Sep 17 00:00:00 2001 From: "Peter G. Jensen" Date: Sat, 7 Oct 2023 10:47:45 +0200 Subject: [PATCH] fixing constraint lookup --- src/RefinementTree.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/RefinementTree.cpp b/src/RefinementTree.cpp index 86e361d..0c8c26a 100644 --- a/src/RefinementTree.cpp +++ b/src/RefinementTree.cpp @@ -88,13 +88,12 @@ namespace prlearn { } } else { - size_t j = 0; for(size_t i = 0; i < n_labels; ++i) { + size_t j = 0; for(;j < _mapping.size() && _mapping[j]._label < next_labels[i]; ++j) {}; - if(j >= _mapping.size()) return val; - if(_mapping[j]._label != next_labels[i]) - continue; + if(j >= _mapping.size()) continue; + if(_mapping[j]._label != next_labels[i]) continue; const auto& res = _mapping[j]; auto node = _nodes[res._nid].get_leaf(point, res._nid, _nodes); auto v = _nodes[node]._predictor._q.avg();