-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
45 lines (39 loc) · 1.11 KB
/
main.cpp
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
/*
title: Tabular method solver
author: 윤상건 (Sang-geon Yun, [email protected])
*/
#include <iostream>
#include <vector>
#include "headers/TabularMethodSolver.h"
using namespace std;
typedef unsigned long long int ull;
int main(){
freopen("./testCases.txt", "r", stdin);
int tcase; cin >> tcase;
while(tcase--){
vector<ull> minterms, dontcares;
int m, d;
cin >> m;
cout << "Minterms: ";
for(int i = 0; i < m; ++i){
ull t; cin >> t;
minterms.push_back(t);
cout << t << ", ";
}
cin >> d;
cout << endl << "Dont cares: ";
for(int i = 0; i < d; ++i){
ull t; cin >> t;
dontcares.push_back(t);
cout << t << ", ";
}
cout << endl;
Tabular tabular(minterms, dontcares);
string trueSolution = tabular.solve(false, true);
string approxSolution = tabular.solve(true);
cout << "True solution: " << trueSolution << endl;
cout << "Approximation: " << approxSolution << endl;
cout << endl;
}
return 0;
}