-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest.cpp
More file actions
37 lines (30 loc) · 879 Bytes
/
Copy pathtest.cpp
File metadata and controls
37 lines (30 loc) · 879 Bytes
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
#include <iostream>
#include "lattice.h"
int main()
{
Lattice<int> lat(40, 40); // 40-demensional full-rank lattice
lat.setSVPChallenge(40, 0);
// set as a random lattice
// lat.setRandom(10, 10, 1000, 10000);
// print the lattice basis
std::cout << lat;
// compute GSO-information
lat.computeGSO();
// compute the shortest vector
std::vector<int> v = lat.mulVecBasis(lat.ENUM(4000000));
print(v);
// lattice basis reduction
// lat.L2(0.99, 0.51);
// lat.LLL(0.99);
// lat.dualBKZ(20, 0.99);
// lat.deepBKZ(30, 0.99);
// lat.dualDeepBKZ(30, 0.99);
lat.BKZ(20, 0.99);
// lat.BKZ(6, 0.99);
std::cout << lat.b1Norm() << std::endl;
std::cout << lat;
printf("rhf = %Lf\n", lat.rhf());
printf("sl = %Lf\n", lat.sl());
// std::cout << lat.volume(false) << std::endl;
return 0;
}