| 1 |
// Copyright (C) 2006 Fokko Beekhof |
| 2 |
// Email contact: [email protected] |
| 3 |
|
| 4 |
// The OMPTL library is free software; you can redistribute it and/or |
| 5 |
// modify it under the terms of the GNU Lesser General Public |
| 6 |
// License as published by the Free Software Foundation; either |
| 7 |
// version 2.1 of the License, or (at your option) any later version. |
| 8 |
|
| 9 |
// This library is distributed in the hope that it will be useful, |
| 10 |
// but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 12 |
// Lesser General Public License for more details. |
| 13 |
|
| 14 |
// You should have received a copy of the GNU Lesser General Public |
| 15 |
// License along with this library; if not, write to the Free Software |
| 16 |
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 17 |
|
| 18 |
|
| 19 |
#ifndef OMPTL_ALGORITHM |
| 20 |
#define OMPTL_ALGORITHM 1 |
| 21 |
|
| 22 |
#include <algorithm> |
| 23 |
#include "omptl" |
| 24 |
|
| 25 |
namespace omptl |
| 26 |
{ |
| 27 |
|
| 28 |
template <class ForwardIterator> |
| 29 |
ForwardIterator adjacent_find(ForwardIterator first, ForwardIterator last, |
| 30 |
const unsigned P = _Pfunc::Pfunc()); |
| 31 |
|
| 32 |
template <class ForwardIterator, class BinaryPredicate> |
| 33 |
ForwardIterator adjacent_find(ForwardIterator first, ForwardIterator last, |
| 34 |
BinaryPredicate binary_pred, |
| 35 |
const unsigned P = _Pfunc::Pfunc()); |
| 36 |
|
| 37 |
template <class ForwardIterator, class T, class StrictWeakOrdering> |
| 38 |
bool binary_search(ForwardIterator first, ForwardIterator last, const T& value, |
| 39 |
StrictWeakOrdering comp, |
| 40 |
const unsigned P = _Pfunc::Pfunc()); |
| 41 |
|
| 42 |
template <class ForwardIterator, class T> |
| 43 |
bool binary_search(ForwardIterator first, ForwardIterator last, const T& value, |
| 44 |
const unsigned P = _Pfunc::Pfunc()); |
| 45 |
|
| 46 |
template <class InputIterator, class OutputIterator> |
| 47 |
OutputIterator copy(InputIterator first, InputIterator last, |
| 48 |
OutputIterator result, |
| 49 |
const unsigned P = _Pfunc::Pfunc()); |
| 50 |
|
| 51 |
template <class BidirectionalIterator1, class BidirectionalIterator2> |
| 52 |
BidirectionalIterator2 copy_backward(BidirectionalIterator1 first, |
| 53 |
BidirectionalIterator1 last, |
| 54 |
BidirectionalIterator2 result, |
| 55 |
const unsigned P = _Pfunc::Pfunc()); |
| 56 |
|
| 57 |
/* |
| 58 |
* Note: implementation assumes that |
| 59 |
* ::std::iterator_traits<InputIterator>::difference_type(0) will |
| 60 |
* return a difference_type representing zero. |
| 61 |
*/ |
| 62 |
template <class InputIterator, class EqualityComparable> |
| 63 |
typename ::std::iterator_traits<InputIterator>::difference_type |
| 64 |
count(InputIterator first, InputIterator last, const EqualityComparable& value, |
| 65 |
const unsigned P = _Pfunc::Pfunc()); |
| 66 |
|
| 67 |
template <class InputIterator, class EqualityComparable, class Size> |
| 68 |
void count(InputIterator first, InputIterator last, |
| 69 |
const EqualityComparable& value, |
| 70 |
Size& n, const unsigned P = _Pfunc::Pfunc()); |
| 71 |
|
| 72 |
template <class InputIterator, class Predicate> |
| 73 |
typename InputIterator::difference_type |
| 74 |
count_if(InputIterator first, InputIterator last, Predicate pred, |
| 75 |
const unsigned P = _Pfunc::Pfunc()); |
| 76 |
|
| 77 |
template <class InputIterator, class Predicate, class Size> |
| 78 |
void count_if(InputIterator first, InputIterator last, |
| 79 |
Predicate pred, Size& n, const unsigned P = _Pfunc::Pfunc()); |
| 80 |
|
| 81 |
template <class InputIterator1, class InputIterator2, |
| 82 |
class BinaryPredicate> |
| 83 |
bool equal(InputIterator1 first1, InputIterator1 last1, |
| 84 |
InputIterator2 first2, BinaryPredicate binary_pred, |
| 85 |
const unsigned P = _Pfunc::Pfunc()); |
| 86 |
|
| 87 |
template <class InputIterator1, class InputIterator2> |
| 88 |
bool equal(InputIterator1 first1, InputIterator1 last1, |
| 89 |
InputIterator2 first2, const unsigned P = _Pfunc::Pfunc()); |
| 90 |
|
| 91 |
template <class ForwardIterator, class T, class StrictWeakOrdering> |
| 92 |
::std::pair<ForwardIterator, ForwardIterator> |
| 93 |
equal_range(ForwardIterator first, ForwardIterator last, const T& value, |
| 94 |
StrictWeakOrdering comp, |
| 95 |
const unsigned P = _Pfunc::Pfunc()); |
| 96 |
|
| 97 |
template <class ForwardIterator, class T> |
| 98 |
::std::pair<ForwardIterator, ForwardIterator> |
| 99 |
equal_range(ForwardIterator first, ForwardIterator last, const T& value, |
| 100 |
const unsigned P = _Pfunc::Pfunc()); |
| 101 |
|
| 102 |
template <class ForwardIterator, class T> |
| 103 |
void fill(ForwardIterator first, ForwardIterator last, const T& value, |
| 104 |
const unsigned P = _Pfunc::Pfunc()); |
| 105 |
|
| 106 |
template <class OutputIterator, class Size, class T> |
| 107 |
OutputIterator fill_n(OutputIterator first, Size n, const T& value, |
| 108 |
const unsigned P = _Pfunc::Pfunc()); |
| 109 |
|
| 110 |
/* |
| 111 |
* find suffers from a loss of efficiency when executed in parallel! |
| 112 |
*/ |
| 113 |
template<class InputIterator, class EqualityComparable> |
| 114 |
InputIterator find(InputIterator first, InputIterator last, |
| 115 |
const EqualityComparable& value, |
| 116 |
const unsigned P = _Pfunc::Pfunc()); |
| 117 |
|
| 118 |
/* |
| 119 |
* find_if suffers from a loss of efficiency when executed in parallel! |
| 120 |
*/ |
| 121 |
template<class InputIterator, class Predicate> |
| 122 |
InputIterator find_if(InputIterator first, InputIterator last, |
| 123 |
Predicate pred, const unsigned P = _Pfunc::Pfunc()); |
| 124 |
|
| 125 |
template <class ForwardIterator1, class ForwardIterator2, |
| 126 |
class BinaryPredicate> |
| 127 |
ForwardIterator1 |
| 128 |
find_end(ForwardIterator1 first1, ForwardIterator1 last1, |
| 129 |
ForwardIterator2 first2, ForwardIterator2 last2, |
| 130 |
BinaryPredicate comp, const unsigned P = _Pfunc::Pfunc() ); |
| 131 |
|
| 132 |
template <class ForwardIterator1, class ForwardIterator2> |
| 133 |
ForwardIterator1 find_end(ForwardIterator1 first1, ForwardIterator1 last1, |
| 134 |
ForwardIterator2 first2, ForwardIterator2 last2, |
| 135 |
const unsigned P = _Pfunc::Pfunc() ); |
| 136 |
|
| 137 |
/* |
| 138 |
* find_first_of suffers from a loss of efficiency when executed in parallel! |
| 139 |
*/ |
| 140 |
template <class InputIterator, class ForwardIterator, class BinaryPredicate> |
| 141 |
InputIterator find_first_of(InputIterator first1, InputIterator last1, |
| 142 |
ForwardIterator first2, ForwardIterator last2, |
| 143 |
BinaryPredicate comp, |
| 144 |
const unsigned P = _Pfunc::Pfunc()); |
| 145 |
|
| 146 |
template <class InputIterator, class ForwardIterator> |
| 147 |
InputIterator find_first_of(InputIterator first1, InputIterator last1, |
| 148 |
ForwardIterator first2, ForwardIterator last2, |
| 149 |
const unsigned P = _Pfunc::Pfunc()); |
| 150 |
|
| 151 |
// Calls to UnaryFunction f must be completely independent |
| 152 |
template <class InputIterator, class UnaryFunction> |
| 153 |
UnaryFunction for_each(InputIterator first, InputIterator last, UnaryFunction f, |
| 154 |
const unsigned P = _Pfunc::Pfunc()); |
| 155 |
|
| 156 |
// Not parallellized, Generator is explicitly allowed and expected to return |
| 157 |
// different results on subsequent calls. Order is therefor respected unless |
| 158 |
// the programmer explicitly accepts responsibility and calls par_generate. |
| 159 |
template <class ForwardIterator, class Generator> |
| 160 |
void generate(ForwardIterator first, ForwardIterator last, Generator gen); |
| 161 |
|
| 162 |
template <class ForwardIterator, class Generator> |
| 163 |
void par_generate(ForwardIterator first, ForwardIterator last, Generator gen, |
| 164 |
const unsigned P = _Pfunc::Pfunc()); |
| 165 |
|
| 166 |
template <class RandomAccessIterator, class StrictWeakOrdering> |
| 167 |
void push_heap(RandomAccessIterator first, RandomAccessIterator last, |
| 168 |
StrictWeakOrdering comp, |
| 169 |
const unsigned P = _Pfunc::Pfunc()); |
| 170 |
|
| 171 |
template <class RandomAccessIterator> |
| 172 |
void push_heap(RandomAccessIterator first, RandomAccessIterator last, |
| 173 |
const unsigned P = _Pfunc::Pfunc()); |
| 174 |
|
| 175 |
template <class RandomAccessIterator, class StrictWeakOrdering> |
| 176 |
inline void pop_heap(RandomAccessIterator first, RandomAccessIterator last, |
| 177 |
StrictWeakOrdering comp, |
| 178 |
const unsigned P = _Pfunc::Pfunc()); |
| 179 |
|
| 180 |
template <class RandomAccessIterator> |
| 181 |
inline void pop_heap(RandomAccessIterator first, RandomAccessIterator last, |
| 182 |
const unsigned P = _Pfunc::Pfunc()); |
| 183 |
|
| 184 |
template <class RandomAccessIterator, class StrictWeakOrdering> |
| 185 |
void make_heap(RandomAccessIterator first, RandomAccessIterator last, |
| 186 |
StrictWeakOrdering comp, |
| 187 |
const unsigned P = _Pfunc::Pfunc()); |
| 188 |
|
| 189 |
template <class RandomAccessIterator> |
| 190 |
void make_heap(RandomAccessIterator first, RandomAccessIterator last, |
| 191 |
const unsigned P = _Pfunc::Pfunc()); |
| 192 |
|
| 193 |
template <class RandomAccessIterator, class StrictWeakOrdering> |
| 194 |
void sort_heap(RandomAccessIterator first, RandomAccessIterator last, |
| 195 |
StrictWeakOrdering comp, |
| 196 |
const unsigned P = _Pfunc::Pfunc()); |
| 197 |
|
| 198 |
template <class RandomAccessIterator> |
| 199 |
void sort_heap(RandomAccessIterator first, RandomAccessIterator last, |
| 200 |
const unsigned P = _Pfunc::Pfunc()); |
| 201 |
|
| 202 |
// Warning: includes loses some efficiency in parallel. |
| 203 |
template <class InputIterator1, class InputIterator2, class StrictWeakOrdering> |
| 204 |
bool includes(InputIterator1 first1, InputIterator1 last1, |
| 205 |
InputIterator2 first2, InputIterator2 last2, |
| 206 |
StrictWeakOrdering comp, const unsigned P = _Pfunc::Pfunc()); |
| 207 |
|
| 208 |
template <class InputIterator1, class InputIterator2> |
| 209 |
bool includes(InputIterator1 first1, InputIterator1 last1, |
| 210 |
InputIterator2 first2, InputIterator2 last2, |
| 211 |
const unsigned P = _Pfunc::Pfunc()); |
| 212 |
|
| 213 |
template <class InputIterator1, class InputIterator2, class BinaryPredicate> |
| 214 |
bool lexicographical_compare(InputIterator1 first1, InputIterator1 last1, |
| 215 |
InputIterator2 first2, InputIterator2 last2, |
| 216 |
BinaryPredicate comp, |
| 217 |
const unsigned P = _Pfunc::Pfunc()); |
| 218 |
|
| 219 |
template <class InputIterator1, class InputIterator2> |
| 220 |
bool lexicographical_compare(InputIterator1 first1, InputIterator1 last1, |
| 221 |
InputIterator2 first2, InputIterator2 last2, |
| 222 |
const unsigned P = _Pfunc::Pfunc()); |
| 223 |
|
| 224 |
template <class ForwardIterator, class T, class StrictWeakOrdering> |
| 225 |
ForwardIterator lower_bound(ForwardIterator first, ForwardIterator last, |
| 226 |
const T& value, StrictWeakOrdering comp, |
| 227 |
const unsigned P = _Pfunc::Pfunc()); |
| 228 |
|
| 229 |
template <class ForwardIterator, class T> |
| 230 |
ForwardIterator |
| 231 |
lower_bound(ForwardIterator first, ForwardIterator last, |
| 232 |
const T& value, const unsigned P = _Pfunc::Pfunc()); |
| 233 |
|
| 234 |
template <class InputIterator1, class InputIterator2, class OutputIterator, |
| 235 |
class StrictWeakOrdering> |
| 236 |
OutputIterator merge(InputIterator1 first1, InputIterator1 last1, |
| 237 |
InputIterator2 first2, InputIterator2 last2, |
| 238 |
OutputIterator result, |
| 239 |
StrictWeakOrdering comp, |
| 240 |
const unsigned P = _Pfunc::Pfunc()); |
| 241 |
|
| 242 |
template <class InputIterator1, class InputIterator2, class OutputIterator> |
| 243 |
OutputIterator merge(InputIterator1 first1, InputIterator1 last1, |
| 244 |
InputIterator2 first2, InputIterator2 last2, |
| 245 |
OutputIterator result, |
| 246 |
const unsigned P = _Pfunc::Pfunc()); |
| 247 |
|
| 248 |
template <class ForwardIterator, class BinaryPredicate> |
| 249 |
ForwardIterator min_element(ForwardIterator first, ForwardIterator last, |
| 250 |
BinaryPredicate comp, |
| 251 |
const unsigned P = _Pfunc::Pfunc()); |
| 252 |
|
| 253 |
template <class ForwardIterator> |
| 254 |
ForwardIterator min_element(ForwardIterator first, ForwardIterator last, |
| 255 |
const unsigned P = _Pfunc::Pfunc()); |
| 256 |
|
| 257 |
template <class ForwardIterator, class BinaryPredicate> |
| 258 |
ForwardIterator max_element(ForwardIterator first, ForwardIterator last, |
| 259 |
BinaryPredicate comp, |
| 260 |
const unsigned P = _Pfunc::Pfunc()); |
| 261 |
|
| 262 |
template <class ForwardIterator> |
| 263 |
ForwardIterator max_element(ForwardIterator first, ForwardIterator last, |
| 264 |
const unsigned P = _Pfunc::Pfunc()); |
| 265 |
|
| 266 |
template <class InputIterator1, class InputIterator2, class BinaryPredicate> |
| 267 |
::std::pair<InputIterator1, InputIterator2> |
| 268 |
mismatch(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, |
| 269 |
BinaryPredicate binary_pred, const unsigned P = _Pfunc::Pfunc()); |
| 270 |
|
| 271 |
template <class InputIterator1, class InputIterator2> |
| 272 |
::std::pair<InputIterator1, InputIterator2> |
| 273 |
mismatch(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, |
| 274 |
const unsigned P = _Pfunc::Pfunc()); |
| 275 |
|
| 276 |
template <class RandomAccessIterator, class StrictWeakOrdering> |
| 277 |
void nth_element(RandomAccessIterator first, RandomAccessIterator nth, |
| 278 |
RandomAccessIterator last, StrictWeakOrdering comp, |
| 279 |
const unsigned P = _Pfunc::Pfunc()); |
| 280 |
|
| 281 |
template <class RandomAccessIterator> |
| 282 |
void nth_element(RandomAccessIterator first, RandomAccessIterator nth, |
| 283 |
RandomAccessIterator last, |
| 284 |
const unsigned P = _Pfunc::Pfunc()); |
| 285 |
|
| 286 |
template <class RandomAccessIterator, class StrictWeakOrdering> |
| 287 |
void partial_sort(RandomAccessIterator first, |
| 288 |
RandomAccessIterator middle, |
| 289 |
RandomAccessIterator last, |
| 290 |
StrictWeakOrdering comp, |
| 291 |
const unsigned P = _Pfunc::Pfunc()); |
| 292 |
|
| 293 |
template <class RandomAccessIterator> |
| 294 |
void partial_sort(RandomAccessIterator first, |
| 295 |
RandomAccessIterator middle, |
| 296 |
RandomAccessIterator last, |
| 297 |
const unsigned P = _Pfunc::Pfunc()); |
| 298 |
|
| 299 |
template <class InputIterator, class RandomAccessIterator, |
| 300 |
class StrictWeakOrdering> |
| 301 |
RandomAccessIterator |
| 302 |
partial_sort_copy(InputIterator first, InputIterator last, |
| 303 |
RandomAccessIterator result_first, |
| 304 |
RandomAccessIterator result_last, StrictWeakOrdering comp, |
| 305 |
const unsigned P = _Pfunc::Pfunc()); |
| 306 |
|
| 307 |
template <class InputIterator, class RandomAccessIterator> |
| 308 |
RandomAccessIterator |
| 309 |
partial_sort_copy(InputIterator first, InputIterator last, |
| 310 |
RandomAccessIterator result_first, |
| 311 |
RandomAccessIterator result_last, |
| 312 |
const unsigned P = _Pfunc::Pfunc()); |
| 313 |
|
| 314 |
template <class ForwardIterator, class Predicate> |
| 315 |
ForwardIterator partition(ForwardIterator first, ForwardIterator last, |
| 316 |
Predicate pred, |
| 317 |
const unsigned P = _Pfunc::Pfunc()); |
| 318 |
|
| 319 |
template <class BidirectionalIterator, class StrictWeakOrdering> |
| 320 |
bool next_permutation(BidirectionalIterator first, BidirectionalIterator last, |
| 321 |
StrictWeakOrdering comp, |
| 322 |
const unsigned P = _Pfunc::Pfunc()); |
| 323 |
|
| 324 |
template <class BidirectionalIterator> |
| 325 |
bool next_permutation(BidirectionalIterator first, BidirectionalIterator last, |
| 326 |
const unsigned P = _Pfunc::Pfunc()); |
| 327 |
|
| 328 |
template <class BidirectionalIterator, class StrictWeakOrdering> |
| 329 |
bool prev_permutation(BidirectionalIterator first, BidirectionalIterator last, |
| 330 |
StrictWeakOrdering comp, |
| 331 |
const unsigned P = _Pfunc::Pfunc()); |
| 332 |
|
| 333 |
template <class BidirectionalIterator> |
| 334 |
bool prev_permutation(BidirectionalIterator first, BidirectionalIterator last, |
| 335 |
const unsigned P = _Pfunc::Pfunc()); |
| 336 |
|
| 337 |
template <class ForwardIterator, class Predicate> |
| 338 |
ForwardIterator |
| 339 |
stable_partition(ForwardIterator first, ForwardIterator last, |
| 340 |
Predicate pred, const unsigned P = _Pfunc::Pfunc()); |
| 341 |
|
| 342 |
template <class RandomAccessIterator> |
| 343 |
void random_shuffle(RandomAccessIterator first, RandomAccessIterator last, |
| 344 |
const unsigned P = _Pfunc::Pfunc()); |
| 345 |
|
| 346 |
template <class RandomAccessIterator, class RandomNumberGenerator> |
| 347 |
void random_shuffle(RandomAccessIterator first, RandomAccessIterator last, |
| 348 |
RandomNumberGenerator &rgen, |
| 349 |
const unsigned P = _Pfunc::Pfunc()); |
| 350 |
|
| 351 |
template <class ForwardIterator, class T> |
| 352 |
ForwardIterator remove(ForwardIterator first, ForwardIterator last, |
| 353 |
const T& value, const unsigned P = _Pfunc::Pfunc()); |
| 354 |
|
| 355 |
template <class ForwardIterator, class Predicate> |
| 356 |
ForwardIterator remove_if(ForwardIterator first, ForwardIterator last, |
| 357 |
Predicate pred, |
| 358 |
const unsigned P = _Pfunc::Pfunc()); |
| 359 |
|
| 360 |
template <class InputIterator, class OutputIterator, class T> |
| 361 |
OutputIterator remove_copy(InputIterator first, InputIterator last, |
| 362 |
OutputIterator result, const T& value, |
| 363 |
const unsigned P = _Pfunc::Pfunc()); |
| 364 |
|
| 365 |
template <class InputIterator, class OutputIterator, class Predicate> |
| 366 |
OutputIterator remove_copy_if(InputIterator first, InputIterator last, |
| 367 |
OutputIterator result, Predicate pred, |
| 368 |
const unsigned P = _Pfunc::Pfunc()); |
| 369 |
|
| 370 |
template <class ForwardIterator, class T> |
| 371 |
void replace(ForwardIterator first, ForwardIterator last, const T& old_value, |
| 372 |
const T& new_value, const unsigned P = _Pfunc::Pfunc()); |
| 373 |
|
| 374 |
template <class InputIterator, class OutputIterator, class T> |
| 375 |
OutputIterator replace_copy(InputIterator first, InputIterator last, |
| 376 |
OutputIterator result, const T& old_value, |
| 377 |
const T& new_value, |
| 378 |
const unsigned P = _Pfunc::Pfunc()); |
| 379 |
|
| 380 |
template <class InputIterator, class OutputIterator, class Predicate, class T> |
| 381 |
OutputIterator replace_copy_if(InputIterator first, InputIterator last, |
| 382 |
OutputIterator result, Predicate pred, |
| 383 |
const T& new_value, |
| 384 |
const unsigned P = _Pfunc::Pfunc()); |
| 385 |
|
| 386 |
template <class ForwardIterator, class Predicate, class T> |
| 387 |
void replace_if(ForwardIterator first, ForwardIterator last, Predicate pred, |
| 388 |
const T& new_value, |
| 389 |
const unsigned P = _Pfunc::Pfunc()); |
| 390 |
|
| 391 |
template <class BidirectionalIterator> |
| 392 |
void reverse(BidirectionalIterator first, BidirectionalIterator last, |
| 393 |
const unsigned P = _Pfunc::Pfunc()); |
| 394 |
|
| 395 |
template <class BidirectionalIterator, class OutputIterator> |
| 396 |
OutputIterator reverse_copy(BidirectionalIterator first, |
| 397 |
BidirectionalIterator last, |
| 398 |
OutputIterator result, |
| 399 |
const unsigned P = _Pfunc::Pfunc()); |
| 400 |
|
| 401 |
template <class ForwardIterator> |
| 402 |
ForwardIterator rotate( ForwardIterator first, ForwardIterator middle, |
| 403 |
ForwardIterator last, |
| 404 |
const unsigned P = _Pfunc::Pfunc()); |
| 405 |
|
| 406 |
template <class ForwardIterator, class OutputIterator> |
| 407 |
OutputIterator rotate_copy(ForwardIterator first, ForwardIterator middle, |
| 408 |
ForwardIterator last, OutputIterator result, |
| 409 |
const unsigned P = _Pfunc::Pfunc()); |
| 410 |
|
| 411 |
// search suffers from a loss of efficiency when executed in parallel! |
| 412 |
template <class ForwardIterator1, class ForwardIterator2, class BinaryPredicate> |
| 413 |
ForwardIterator1 search(ForwardIterator1 first1, ForwardIterator1 last1, |
| 414 |
ForwardIterator2 first2, ForwardIterator2 last2, |
| 415 |
BinaryPredicate binary_pred, |
| 416 |
const unsigned P = _Pfunc::Pfunc()); |
| 417 |
|
| 418 |
template <class ForwardIterator1, class ForwardIterator2> |
| 419 |
ForwardIterator1 search(ForwardIterator1 first1, ForwardIterator1 last1, |
| 420 |
ForwardIterator2 first2, ForwardIterator2 last2, |
| 421 |
const unsigned P = _Pfunc::Pfunc()); |
| 422 |
|
| 423 |
template <class ForwardIterator, class Integer, |
| 424 |
class T, class BinaryPredicate> |
| 425 |
ForwardIterator search_n(ForwardIterator first, ForwardIterator last, |
| 426 |
Integer count, const T& value, |
| 427 |
BinaryPredicate binary_pred, |
| 428 |
const unsigned P = _Pfunc::Pfunc()); |
| 429 |
|
| 430 |
template <class ForwardIterator, class Integer, class T> |
| 431 |
ForwardIterator search_n(ForwardIterator first, ForwardIterator last, |
| 432 |
Integer count, const T& value, |
| 433 |
const unsigned P = _Pfunc::Pfunc()); |
| 434 |
|
| 435 |
template <class InputIterator1, class InputIterator2, class OutputIterator, |
| 436 |
class StrictWeakOrdering> |
| 437 |
OutputIterator set_difference(InputIterator1 first1, InputIterator1 last1, |
| 438 |
InputIterator2 first2, InputIterator2 last2, |
| 439 |
OutputIterator result, StrictWeakOrdering comp, |
| 440 |
const unsigned P = _Pfunc::Pfunc()); |
| 441 |
|
| 442 |
template <class InputIterator1, class InputIterator2, class OutputIterator> |
| 443 |
OutputIterator set_difference(InputIterator1 first1, InputIterator1 last1, |
| 444 |
InputIterator2 first2, InputIterator2 last2, |
| 445 |
OutputIterator result, |
| 446 |
const unsigned P = _Pfunc::Pfunc()); |
| 447 |
|
| 448 |
template <class InputIterator1, class InputIterator2, class OutputIterator, |
| 449 |
class StrictWeakOrdering> |
| 450 |
OutputIterator set_intersection(InputIterator1 first1, InputIterator1 last1, |
| 451 |
InputIterator2 first2, InputIterator2 last2, |
| 452 |
OutputIterator result, StrictWeakOrdering comp, |
| 453 |
const unsigned P = _Pfunc::Pfunc()); |
| 454 |
|
| 455 |
template <class InputIterator1, class InputIterator2, class OutputIterator> |
| 456 |
OutputIterator set_intersection(InputIterator1 first1, InputIterator1 last1, |
| 457 |
InputIterator2 first2, InputIterator2 last2, |
| 458 |
OutputIterator result, |
| 459 |
const unsigned P = _Pfunc::Pfunc()); |
| 460 |
|
| 461 |
|
| 462 |
template <class InputIterator1, class InputIterator2, class OutputIterator, |
| 463 |
class StrictWeakOrdering> |
| 464 |
OutputIterator |
| 465 |
set_symmetric_difference(InputIterator1 first1, InputIterator1 last1, |
| 466 |
InputIterator2 first2, InputIterator2 last2, |
| 467 |
OutputIterator result, StrictWeakOrdering comp, |
| 468 |
const unsigned P = _Pfunc::Pfunc()); |
| 469 |
|
| 470 |
template <class InputIterator1, class InputIterator2, class OutputIterator> |
| 471 |
OutputIterator |
| 472 |
set_symmetric_difference(InputIterator1 first1, InputIterator1 last1, |
| 473 |
InputIterator2 first2, InputIterator2 last2, |
| 474 |
OutputIterator result, |
| 475 |
const unsigned P = _Pfunc::Pfunc()); |
| 476 |
|
| 477 |
template <class InputIterator1, class InputIterator2, class OutputIterator, |
| 478 |
class StrictWeakOrdering> |
| 479 |
OutputIterator set_union(InputIterator1 first1, InputIterator1 last1, |
| 480 |
InputIterator2 first2, InputIterator2 last2, |
| 481 |
OutputIterator result, StrictWeakOrdering comp, |
| 482 |
const unsigned P = _Pfunc::Pfunc()); |
| 483 |
|
| 484 |
template <class InputIterator1, class InputIterator2, class OutputIterator> |
| 485 |
OutputIterator set_union(InputIterator1 first1, InputIterator1 last1, |
| 486 |
InputIterator2 first2, InputIterator2 last2, |
| 487 |
OutputIterator result, |
| 488 |
const unsigned P = _Pfunc::Pfunc()); |
| 489 |
|
| 490 |
|
| 491 |
template<typename RandomAccessIterator> |
| 492 |
void stable_sort(RandomAccessIterator first, RandomAccessIterator last, |
| 493 |
const unsigned P = _Pfunc::Pfunc()); |
| 494 |
|
| 495 |
template<typename RandomAccessIterator, class StrictWeakOrdering> |
| 496 |
void stable_sort(RandomAccessIterator first, RandomAccessIterator last, |
| 497 |
StrictWeakOrdering comp, const unsigned P = _Pfunc::Pfunc()); |
| 498 |
|
| 499 |
template<typename RandomAccessIterator> |
| 500 |
void sort(RandomAccessIterator first, RandomAccessIterator last, |
| 501 |
const unsigned P = _Pfunc::Pfunc()); |
| 502 |
|
| 503 |
template<typename RandomAccessIterator, class StrictWeakOrdering> |
| 504 |
void sort(RandomAccessIterator first, RandomAccessIterator last, |
| 505 |
StrictWeakOrdering comp, const unsigned P = _Pfunc::Pfunc()); |
| 506 |
|
| 507 |
template <class ForwardIterator1, class ForwardIterator2> |
| 508 |
ForwardIterator2 swap_ranges(ForwardIterator1 first1, ForwardIterator1 last1, |
| 509 |
ForwardIterator2 first2, |
| 510 |
const unsigned P = _Pfunc::Pfunc()); |
| 511 |
|
| 512 |
template <class InputIterator, class OutputIterator, class UnaryFunction> |
| 513 |
OutputIterator transform(InputIterator first, InputIterator last, |
| 514 |
OutputIterator result, UnaryFunction op, |
| 515 |
const unsigned P = _Pfunc::Pfunc()); |
| 516 |
|
| 517 |
template <class InputIterator1, class InputIterator2, class OutputIterator, |
| 518 |
class BinaryFunction> |
| 519 |
OutputIterator transform(InputIterator1 first1, InputIterator1 last1, |
| 520 |
InputIterator2 first2, OutputIterator result, |
| 521 |
BinaryFunction binary_op, |
| 522 |
const unsigned P = _Pfunc::Pfunc()); |
| 523 |
|
| 524 |
template <class ForwardIterator, class BinaryPredicate> |
| 525 |
ForwardIterator unique(ForwardIterator first, ForwardIterator last, |
| 526 |
BinaryPredicate binary_pred, |
| 527 |
const unsigned P = _Pfunc::Pfunc()); |
| 528 |
|
| 529 |
template <class ForwardIterator> |
| 530 |
ForwardIterator unique(ForwardIterator first, ForwardIterator last, |
| 531 |
const unsigned P = _Pfunc::Pfunc()); |
| 532 |
|
| 533 |
template <class InputIterator, class OutputIterator, class BinaryPredicate> |
| 534 |
OutputIterator unique_copy(InputIterator first, InputIterator last, |
| 535 |
OutputIterator result, BinaryPredicate binary_pred, |
| 536 |
const unsigned P = _Pfunc::Pfunc()); |
| 537 |
|
| 538 |
template <class InputIterator, class OutputIterator> |
| 539 |
OutputIterator unique_copy(InputIterator first, InputIterator last, |
| 540 |
OutputIterator result, |
| 541 |
const unsigned P = _Pfunc::Pfunc()); |
| 542 |
|
| 543 |
template <class ForwardIterator, class T, class StrictWeakOrdering> |
| 544 |
ForwardIterator upper_bound(ForwardIterator first, ForwardIterator last, |
| 545 |
const T& value, StrictWeakOrdering comp, |
| 546 |
const unsigned P = _Pfunc::Pfunc()); |
| 547 |
|
| 548 |
template <class ForwardIterator, class T> |
| 549 |
ForwardIterator upper_bound(ForwardIterator first, ForwardIterator last, |
| 550 |
const T& value, |
| 551 |
const unsigned P = _Pfunc::Pfunc()); |
| 552 |
|
| 553 |
} // namespace omptl |
| 554 |
|
| 555 |
#ifdef _OPENMP |
| 556 |
#include "omptl_algorithm_par.h" |
| 557 |
#else |
| 558 |
#include "omptl_algorithm_ser.h" |
| 559 |
#endif |
| 560 |
|
| 561 |
#endif /* OMPTL_ALGORITHM */ |