32 #ifndef _GLIBCXX_PARALLEL_CHECKERS_H
33 #define _GLIBCXX_PARALLEL_CHECKERS_H 1
39 namespace __gnu_parallel
49 template<
typename InputIterator,
typename Comparator>
59 InputIterator current(begin), recent(begin);
61 unsigned long long position = 1;
62 for (current++; current != end; current++)
64 if (comp(*current, *recent))
66 printf(
"is_sorted: check failed before position %i.\n",
87 template<
typename InputIterator,
typename Comparator>
90 InputIterator& first_failure,
98 InputIterator current(begin), recent(begin);
100 unsigned long long position = 1;
101 for (current++; current != end; current++)
103 if (comp(*current, *recent))
105 first_failure = current;
106 printf(
"is_sorted: check failed before position %lld.\n",
126 template<
typename InputIterator,
typename Comparator>
132 <InputIterator>::value_type>())
137 InputIterator recent(begin);
140 for (InputIterator pos(begin + 1); pos != end; pos++)
142 if (comp(*pos, *recent))
144 printf(
"%ld: %d %d %d %d\n", pos - begin, *(pos - 2),
145 *(pos- 1), *pos, *(pos + 1));