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.

Ignore:
Timestamp:
2015-06-15T12:57:10-07:00 (9 years ago)
Author:
Marek Rychlik
Message:

* empty log message *

File:
1 edited

Legend:

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

    r1810 r1811  
    368368;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    369369;;
    370 ;; Unary and binary operation definition facility
    371 ;;
    372 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    373 
    374 (defmacro define-unop ((maxima-name fun-name (&rest args) &key (env :ring-and-order))
    375                        &optional
    376                          (documentation nil documentation-supplied-p)
    377                        &aux
    378                          ;; The argument passed as first arg
    379                          (env-arg (ecase env
    380                                     (:ring-and-order 'ring-and-order)
    381                                     (:ring 'ring))))
     370;; N-ary (unary and binary) operation definition facility
     371;;
     372;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
     373
     374(defmacro define-op (maxima-name (fun-name &rest args)
     375                     &key (env :ring-and-order)
     376                     &optional
     377                       (documentation nil documentation-supplied-p)
     378                     &aux
     379                       ;; The argument passed as first arg
     380                       (env-arg (ecase env
     381                                  (:ring-and-order 'ring-and-order)
     382                                  (:ring 'ring))))
    382383  "Define a MAXIMA-level unary operator MAXIMA-NAME corresponding to unary function FUN-NAME."
    383384  `(defmfun ,maxima-name (,@args vars)
     
    386387       (,fun-name ,env-arg ,@args p))))
    387388
    388 (defmacro define-binop ((maxima-name fun-name)
    389                         &optional (documentation nil documentation-supplied-p))
    390   "Define a MAXIMA-level binary operator MAXIMA-NAME corresponding to binary function FUN-NAME."
    391   `(defmfun ,maxima-name (p q vars)
    392      ,@(when documentation-supplied-p (list documentation))
    393      (with-ring-and-order ((vars) :polynomials (p q) :value-type :polynomial)
    394        (,fun-name ring-and-order p q))))
    395 
    396 
    397389;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    398390;;
     
    405397
    406398;;Simple operators
    407 (define-binop ($poly_add poly-add (p q))
     399(define-op $poly_add (poly-add p q)
    408400  "Adds two polynomials P and Q")
    409401
    410 (define-binop ($poly_subtract poly-sub (p q))
     402#|
     403(define-op ($poly_subtract poly-sub (p q))
    411404  "Subtracts a polynomial Q from P.")
    412405
    413 (define-binop ($poly_multiply poly-mul (p q))
     406(define-op ($poly_multiply poly-mul (p q))
    414407  "Returns the product of polynomials P and Q.")
    415408
    416 (define-binop ($poly_s_polynomial spoly (p q))
     409(define-op ($poly_s_polynomial spoly (p q))
    417410  "Returns the syzygy polynomial (S-polynomial) of two polynomials P and Q.")
    418411
    419 (define-unop ($poly_primitive_part poly-primitive-part (p) :env :ring)
     412(define-op ($poly_primitive_part poly-primitive-part (p) :env :ring)
    420413  "Returns the polynomial P divided by GCD of its coefficients.")
    421414
    422 (define-unop ($poly_normalize poly-normalize (p) :env :ring)
     415(define-op ($poly_normalize poly-normalize (p) :env :ring)
    423416  "Returns the polynomial P divided by the leading coefficient.")
    424417
    425 
     418|#
    426419
    427420;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Note: See TracChangeset for help on using the changeset viewer.