thrust::mismatch#
Overloads#
mismatch(exec, first1, last1, first2)#
-
template<typename DerivedPolicy, typename InputIterator1, typename InputIterator2>
::cuda::std::pair<InputIterator1, InputIterator2> thrust::mismatch( - const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
- InputIterator1 first1,
- InputIterator1 last1,
- InputIterator2 first2
mismatchfinds the first position where the two ranges[first1, last1)and[first2, first2 + (last1 - first1))differ. The two versions ofmismatchuse different tests for whether elements differ.This version of
mismatchfinds the first iteratoriin[first1, last1)such that*i == *(first2 + (i - first1))isfalse. The return value is apairwhose first element isiand whose second element is*(first2 + (i - first1)). If no such iteratoriexists, the return value is apairwhose first element islast1and whose second element is*(first2 + (last1 - first1)).The algorithm’s execution is parallelized as determined by
exec.#include <thrust/mismatch.h> #include <thrust/device_vector.h> #include <thrust/execution_policy.h> ... thrust::device_vector<int> vec1(4); thrust::device_vector<int> vec2(4); vec1[0] = 0; vec2[0] = 0; vec1[1] = 5; vec2[1] = 5; vec1[2] = 3; vec2[2] = 8; vec1[3] = 7; vec2[3] = 7; using Iterator = thrust::device_vector<int>::iterator; cuda::std::pair<Iterator,Iterator> result; result = thrust::mismatch(thrust::device, vec1.begin(), vec1.end(), vec2.begin()); // result.first is vec1.begin() + 2 // result.second is vec2.begin() + 2
Added in version 2.2.0.
See also
See also
- Parameters:
exec – The execution policy to use for parallelization.
first1 – The beginning of the first sequence.
last1 – The end of the first sequence.
first2 – The beginning of the second sequence.
- Template Parameters:
DerivedPolicy – The name of the derived execution policy.
InputIterator1 – is a model of Input Iterator and
InputIterator1'svalue_typeis equality comparable toInputIterator2'svalue_type.InputIterator2 – is a model of Input Iterator.
- Returns:
The first position where the sequences differ.
mismatch(first1, last1, first2)#
-
template<typename InputIterator1, typename InputIterator2>
::cuda::std::pair<InputIterator1, InputIterator2> thrust::mismatch( - InputIterator1 first1,
- InputIterator1 last1,
- InputIterator2 first2
mismatchfinds the first position where the two ranges[first1, last1)and[first2, first2 + (last1 - first1))differ. The two versions ofmismatchuse different tests for whether elements differ.This version of
mismatchfinds the first iteratoriin[first1, last1)such that*i == *(first2 + (i - first1))isfalse. The return value is apairwhose first element isiand whose second element is*(first2 + (i - first1)). If no such iteratoriexists, the return value is apairwhose first element islast1and whose second element is*(first2 + (last1 - first1)).#include <thrust/mismatch.h> #include <thrust/device_vector.h> ... thrust::device_vector<int> vec1(4); thrust::device_vector<int> vec2(4); vec1[0] = 0; vec2[0] = 0; vec1[1] = 5; vec2[1] = 5; vec1[2] = 3; vec2[2] = 8; vec1[3] = 7; vec2[3] = 7; using Iterator = thrust::device_vector<int>::iterator; cuda::std::pair<Iterator,Iterator> result; result = thrust::mismatch(vec1.begin(), vec1.end(), vec2.begin()); // result.first is vec1.begin() + 2 // result.second is vec2.begin() + 2
Added in version 2.2.0.
See also
See also
- Parameters:
first1 – The beginning of the first sequence.
last1 – The end of the first sequence.
first2 – The beginning of the second sequence.
- Template Parameters:
InputIterator1 – is a model of Input Iterator and
InputIterator1'svalue_typeis equality comparable toInputIterator2'svalue_type.InputIterator2 – is a model of Input Iterator.
- Returns:
The first position where the sequences differ.
mismatch(exec, first1, last1, first2, pred)#
-
template<typename DerivedPolicy, typename InputIterator1, typename InputIterator2, typename BinaryPredicate>
::cuda::std::pair<InputIterator1, InputIterator2> thrust::mismatch( - const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
- InputIterator1 first1,
- InputIterator1 last1,
- InputIterator2 first2,
- BinaryPredicate pred
mismatchfinds the first position where the two ranges[first1, last1)and[first2, first2 + (last1 - first1))differ. The two versions ofmismatchuse different tests for whether elements differ.This version of
mismatchfinds the first iteratoriin[first1, last1)such thatpred(*i, *(first2 + (i - first1))isfalse. The return value is apairwhose first element isiand whose second element is*(first2 + (i - first1)). If no such iteratoriexists, the return value is apairwhose first element islast1and whose second element is*(first2 + (last1 - first1)).The algorithm’s execution is parallelized as determined by
exec.#include <thrust/mismatch.h> #include <thrust/device_vector.h> #include <thrust/execution_policy.h> ... thrust::device_vector<int> vec1(4); thrust::device_vector<int> vec2(4); vec1[0] = 0; vec2[0] = 0; vec1[1] = 5; vec2[1] = 5; vec1[2] = 3; vec2[2] = 8; vec1[3] = 7; vec2[3] = 7; using Iterator = thrust::device_vector<int>::iterator; cuda::std::pair<Iterator,Iterator> result; result = thrust::mismatch(thrust::device, vec1.begin(), vec1.end(), vec2.begin(), ::cuda::std::equal_to<int>()); // result.first is vec1.begin() + 2 // result.second is vec2.begin() + 2
Added in version 2.2.0.
See also
See also
- Parameters:
exec – The execution policy to use for parallelization.
first1 – The beginning of the first sequence.
last1 – The end of the first sequence.
first2 – The beginning of the second sequence.
pred – The binary predicate to compare elements.
- Template Parameters:
DerivedPolicy – The name of the derived execution policy.
InputIterator1 – is a model of Input Iterator.
InputIterator2 – is a model of Input Iterator.
Predicate – is a model of Input Iterator.
- Returns:
The first position where the sequences differ.
mismatch(first1, last1, first2, pred)#
-
template<typename InputIterator1, typename InputIterator2, typename BinaryPredicate>
::cuda::std::pair<InputIterator1, InputIterator2> thrust::mismatch( - InputIterator1 first1,
- InputIterator1 last1,
- InputIterator2 first2,
- BinaryPredicate pred
mismatchfinds the first position where the two ranges[first1, last1)and[first2, first2 + (last1 - first1))differ. The two versions ofmismatchuse different tests for whether elements differ.This version of
mismatchfinds the first iteratoriin[first1, last1)such thatpred(*i, *(first2 + (i - first1))isfalse. The return value is apairwhose first element isiand whose second element is*(first2 + (i - first1)). If no such iteratoriexists, the return value is apairwhose first element islast1and whose second element is*(first2 + (last1 - first1)).#include <thrust/mismatch.h> #include <thrust/device_vector.h> ... thrust::device_vector<int> vec1(4); thrust::device_vector<int> vec2(4); vec1[0] = 0; vec2[0] = 0; vec1[1] = 5; vec2[1] = 5; vec1[2] = 3; vec2[2] = 8; vec1[3] = 7; vec2[3] = 7; using Iterator = thrust::device_vector<int>::iterator; cuda::std::pair<Iterator,Iterator> result; result = thrust::mismatch(vec1.begin(), vec1.end(), vec2.begin(), ::cuda::std::equal_to<int>()); // result.first is vec1.begin() + 2 // result.second is vec2.begin() + 2
Added in version 2.2.0.
See also
See also
- Parameters:
first1 – The beginning of the first sequence.
last1 – The end of the first sequence.
first2 – The beginning of the second sequence.
pred – The binary predicate to compare elements.
- Template Parameters:
InputIterator1 – is a model of Input Iterator.
InputIterator2 – is a model of Input Iterator.
Predicate – is a model of Input Iterator.
- Returns:
The first position where the sequences differ.
mismatch(exec, first1, last1, first2, last2)#
-
template<typename DerivedPolicy, typename InputIterator1, typename InputIterator2>
::cuda::std::pair<InputIterator1, InputIterator2> thrust::mismatch( - const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
- InputIterator1 first1,
- InputIterator1 last1,
- InputIterator2 first2,
- InputIterator2 last2
mismatchfinds the first position where the two ranges[first1, last1)and[first2, last2)differ. This bounded overload stops as soon as either range is exhausted, preventing reads past the end of the shorter range.The algorithm’s execution is parallelized as determined by
exec.Added in version 3.4.0.
- Parameters:
exec – The execution policy to use for parallelization.
first1 – The beginning of the first sequence.
last1 – The end of the first sequence.
first2 – The beginning of the second sequence.
last2 – The end of the second sequence.
- Template Parameters:
DerivedPolicy – The name of the derived execution policy.
InputIterator1 – is a model of Input Iterator and
InputIterator1'svalue_typeis equality comparable toInputIterator2'svalue_type.InputIterator2 – is a model of Input Iterator.
- Returns:
The first position where the sequences differ, or the end of the shorter range if they match up to that point.
mismatch(first1, last1, first2, last2)#
-
template<typename InputIterator1, typename InputIterator2>
::cuda::std::pair<InputIterator1, InputIterator2> thrust::mismatch( - InputIterator1 first1,
- InputIterator1 last1,
- InputIterator2 first2,
- InputIterator2 last2
mismatchfinds the first position where the two ranges[first1, last1)and[first2, last2)differ. This bounded overload stops as soon as either range is exhausted, preventing reads past the end of the shorter range.Added in version 3.4.0.
- Parameters:
first1 – The beginning of the first sequence.
last1 – The end of the first sequence.
first2 – The beginning of the second sequence.
last2 – The end of the second sequence.
- Template Parameters:
InputIterator1 – is a model of Input Iterator and
InputIterator1'svalue_typeis equality comparable toInputIterator2'svalue_type.InputIterator2 – is a model of Input Iterator.
- Returns:
The first position where the sequences differ, or the end of the shorter range if they match up to that point.
mismatch(exec, first1, last1, first2, last2, pred)#
-
template<typename DerivedPolicy, typename InputIterator1, typename InputIterator2, typename BinaryPredicate>
::cuda::std::pair<InputIterator1, InputIterator2> thrust::mismatch( - const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
- InputIterator1 first1,
- InputIterator1 last1,
- InputIterator2 first2,
- InputIterator2 last2,
- BinaryPredicate pred
mismatchfinds the first position where the two ranges[first1, last1)and[first2, last2)differ. This bounded overload stops as soon as either range is exhausted, preventing reads past the end of the shorter range.The algorithm’s execution is parallelized as determined by
exec.Added in version 3.4.0.
- Parameters:
exec – The execution policy to use for parallelization.
first1 – The beginning of the first sequence.
last1 – The end of the first sequence.
first2 – The beginning of the second sequence.
last2 – The end of the second sequence.
pred – The binary predicate to compare elements.
- Template Parameters:
DerivedPolicy – The name of the derived execution policy.
InputIterator1 – is a model of Input Iterator.
InputIterator2 – is a model of Input Iterator.
BinaryPredicate – is a model of Binary Predicate.
- Returns:
The first position where the sequences differ, or the end of the shorter range if they match up to that point.
mismatch(first1, last1, first2, last2, pred)#
-
template<typename InputIterator1, typename InputIterator2, typename BinaryPredicate>
::cuda::std::pair<InputIterator1, InputIterator2> thrust::mismatch( - InputIterator1 first1,
- InputIterator1 last1,
- InputIterator2 first2,
- InputIterator2 last2,
- BinaryPredicate pred
mismatchfinds the first position where the two ranges[first1, last1)and[first2, last2)differ. This bounded overload stops as soon as either range is exhausted, preventing reads past the end of the shorter range.Added in version 3.4.0.
- Parameters:
first1 – The beginning of the first sequence.
last1 – The end of the first sequence.
first2 – The beginning of the second sequence.
last2 – The end of the second sequence.
pred – The binary predicate to compare elements.
- Template Parameters:
InputIterator1 – is a model of Input Iterator.
InputIterator2 – is a model of Input Iterator.
BinaryPredicate – is a model of Binary Predicate.
- Returns:
The first position where the sequences differ, or the end of the shorter range if they match up to that point.