Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion doc/heap.qbk
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,12 @@ _heap_ provides the following data structures:
constraints for the tree structure, all heap operations can be performed in O(log n).
]
]

[[[classref boost::heap::min_max_heap]]
[
[@https://en.wikipedia.org/wiki/Min-max_heap Min-max heaps] are a combination of a min heap and max heap in the same tree structure that allow to retrieve both the maximum and the minimum in constant time.
]
]
]

[table Comparison of amortized complexity
Expand All @@ -355,6 +361,7 @@ _heap_ provides the following data structures:

[[[classref boost::heap::pairing_heap]] [[^O(1)]] [O(2**2*log(log(N)))] [O(log(N))] [O(2**2*log(log(N)))] [O(2**2*log(log(N)))] [O(2**2*log(log(N)))] [O(2**2*log(log(N)))] [O(2**2*log(log(N)))]]
[[[classref boost::heap::skew_heap]] [[^O(1)]] [O(log(N))] [O(log(N))] [O(log(N))] [O(log(N))] [O(log(N))] [O(log(N))] [O(log(N+M))]]
[[[classref boost::heap::min_max_heap]] [[^O(1)]] [O(log(N))] [O(log(N))] [O(log(N))] [O(log(N))] [O(log(N))] [O(log(N))] [O((N+M)*log(N+M))]]
]


Expand Down Expand Up @@ -392,7 +399,7 @@ The data structures can be configured with [@boost:/libs/parameter/doc/html/inde
]

[[[classref boost::heap::arity]]
[Specifies the arity of a d-ary heap. For details, please consult the class reference of [classref boost::heap::d_ary_heap]]
[Specifies the arity of a d-ary or a min-max heap. For details, please consult the class reference of [classref boost::heap::d_ary_heap] and [classref boost::heap::min_max_heap].]
]

[[[classref boost::heap::store_parent_pointer]]
Expand Down
7 changes: 0 additions & 7 deletions include/boost/heap/d_ary_heap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,6 @@ namespace boost {
namespace heap {
namespace detail {

struct nop_index_updater
{
template <typename T>
static void run(T &, std::size_t)
{}
};

typedef parameter::parameters<boost::parameter::required<tag::arity>,
boost::parameter::optional<tag::allocator>,
boost::parameter::optional<tag::compare>,
Expand Down
4 changes: 2 additions & 2 deletions include/boost/heap/detail/ilog2.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ struct log2<unsigned int>
{
unsigned int operator()(unsigned int value)
{
return sizeof(unsigned int)*8 - __builtin_clz(value - 1);
return sizeof(unsigned int)*8 - __builtin_clz(value) - 1;
}
};

Expand All @@ -42,7 +42,7 @@ struct log2<unsigned long>
{
unsigned long operator()(unsigned long value)
{
return sizeof(unsigned long)*8 - __builtin_clzl(value - 1);
return sizeof(unsigned long)*8 - __builtin_clzl(value) - 1;
}
};

Expand Down
Loading