Ticket #12835: sage-fplll.patch

File sage-fplll.patch, 8.9 KB (added by pcpa, 9 years ago)

sage patch

  • sage-5.4.beta1/spkg/build/sage-5.4.beta1/module_list.py

    diff -up sage-5.4.beta1/spkg/build/sage-5.4.beta1/module_list.py.orig sage-5.4.beta1/spkg/build/sage-5.4.beta1/module_list.py
    old new ext_modules = [ 
    612612              libraries = ['gmp', 'mpfr', 'stdc++', 'fplll'],
    613613              language="c++",
    614614              include_dirs = [SAGE_INC + 'fplll'],
     615              extra_compile_args=["-DFPLLL_V3_COMPAT"],
    615616              depends = [SAGE_INC + "fplll/fplll.h"]),
    616617
    617618    Extension('sage.libs.linbox.linbox',
  • sage-5.4.beta1/spkg/build/sage-5.4.beta1/sage/libs/fplll/fplll.pxi

    diff -up sage-5.4.beta1/spkg/build/sage-5.4.beta1/sage/libs/fplll/fplll.pxi.orig sage-5.4.beta1/spkg/build/sage-5.4.beta1/sage/libs/fplll/fplll.pxi
    old new cdef extern from "fplll/fplll.h": 
    1010#
    1111
    1212cdef extern from "fplll/nr.h":
    13     ctypedef struct Z_NR "Z_NR<mpz_t>":
     13    ctypedef struct Z_NR "fplll::Z_NR<mpz_t>":
    1414        mpz_t (*GetData)()
    1515        void (*set_mpz_t "set")(mpz_t d)
    1616
    17     Z_NR *Z_NR_new "new Z_NR<mpz_t>"()
     17    Z_NR *Z_NR_new "new fplll::Z_NR<mpz_t>"()
    1818    void Z_NR_delete "delete "(Z_NR *mem)
    1919
    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)
    2222
    2323#
    2424# matrices over the integers
    2525#
    2626
    2727cdef extern from "fplll/matrix.h":
    28     ctypedef struct ZZ_mat "ZZ_mat<mpz_t>":
     28    ctypedef struct ZZ_mat "fplll::ZZ_mat<mpz_t>":
    2929        int (*GetNumCols)()
    3030        int (*GetNumRows)()
    3131
    cdef extern from "fplll/matrix.h": 
    4141        void (*gen_ntrulike2)(int bits,int q)
    4242        void (*gen_ajtai)(double alpha)
    4343
    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)
    4545    void ZZ_mat_delete "delete "(ZZ_mat *mem)
    4646
    4747#
    4848# fastest LLL
    4949#
    5050
    51 cdef  extern from "fplll/fast.h":
    52     ctypedef struct fast_double "fast<mpz_t,double>":
     51cdef  extern from "fplll/fplllv31.h":
     52    ctypedef struct fast_double "fplll::fast<mpz_t,double>":
    5353      int (*LLL)()
    5454      ZZ_mat* (*GetBase)()
    5555
    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)
    5757    void fast_double_delete "delete "(fast_double *mem)
    5858
    5959#
    6060# fastest LLL with early reduction
    6161#
    6262
    63 cdef  extern from "fplll/fast_earlyred.h":
    64     ctypedef struct fast_early_red_double "fast_early_red<mpz_t,double>":
     63cdef  extern from "fplll/fplllv31.h":
     64    ctypedef struct fast_early_red_double "fplll::fast_early_red<mpz_t,double>":
    6565      int (*LLL)()
    6666      ZZ_mat* (*GetBase)()
    6767
    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)
    6969    void fast_early_red_double_delete "delete "(fast_early_red_double *mem)
    7070
    7171#
    7272# heuristic
    7373#
    7474
    75 cdef  extern from "fplll/heuristic.h":
    76     ctypedef struct heuristic_mpfr "heuristic<mpz_t,mpfr_t>":
     75cdef  extern from "fplll/fplllv31.h":
     76    ctypedef struct heuristic_mpfr "fplll::heuristic<mpz_t,mpfr_t>":
    7777      int (*LLL)()
    7878      ZZ_mat* (*GetBase)()
    7979
    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)
    8181    void heuristic_mpfr_delete "delete "(heuristic_mpfr *mem)
    8282
    83     ctypedef struct heuristic_dpe "heuristic<mpz_t,dpe_t>":
     83    ctypedef struct heuristic_dpe "fplll::heuristic<mpz_t,dpe_t>":
    8484      int (*LLL)()
    8585      ZZ_mat* (*GetBase)()
    8686
    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)
    8888    void heuristic_dpe_delete "delete "(heuristic_dpe *mem)
    8989
    90     ctypedef struct heuristic_double "heuristic<mpz_t,double>":
     90    ctypedef struct heuristic_double "fplll::heuristic<mpz_t,double>":
    9191      int (*LLL)()
    9292      ZZ_mat* (*GetBase)()
    9393
    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)
    9595    void heuristic_double_delete "delete "(heuristic_double *mem)
    9696
    9797#
    9898# heuristic with early reduction
    9999#
    100100
    101 cdef  extern from "fplll/heuristic_early_red.h":
    102     ctypedef struct heuristic_early_red_mpfr "heuristic_early_red<mpz_t,mpfr_t>":
     101cdef  extern from "fplll/fplllv31.h":
     102    ctypedef struct heuristic_early_red_mpfr "fplll::heuristic_early_red<mpz_t,mpfr_t>":
    103103      int (*LLL)()
    104104      ZZ_mat* (*GetBase)()
    105105
    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)
    107107    void heuristic_early_red_mpfr_delete "delete "(heuristic_early_red_mpfr *mem)
    108108
    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>":
    110110      int (*LLL)()
    111111      ZZ_mat* (*GetBase)()
    112112
    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)
    114114    void heuristic_early_red_dpe_delete "delete "(heuristic_early_red_dpe *mem)
    115115
    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>":
    117117      int (*LLL)()
    118118      ZZ_mat* (*GetBase)()
    119119
    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)
    121121    void heuristic_early_red_double_delete "delete "(heuristic_early_red_double *mem)
    122122
    123123
    cdef extern from "fplll/heuristic_early 
    126126# provable LLL
    127127#
    128128
    129 cdef  extern from "fplll/proved.h":
    130     ctypedef struct proved_mpfr "proved<mpz_t,mpfr_t>":
     129cdef  extern from "fplll/fplllv31.h":
     130    ctypedef struct proved_mpfr "fplll::proved<mpz_t,mpfr_t>":
    131131      int (*LLL)()
    132132      ZZ_mat* (*GetBase)()
    133133
    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)
    135135    void proved_mpfr_delete "delete "(proved_mpfr *mem)
    136136
    137     ctypedef struct proved_dpe "proved<mpz_t,dpe_t>":
     137    ctypedef struct proved_dpe "fplll::proved<mpz_t,dpe_t>":
    138138      int (*LLL)()
    139139      ZZ_mat* (*GetBase)()
    140140
    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)
    142142    void proved_dpe_delete "delete "(proved_dpe *mem)
    143143
    144     ctypedef struct proved_double "proved<mpz_t,double>":
     144    ctypedef struct proved_double "fplll::proved<mpz_t,double>":
    145145      int (*LLL)()
    146146      ZZ_mat* (*GetBase)()
    147147
    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)
    149149    void proved_double_delete "delete "(proved_double *mem)
    150150
    151151#
    152152# wrapper code which chooses a LLL sequence automatically
    153153#
    154154
    155 cdef  extern from "fplll/wrapper.h":
    156     ctypedef struct wrapper:
     155cdef  extern from "fplll/fplllv31.h":
     156    ctypedef struct wrapper "fplll::wrapper":
    157157      int (*LLL)()
    158158      ZZ_mat* (*GetBase)()
    159159
    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)
    161161    void wrapper_delete "delete "(wrapper *mem)