![]() |
Home | Libraries | People | FAQ | More |
boost::heap::binomial_heap — binomial heap
// In header: <boost/heap/binomial_heap.hpp> template<typename T, Options> class binomial_heap { public: // types typedef ; typedef ; typedef ; typedef ; typedef ; typedef ; typedef ; typedef ; typedef ; typedef ; typedef ; typedef ; typedef ; // construct/copy/destruct ( = ); (binomial_heap ); (binomial_heap &&); binomial_heap & (binomial_heap ); binomial_heap & (binomial_heap &&); ~(); // public member functions () ; () ; () ; (); () ; (binomial_heap &); () ; (); template< Args> (); (); (, ); (); (, ); (); (, ); (); (binomial_heap &); () ; () ; () ; () ; (); () ; template<typename HeapType> () ; template<typename HeapType> () ; template<typename HeapType> () ; template<typename HeapType> () ; template<typename HeapType> () ; template<typename HeapType> () ; // public static functions (); // public data members static constant_time_size; static has_ordered_iterators; static is_mergable; static is_stable; static has_reserve; };
The template parameter T is the type to be managed by the container. The user can specify additional options and if no options are provided default options are used.
The container supports the following options:
boost::heap::stable<>
, defaults to stable<false>
boost::heap::compare<>
, defaults to compare<std::less<T>
>
boost::heap::allocator<>
, defaults to allocator<std::allocator<T>
>
boost::heap::constant_time_size<>
, defaults to constant_time_size<true>
boost::heap::stability_counter_type<>
, defaults to stability_counter_type<boost::uintmax_t>
binomial_heap
public
construct/copy/destruct( cmp = );
Effects: constructs an empty priority queue.
Complexity: Constant.
(binomial_heap rhs);
Effects: copy-constructs priority queue from rhs.
Complexity: Linear.
(binomial_heap && rhs);
Effects: C++11-style move constructor.
Complexity: Constant.
Note: Only available, if BOOST_NO_CXX11_RVALUE_REFERENCES is not defined
binomial_heap & (binomial_heap rhs);
Effects: Assigns priority queue from rhs.
Complexity: Linear.
binomial_heap & (binomial_heap && rhs);
Effects: C++11-style move assignment.
Complexity: Constant.
Note: Only available, if BOOST_NO_CXX11_RVALUE_REFERENCES is not defined
~();
binomial_heap
public member functions() ;
Effects: Returns true, if the priority queue contains no elements.
Complexity: Constant.
() ;
Effects: Returns the number of elements contained in the priority queue.
Complexity: Constant, if configured with constant_time_size<true>, otherwise linear.
() ;
Effects: Returns the maximum number of elements the priority queue can contain.
Complexity: Constant.
();
Effects: Removes all elements from the priority queue.
Complexity: Linear.
() ;
Effects: Returns allocator.
Complexity: Constant.
(binomial_heap & rhs);
Effects: Swaps two priority queues.
Complexity: Constant.
() ;
Effects: Returns a const_reference to the maximum element.
Complexity: Constant.
( v);
Effects: Adds a new element to the priority queue. Returns handle to element
Complexity: Logarithmic.
template< Args> ( args);
Effects: Adds a new element to the priority queue. The element is directly constructed in-place. Returns handle to element.
Complexity: Logarithmic.
();
Effects: Removes the top element from the priority queue.
Complexity: Logarithmic.
( handle, v);
Effects: Assigns v
to the element handled by handle
& updates the priority queue.
Complexity: Logarithmic.
( handle);
Effects: Updates the heap after the element handled by handle
has been changed.
Complexity: Logarithmic.
Note: If this is not called, after a handle has been updated, the behavior of the data structure is undefined!
( handle, v);
Effects: Assigns v
to the element handled by handle
& updates the priority queue.
Complexity: Logarithmic.
Note: The new value is expected to be greater than the current one
( handle);
Effects: Updates the heap after the element handled by handle
has been changed.
Complexity: Logarithmic.
Note: If this is not called, after a handle has been updated, the behavior of the data structure is undefined!
( handle, v);
Effects: Assigns v
to the element handled by handle
& updates the priority queue.
Complexity: Logarithmic.
Note: The new value is expected to be less than the current one
( handle);
Effects: Updates the heap after the element handled by handle
has been changed.
Complexity: Logarithmic.
Note: The new value is expected to be less than the current one. If this is not called, after a handle has been updated, the behavior of the data structure is undefined!
(binomial_heap & rhs);
Effects: Merge with priority queue rhs.
Complexity: Logarithmic.
() ;
Effects: Returns an iterator to the first element contained in the priority queue.
Complexity: Constant.
() ;
Effects: Returns an iterator to the end of the priority queue.
Complexity: Constant.
() ;
Effects: Returns an ordered iterator to the first element contained in the priority queue.
Note: Ordered iterators traverse the priority queue in heap order.
() ;
Effects: Returns an ordered iterator to the end of the priority queue.
Note: Ordered iterators traverse the priority queue in heap order.
( handle);
Effects: Removes the element handled by handle
from the priority_queue
.
Complexity: Logarithmic.
() ;
Effect: Returns the value_compare object used by the priority queue
template<typename HeapType> ( rhs) ;
Returns: Element-wise comparison of heap data structures
Requirement: the value_compare
object of both heaps must match.
template<typename HeapType> ( rhs) ;
Returns: Element-wise comparison of heap data structures
Requirement: the value_compare
object of both heaps must match.
template<typename HeapType> ( rhs) ;
Returns: Element-wise comparison of heap data structures
Requirement: the value_compare
object of both heaps must match.
template<typename HeapType> ( rhs) ;
Returns: Element-wise comparison of heap data structures
Requirement: the value_compare
object of both heaps must match.
template<typename HeapType> ( rhs) ;Equivalent comparison Returns: True, if both heap data structures are equivalent.
Requirement: the value_compare
object of both heaps must match.
template<typename HeapType> ( rhs) ;Equivalent comparison Returns: True, if both heap data structures are not equivalent.
Requirement: the value_compare
object of both heaps must match.