Changeset 1669
- Timestamp:
- 2015-06-14T20:51:05-07:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/f4grobner/mx-grobner.lisp
r1659 r1669 69 69 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 70 70 71 (defparameter *maxima-ring*71 (defparameter +maxima-ring+ 72 72 (make-ring 73 73 ;;(defun coeff-zerop (expr) (meval1 `(($is) (($equal) ,expr 0)))) … … 132 132 (case ring 133 133 ((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+) 136 136 (otherwise 137 137 (mtell "~%Warning: Ring ~M not found. Using default.~%" ring)))) … … 267 267 (p (parse-poly p vars))) 268 268 ,@(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))) 270 270 271 271 (defmacro define-binop (maxima-name fun-name … … 278 278 (q (parse-poly q vars))) 279 279 ,@(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))) 281 281 282 282 … … 295 295 (defmacro with-coefficient-ring ((ring) &body body) 296 296 "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+))) 298 298 . ,body)) 299 299 … … 301 301 "Evaluate BODY with monomial order set to ORDER and coefficient ring set to RING." 302 302 `(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+))) 304 304 . ,body)) 305 305 … … 392 392 (defmfun $poly_expt (p n vars) 393 393 (with-parsed-polynomials ((vars) :polynomials (p) :value-type :polynomial) 394 (poly-expt *maxima-ring*p n)))394 (poly-expt +maxima-ring+ p n))) 395 395 396 396 (defmfun $poly_content (p vars) 397 397 (with-parsed-polynomials ((vars) :polynomials (p)) 398 (poly-content *maxima-ring*p)))398 (poly-content +maxima-ring+ p))) 399 399 400 400 (defmfun $poly_pseudo_divide (f fl vars … … 403 403 (fl (parse-poly-list fl vars))) 404 404 (multiple-value-bind (quot rem c division-count) 405 (poly-pseudo-divide *maxima-ring*f fl)405 (poly-pseudo-divide +maxima-ring+ f fl) 406 406 `((mlist) 407 407 ,(coerce-to-maxima :poly-list quot vars) … … 412 412 (defmfun $poly_exact_divide (f g vars) 413 413 (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))) 415 415 416 416 (defmfun $poly_normal_form (f fl vars) … … 418 418 :poly-lists (fl) 419 419 :value-type :polynomial) 420 (normal-form *maxima-ring*f (remzero fl) nil)))420 (normal-form +maxima-ring+ f (remzero fl) nil))) 421 421 422 422 (defmfun $poly_buchberger_criterion (g vars) 423 423 (with-parsed-polynomials ((vars) :poly-lists (g) :value-type :logical) 424 (buchberger-criterion *maxima-ring*g)))424 (buchberger-criterion +maxima-ring+ g))) 425 425 426 426 (defmfun $poly_buchberger (fl vars) 427 427 (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))) 429 429 430 430 (defmfun $poly_reduction (plist vars) 431 431 (with-parsed-polynomials ((vars) :poly-lists (plist) 432 432 :value-type :poly-list) 433 (reduction *maxima-ring*plist)))433 (reduction +maxima-ring+ plist))) 434 434 435 435 (defmfun $poly_minimization (plist vars) … … 441 441 (with-parsed-polynomials ((vars) :poly-lists (plist) 442 442 :value-type :poly-list) 443 (poly-normalize-list *maxima-ring*plist)))443 (poly-normalize-list +maxima-ring+ plist))) 444 444 445 445 (defmfun $poly_grobner (f vars) 446 446 (with-parsed-polynomials ((vars) :poly-lists (f) 447 447 :value-type :poly-list) 448 (grobner *maxima-ring*(remzero f))))448 (grobner +maxima-ring+ (remzero f)))) 449 449 450 450 (defmfun $poly_reduced_grobner (f vars) 451 451 (with-parsed-polynomials ((vars) :poly-lists (f) 452 452 :value-type :poly-list) 453 (reduced-grobner *maxima-ring*(remzero f))))453 (reduced-grobner +maxima-ring+ (remzero f)))) 454 454 455 455 (defmfun $poly_depends_p (p var mvars … … 463 463 (with-parsed-polynomials ((vars) :poly-lists (flist) 464 464 :value-type :poly-list) 465 (elimination-ideal *maxima-ring*flist k nil 0)))465 (elimination-ideal +maxima-ring+ flist k nil 0))) 466 466 467 467 (defmfun $poly_colon_ideal (f g vars) 468 468 (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))) 470 470 471 471 (defmfun $poly_ideal_intersection (f g vars) 472 472 (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))) 474 474 475 475 (defmfun $poly_lcm (f g vars) 476 476 (with-parsed-polynomials ((vars) :polynomials (f g) :value-type :polynomial) 477 (poly-lcm *maxima-ring*f g)))477 (poly-lcm +maxima-ring+ f g))) 478 478 479 479 (defmfun $poly_gcd (f g vars) … … 482 482 (defmfun $poly_grobner_equal (g1 g2 vars) 483 483 (with-parsed-polynomials ((vars) :poly-lists (g1 g2)) 484 (grobner-equal *maxima-ring*g1 g2)))484 (grobner-equal +maxima-ring+ g1 g2))) 485 485 486 486 (defmfun $poly_grobner_subsetp (g1 g2 vars) 487 487 (with-parsed-polynomials ((vars) :poly-lists (g1 g2)) 488 (grobner-subsetp *maxima-ring*g1 g2)))488 (grobner-subsetp +maxima-ring+ g1 g2))) 489 489 490 490 (defmfun $poly_grobner_member (p g vars) 491 491 (with-parsed-polynomials ((vars) :polynomials (p) :poly-lists (g)) 492 (grobner-member *maxima-ring*p g)))492 (grobner-member +maxima-ring+ p g))) 493 493 494 494 (defmfun $poly_ideal_saturation1 (f p vars) 495 495 (with-parsed-polynomials ((vars) :poly-lists (f) :polynomials (p) 496 496 :value-type :poly-list) 497 (ideal-saturation-1 *maxima-ring*f p 0)))497 (ideal-saturation-1 +maxima-ring+ f p 0))) 498 498 499 499 (defmfun $poly_saturation_extension (f plist vars new-vars) … … 501 501 :poly-lists (f plist) 502 502 :value-type :poly-list) 503 (saturation-extension *maxima-ring*f plist)))503 (saturation-extension +maxima-ring+ f plist))) 504 504 505 505 (defmfun $poly_polysaturation_extension (f plist vars new-vars) … … 507 507 :poly-lists (f plist) 508 508 :value-type :poly-list) 509 (polysaturation-extension *maxima-ring*f plist)))509 (polysaturation-extension +maxima-ring+ f plist))) 510 510 511 511 (defmfun $poly_ideal_polysaturation1 (f plist vars) 512 512 (with-parsed-polynomials ((vars) :poly-lists (f plist) 513 513 :value-type :poly-list) 514 (ideal-polysaturation-1 *maxima-ring*f plist 0 nil)))514 (ideal-polysaturation-1 +maxima-ring+ f plist 0 nil))) 515 515 516 516 (defmfun $poly_ideal_saturation (f g vars) 517 517 (with-parsed-polynomials ((vars) :poly-lists (f g) 518 518 :value-type :poly-list) 519 (ideal-saturation *maxima-ring*f g 0 nil)))519 (ideal-saturation +maxima-ring+ f g 0 nil))) 520 520 521 521 (defmfun $poly_ideal_polysaturation (f ideal-list vars) … … 523 523 :poly-list-lists (ideal-list) 524 524 :value-type :poly-list) 525 (ideal-polysaturation *maxima-ring*f ideal-list 0 nil)))525 (ideal-polysaturation +maxima-ring+ f ideal-list 0 nil))) 526 526 527 527 (defmfun $poly_lt (f vars) … … 531 531 (defmfun $poly_lm (f vars) 532 532 (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+))))))) 534 534 535 535 |#
Note:
See TracChangeset
for help on using the changeset viewer.