Skip to content

Commit

Permalink
Making is_heap and is_heap_until conforming to C++20
Browse files Browse the repository at this point in the history
  • Loading branch information
hkaiser committed Sep 16, 2020
1 parent 1c6a32c commit 369dbdf
Show file tree
Hide file tree
Showing 11 changed files with 1,090 additions and 278 deletions.
5 changes: 3 additions & 2 deletions docs/sphinx/api/public_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,13 @@ Functions
- :cpp:func:`hpx::generate_n`
- :cpp:func:`hpx::parallel::v1::includes`
- :cpp:func:`hpx::parallel::v1::inplace_merge`
- :cpp:func:`hpx::parallel::v1::is_heap`
- :cpp:func:`hpx::parallel::v1::is_heap_until`
- :cpp:func:`hpx::is_heap`
- :cpp:func:`hpx::is_heap_until`
- :cpp:func:`hpx::parallel::v1::is_partitioned`
- :cpp:func:`hpx::parallel::v1::is_sorted`
- :cpp:func:`hpx::parallel::v1::is_sorted_until`
- :cpp:func:`hpx::parallel::v1::lexicographical_compare`
- :cpp:func:`hpx::make_heap`
- :cpp:func:`hpx::parallel::v1::max_element`
- :cpp:func:`hpx::parallel::v1::merge`
- :cpp:func:`hpx::parallel::v1::min_element`
Expand Down
8 changes: 6 additions & 2 deletions docs/sphinx/manual/writing_single_node_hpx_applications.rst
Original file line number Diff line number Diff line change
Expand Up @@ -572,14 +572,18 @@ Parallel algorithms
* Description
* In header
* Algorithm page at cppreference.com
* * :cpp:func:`hpx::parallel::v1::is_heap`
* * :cpp:func:`hpx::is_heap`
* Returns ``true`` if the range is max heap.
* ``<hpx/algorithm.hpp>``
* :cppreference-algorithm:`is_heap`
* * :cpp:func:`hpx::parallel::v1::is_heap_until`
* * :cpp:func:`hpx::is_heap_until`
* Returns the first element that breaks a max heap.
* ``<hpx/algorithm.hpp>``
* :cppreference-algorithm:`is_heap_until`
* * :cpp:func:`hpx::make_heap`
* Constructs a max heap in the range [first, last).
* ``<hpx/algorithm.hpp>``
* :cppreference-algorithm:`make_heap`

.. list-table:: Minimum/maximum operations (In Header: <hpx/algorithm.hpp>)

Expand Down
2 changes: 0 additions & 2 deletions libs/full/include/include/hpx/algorithm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ namespace hpx {
using hpx::parallel::adjacent_find;
using hpx::parallel::includes;
using hpx::parallel::inplace_merge;
using hpx::parallel::is_heap;
using hpx::parallel::is_heap_until;
using hpx::parallel::is_partitioned;
using hpx::parallel::is_sorted;
using hpx::parallel::is_sorted_until;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,8 @@ namespace hpx { namespace parallel { inline namespace v1 {
// clang-format off
template <typename ExPolicy, typename FwdIter1, typename FwdIter2,
HPX_CONCEPT_REQUIRES_(
execution::is_execution_policy<ExPolicy>::value&&
hpx::traits::is_iterator<FwdIter1>::value&&
execution::is_execution_policy<ExPolicy>::value &&
hpx::traits::is_iterator<FwdIter1>::value &&
hpx::traits::is_iterator<FwdIter2>::value)>
// clang-format on
HPX_DEPRECATED_V(
Expand Down
542 changes: 349 additions & 193 deletions libs/parallelism/algorithms/include/hpx/parallel/algorithms/is_heap.hpp

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ double run_is_heap_benchmark_seq(int test_count, std::vector<int> const& v)
for (int i = 0; i < test_count; ++i)
{
using namespace hpx::execution;
result = hpx::parallel::is_heap(seq, std::begin(v), std::end(v));
result = hpx::is_heap(seq, std::begin(v), std::end(v));
}

time = hpx::util::high_resolution_clock::now() - time;
Expand All @@ -101,7 +101,7 @@ double run_is_heap_benchmark_par(int test_count, std::vector<int> const& v)
for (int i = 0; i < test_count; ++i)
{
using namespace hpx::execution;
result = hpx::parallel::is_heap(par, std::begin(v), std::end(v));
result = hpx::is_heap(par, std::begin(v), std::end(v));
}

time = hpx::util::high_resolution_clock::now() - time;
Expand All @@ -122,7 +122,7 @@ double run_is_heap_benchmark_par_unseq(
for (int i = 0; i < test_count; ++i)
{
using namespace hpx::execution;
result = hpx::parallel::is_heap(par_unseq, std::begin(v), std::end(v));
result = hpx::is_heap(par_unseq, std::begin(v), std::end(v));
}

time = hpx::util::high_resolution_clock::now() - time;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ double run_is_heap_until_benchmark_seq(
for (int i = 0; i < test_count; ++i)
{
using namespace hpx::execution;
result = hpx::parallel::is_heap_until(seq, std::begin(v), std::end(v));
result = hpx::is_heap_until(seq, std::begin(v), std::end(v));
}

time = hpx::util::high_resolution_clock::now() - time;
Expand All @@ -106,7 +106,7 @@ double run_is_heap_until_benchmark_par(
for (int i = 0; i < test_count; ++i)
{
using namespace hpx::execution;
result = hpx::parallel::is_heap_until(par, std::begin(v), std::end(v));
result = hpx::is_heap_until(par, std::begin(v), std::end(v));
}

time = hpx::util::high_resolution_clock::now() - time;
Expand All @@ -128,8 +128,7 @@ double run_is_heap_until_benchmark_par_unseq(
for (int i = 0; i < test_count; ++i)
{
using namespace hpx::execution;
result =
hpx::parallel::is_heap_until(par_unseq, std::begin(v), std::end(v));
result = hpx::is_heap_until(par_unseq, std::begin(v), std::end(v));
}

time = hpx::util::high_resolution_clock::now() - time;
Expand Down
Loading

0 comments on commit 369dbdf

Please sign in to comment.