hpx/parallel/container_algorithms/rotate.hpp¶
See Public API for a list of names and headers that are part of the public HPX API.
-
namespace
hpx
-
namespace
ranges
Functions
-
template<typename
FwdIter
, typenameSent
>
subrange_t<FwdIter, Sent>rotate
(FwdIter first, FwdIter middle, Sent last)¶ Performs a left rotation on a range of elements. Specifically, rotate swaps the elements in the range [first, last) in such a way that the element middle becomes the first element of the new range and middle - 1 becomes the last element.
The assignments in the parallel
rotate algorithm execute in sequential order in the calling thread.- Note
Complexity: Linear in the distance between first and last.
- Template Parameters
FwdIter
: The type of the source iterators used (deduced). This iterator type must meet the requirements of an forward iterator.Sent
: The type of the end iterators used (deduced). This sentinel type must be a sentinel for FwdIter.
- Parameters
first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.middle
: Refers to the element that should appear at the beginning of the rotated range.last
: Refers to the end of the sequence of elements the algorithm will be applied to.
- Note
The type of dereferenced FwdIter must meet the requirements of MoveAssignable and MoveConstructible.
- Return
The rotate algorithm returns a subrange_t<FwdIter, Sent>. The rotate algorithm returns the iterator equal to pair(first + (last - middle), last).
-
template<typename
ExPolicy
, typenameFwdIter
, typenameSent
>
parallel::util::detail::algorithm_result<ExPolicy, subrange_t<FwdIter, Sent>>::typerotate
(ExPolicy &&policy, FwdIter first, FwdIter middle, Sent last)¶ Performs a left rotation on a range of elements. Specifically, rotate swaps the elements in the range [first, last) in such a way that the element middle becomes the first element of the new range and middle - 1 becomes the last element.
The assignments in the parallel
rotate algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
Complexity: Linear in the distance between first and last.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIter
: The type of the source iterators used (deduced). This iterator type must meet the requirements of an forward iterator.Sent
: The type of the end iterators used (deduced). This sentinel type must be a sentinel for FwdIter.
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.middle
: Refers to the element that should appear at the beginning of the rotated range.last
: Refers to the end of the sequence of elements the algorithm will be applied to.
The assignments in the parallel rotate algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Note
The type of dereferenced FwdIter must meet the requirements of MoveAssignable and MoveConstructible.
- Return
The rotate algorithm returns a hpx::future<subrange_t<FwdIter, Sent>> if the execution policy is of type parallel_task_policy and returns a subrange_t<FwdIter, Sent> otherwise. The rotate algorithm returns the iterator equal to pair(first + (last - middle), last).
-
template<typename
Rng
>
subrange_t<hpx::traits::range_iterator_t<Rng>, hpx::traits::range_iterator_t<Rng>>rotate
(Rng &&rng, hpx::traits::range_iterator_t<Rng> middle)¶ Uses rng as the source range, as if using util::begin(rng) as first and ranges::end(rng) as last. Performs a left rotation on a range of elements. Specifically, rotate swaps the elements in the range [first, last) in such a way that the element middle becomes the first element of the new range and middle - 1 becomes the last element.
The assignments in the parallel
rotate algorithm execute in sequential order in the calling thread.- Note
Complexity: Linear in the distance between first and last.
- Template Parameters
Rng
: The type of the source range used (deduced). The iterators extracted from this range type must meet the requirements of a forward iterator.
- Parameters
rng
: Refers to the sequence of elements the algorithm will be applied to.middle
: Refers to the element that should appear at the beginning of the rotated range.
- Note
The type of dereferenced FwdIter must meet the requirements of MoveAssignable and MoveConstructible.
- Return
The rotate algorithm returns a subrange_t<hpx::traits::range_iterator_t<Rng>, hpx::traits::range_iterator_t<Rng>>. The rotate algorithm returns the iterator equal to pair(first + (last - middle), last).
-
template<typename
ExPolicy
, typenameRng
>
util::detail::algorithm_result<ExPolicy, subrange_t<hpx::traits::range_iterator_t<Rng>, hpx::traits::range_iterator_t<Rng>>>::typerotate
(ExPolicy &&policy, Rng &&rng, hpx::traits::range_iterator_t<Rng> middle)¶ Uses rng as the source range, as if using util::begin(rng) as first and ranges::end(rng) as last. Performs a left rotation on a range of elements. Specifically, rotate swaps the elements in the range [first, last) in such a way that the element middle becomes the first element of the new range and middle - 1 becomes the last element.
The assignments in the parallel
rotate algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
Complexity: Linear in the distance between first and last.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.Rng
: The type of the source range used (deduced). The iterators extracted from this range type must meet the requirements of a forward iterator.
- Parameters
rng
: Refers to the sequence of elements the algorithm will be applied to.policy
: The execution policy to use for the scheduling of the iterations.middle
: Refers to the element that should appear at the beginning of the rotated range.
The assignments in the parallel rotate algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Note
The type of dereferenced FwdIter must meet the requirements of MoveAssignable and MoveConstructible.
- Return
The rotate algorithm returns a hpx::future <subrange_t<hpx::traits::range_iterator_t<Rng>, hpx::traits::range_iterator_t<Rng>>> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns subrange_t<hpx::traits::range_iterator_t<Rng>, hpx::traits::range_iterator_t<Rng>>. otherwise. The rotate algorithm returns the iterator equal to pair(first + (last - middle), last).
-
template<typename
FwdIter
, typenameSent
, typenameOutIter
>
rotate_copy_result<FwdIter, OutIter>rotate_copy
(FwdIter first, FwdIter middle, Sent last, OutIter dest_first)¶ Copies the elements from the range [first, last), to another range beginning at dest_first in such a way, that the element middle becomes the first element of the new range and middle - 1 becomes the last element.
The assignments in the parallel
rotate_copy algorithm execute in sequential order in the calling thread.- Note
Complexity: Performs exactly last - first assignments.
- Template Parameters
FwdIter
: The type of the source iterators used (deduced). This iterator type must meet the requirements of an forward iterator.Sent
: The type of the end iterators used (deduced). This sentinel type must be a sentinel for FwdIter.OutIter
: The type of the iterator representing the destination range (deduced). This iterator type must meet the requirements of an output iterator.
- Parameters
first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.middle
: Refers to the element that should appear at the beginning of the rotated range.last
: Refers to the end of the sequence of elements the algorithm will be applied to.
- Return
The rotate_copy algorithm returns a rotate_copy_result<FwdIter, OutIter>. The rotate_copy algorithm returns the output iterator to the element past the last element copied.
-
template<typename
ExPolicy
, typenameFwdIter1
, typenameSent
, typenameFwdIter2
>
parallel::util::detail::algorithm_result<ExPolicy, rotate_copy_result<FwdIter1, FwdIter2>>::typerotate_copy
(ExPolicy &&policy, FwdIter1 first, FwdIter1 middle, Sent last, FwdIter2 dest_first)¶ Copies the elements from the range [first, last), to another range beginning at dest_first in such a way, that the element middle becomes the first element of the new range and middle - 1 becomes the last element.
The assignments in the parallel
rotate_copy algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
Complexity: Performs exactly last - first assignments.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIter1
: The type of the source iterators used (deduced). This iterator type must meet the requirements of an forward iterator.FwdIter2
: The type of the iterator representing the destination range (deduced). This iterator type must meet the requirements of an forward iterator.Sent
: The type of the end iterators used (deduced). This sentinel type must be a sentinel for FwdIter.
- Parameters
first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.middle
: Refers to the element that should appear at the beginning of the rotated range.last
: Refers to the end of the sequence of elements the algorithm will be applied to.
The assignments in the parallel rotate_copy algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
The rotate_copy algorithm returns areturns hpx::future< rotate_copy_result<FwdIter1, FwdIter2>> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns rotate_copy_result<FwdIter1, FwdIter2> otherwise. The rotate_copy algorithm returns the output iterator to the element past the last element copied.
-
template<typename
Rng
, typenameOutIter
>
rotate_copy_result<hpx::traits::range_iterator_t<Rng>, OutIter>rotate_copy
(Rng &&rng, hpx::traits::range_iterator_t<Rng> middle, OutIter dest_first)¶ Uses rng as the source range, as if using util::begin(rng) as first and ranges::end(rng) as last. Copies the elements from the range [first, last), to another range beginning at dest_first in such a way, that the element middle becomes the first element of the new range and middle - 1 becomes the last element.
The assignments in the parallel
rotate_copy algorithm execute in sequential order in the calling thread.- Note
Complexity: Performs exactly last - first assignments.
- Template Parameters
Rng
: The type of the source range used (deduced). The iterators extracted from this range type must meet the requirements of a forward iterator.OutIter
: The type of the iterator representing the destination range (deduced). This iterator type must meet the requirements of an forward iterator.
- Parameters
rng
: Refers to the sequence of elements the algorithm will be applied to.middle
: Refers to the element that should appear at the beginning of the rotated range.dest_first
: Refers to the begin of the destination range.
- Return
The rotate algorithm returns a rotate_copy_result<hpx::traits::range_iterator_t<Rng>, OutIter>. The rotate_copy algorithm returns the output iterator to the element past the last element copied.
-
template<typename
ExPolicy
, typenameRng
, typenameOutIter
>
parallel::util::detail::algorithm_result<ExPolicy, rotate_copy_result<hpx::traits::range_iterator_t<Rng>, OutIter>>::typerotate_copy
(ExPolicy &&policy, Rng &&rng, hpx::traits::range_iterator_t<Rng> middle, OutIter dest_first)¶ Uses rng as the source range, as if using util::begin(rng) as first and ranges::end(rng) as last. Copies the elements from the range [first, last), to another range beginning at dest_first in such a way, that the element new_first becomes the first element of the new range and new_first - 1 becomes the last element.
The assignments in the parallel
rotate_copy algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
Complexity: Performs exactly last - first assignments.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.Rng
: The type of the source range used (deduced). The iterators extracted from this range type must meet the requirements of a forward iterator.OutIter
: The type of the iterator representing the destination range (deduced). This iterator type must meet the requirements of an output iterator.
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.rng
: Refers to the sequence of elements the algorithm will be applied to.middle
: Refers to the element that should appear at the beginning of the rotated range.dest_first
: Refers to the begin of the destination range.
The assignments in the parallel rotate_copy algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
The rotate_copy algorithm returns a hpx::future<otate_copy_result< hpx::traits::range_iterator_t<Rng>, OutIter>> if the execution policy is of type parallel_task_policy and returns rotate_copy_result< hpx::traits::range_iterator_t<Rng>, OutIter> otherwise. The rotate_copy algorithm returns the output iterator to the element past the last element copied.
-
template<typename
-
namespace