Lines Matching refs:budget
202 trbudget_init(trbudget_t *budget, saidx_t chance, saidx_t incval) {
203 budget->chance = chance;
204 budget->remain = budget->incval = incval;
209 trbudget_check(trbudget_t *budget, saidx_t size) {
210 if(size <= budget->remain) { budget->remain -= size; return 1; }
211 if(budget->chance == 0) { budget->count += size; return 0; }
212 budget->remain += budget->incval - size;
213 budget->chance -= 1;
329 trbudget_t *budget) {
402 if(trbudget_check(budget, a - first)) {
459 if((1 < (b - a)) && (trbudget_check(budget, b - a))) {
536 if(trbudget_check(budget, last - first)) {
558 trbudget_t budget;
561 trbudget_init(&budget, tr_ilg(n) * 2 / 3, n);
562 /* trbudget_init(&budget, tr_ilg(n) * 3 / 4, n); */
573 budget.count = 0;
574 tr_introsort(ISA, ISAd, SA, first, last, &budget);
575 if(budget.count != 0) { unsorted += budget.count; }