-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.cpp
35 lines (23 loc) · 943 Bytes
/
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
#include <boost/multiprecision/cpp_int.hpp>
using T = boost::multiprecision::cpp_int;
const int k = 4;
const int dimension = 1<<k;
#include "gadget.h"
#include "rational.h"
#include "optimizer.h"
#include "orbit.h"
#include <vector>
#include <iostream>
int main() {
std::cout << "Analyzing orbits of the symmetry group..." << std::endl;
OrbitInfo orbitInfo;
Optimizer optimizer;
Evaluator evaluator(orbitInfo);
std::cout << "Optimizing gadget..." << std::endl;
auto gadget = optimizer.gadgetSearch(orbitInfo);
std::cout << "Finished optimizing gadget" << std::endl;
auto randomCost = evaluator.relaxedRandomCost(gadget);
auto dictCost = Rational<T>(gadget.getTotalWeight(), dimension);
auto inapproximabilityFactor = randomCost / dictCost;
std::cout << "The found gadget has inapproximability factor " << inapproximabilityFactor.a << "/" << inapproximabilityFactor.b << std::endl;
}