-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCofactor.cpp
More file actions
55 lines (40 loc) · 1.12 KB
/
Cofactor.cpp
File metadata and controls
55 lines (40 loc) · 1.12 KB
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
54
55
using std::cout;
using std::cin;
using std::endl;
using std::vector;
#define Positive 1
#define Negative 2
#define DC 3
#define Zero 0
#define Vec_2D vector<vector<int>>
Vec_2D Cofactor(Vec_2D Pol_Comp_i, int most_binate, int Size, int No, int type){
//Positive Cofactor
if( type == 1){
for(int i = 0; i < No; i++){
if(Pol_Comp_i[i][most_binate] == Positive){
Pol_Comp_i[i][most_binate] = DC;
}
else if(Pol_Comp_i[i][most_binate] == Negative){
//Remove cubelist
Pol_Comp_i.erase(Pol_Comp_i.begin() + i);
i--;
No--;
}
}
}
//Negative Cofactor
else if( type == 0 ){
for(int i = 0; i < No; i++){
if(Pol_Comp_i[i][most_binate] == Negative){
Pol_Comp_i[i][most_binate] = DC;
}
else if(Pol_Comp_i[i][most_binate] == Positive){
//Remove cubelist
Pol_Comp_i.erase(Pol_Comp_i.begin() + i);
i--;
No--;
}
}
}
return Pol_Comp_i;
}