COMBINATORIAL_BLAS 1.6
 
Loading...
Searching...
No Matches
ParallelMerge.cpp
Go to the documentation of this file.
1#include <vector>
2#include <utility>
3#include <parallel/algorithm>
4#include <algorithm>
5#include <iostream>
6#include <iterator>
7
8using namespace std;
9
10int main()
11{
12
13 int sequences[10][10];
14 for (int i = 0; i < 10; ++i)
15 for (int j = 0; j < 10; ++j)
16 sequences[i][j] = i*j;
17 int out[100];
18 std::vector<std::pair<int*, int*> > seqs;
19 for (int i = 0; i < 10; ++i)
20 { seqs.push_back(std::make_pair(sequences[i], sequences[i] + 10)); }
21
22 int * final = __gnu_parallel::multiway_merge(seqs.begin(), seqs.end(), out, 100, std::less<int>());
23 copy(out, final, ostream_iterator<int>(cout, " "));
24 return 0;
25}
26
27
int main()