close Warning: Can't synchronize with repository "(default)" (The repository directory has changed, you should resynchronize the repository with: trac-admin $ENV repository resync '(default)'). Look in the Trac log for more information.

source: branches/f4grobner/grobner-wrap.lisp@ 1624

Last change on this file since 1624 was 1624, checked in by Marek Rychlik, 9 years ago

* empty log message *

File size: 2.8 KB
RevLine 
[1201]1;;; -*- Mode: Lisp -*-
[511]2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3;;;
4;;; Copyright (C) 1999, 2002, 2009, 2015 Marek Rychlik <rychlik@u.arizona.edu>
5;;;
6;;; This program is free software; you can redistribute it and/or modify
7;;; it under the terms of the GNU General Public License as published by
8;;; the Free Software Foundation; either version 2 of the License, or
9;;; (at your option) any later version.
10;;;
11;;; This program is distributed in the hope that it will be useful,
12;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
13;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14;;; GNU General Public License for more details.
15;;;
16;;; You should have received a copy of the GNU General Public License
17;;; along with this program; if not, write to the Free Software
18;;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19;;;
20;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
21
22;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
23;;
24;; Selection of algorithm and pair heuristic
25;;
26;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
27
28(defpackage "GROBNER-WRAP"
[1363]29 (:use :cl :buchberger :gebauer-moeller :gb-postprocessing :division :ring-and-order)
[514]30 (:export "$POLY_GROBNER_ALGORITHM" "GROBNER" "REDUCED-GROBNER"))
[511]31
32(in-package :grobner-wrap)
33
[1622]34(defun choose-grobner-algorithm (algorithm)
[511]35 "Return a function which calculates Grobner basis, based on its
36names. Names currently used are either Lisp symbols, Maxima symbols or
37keywords."
38 (ecase algorithm
[1374]39 ((buchberger :buchberger $buchberger)
40 #'buchberger)
41 ((parallel-buchberger :parallel-buchberger $parallel_buchberger)
42 #'parallel-buchberger)
[1524]43 ((gebauer-moeller :gebauer-moeller :gebauer_moeller $gebauer_moeller)
[1374]44 #'gebauer-moeller)))
[511]45
[1376]46(defun grobner (ring-and-order f
47 &optional
48 (start 0)
[1377]49 (top-reduction-only $poly_top_reduction_only))
[1375]50 "Compute the Groebner basis of an ideal generated by F. Optionally,
51assume that first START elements are already a grobner basis.
[1376]52If TOP-REDUCTION-ONLY is T then perform top reduction only."
[1362]53 (declare (type ring-and-order ring-and-order))
[511]54 ;;(setf F (sort F #'< :key #'sugar))
[1623]55 (funcall
56 (choose-grobner-function $poly_grobner_algorithm)
[1360]57 ring-and-order f start top-reduction-only))
[511]58
[1378]59(defun reduced-grobner (ring-and-order f
60 &optional
61 (start 0)
62 (top-reduction-only $poly_top_reduction_only))
[1362]63 (declare (type ring-and-order ring-and-order))
[1538]64 (reduction ring-and-order
[1602]65 (grobner ring-and-order
[1538]66 f
67 start
[1602]68 top-reduction-only)))
Note: See TracBrowser for help on using the repository browser.