HPX - High Performance ParalleX

PrevUpHomeNext

Function template mismatch

hpx::parallel::v1::mismatch

Synopsis

// In header: <hpx/parallel/algorithms/mismatch.hpp>


template<typename ExPolicy, typename InIter1, typename InIter2> 
  unspecified mismatch(ExPolicy && policy, InIter1 first1, InIter1 last1, 
                       InIter2 first2, InIter2 last2);

Description

Returns true if the range [first1, last1) is mismatch to the range [first2, last2), and false otherwise.

[Note] Note

Complexity: At most min(last1 - first1, last2 - first2) applications of the operator==(). If InIter1 and InIter2 meet the requirements of RandomAccessIterator and (last1 - first1) != (last2 - first2) then no applications of the operator==() are made.

The comparison operations in the parallel mismatch algorithm invoked with an execution policy object of type sequential_execution_policy execute in sequential order in the calling thread.

The comparison operations in the parallel mismatch algorithm invoked with an execution policy object of type parallel_execution_policy or parallel_task_execution_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.

[Note] Note

The two ranges are considered mismatch if, for every iterator i in the range [first1,last1), *i mismatchs *(first2 + (i - first1)). This overload of mismatch uses operator== to determine if two elements are mismatch.

Parameters:

first1

Refers to the beginning of the sequence of elements of the first range the algorithm will be applied to.

first2

Refers to the beginning of the sequence of elements of the second range the algorithm will be applied to.

last1

Refers to the end of the sequence of elements of the first range the algorithm will be applied to.

last2

Refers to the end of the sequence of elements of the second range the algorithm will be applied to.

policy

The execution policy to use for the scheduling of the iterations.

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.

InIter1

The type of the source iterators used for the first range (deduced). This iterator type must meet the requirements of an input iterator.

InIter2

The type of the source iterators used for the second range (deduced). This iterator type must meet the requirements of an input iterator.

Returns:

The mismatch algorithm returns a hpx::future<bool> if the execution policy is of type sequential_task_execution_policy or parallel_task_execution_policy and returns bool otherwise. The mismatch algorithm returns true if the elements in the two ranges are mismatch, otherwise it returns false. If the length of the range [first1, last1) does not mismatch the length of the range [first2, last2), it returns false.


PrevUpHomeNext