# HG changeset patch
# User JeanPierre Flori <jeanpierre.flori@ssi.gouv.fr>
# Date 1369749542 7200
# Node ID 97223a428ccd5464e90ea4b1c1aaee0f36b7b033
# Parent cd1cc2ccea1888173e09580c240233a66b3ba9e1
Update fplll to version 4.0.4.
diff git a/module_list.py b/module_list.py
a

b


637  637  libraries = ['gmp', 'mpfr', 'stdc++', 'fplll'], 
638  638  language="c++", 
639  639  include_dirs = [SAGE_INC + '/fplll'], 
 640  extra_compile_args=["DFPLLL_V3_COMPAT"], 
640  641  depends = [SAGE_INC + "/fplll/fplll.h"]), 
641  642  
642  643  Extension('sage.libs.linbox.linbox', 
diff git a/sage/libs/fplll/fplll.pxi b/sage/libs/fplll/fplll.pxi
a

b


10  10  # 
11  11  
12  12  cdef extern from "fplll/nr.h": 
13   ctypedef struct Z_NR "Z_NR<mpz_t>": 
 13  ctypedef struct Z_NR "fplll::Z_NR<mpz_t>": 
14  14  mpz_t (*GetData)() 
15  15  void (*set_mpz_t "set")(mpz_t d) 
16  16  
17   Z_NR *Z_NR_new "new Z_NR<mpz_t>"() 
 17  Z_NR *Z_NR_new "new fplll::Z_NR<mpz_t>"() 
18  18  void Z_NR_delete "delete "(Z_NR *mem) 
19  19  
20   Z_NR *Z_NR_construct "Construct< Z_NR<mpz_t> >"(void *mem) 
21   void Z_NR_destruct "Destruct< Z_NR<mpz_t> >"(Z_NR *mem) 
 20  Z_NR *Z_NR_construct "Construct< fplll::Z_NR<mpz_t> >"(void *mem) 
 21  void Z_NR_destruct "Destruct< fplll::Z_NR<mpz_t> >"(Z_NR *mem) 
22  22  
23  23  # 
24  24  # matrices over the integers 
25  25  # 
26  26  
27  27  cdef extern from "fplll/matrix.h": 
28   ctypedef struct ZZ_mat "ZZ_mat<mpz_t>": 
 28  ctypedef struct ZZ_mat "fplll::ZZ_mat<mpz_t>": 
29  29  int (*GetNumCols)() 
30  30  int (*GetNumRows)() 
31  31  
… 
… 

41  41  void (*gen_ntrulike2)(int bits,int q) 
42  42  void (*gen_ajtai)(double alpha) 
43  43  
44   ZZ_mat *ZZ_mat_new "new ZZ_mat<mpz_t>"(int r, int c) 
 44  ZZ_mat *ZZ_mat_new "new fplll::ZZ_mat<mpz_t>"(int r, int c) 
45  45  void ZZ_mat_delete "delete "(ZZ_mat *mem) 
46  46  
47  47  # 
48  48  # fastest LLL 
49  49  # 
50  50  
51   cdef extern from "fplll/fast.h": 
52   ctypedef struct fast_double "fast<mpz_t,double>": 
 51  cdef extern from "fplll/fplllv31.h": 
 52  ctypedef struct fast_double "fplll::fast<mpz_t,double>": 
53  53  int (*LLL)() 
54  54  ZZ_mat* (*GetBase)() 
55  55  
56   fast_double *fast_double_new "new fast<mpz_t,double>"(ZZ_mat *B,int precision, double eta, double delta) 
 56  fast_double *fast_double_new "new fplll::fast<mpz_t,double>"(ZZ_mat *B,int precision, double eta, double delta) 
57  57  void fast_double_delete "delete "(fast_double *mem) 
58  58  
59  59  # 
60  60  # fastest LLL with early reduction 
61  61  # 
62  62  
63   cdef extern from "fplll/fast_earlyred.h": 
64   ctypedef struct fast_early_red_double "fast_early_red<mpz_t,double>": 
 63  cdef extern from "fplll/fplllv31.h": 
 64  ctypedef struct fast_early_red_double "fplll::fast_early_red<mpz_t,double>": 
65  65  int (*LLL)() 
66  66  ZZ_mat* (*GetBase)() 
67  67  
68   fast_early_red_double *fast_early_red_double_new "new fast_early_red<mpz_t,double>"(ZZ_mat *B,int precision, double eta, double delta) 
 68  fast_early_red_double *fast_early_red_double_new "new fplll::fast_early_red<mpz_t,double>"(ZZ_mat *B,int precision, double eta, double delta) 
69  69  void fast_early_red_double_delete "delete "(fast_early_red_double *mem) 
70  70  
71  71  # 
72  72  # heuristic 
73  73  # 
74  74  
75   cdef extern from "fplll/heuristic.h": 
76   ctypedef struct heuristic_mpfr "heuristic<mpz_t,mpfr_t>": 
 75  cdef extern from "fplll/fplllv31.h": 
 76  ctypedef struct heuristic_mpfr "fplll::heuristic<mpz_t,mpfr_t>": 
77  77  int (*LLL)() 
78  78  ZZ_mat* (*GetBase)() 
79  79  
80   heuristic_mpfr *heuristic_mpfr_new "new heuristic<mpz_t,mpfr_t>"(ZZ_mat *B,int precision, double eta, double delta) 
 80  heuristic_mpfr *heuristic_mpfr_new "new fplll::heuristic<mpz_t,mpfr_t>"(ZZ_mat *B,int precision, double eta, double delta) 
81  81  void heuristic_mpfr_delete "delete "(heuristic_mpfr *mem) 
82  82  
83   ctypedef struct heuristic_dpe "heuristic<mpz_t,dpe_t>": 
 83  ctypedef struct heuristic_dpe "fplll::heuristic<mpz_t,dpe_t>": 
84  84  int (*LLL)() 
85  85  ZZ_mat* (*GetBase)() 
86  86  
87   heuristic_dpe *heuristic_dpe_new "new heuristic<mpz_t,dpe_t>"(ZZ_mat *B,int precision, double eta, double delta) 
 87  heuristic_dpe *heuristic_dpe_new "new fplll::heuristic<mpz_t,dpe_t>"(ZZ_mat *B,int precision, double eta, double delta) 
88  88  void heuristic_dpe_delete "delete "(heuristic_dpe *mem) 
89  89  
90   ctypedef struct heuristic_double "heuristic<mpz_t,double>": 
 90  ctypedef struct heuristic_double "fplll::heuristic<mpz_t,double>": 
91  91  int (*LLL)() 
92  92  ZZ_mat* (*GetBase)() 
93  93  
94   heuristic_double *heuristic_double_new "new heuristic<mpz_t,double>"(ZZ_mat *B,int precision, double eta, double delta) 
 94  heuristic_double *heuristic_double_new "new fplll::heuristic<mpz_t,double>"(ZZ_mat *B,int precision, double eta, double delta) 
95  95  void heuristic_double_delete "delete "(heuristic_double *mem) 
96  96  
97  97  # 
98  98  # heuristic with early reduction 
99  99  # 
100  100  
101   cdef extern from "fplll/heuristic_early_red.h": 
102   ctypedef struct heuristic_early_red_mpfr "heuristic_early_red<mpz_t,mpfr_t>": 
 101  cdef extern from "fplll/fplllv31.h": 
 102  ctypedef struct heuristic_early_red_mpfr "fplll::heuristic_early_red<mpz_t,mpfr_t>": 
103  103  int (*LLL)() 
104  104  ZZ_mat* (*GetBase)() 
105  105  
106   heuristic_early_red_mpfr *heuristic_early_red_mpfr_new "new heuristic_early_red<mpz_t,mpfr_t>"(ZZ_mat *B,int precision, double eta, double delta) 
 106  heuristic_early_red_mpfr *heuristic_early_red_mpfr_new "new fplll::heuristic_early_red<mpz_t,mpfr_t>"(ZZ_mat *B,int precision, double eta, double delta) 
107  107  void heuristic_early_red_mpfr_delete "delete "(heuristic_early_red_mpfr *mem) 
108  108  
109   ctypedef struct heuristic_early_red_dpe "heuristic_early_red<mpz_t,dpe_t>": 
 109  ctypedef struct heuristic_early_red_dpe "fplll::heuristic_early_red<mpz_t,dpe_t>": 
110  110  int (*LLL)() 
111  111  ZZ_mat* (*GetBase)() 
112  112  
113   heuristic_early_red_dpe *heuristic_early_red_dpe_new "new heuristic_early_red<mpz_t,dpe_t>"(ZZ_mat *B,int precision, double eta, double delta) 
 113  heuristic_early_red_dpe *heuristic_early_red_dpe_new "new fplll::heuristic_early_red<mpz_t,dpe_t>"(ZZ_mat *B,int precision, double eta, double delta) 
114  114  void heuristic_early_red_dpe_delete "delete "(heuristic_early_red_dpe *mem) 
115  115  
116   ctypedef struct heuristic_early_red_double "heuristic_early_red<mpz_t,double>": 
 116  ctypedef struct heuristic_early_red_double "fplll::heuristic_early_red<mpz_t,double>": 
117  117  int (*LLL)() 
118  118  ZZ_mat* (*GetBase)() 
119  119  
120   heuristic_early_red_double *heuristic_early_red_double_new "new heuristic_early_red<mpz_t,double>"(ZZ_mat *B,int precision, double eta, double delta) 
 120  heuristic_early_red_double *heuristic_early_red_double_new "new fplll::heuristic_early_red<mpz_t,double>"(ZZ_mat *B,int precision, double eta, double delta) 
121  121  void heuristic_early_red_double_delete "delete "(heuristic_early_red_double *mem) 
122  122  
123  123  
… 
… 

126  126  # provable LLL 
127  127  # 
128  128  
129   cdef extern from "fplll/proved.h": 
130   ctypedef struct proved_mpfr "proved<mpz_t,mpfr_t>": 
 129  cdef extern from "fplll/fplllv31.h": 
 130  ctypedef struct proved_mpfr "fplll::proved<mpz_t,mpfr_t>": 
131  131  int (*LLL)() 
132  132  ZZ_mat* (*GetBase)() 
133  133  
134   proved_mpfr *proved_mpfr_new "new proved<mpz_t,mpfr_t>"(ZZ_mat *B,int precision, double eta, double delta) 
 134  proved_mpfr *proved_mpfr_new "new fplll::proved<mpz_t,mpfr_t>"(ZZ_mat *B,int precision, double eta, double delta) 
135  135  void proved_mpfr_delete "delete "(proved_mpfr *mem) 
136  136  
137   ctypedef struct proved_dpe "proved<mpz_t,dpe_t>": 
 137  ctypedef struct proved_dpe "fplll::proved<mpz_t,dpe_t>": 
138  138  int (*LLL)() 
139  139  ZZ_mat* (*GetBase)() 
140  140  
141   proved_dpe *proved_dpe_new "new proved<mpz_t,dpe_t>"(ZZ_mat *B,int precision, double eta, double delta) 
 141  proved_dpe *proved_dpe_new "new fplll::proved<mpz_t,dpe_t>"(ZZ_mat *B,int precision, double eta, double delta) 
142  142  void proved_dpe_delete "delete "(proved_dpe *mem) 
143  143  
144   ctypedef struct proved_double "proved<mpz_t,double>": 
 144  ctypedef struct proved_double "fplll::proved<mpz_t,double>": 
145  145  int (*LLL)() 
146  146  ZZ_mat* (*GetBase)() 
147  147  
148   proved_double *proved_double_new "new proved<mpz_t,double>"(ZZ_mat *B,int precision, double eta, double delta) 
 148  proved_double *proved_double_new "new fplll::proved<mpz_t,double>"(ZZ_mat *B,int precision, double eta, double delta) 
149  149  void proved_double_delete "delete "(proved_double *mem) 
150  150  
151  151  # 
152  152  # wrapper code which chooses a LLL sequence automatically 
153  153  # 
154  154  
155   cdef extern from "fplll/wrapper.h": 
156   ctypedef struct wrapper: 
 155  cdef extern from "fplll/fplllv31.h": 
 156  ctypedef struct wrapper "fplll::wrapper": 
157  157  int (*LLL)() 
158  158  ZZ_mat* (*GetBase)() 
159  159  
160   wrapper *wrapper_new "new wrapper"(ZZ_mat *B,int precision, double eta, double delta) 
 160  wrapper *wrapper_new "new fplll::wrapper"(ZZ_mat *B,int precision, double eta, double delta) 
161  161  void wrapper_delete "delete "(wrapper *mem) 