Changeset 1797
- Timestamp:
- 2015-06-15T11:46:14-07:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/f4grobner/mx-grobner.lisp
r1796 r1797 268 268 (otherwise 269 269 object))) 270 271 272 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;273 ;;274 ;; Unary and binary operation definition facility275 ;;276 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;277 278 (defmacro define-unop (maxima-name fun-name279 &optional (documentation nil documentation-supplied-p))280 "Define a MAXIMA-level unary operator MAXIMA-NAME corresponding to unary function FUN-NAME."281 `(defun ,maxima-name (p vars282 &aux283 (vars (coerce-maxima-list vars))284 (p (parse-poly p vars)))285 ,@(when documentation-supplied-p (list documentation))286 (poly->maxima :polynomial (,fun-name +maxima-ring+ p) vars)))287 288 (defmacro define-binop (maxima-name fun-name289 &optional (documentation nil documentation-supplied-p))290 "Define a MAXIMA-level binary operator MAXIMA-NAME corresponding to binary function FUN-NAME."291 `(defmfun ,maxima-name (p q vars292 &aux293 (vars (coerce-maxima-list vars))294 (p (parse-poly p vars))295 (q (parse-poly q vars)))296 ,@(when documentation-supplied-p (list documentation))297 (poly->maxima :polynomial (,fun-name +maxima-ring+ p q) vars)))298 270 299 271 … … 425 397 426 398 399 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 400 ;; 401 ;; Unary and binary operation definition facility 402 ;; 403 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 404 405 (defmacro define-unop (maxima-name fun-name 406 &optional (documentation nil documentation-supplied-p)) 407 "Define a MAXIMA-level unary operator MAXIMA-NAME corresponding to unary function FUN-NAME." 408 `(defun ,maxima-name (p vars) 409 ,@(when documentation-supplied-p (list documentation)) 410 (with-ring-and-order ((vars) :polynomials (p) :value-type :polynomial) 411 (,fun-name ring p) vars))) 412 413 (defmacro define-binop (maxima-name fun-name 414 &optional (documentation nil documentation-supplied-p)) 415 "Define a MAXIMA-level binary operator MAXIMA-NAME corresponding to binary function FUN-NAME." 416 `(defun ,maxima-name (p vars) 417 ,@(when documentation-supplied-p (list documentation)) 418 (with-ring-and-order ((vars) :polynomials (p q) :value-type :polynomial) 419 (,fun-name ring p q) vars))) 420 421 422 427 423 ;;Functions 428 424
Note:
See TracChangeset
for help on using the changeset viewer.