Home | History | Annotate | Download | only in bits

Lines Matching refs:__first

73     __is_heap_until(_RandomAccessIterator __first, _Distance __n)
78 if (__first[__parent] < __first[__child])
89 __is_heap_until(_RandomAccessIterator __first, _Distance __n,
95 if (__comp(__first[__parent], __first[__child]))
107 __is_heap(_RandomAccessIterator __first, _Distance __n)
108 { return std::__is_heap_until(__first, __n) == __n; }
113 __is_heap(_RandomAccessIterator __first, _Compare __comp, _Distance __n)
114 { return std::__is_heap_until(__first, __n, __comp) == __n; }
118 __is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
119 { return std::__is_heap(__first, std::distance(__first, __last)); }
123 __is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
125 { return std::__is_heap(__first, __comp, std::distance(__first, __last)); }
132 __push_heap(_RandomAccessIterator __first,
136 while (__holeIndex > __topIndex && *(__first + __parent) < __value)
138 *(__first + __holeIndex) = _GLIBCXX_MOVE(*(__first + __parent));
142 *(__first + __holeIndex) = _GLIBCXX_MOVE(__value);
147 * @param __first Start of heap.
152 * over the range [__first,__last-1). After completion,
153 * [__first,__last) is a valid heap.
157 push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
168 __glibcxx_requires_valid_range(__first, __last);
169 __glibcxx_requires_heap(__first, __last - 1);
172 std::__push_heap(__first, _DistanceType((__last - __first) - 1),
179 __push_heap(_RandomAccessIterator __first, _Distance __holeIndex,
184 && __comp(*(__first + __parent), __value))
186 *(__first + __holeIndex) = _GLIBCXX_MOVE(*(__first + __parent));
190 *(__first + __holeIndex) = _GLIBCXX_MOVE(__value);
195 * @param __first Start of heap.
201 * heap over the range [__first,__last-1). After completion,
202 * [__first,__last) is a valid heap. Compare operations are
207 push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
218 __glibcxx_requires_valid_range(__first, __last);
219 __glibcxx_requires_heap_pred(__first, __last - 1, __comp);
222 std::__push_heap(__first, _DistanceType((__last - __first) - 1),
228 __adjust_heap(_RandomAccessIterator __first, _Distance __holeIndex,
236 if (*(__first + __secondChild) < *(__first + (__secondChild - 1)))
238 *(__first + __holeIndex) = _GLIBCXX_MOVE(*(__first + __secondChild));
244 *(__first + __holeIndex) = _GLIBCXX_MOVE(*(__first
248 std::__push_heap(__first, __holeIndex, __topIndex,
254 __pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
263 *__result = _GLIBCXX_MOVE(*__first);
264 std::__adjust_heap(__first, _DistanceType(0),
265 _DistanceType(__last - __first),
271 * @param __first Start of heap.
273 * @pre [__first, __last) is a valid, non-empty range.
276 * This operation pops the top of the heap. The elements __first
277 * and __last-1 are swapped and [__first,__last-1) is made into a
282 pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
291 __glibcxx_requires_non_empty_range(__first, __last);
292 __glibcxx_requires_valid_range(__first, __last);
293 __glibcxx_requires_heap(__first, __last);
296 std::__pop_heap(__first, __last, __last);
302 __adjust_heap(_RandomAccessIterator __first, _Distance __holeIndex,
310 if (__comp(*(__first + __secondChild),
311 *(__first + (__secondChild - 1))))
313 *(__first + __holeIndex) = _GLIBCXX_MOVE(*(__first + __secondChild));
319 *(__first + __holeIndex) = _GLIBCXX_MOVE(*(__first
323 std::__push_heap(__first, __holeIndex, __topIndex,
329 __pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
338 *__result = _GLIBCXX_MOVE(*__first);
339 std::__adjust_heap(__first, _DistanceType(0),
340 _DistanceType(__last - __first),
346 * @param __first Start of heap.
351 * This operation pops the top of the heap. The elements __first
352 * and __last-1 are swapped and [__first,__last-1) is made into a
357 pop_heap(_RandomAccessIterator __first,
363 __glibcxx_requires_valid_range(__first, __last);
364 __glibcxx_requires_non_empty_range(__first, __last);
365 __glibcxx_requires_heap_pred(__first, __last, __comp);
368 std::__pop_heap(__first, __last, __last, __comp);
373 * @param __first Start of heap.
377 * This operation makes the elements in [__first,__last) into a heap.
381 make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
392 __glibcxx_requires_valid_range(__first, __last);
394 if (__last - __first < 2)
397 const _DistanceType __len = __last - __first;
401 _ValueType __value = _GLIBCXX_MOVE(*(__first + __parent));
402 std::__adjust_heap(__first, __parent, __len, _GLIBCXX_MOVE(__value));
411 * @param __first Start of heap.
416 * This operation makes the elements in [__first,__last) into a heap.
421 make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
432 __glibcxx_requires_valid_range(__first, __last);
434 if (__last - __first < 2)
437 const _DistanceType __len = __last - __first;
441 _ValueType __value = _GLIBCXX_MOVE(*(__first + __parent));
442 std::__adjust_heap(__first, __parent, __len, _GLIBCXX_MOVE(__value),
452 * @param __first Start of heap.
456 * This operation sorts the valid heap in the range [__first,__last).
460 sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
467 __glibcxx_requires_valid_range(__first, __last);
468 __glibcxx_requires_heap(__first, __last);
470 while (__last - __first > 1)
473 std::__pop_heap(__first, __last, __last);
479 * @param __first Start of heap.
484 * This operation sorts the valid heap in the range [__first,__last).
489 sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
495 __glibcxx_requires_valid_range(__first, __last);
496 __glibcxx_requires_heap_pred(__first, __last, __comp);
498 while (__last - __first > 1)
501 std::__pop_heap(__first, __last, __last, __comp);
508 * @param __first Start of range.
513 * This operation returns the last iterator i in [__first, __last) for which
514 * the range [__first, i) is a heap.
518 is_heap_until(_RandomAccessIterator __first, _RandomAccessIterator __last)
525 __glibcxx_requires_valid_range(__first, __last);
527 return __first + std::__is_heap_until(__first, std::distance(__first,
533 * @param __first Start of range.
539 * This operation returns the last iterator i in [__first, __last) for which
540 * the range [__first, i) is a heap. Comparisons are made using __comp.
544 is_heap_until(_RandomAccessIterator __first, _RandomAccessIterator __last,
550 __glibcxx_requires_valid_range(__first, __last);
552 return __first + std::__is_heap_until(__first, std::distance(__first,
559 * @param __first Start of range.
566 is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
567 { return std::is_heap_until(__first, __last) == __last; }
571 * @param __first Start of range.
579 is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
581 { return std::is_heap_until(__first, __last, __comp) == __last; }