Ticket #900: 6951.patch

File 6951.patch, 4.3 KB (added by cwitty, 6 years ago)
  • c_lib/include/ntl_wrap.h

    # HG changeset patch
    # User Carl Witty <cwitty@newtonlabs.com>
    # Date 1192403310 25200
    # Node ID 32deec855431995bd24277155a09a51269e161a5
    # Parent  fd99175ab57d864d984ea38d14059df2738d6119
    Systematically rename square_free -> squarefree in function names (for consistency)
    
    diff -r fd99175ab57d -r 32deec855431 c_lib/include/ntl_wrap.h
    a b EXTERN void ZZX_preallocate_space(struct 
    123123//         e -- point to list of e longs (the exponents) 
    124124//         n -- length of above two lists 
    125125//  The lists v and e are mallocd, and must be freed by the calling code. 
    126 EXTERN void ZZX_square_free_decomposition(struct ZZX*** v, long** e, long* n, struct ZZX* x); 
     126EXTERN void ZZX_squarefree_decomposition(struct ZZX*** v, long** e, long* n, struct ZZX* x); 
    127127 
    128128 
    129129//////// ZZ_pX ////////// 
  • c_lib/src/ntl_wrap.cpp

    diff -r fd99175ab57d -r 32deec855431 c_lib/src/ntl_wrap.cpp
    a b EXTERN struct ZZ* ZZX_polyeval(struct ZZ 
    452452} 
    453453*/ 
    454454 
    455 void ZZX_square_free_decomposition(struct ZZX*** v, long** e, long* n, struct ZZX* x) 
     455void ZZX_squarefree_decomposition(struct ZZX*** v, long** e, long* n, struct ZZX* x) 
    456456{ 
    457457  vec_pair_ZZX_long factors; 
    458458  SquareFreeDecomp(factors, *x); 
  • sage/libs/ntl/decl.pxi

    diff -r fd99175ab57d -r 32deec855431 sage/libs/ntl/decl.pxi
    a b cdef extern from "ntl_wrap.h": 
    133133    void ZZX_XGCD "XGCD"(ZZ_c r, ZZX_c s, ZZX_c t, ZZX_c a, ZZX_c b, long deterministic) 
    134134    void ZZX_content "content"(ZZ_c d, ZZX_c f) 
    135135 
    136     void ZZX_square_free_decomposition(ZZX_c*** v, long** e, long* n, ZZX_c* x) 
     136    void ZZX_squarefree_decomposition(ZZX_c*** v, long** e, long* n, ZZX_c* x) 
    137137 
    138138    char* ZZX_repr(ZZX_c* x) 
    139139    ZZX_c* ZZX_copy(ZZX_c* x) 
  • sage/libs/ntl/ntl_ZZX.pyx

    diff -r fd99175ab57d -r 32deec855431 sage/libs/ntl/ntl_ZZX.pyx
    a b cdef class ntl_ZZX: 
    10771077        ZZX_preallocate_space(&self.x, n) 
    10781078        _sig_off 
    10791079 
    1080     def square_free_decomposition(self): 
     1080    def squarefree_decomposition(self): 
    10811081        """ 
    10821082        Returns the square-free decomposition of self (a partial 
    10831083        factorization into square-free, relatively prime polynomials) 
    cdef class ntl_ZZX: 
    10871087 
    10881088        EXAMPLES: 
    10891089            sage: f = ntl.ZZX([0, 1, 2, 1]) 
    1090             sage: f.square_free_decomposition() 
     1090            sage: f.squarefree_decomposition() 
    10911091            [([0 1], 1), ([1 1], 2)] 
    10921092        """ 
    10931093        cdef ZZX_c** v 
    10941094        cdef long* e 
    10951095        cdef long i, n 
    10961096        _sig_on 
    1097         ZZX_square_free_decomposition(&v, &e, &n, &self.x) 
     1097        ZZX_squarefree_decomposition(&v, &e, &n, &self.x) 
    10981098        _sig_off 
    10991099        F = [] 
    11001100        for i from 0 <= i < n: 
  • sage/rings/polynomial/polynomial_integer_dense_ntl.pyx

    diff -r fd99175ab57d -r 32deec855431 sage/rings/polynomial/polynomial_integer_dense_ntl.pyx
    a b cdef class Polynomial_integer_dense_ntl( 
    646646        return pari(self.list()).Polrev(variable) 
    647647 
    648648 
    649     def square_free_decomposition(self): 
     649    def squarefree_decomposition(self): 
    650650        """ 
    651651        Return the square-free decomposition of self.  This is 
    652652        a partial factorization of self into square-free, relatively 
    cdef class Polynomial_integer_dense_ntl( 
    657657        EXAMPLES: 
    658658            sage: R.<x> = PolynomialRing(ZZ) 
    659659            sage: p = 37 * (x-1)^2 * (x-2)^2 * (x-3)^3 * (x-4) 
    660             sage: p.square_free_decomposition() 
     660            sage: p.squarefree_decomposition() 
    661661            (37) * (x - 4) * (x^2 - 3*x + 2)^2 * (x - 3)^3 
    662662        """ 
    663663 
    cdef class Polynomial_integer_dense_ntl( 
    670670        cdef long* e 
    671671        cdef long i, n 
    672672        cdef Polynomial_integer_dense_ntl z 
    673         ZZX_square_free_decomposition(&v, &e, &n, &p.__poly) 
     673        ZZX_squarefree_decomposition(&v, &e, &n, &p.__poly) 
    674674        F = [] 
    675675        for i from 0 <= i < n: 
    676676            z = self._new()