Lines Matching refs:candidates
80 static Score buildCandidatesList(std::vector<Candidate>* candidates, in buildCandidatesList() argument
83 candidates->resize(0); in buildCandidatesList()
117 candidates->push_back({score, i}); in buildCandidatesList()
126 std::make_heap(candidates->begin(), candidates->end(), greaterScore()); in buildCandidatesList()
127 Score minScore = candidates->at(0).score; in buildCandidatesList()
140 candidates->push_back({score, i}); in buildCandidatesList()
141 std::push_heap(candidates->begin(), candidates->end(), greaterScore()); in buildCandidatesList()
142 if (candidates->size() > CANDIDATE_BUNDLE_SIZE && maxScore != minScore) { in buildCandidatesList()
143 while (candidates->at(0).score == minScore) { in buildCandidatesList()
144 std::pop_heap(candidates->begin(), candidates->end(), greaterScore()); in buildCandidatesList()
145 candidates->pop_back(); in buildCandidatesList()
147 minScore = candidates->at(0).score; in buildCandidatesList()
162 std::make_heap(candidates->begin(), candidates->end(), lessScore()); in buildCandidatesList()
168 static Score rebuildCandidatesList(std::vector<TextIdx>* candidates, in rebuildCandidatesList() argument
171 size_t n = candidates->size(); in rebuildCandidatesList()
172 TextIdx* data = candidates->data(); in rebuildCandidatesList()
203 if (candidates->size() <= score) { in rebuildCandidatesList()
204 candidates->resize(score + 1); in rebuildCandidatesList()
209 next[i] = candidates->at(score); in rebuildCandidatesList()
210 candidates->at(score) = i; in rebuildCandidatesList()
223 candidates->resize(maxScore + 1); in rebuildCandidatesList()
477 std::vector<TextIdx> candidates; in durchschlagGenerateExclusive() local
480 &candidates, &map, span, shortcut, end, next.data()); in durchschlagGenerateExclusive()
500 if (candidates[maxScore] != 0) { in durchschlagGenerateExclusive()
501 candidate = candidates[maxScore]; in durchschlagGenerateExclusive()
502 candidates[maxScore] = next[candidate]; in durchschlagGenerateExclusive()
523 next[candidate] = candidates[score]; in durchschlagGenerateExclusive()
524 candidates[score] = candidate; in durchschlagGenerateExclusive()
527 &candidates, &map, span, shortcut, end, next.data()); in durchschlagGenerateExclusive()
583 std::vector<Candidate> candidates; in durchschlagGenerateCollaborative() local
584 candidates.reserve(CANDIDATE_BUNDLE_SIZE + 1024); in durchschlagGenerateCollaborative()
585 Score minScore = buildCandidatesList(&candidates, &map, span, shortcut, end); in durchschlagGenerateCollaborative()
595 if (minScore == 0 && candidates.empty()) { in durchschlagGenerateCollaborative()
599 if (candidates.empty()) { in durchschlagGenerateCollaborative()
600 minScore = buildCandidatesList(&candidates, &map, span, shortcut, end); in durchschlagGenerateCollaborative()
603 TextIdx candidate = candidates[0].position; in durchschlagGenerateCollaborative()
604 Score expectedScore = candidates[0].score; in durchschlagGenerateCollaborative()
606 candidates.resize(0); in durchschlagGenerateCollaborative()
609 std::pop_heap(candidates.begin(), candidates.end(), lessScore()); in durchschlagGenerateCollaborative()
610 candidates.pop_back(); in durchschlagGenerateCollaborative()
622 candidates.push_back({score, candidate}); in durchschlagGenerateCollaborative()
623 std::push_heap(candidates.begin(), candidates.end(), lessScore()); in durchschlagGenerateCollaborative()