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.

Changeset 1669 for branches


Ignore:
Timestamp:
2015-06-14T20:51:05-07:00 (9 years ago)
Author:
Marek Rychlik
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/f4grobner/mx-grobner.lisp

    r1659 r1669  
    6969;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    7070
    71 (defparameter *maxima-ring*
     71(defparameter +maxima-ring+
    7272    (make-ring
    7373     ;;(defun coeff-zerop (expr) (meval1 `(($is) (($equal) ,expr 0))))
     
    132132    (case ring
    133133      ((maxima-ring  :maxima-ring #:maxima-ring $expression_ring #:expression_ring)
    134        *maxima-ring*)
    135       ((ring-of-integers :ring-of-integers #:ring-of-integers $ring_of_integers) *ring-of-integers*)
     134       +maxima-ring+)
     135      ((ring-of-integers :ring-of-integers #:ring-of-integers $ring_of_integers) +ring-of-integers+)
    136136      (otherwise
    137137       (mtell "~%Warning: Ring ~M not found. Using default.~%" ring))))
     
    267267                             (p (parse-poly p vars)))
    268268     ,@(when documentation-supplied-p (list documentation))
    269      (coerce-to-maxima :polynomial (,fun-name *maxima-ring* p) vars)))
     269     (coerce-to-maxima :polynomial (,fun-name +maxima-ring+ p) vars)))
    270270
    271271(defmacro define-binop (maxima-name fun-name
     
    278278                             (q (parse-poly q vars)))
    279279     ,@(when documentation-supplied-p (list documentation))
    280      (coerce-to-maxima :polynomial (,fun-name *maxima-ring* p q) vars)))
     280     (coerce-to-maxima :polynomial (,fun-name +maxima-ring+ p q) vars)))
    281281
    282282
     
    295295(defmacro with-coefficient-ring ((ring) &body body)
    296296  "Evaluate BODY with coefficient ring set to RING."
    297   `(let ((*maxima-ring* (or (find-ring ,ring) *maxima-ring*)))
     297  `(let ((+maxima-ring+ (or (find-ring ,ring) +maxima-ring+)))
    298298     . ,body))
    299299
     
    301301  "Evaluate BODY with monomial order set to ORDER and coefficient ring set to RING."
    302302  `(let ((*monomial-order* (or (find-order ,order) *monomial-order*))
    303          (*maxima-ring* (or (find-ring ,ring) *maxima-ring*)))
     303         (+maxima-ring+ (or (find-ring ,ring) +maxima-ring+)))
    304304     . ,body))
    305305
     
    392392(defmfun $poly_expt (p n vars)
    393393  (with-parsed-polynomials ((vars) :polynomials (p) :value-type :polynomial)
    394     (poly-expt *maxima-ring* p n)))
     394    (poly-expt +maxima-ring+ p n)))
    395395
    396396(defmfun $poly_content (p vars)
    397397  (with-parsed-polynomials ((vars) :polynomials (p))
    398     (poly-content *maxima-ring* p)))
     398    (poly-content +maxima-ring+ p)))
    399399
    400400(defmfun $poly_pseudo_divide (f fl vars
     
    403403                                 (fl (parse-poly-list fl vars)))
    404404  (multiple-value-bind (quot rem c division-count)
    405       (poly-pseudo-divide *maxima-ring* f fl)
     405      (poly-pseudo-divide +maxima-ring+ f fl)
    406406    `((mlist)
    407407      ,(coerce-to-maxima :poly-list quot vars)
     
    412412(defmfun $poly_exact_divide (f g vars)
    413413  (with-parsed-polynomials ((vars) :polynomials (f g) :value-type :polynomial)
    414     (poly-exact-divide *maxima-ring* f g)))
     414    (poly-exact-divide +maxima-ring+ f g)))
    415415
    416416(defmfun $poly_normal_form (f fl vars)
     
    418418                                   :poly-lists (fl)
    419419                                   :value-type :polynomial)
    420     (normal-form *maxima-ring* f (remzero fl) nil)))
     420    (normal-form +maxima-ring+ f (remzero fl) nil)))
    421421
    422422(defmfun $poly_buchberger_criterion (g vars)
    423423  (with-parsed-polynomials ((vars) :poly-lists (g) :value-type :logical)
    424     (buchberger-criterion *maxima-ring* g)))
     424    (buchberger-criterion +maxima-ring+ g)))
    425425
    426426(defmfun $poly_buchberger (fl vars)
    427427  (with-parsed-polynomials ((vars) :poly-lists (fl) :value-type :poly-list)
    428     (buchberger *maxima-ring*  (remzero fl) 0 nil)))
     428    (buchberger +maxima-ring+  (remzero fl) 0 nil)))
    429429
    430430(defmfun $poly_reduction (plist vars)
    431431  (with-parsed-polynomials ((vars) :poly-lists (plist)
    432432                                   :value-type :poly-list)
    433     (reduction *maxima-ring* plist)))
     433    (reduction +maxima-ring+ plist)))
    434434
    435435(defmfun $poly_minimization (plist vars)
     
    441441  (with-parsed-polynomials ((vars) :poly-lists (plist)
    442442                                   :value-type :poly-list)
    443     (poly-normalize-list *maxima-ring* plist)))
     443    (poly-normalize-list +maxima-ring+ plist)))
    444444
    445445(defmfun $poly_grobner (f vars)
    446446  (with-parsed-polynomials ((vars) :poly-lists (f)
    447447                                   :value-type :poly-list)
    448     (grobner *maxima-ring* (remzero f))))
     448    (grobner +maxima-ring+ (remzero f))))
    449449
    450450(defmfun $poly_reduced_grobner (f vars)
    451451  (with-parsed-polynomials ((vars) :poly-lists (f)
    452452                                   :value-type :poly-list)
    453     (reduced-grobner *maxima-ring* (remzero f))))
     453    (reduced-grobner +maxima-ring+ (remzero f))))
    454454
    455455(defmfun $poly_depends_p (p var mvars
     
    463463  (with-parsed-polynomials ((vars) :poly-lists (flist)
    464464                                   :value-type :poly-list)
    465     (elimination-ideal *maxima-ring* flist k nil 0)))
     465    (elimination-ideal +maxima-ring+ flist k nil 0)))
    466466
    467467(defmfun $poly_colon_ideal (f g vars)
    468468  (with-parsed-polynomials ((vars) :poly-lists (f g) :value-type :poly-list)
    469     (colon-ideal *maxima-ring* f g nil)))
     469    (colon-ideal +maxima-ring+ f g nil)))
    470470
    471471(defmfun $poly_ideal_intersection (f g vars)
    472472  (with-parsed-polynomials ((vars) :poly-lists (f g) :value-type :poly-list) 
    473     (ideal-intersection *maxima-ring* f g nil)))
     473    (ideal-intersection +maxima-ring+ f g nil)))
    474474
    475475(defmfun $poly_lcm (f g vars)
    476476  (with-parsed-polynomials ((vars) :polynomials (f g) :value-type :polynomial)
    477     (poly-lcm *maxima-ring* f g)))
     477    (poly-lcm +maxima-ring+ f g)))
    478478
    479479(defmfun $poly_gcd (f g vars)
     
    482482(defmfun $poly_grobner_equal (g1 g2 vars)
    483483  (with-parsed-polynomials ((vars) :poly-lists (g1 g2))
    484     (grobner-equal *maxima-ring* g1 g2)))
     484    (grobner-equal +maxima-ring+ g1 g2)))
    485485
    486486(defmfun $poly_grobner_subsetp (g1 g2 vars)
    487487  (with-parsed-polynomials ((vars) :poly-lists (g1 g2))
    488     (grobner-subsetp *maxima-ring* g1 g2)))
     488    (grobner-subsetp +maxima-ring+ g1 g2)))
    489489
    490490(defmfun $poly_grobner_member (p g vars)
    491491  (with-parsed-polynomials ((vars) :polynomials (p) :poly-lists (g))
    492     (grobner-member *maxima-ring* p g)))
     492    (grobner-member +maxima-ring+ p g)))
    493493
    494494(defmfun $poly_ideal_saturation1 (f p vars)
    495495  (with-parsed-polynomials ((vars) :poly-lists (f) :polynomials (p)
    496496                                   :value-type :poly-list)
    497     (ideal-saturation-1 *maxima-ring* f p 0)))
     497    (ideal-saturation-1 +maxima-ring+ f p 0)))
    498498
    499499(defmfun $poly_saturation_extension (f plist vars new-vars)
     
    501501                            :poly-lists (f plist)
    502502                            :value-type :poly-list)
    503     (saturation-extension *maxima-ring* f plist)))
     503    (saturation-extension +maxima-ring+ f plist)))
    504504
    505505(defmfun $poly_polysaturation_extension (f plist vars new-vars)
     
    507507                            :poly-lists (f plist)
    508508                            :value-type :poly-list)
    509     (polysaturation-extension *maxima-ring* f plist)))
     509    (polysaturation-extension +maxima-ring+ f plist)))
    510510
    511511(defmfun $poly_ideal_polysaturation1 (f plist vars)
    512512  (with-parsed-polynomials ((vars) :poly-lists (f plist)
    513513                                   :value-type :poly-list)
    514     (ideal-polysaturation-1 *maxima-ring* f plist 0 nil)))
     514    (ideal-polysaturation-1 +maxima-ring+ f plist 0 nil)))
    515515
    516516(defmfun $poly_ideal_saturation (f g vars)
    517517  (with-parsed-polynomials ((vars) :poly-lists (f g)
    518518                                   :value-type  :poly-list)
    519     (ideal-saturation *maxima-ring* f g 0 nil)))
     519    (ideal-saturation +maxima-ring+ f g 0 nil)))
    520520
    521521(defmfun $poly_ideal_polysaturation (f ideal-list vars)
     
    523523                                   :poly-list-lists (ideal-list)
    524524                                   :value-type :poly-list)
    525     (ideal-polysaturation *maxima-ring* f ideal-list 0 nil)))
     525    (ideal-polysaturation +maxima-ring+ f ideal-list 0 nil)))
    526526
    527527(defmfun $poly_lt (f vars)
     
    531531(defmfun $poly_lm (f vars)
    532532  (with-parsed-polynomials ((vars) :polynomials (f) :value-type :polynomial)
    533     (make-poly-from-termlist (list (make-term (poly-lm f) (funcall (ring-unit *maxima-ring*)))))))
     533    (make-poly-from-termlist (list (make-term (poly-lm f) (funcall (ring-unit +maxima-ring+)))))))
    534534
    535535|#
Note: See TracChangeset for help on using the changeset viewer.