-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathChooseOne.php
More file actions
35 lines (32 loc) · 1.19 KB
/
ChooseOne.php
File metadata and controls
35 lines (32 loc) · 1.19 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
<?
function ChooseOne($table, $num_rows, $num_cols)
{
global $TP;
global $horizontal_id;
global $vertical_id;
global $needed;
for ($i = 0; $i < $num_cols; $i++) {
for ($j = 0; $j < $num_rows; $j++) {
if ($table[$j][$i] == '1') {
$found = 1;
$needed[] = $vertical_id[$j]; //a ten vektor si ulozim medzi irredundantne implikanty
print("Aktuálne pole irredundantných implikantov : ");
foreach ($needed as $value) {
print($value . " ");
}
print("<br>\n");
for ($k = 0; $k < $num_cols; $k++) { //prejdeme vsetky stlpce, v ktorych ma ten vektor hodnotu 1, tieto stlpce sa vyhodia
if ($table[$j][$k] == '1') {
for ($l = 0; $l < $num_rows; $l++) {
$TP[$l][$k] = 2; //vyhodenie stlpca, teda cely sa vynuluje
}
}
}
for ($l = 0; $l < $num_cols; $l++) { //znulujeme aj cely riadok toho vektora
$TP[$j][$l] = 2;
}
return;
}
}
}
}