-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
53 lines (43 loc) · 1.32 KB
/
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#include "matroid.h"
int main(){
Matroid pairMatroid;
Matroid oddMatroid;
Matroid bigMatroid;
Matroid pairOddMatroid;
Matroid mixMatroid;
int pair= 0;
int odd = 1;
int big = 100;
int pairOdd = 0;
int mix = 96;
for(int index = 0; index < 10; index++ ){
pairMatroid.setS[index] = pair +=2;
oddMatroid.setS[index] = odd += 2;
bigMatroid.setS[index] = big++;
pairOddMatroid.setS[index] = pairOdd++;
mixMatroid.setS[index] = mix++;
}
Matroid testA[3] = {pairMatroid, oddMatroid, bigMatroid};
Matroid *ptrtestA[3] = {&pairMatroid, &oddMatroid, &bigMatroid};
Matroid *testB[5] = {&pairMatroid, &oddMatroid, &bigMatroid, &pairOddMatroid, &mixMatroid};
//a)
printf("Parte a) \n\n");
#pragma omp parallel sections
#pragma omp parallel section
functionIsPair(testA, 3);
#pragma omp parallel section
functionIsOdd(testA, 3);
#pragma omp parallel section
functionBig(ptrtestA, 3);
printf("Fin Parte a)----------------------------\n");
printf("\n\nParte b) \n\n");
//Se ajustan los matroids para que todos tengan al menos 1 elemento que sea valido para una misma funcion y que cumpla para la interseccion
pairMatroid.setS[9] = 101;
oddMatroid.setS[5] = 101;
pairOddMatroid.setS[5] = 101;
mixMatroid.setS[3] = 101;
#pragma omp parallel
functionBig(testB, 5);
calculateIntersection(testB, 5);
return 1;
}