hpx/parallel/util/low_level.hpp

See Public API for a list of names and headers that are part of the public HPX API.

namespace hpx
namespace parallel
namespace util

Functions

template<typename Value, typename ...Args>
void construct_object(Value *ptr, Args&&... args)

create an object in the memory specified by ptr

Template Parameters
  • Value: : typename of the object to create

  • Args: : parameters for the constructor

Parameters
  • [in] ptr: : pointer to the memory where to create the object

  • [in] args: : arguments to the constructor

template<typename Value>
void destroy_object(Value *ptr)

destroy an object in the memory specified by ptr

Template Parameters
  • Value: : typename of the object to create

Parameters
  • [in] ptr: : pointer to the object to destroy

template<typename Iter, typename Sent>
void init(Iter first, Sent last, typename std::iterator_traits<Iter>::value_type &val)

Initialize a range of objects with the object val moving across them

Return

range initialized

Parameters
  • [in] r: : range of elements not initialized

  • [in] val: : object used for the initialization

template<typename Value, typename ...Args>
void construct(Value *ptr, Args&&... args)

create an object in the memory specified by ptr

Template Parameters
  • Value: : typename of the object to create

  • Args: : parameters for the constructor

Parameters
  • [in] ptr: : pointer to the memory where to create the object

  • [in] args: : arguments to the constructor

template<typename Iter1, typename Sent1, typename Iter2>
Iter2 init_move(Iter2 it_dest, Iter1 first, Sent1 last)

Move objects.

Template Parameters
  • Iter: : iterator to the elements

  • Value: : typename of the object to create

Parameters
  • [in] itdest: : iterator to the final place of the objects

  • [in] R: : range to move

template<typename Iter, typename Sent, typename Value = typename std::iterator_traits<Iter>::value_type>
Value *uninit_move(Value *ptr, Iter first, Sent last)

Move objects to uninitialized memory.

Template Parameters
  • Iter: : iterator to the elements

  • Value: : typename of the object to construct

Parameters
  • [in] ptr: : pointer to the memory where to create the object

  • [in] R: : range to move

template<typename Iter, typename Sent>
void destroy(Iter first, Sent last)

Move objects to uninitialized memory.

Template Parameters
  • Iter: : iterator to the elements

  • Value: : typename of the object to construct

Parameters
  • [in] ptr: : pointer to the memory where to construct the object

  • [in] R: : range to move

template<typename Iter1, typename Sent1, typename Iter2, typename Compare>
Iter2 full_merge(Iter1 buf1, Sent1 end_buf1, Iter1 buf2, Sent1 end_buf2, Iter2 buf_out, Compare comp)

Merge two contiguous buffers pointed by buf1 and buf2 , and put in the buffer pointed by buf_out.

Parameters
  • [in] buf1: : iterator to the first element in the first buffer

  • [in] end_buf1: : final iterator of first buffer

  • [in] buf2: : iterator to the first iterator to the second buffer

  • [in] end_buf2: : final iterator of the second buffer

  • [in] buf_out: : buffer where move the elements merged

  • [in] comp: : comparison object

template<typename Iter, typename Sent, typename Value, typename Compare>
Value *uninit_full_merge(Iter first1, Sent last1, Iter first2, Sent last2, Value *it_out, Compare comp)

Merge two contiguous buffers pointed by first1 and first2 , and put in the uninitialized buffer pointed by it_out.

Parameters
  • [in] first1: : iterator to the first element in the first buffer

  • [in] last: : last iterator of the first buffer

  • [in] first2: : iterator to the first element to the second buffer

  • [in] last22: : final iterator of the second buffer

  • [in] it_out: : uninitialized buffer where move the elements merged

  • [in] comp: : comparison object

template<typename Iter1, typename Sent1, typename Iter2, typename Sent2, typename Compare>
Iter2 half_merge(Iter1 buf1, Sent1 end_buf1, Iter2 buf2, Sent2 end_buf2, Iter2 buf_out, Compare comp)

: Merge two buffers. The first buffer is in a separate memory. The second buffer have a empty space before buf2 of the same size than the (end_buf1 - buf1)

Remark

The elements pointed by Iter1 and Iter2 must be the same

Parameters
  • [in] buf1: : iterator to the first element of the first buffer

  • [in] end_buf1: : iterator to the last element of the first buffer

  • [in] buf2: : iterator to the first element of the second buffer

  • [in] end_buf2: : iterator to the last element of the second buffer

  • [in] buf_out: : iterator to the first element to the buffer where put the result

  • [in] comp: : object for Compare two elements of the type pointed by the Iter1 and Iter2

template<typename Iter1, typename Sent1, typename Iter2, typename Sent2, typename Iter3, typename Compare>
bool in_place_merge_uncontiguous(Iter1 src1, Sent1 end_src1, Iter2 src2, Sent2 end_src2, Iter3 aux, Compare comp)

Merge two non contiguous buffers, placing the results in the buffers for to do this use an auxiliary buffer pointed by aux

Parameters
  • [in] src1: : iterator to the first element of the first buffer

  • [in] end_src1: : last iterator of the first buffer

  • [in] src2: : iterator to the first element of the second buffer

  • [in] end_src2: : last iterator of the second buffer

  • [in] aux: : iterator to the first element of the auxiliary buffer

  • [in] comp: : object for to Compare elements

Exceptions

template<typename Iter1, typename Sent1, typename Iter2, typename Compare>
bool in_place_merge(Iter1 src1, Iter1 src2, Sent1 end_src2, Iter2 buf, Compare comp)

: merge two contiguous buffers,using an auxiliary buffer pointed by buf

Parameters
  • [in] src1: iterator to the first position of the first buffer

  • [in] src2: final iterator of the first buffer and first iterator of the second buffer

  • [in] end_src2: : final iterator of the second buffer

  • [in] buf: : iterator to buffer used as auxiliary memory

  • [in] comp: : object for to Compare elements

Exceptions