Home | History | Annotate | Download | only in bits

Lines Matching refs:__first

74     __is_heap_until(_RandomAccessIterator __first, _Distance __n,
80 if (__comp(__first + __parent, __first + __child))
92 __is_heap(_RandomAccessIterator __first, _Distance __n)
94 return std::__is_heap_until(__first, __n,
101 __is_heap(_RandomAccessIterator __first, _Compare __comp, _Distance __n)
103 return std::__is_heap_until(__first, __n,
109 __is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
110 { return std::__is_heap(__first, std::distance(__first, __last)); }
114 __is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
116 { return std::__is_heap(__first, __comp, std::distance(__first, __last)); }
124 __push_heap(_RandomAccessIterator __first,
129 while (__holeIndex > __topIndex && __comp(__first + __parent, __value))
131 *(__first + __holeIndex) = _GLIBCXX_MOVE(*(__first + __parent));
135 *(__first + __holeIndex) = _GLIBCXX_MOVE(__value);
140 * @param __first Start of heap.
145 * over the range [__first,__last-1). After completion,
146 * [__first,__last) is a valid heap.
150 push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
161 __glibcxx_requires_valid_range(__first, __last);
162 __glibcxx_requires_heap(__first, __last - 1);
165 std::__push_heap(__first, _DistanceType((__last - __first) - 1),
172 * @param __first Start of heap.
178 * heap over the range [__first,__last-1). After completion,
179 * [__first,__last) is a valid heap. Compare operations are
184 push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
195 __glibcxx_requires_valid_range(__first, __last);
196 __glibcxx_requires_heap_pred(__first, __last - 1, __comp);
199 std::__push_heap(__first, _DistanceType((__last - __first) - 1),
207 __adjust_heap(_RandomAccessIterator __first, _Distance __holeIndex,
215 if (__comp(__first + __secondChild,
216 __first + (__secondChild - 1)))
218 *(__first + __holeIndex) = _GLIBCXX_MOVE(*(__first + __secondChild));
224 *(__first + __holeIndex) = _GLIBCXX_MOVE(*(__first
228 std::__push_heap(__first, __holeIndex, __topIndex,
235 __pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
244 *__result = _GLIBCXX_MOVE(*__first);
245 std::__adjust_heap(__first, _DistanceType(0),
246 _DistanceType(__last - __first),
252 * @param __first Start of heap.
254 * @pre [__first, __last) is a valid, non-empty range.
257 * This operation pops the top of the heap. The elements __first
258 * and __last-1 are swapped and [__first,__last-1) is made into a
263 pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
272 __glibcxx_requires_non_empty_range(__first, __last);
273 __glibcxx_requires_valid_range(__first, __last);
274 __glibcxx_requires_heap(__first, __last);
276 if (__last - __first > 1)
279 std::__pop_heap(__first, __last, __last,
286 * @param __first Start of heap.
291 * This operation pops the top of the heap. The elements __first
292 * and __last-1 are swapped and [__first,__last-1) is made into a
297 pop_heap(_RandomAccessIterator __first,
303 __glibcxx_requires_valid_range(__first, __last);
304 __glibcxx_requires_non_empty_range(__first, __last);
305 __glibcxx_requires_heap_pred(__first, __last, __comp);
307 if (__last - __first > 1)
310 std::__pop_heap(__first, __last, __last,
317 __make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
325 if (__last - __first < 2)
328 const _DistanceType __len = __last - __first;
332 _ValueType __value = _GLIBCXX_MOVE(*(__first + __parent));
333 std::__adjust_heap(__first, __parent, __len, _GLIBCXX_MOVE(__value),
343 * @param __first Start of heap.
347 * This operation makes the elements in [__first,__last) into a heap.
351 make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
358 __glibcxx_requires_valid_range(__first, __last);
360 std::__make_heap(__first, __last,
366 * @param __first Start of heap.
371 * This operation makes the elements in [__first,__last) into a heap.
376 make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
382 __glibcxx_requires_valid_range(__first, __last);
384 std::__make_heap(__first, __last,
390 __sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
393 while (__last - __first > 1)
396 std::__pop_heap(__first, __last, __last, __comp);
402 * @param __first Start of heap.
406 * This operation sorts the valid heap in the range [__first,__last).
410 sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
417 __glibcxx_requires_valid_range(__first, __last);
418 __glibcxx_requires_heap(__first, __last);
420 std::__sort_heap(__first, __last,
426 * @param __first Start of heap.
431 * This operation sorts the valid heap in the range [__first,__last).
436 sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
442 __glibcxx_requires_valid_range(__first, __last);
443 __glibcxx_requires_heap_pred(__first, __last, __comp);
445 std::__sort_heap(__first, __last,
452 * @param __first Start of range.
457 * This operation returns the last iterator i in [__first, __last) for which
458 * the range [__first, i) is a heap.
462 is_heap_until(_RandomAccessIterator __first, _RandomAccessIterator __last)
469 __glibcxx_requires_valid_range(__first, __last);
471 return __first +
472 std::__is_heap_until(__first, std::distance(__first, __last),
478 * @param __first Start of range.
484 * This operation returns the last iterator i in [__first, __last) for which
485 * the range [__first, i) is a heap. Comparisons are made using __comp.
489 is_heap_until(_RandomAccessIterator __first, _RandomAccessIterator __last,
495 __glibcxx_requires_valid_range(__first, __last);
497 return __first
498 + std::__is_heap_until(__first, std::distance(__first, __last),
504 * @param __first Start of range.
511 is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
512 { return std::is_heap_until(__first, __last) == __last; }
516 * @param __first Start of range.
524 is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
526 { return std::is_heap_until(__first, __last, __comp) == __last; }