Skip to content

Commit

Permalink
Removed various bugs, extended unit test, added performance test
Browse files Browse the repository at this point in the history
  • Loading branch information
Folláth János committed Nov 18, 2014
1 parent c219ac2 commit d38db1b
Show file tree
Hide file tree
Showing 11 changed files with 77,043 additions and 87 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ doc/
# Ignore generated polytope files
*.ine

# Ignore profiling info
*.out

# Ignore generated lattices and boundary functions
*.dat
*.lat
Expand Down
24 changes: 14 additions & 10 deletions TODO
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
+ bounding function randomizálót irni
+ unit testet irni
- timing testet irni és lemérni gproffal
- optimalizálni a számitásokat (mindegyik után unit és timing test):
- a négyzetreemeléseket kihozni amennyire csak lehet
- előre számitani és táblázatból olvasni
- az egységgömbök térfogatát
- a faktoriálisokat
- a normalizáló konstansokat
- kikisérletezni, hogy mi az a legkisebb RR pontosság amire a 120-150 dimenziós számitás stabil
- letekerni a pontosságot amennyire csak lehet
- átállitani integer programozásra az optimalizálást
+ timing testet irni és lemérni gproffal
+ optimalizálni a számitásokat (mindegyik után unit és timing test):
+ a négyzetreemeléseket kihozni amennyire csak lehet - szkippeltem mert nem érdemes, igyis úgyis gyököt kell vonni a sugárhoz
+ előre számitani és táblázatból olvasni
+ a faktoriálisokat (nem működött)
+ a normalizáló konstansokat (cancelled - ha a faktorizálásnál nem használt akkor itt sem fog...)
+ az egységgömbök térfogatát (cancelled - ha a faktorizálásnál nem használt akkor itt sem fog...)
+ kikisérletezni, hogy mi az a legkisebb RR pontosság amire a 120-150 dimenziós számitás stabil (120 bit szemre annak látszik)
+ letekerni a pontosságot amennyire csak lehet
+ átállitani integer programozásra az optimalizálást
+ induláskor mérjen le 10-et és az alapján irja ki a várható befejezési időt és a végén meg a teljes futái időt (elég egyet is)
+ grafikonokat készíteni a célfüggvény értékéről illetve a változások arányáról a megtett lépések függvényében
- tudjon a progi megszakítás után elmentett állapotból folytatni

******** Itt lesz kész az extreme pruning *****
- Megnézni az early termination-ös cikkeket, hogy milyen blokkméretet lenne érdemes használni egy 128 dimenziós bázis előfeldolgozásához
Expand All @@ -22,3 +25,4 @@

******** Itt lesz kész a BKZ2.0 **********


11 changes: 6 additions & 5 deletions app/boundtool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,13 @@ bool cmd_option_exists(char** begin, char** end, const string& option);


int main(int argc, char** argv) {
double v= 0;
double t_node= 0;
double t_reduc= 0;
double delta= 1e-1;
unsigned long iterations= 1000;
mat_ZZ basis;
ZZ v;
v= 0;

stringstream ss;
char* act_arg;
Expand Down Expand Up @@ -162,8 +163,8 @@ int main(int argc, char** argv) {

//length of the shortest vector in the cjloss lattice
if(v>0) {
v= sqrt(v);
cout << "# Using supplied lambda : " << v << endl;
//v= sqrt(v);
cout << "# Using supplied lambda square: " << v << endl;
}
else {
double tmp,gh= 1;
Expand All @@ -175,8 +176,8 @@ int main(int argc, char** argv) {
}
delete gsghs;
gh= pow(gh/ball_vol(dim, 1),1.0/dim);
cout << "# No lambda supplied, using Gaussian heuristic (+5\%) : " << gh*1.05 << endl;
v= gh*1.05;
v= gh*gh;
cout << "# No lambda square supplied, using Gaussian heuristic: " << v << endl;
}


Expand Down
4 changes: 2 additions & 2 deletions debug.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ extension="${filename##*.}"
filename="${filename%.*}"

# gnuplot -p -e "set terminal pdf;set output '$filename.pdf';unset key;set yrange [0:*];plot '$1'"
#gnuplot -p -e "set terminal pdf;set output '$filename.pdf';set yrange [0:*]; plot '$1' i 0 u 1:2 w lines title columnheader(1), '$1' i 1 u 1:2 w lines title columnheader(1)"
gnuplot -p -e "set terminal pdf;set output '$filename.pdf';set yrange [1:*];set logscale y; plot '$1' i 0 u 1:2 w dots title columnheader(1), '$1' i 1 u 1:2 w dots title columnheader(1)"
gnuplot -p -e "set terminal pdf;set output '$filename.pdf';set yrange [0:*]; plot '$1' i 0 u 1:2 w lines title columnheader(1), '$1' i 1 u 1:2 w lines title columnheader(1)"
#gnuplot -p -e "set terminal pdf;set output '$filename.pdf';set yrange [1:*];set logscale y; plot '$1' i 0 u 1:2 w dots title columnheader(1), '$1' i 1 u 1:2 w dots title columnheader(1)"
#gnuplot -p -e "set terminal pdf;set output '$filename.pdf';set yrange [1:*];set logscale y; plot '$1' i 0 u 1:2 w dots title columnheader(1), '$1' i 1 u 1:2 w dots title columnheader(1)"
#gnuplot -p -e "set terminal pdf;set output '$filename.pdf';set yrange [1:1.21e+24];set logscale y; set ytics(1.02e+03,1.05e+06,1.07e+09,1.1e+12,1.13e+15,1.15e+18,1.18e+21,1.21e+24);plot '$1' i 0 u 1:2 title columnheader(1)"
#gnuplot -p -e "set terminal pdf;set output '$filename.pdf';set yrange [1:*];set logscale y; plot '$1' i 0 u 1:2 w dots title columnheader(1), '$1' i 1 u 1:2 w dots title columnheader(1), '$1' i 2 u 1:2 w dots title columnheader(1)"
4 changes: 2 additions & 2 deletions include/cleanbkz/boundary.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

using namespace NTL;

#define RR_PRECISION 200
#define RR_PRECISION 120

/** @file
@brief Contains algorithms for finding the optimal bounding function for a lattice. */
Expand Down Expand Up @@ -54,7 +54,7 @@ void generate_boundary(
double t_reduc, //!< The running time of the basis reduction algorithm used
int n, //!< The dimension of the lattice
double Rvec[], //!< Container with enough space reserved for the result (n double values)
double R, //!< The length of the vector the enumeration is looking for
NTL::ZZ R, //!< The square length of the vector the enumeration is looking for
double delta, //!< The step of the random modifications
unsigned long iterations, //!< The number of random modifications to test
double& p_succ, //!< Container for the success probability of the resulting function
Expand Down
Loading

0 comments on commit d38db1b

Please sign in to comment.