34 int sindex(
int *T,
int nT,
int *A,
int nA) {
37 for (i = 0; i < nA; i++) {
61 #pragma omp parallel private(tid) shared(nths)
63 nths = omp_get_num_threads();
64 tid = omp_get_thread_num();
71 count = (
int *) malloc(nths *
sizeof(
int));
72 disp = (
int *) malloc(nths *
sizeof(
int));
74 for (i = 0; i < nths; i++) {
83 for (i = 0; i < nths - 1; i++) { disp[i + 1] = disp[i] + count[i]; }
85 #pragma omp parallel private(tid) shared(T, nT, A, disp, count)
87 tid = omp_get_thread_num();
88 sindex(T, nT, A + disp[tid], count[tid]);
106 pivot = (max - min) / 2;
107 while (e != T[pivot] && max > min) {
113 pivot = min + (max - min) / 2;
int sindex(int *T, int nT, int *A, int nA)
int omp_pindex(int *T, int nT, int *A, int nA)
int dichotomy(int nT, int *T, int e)