# 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 |
| 123 | 123 | // e -- point to list of e longs (the exponents) |
| 124 | 124 | // n -- length of above two lists |
| 125 | 125 | // 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); |
| | 126 | EXTERN void ZZX_squarefree_decomposition(struct ZZX*** v, long** e, long* n, struct ZZX* x); |
| 127 | 127 | |
| 128 | 128 | |
| 129 | 129 | //////// ZZ_pX ////////// |
diff -r fd99175ab57d -r 32deec855431 c_lib/src/ntl_wrap.cpp
|
a
|
b
|
EXTERN struct ZZ* ZZX_polyeval(struct ZZ |
| 452 | 452 | } |
| 453 | 453 | */ |
| 454 | 454 | |
| 455 | | void ZZX_square_free_decomposition(struct ZZX*** v, long** e, long* n, struct ZZX* x) |
| | 455 | void ZZX_squarefree_decomposition(struct ZZX*** v, long** e, long* n, struct ZZX* x) |
| 456 | 456 | { |
| 457 | 457 | vec_pair_ZZX_long factors; |
| 458 | 458 | SquareFreeDecomp(factors, *x); |
diff -r fd99175ab57d -r 32deec855431 sage/libs/ntl/decl.pxi
|
a
|
b
|
cdef extern from "ntl_wrap.h": |
| 133 | 133 | void ZZX_XGCD "XGCD"(ZZ_c r, ZZX_c s, ZZX_c t, ZZX_c a, ZZX_c b, long deterministic) |
| 134 | 134 | void ZZX_content "content"(ZZ_c d, ZZX_c f) |
| 135 | 135 | |
| 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) |
| 137 | 137 | |
| 138 | 138 | char* ZZX_repr(ZZX_c* x) |
| 139 | 139 | ZZX_c* ZZX_copy(ZZX_c* x) |
diff -r fd99175ab57d -r 32deec855431 sage/libs/ntl/ntl_ZZX.pyx
|
a
|
b
|
cdef class ntl_ZZX: |
| 1077 | 1077 | ZZX_preallocate_space(&self.x, n) |
| 1078 | 1078 | _sig_off |
| 1079 | 1079 | |
| 1080 | | def square_free_decomposition(self): |
| | 1080 | def squarefree_decomposition(self): |
| 1081 | 1081 | """ |
| 1082 | 1082 | Returns the square-free decomposition of self (a partial |
| 1083 | 1083 | factorization into square-free, relatively prime polynomials) |
| … |
… |
cdef class ntl_ZZX: |
| 1087 | 1087 | |
| 1088 | 1088 | EXAMPLES: |
| 1089 | 1089 | sage: f = ntl.ZZX([0, 1, 2, 1]) |
| 1090 | | sage: f.square_free_decomposition() |
| | 1090 | sage: f.squarefree_decomposition() |
| 1091 | 1091 | [([0 1], 1), ([1 1], 2)] |
| 1092 | 1092 | """ |
| 1093 | 1093 | cdef ZZX_c** v |
| 1094 | 1094 | cdef long* e |
| 1095 | 1095 | cdef long i, n |
| 1096 | 1096 | _sig_on |
| 1097 | | ZZX_square_free_decomposition(&v, &e, &n, &self.x) |
| | 1097 | ZZX_squarefree_decomposition(&v, &e, &n, &self.x) |
| 1098 | 1098 | _sig_off |
| 1099 | 1099 | F = [] |
| 1100 | 1100 | for i from 0 <= i < n: |
diff -r fd99175ab57d -r 32deec855431 sage/rings/polynomial/polynomial_integer_dense_ntl.pyx
|
a
|
b
|
cdef class Polynomial_integer_dense_ntl( |
| 646 | 646 | return pari(self.list()).Polrev(variable) |
| 647 | 647 | |
| 648 | 648 | |
| 649 | | def square_free_decomposition(self): |
| | 649 | def squarefree_decomposition(self): |
| 650 | 650 | """ |
| 651 | 651 | Return the square-free decomposition of self. This is |
| 652 | 652 | a partial factorization of self into square-free, relatively |
| … |
… |
cdef class Polynomial_integer_dense_ntl( |
| 657 | 657 | EXAMPLES: |
| 658 | 658 | sage: R.<x> = PolynomialRing(ZZ) |
| 659 | 659 | 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() |
| 661 | 661 | (37) * (x - 4) * (x^2 - 3*x + 2)^2 * (x - 3)^3 |
| 662 | 662 | """ |
| 663 | 663 | |
| … |
… |
cdef class Polynomial_integer_dense_ntl( |
| 670 | 670 | cdef long* e |
| 671 | 671 | cdef long i, n |
| 672 | 672 | 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) |
| 674 | 674 | F = [] |
| 675 | 675 | for i from 0 <= i < n: |
| 676 | 676 | z = self._new() |