libstdc++
Collaboration diagram for Heap:

Functions

template<typename _RandomAccessIterator >
bool std::is_heap (_RandomAccessIterator __first, _RandomAccessIterator __last)
 
template<typename _RandomAccessIterator , typename _Compare >
bool std::is_heap (_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
 
template<typename _RandomAccessIterator >
_RandomAccessIterator std::is_heap_until (_RandomAccessIterator __first, _RandomAccessIterator __last)
 
template<typename _RandomAccessIterator , typename _Compare >
_RandomAccessIterator std::is_heap_until (_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
 
template<typename _RandomAccessIterator >
void std::make_heap (_RandomAccessIterator __first, _RandomAccessIterator __last)
 
template<typename _RandomAccessIterator , typename _Compare >
void std::make_heap (_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
 
template<typename _RandomAccessIterator >
void std::pop_heap (_RandomAccessIterator __first, _RandomAccessIterator __last)
 
template<typename _RandomAccessIterator , typename _Compare >
void std::pop_heap (_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
 
template<typename _RandomAccessIterator >
void std::push_heap (_RandomAccessIterator __first, _RandomAccessIterator __last)
 
template<typename _RandomAccessIterator , typename _Compare >
void std::push_heap (_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
 
template<typename _RandomAccessIterator >
void std::sort_heap (_RandomAccessIterator __first, _RandomAccessIterator __last)
 
template<typename _RandomAccessIterator , typename _Compare >
void std::sort_heap (_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
 

Detailed Description

Function Documentation

template<typename _RandomAccessIterator >
bool std::is_heap ( _RandomAccessIterator  __first,
_RandomAccessIterator  __last 
)
inline

Determines whether a range is a heap.

Parameters
__firstStart of range.
__lastEnd of range.
Returns
True if range is a heap, false otherwise.

Definition at line 519 of file stl_heap.h.

References std::is_heap_until().

template<typename _RandomAccessIterator , typename _Compare >
bool std::is_heap ( _RandomAccessIterator  __first,
_RandomAccessIterator  __last,
_Compare  __comp 
)
inline

Determines whether a range is a heap using comparison functor.

Parameters
__firstStart of range.
__lastEnd of range.
__compComparison functor to use.
Returns
True if range is a heap, false otherwise.

Definition at line 532 of file stl_heap.h.

References std::is_heap_until().

template<typename _RandomAccessIterator >
_RandomAccessIterator std::is_heap_until ( _RandomAccessIterator  __first,
_RandomAccessIterator  __last 
)
inline

Search the end of a heap.

Parameters
__firstStart of range.
__lastEnd of range.
Returns
An iterator pointing to the first element not in the heap.

This operation returns the last iterator i in [__first, __last) for which the range [__first, i) is a heap.

Definition at line 468 of file stl_heap.h.

References std::distance().

template<typename _RandomAccessIterator , typename _Compare >
_RandomAccessIterator std::is_heap_until ( _RandomAccessIterator  __first,
_RandomAccessIterator  __last,
_Compare  __comp 
)
inline

Search the end of a heap using comparison functor.

Parameters
__firstStart of range.
__lastEnd of range.
__compComparison functor to use.
Returns
An iterator pointing to the first element not in the heap.

This operation returns the last iterator i in [__first, __last) for which the range [__first, i) is a heap. Comparisons are made using __comp.

Definition at line 496 of file stl_heap.h.

References std::distance().

Referenced by std::is_heap().

template<typename _RandomAccessIterator >
void std::make_heap ( _RandomAccessIterator  __first,
_RandomAccessIterator  __last 
)
inline

Construct a heap over a range.

Parameters
__firstStart of heap.
__lastEnd of heap.

This operation makes the elements in [__first,__last) into a heap.

Definition at line 353 of file stl_heap.h.

template<typename _RandomAccessIterator , typename _Compare >
void std::make_heap ( _RandomAccessIterator  __first,
_RandomAccessIterator  __last,
_Compare  __comp 
)
inline

Construct a heap over a range using comparison functor.

Parameters
__firstStart of heap.
__lastEnd of heap.
__compComparison functor to use.

This operation makes the elements in [__first,__last) into a heap. Comparisons are made using __comp.

Definition at line 379 of file stl_heap.h.

Referenced by std::priority_queue< _Tp, _Sequence, _Compare >::priority_queue().

template<typename _RandomAccessIterator >
void std::pop_heap ( _RandomAccessIterator  __first,
_RandomAccessIterator  __last 
)
inline

Pop an element off a heap.

Parameters
__firstStart of heap.
__lastEnd of heap.
Precondition
[__first, __last) is a valid, non-empty range.

This operation pops the top of the heap. The elements __first and __last-1 are swapped and [__first,__last-1) is made into a heap.

Definition at line 265 of file stl_heap.h.

template<typename _RandomAccessIterator , typename _Compare >
void std::pop_heap ( _RandomAccessIterator  __first,
_RandomAccessIterator  __last,
_Compare  __comp 
)
inline

Pop an element off a heap using comparison functor.

Parameters
__firstStart of heap.
__lastEnd of heap.
__compComparison functor to use.

This operation pops the top of the heap. The elements __first and __last-1 are swapped and [__first,__last-1) is made into a heap. Comparisons are made using comp.

Definition at line 298 of file stl_heap.h.

Referenced by std::priority_queue< _Tp, _Sequence, _Compare >::pop().

template<typename _RandomAccessIterator >
void std::push_heap ( _RandomAccessIterator  __first,
_RandomAccessIterator  __last 
)
inline

Push an element onto a heap.

Parameters
__firstStart of heap.
__lastEnd of heap + element.

This operation pushes the element at last-1 onto the valid heap over the range [__first,__last-1). After completion, [__first,__last) is a valid heap.

Definition at line 150 of file stl_heap.h.

template<typename _RandomAccessIterator , typename _Compare >
void std::push_heap ( _RandomAccessIterator  __first,
_RandomAccessIterator  __last,
_Compare  __comp 
)
inline

Push an element onto a heap using comparison functor.

Parameters
__firstStart of heap.
__lastEnd of heap + element.
__compComparison functor.

This operation pushes the element at __last-1 onto the valid heap over the range [__first,__last-1). After completion, [__first,__last) is a valid heap. Compare operations are performed using comp.

Definition at line 185 of file stl_heap.h.

Referenced by std::priority_queue< _Tp, _Sequence, _Compare >::push().

template<typename _RandomAccessIterator >
void std::sort_heap ( _RandomAccessIterator  __first,
_RandomAccessIterator  __last 
)
inline

Sort a heap.

Parameters
__firstStart of heap.
__lastEnd of heap.

This operation sorts the valid heap in the range [__first,__last).

Definition at line 414 of file stl_heap.h.

template<typename _RandomAccessIterator , typename _Compare >
void std::sort_heap ( _RandomAccessIterator  __first,
_RandomAccessIterator  __last,
_Compare  __comp 
)
inline

Sort a heap using comparison functor.

Parameters
__firstStart of heap.
__lastEnd of heap.
__compComparison functor to use.

This operation sorts the valid heap in the range [__first,__last). Comparisons are made using __comp.

Definition at line 441 of file stl_heap.h.