# Changeset 5645:2537226feb05

Ignore:
Timestamp:
08/08/07 13:09:57 (6 years ago)
Branch:
default
Message:

added libSINGULAR versions of std and slimgb Groebner basis computations
to get rid of conversion overhead for small GB calculations

Files:
4 edited

Unmodified
Removed
• ## sage/libs/singular/singular-cdefs.pxi

 r5192 ctypedef struct napoly "polyrec" cdef enum tHomog: isNotHomog isHomog testHomog cdef enum rRingOrder_t: ctypedef struct omBin "omBin_s" # numbers, i.e. coefficients # SINGULAR Init void idShow(ideal *i) int IDELEMS(ideal *i) void idSkipZeroes (ideal *ide) long idRankFreeModule(ideal *m, ring *r) ideal *kStd(ideal *i, ideal *q, tHomog h, intvec *w) ideal *t_rep_gb(ring *r,ideal *arg_I, int syz_comp, int F4_mode)
• ## sage/rings/polynomial/multi_polynomial_ideal.py

 r5623 return self.__groebner_basis def _groebner_basis_using_libsingular(self, algorithm="std"): """ Return a Groebner basis of this ideal. If a groebner basis for this ideal has been calculated before the cached Groebner basis is returned regardless of the requested algorithm. ALGORITHM: Uses libSINGULAR. INPUT: algorithm -- 'std'      - Buchberger's algorithm 'slimgb'   - SlimGB algorithm EXAMPLES: We compute a Groebner basis of 'cyclic 4' relative to lexicographic ordering. sage: R. = PolynomialRing(QQ, 4, order='lex') sage: I = sage.rings.ideal.Cyclic(R,4); I Ideal (a + b + c + d, a*b + a*d + b*c + c*d, a*b*c + a*b*d + a*c*d + b*c*d, a*b*c*d - 1) of Polynomial Ring in a, b, c, d over Rational Field sage: I._groebner_basis_using_libsingular() [c^2*d^6 - c^2*d^2 - d^4 + 1, c^3*d^2 + c^2*d^3 - c - d, b*d^4 - b + d^5 - d, b*c - b*d^5 + c^2*d^4 + c*d - d^6 - d^2, b^2 + 2*b*d + d^2, a + b + c + d] """ from sage.rings.polynomial.multi_polynomial_ideal_libsingular import std_libsingular, slimgb_libsingular try: return self.__groebner_basis except AttributeError: if algorithm=="std": S = std_libsingular(self) elif algorithm=="slimgb": S = slimgb_libsingular(self) else: raise TypeError, "algorithm '%s' unknown"%algorithm self.__groebner_basis = S return self.__groebner_basis def _singular_groebner_basis(self): try: elif algorithm.startswith('singular:'): return self._groebner_basis_using_singular(algorithm[9:]) elif algorithm.startswith('libsingular:'): return self._groebner_basis_using_libsingular(algorithm[len('libsingular:'):]) elif algorithm == 'macaulay2:gb': return self._macaulay2_groebner_basis()
• ## sage/rings/polynomial/multi_polynomial_libsingular.pxd

 r5615 cdef ring *_ring cdef int _cmp_c_impl(left, Parent right) except -2
• ## setup.py

 r5620 Extension('sage.rings.polynomial.multi_polynomial_libsingular', sources = ['sage/rings/polynomial/multi_polynomial_libsingular.pyx'], libraries = ['gmp', 'm', 'readline', 'singular', 'singcf', 'singfac', 'omalloc', 'givaro', 'gmpxx'], language="c++", include_dirs=[SAGE_ROOT +'/local/include/singular']), \ Extension('sage.rings.polynomial.multi_polynomial_ideal_libsingular', sources = ['sage/rings/polynomial/multi_polynomial_ideal_libsingular.pyx'], libraries = ['gmp', 'm', 'readline', 'singular', 'singcf', 'singfac', 'omalloc', 'givaro', 'gmpxx'], language="c++",
Note: See TracChangeset for help on using the changeset viewer.