- Timestamp:
- 2015-09-05T21:16:21-07:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/f4grobner/polynomial.lisp
r3649 r3651 393 393 :termlist (apply #'nconc (mapcar #'poly-termlist plist)))))) 394 394 395 (defgeneric spoly (object1 object2) 396 (:documentation "Yields the S-polynomial of OBJECT1 and OBJECT2.") 397 (:method ((f poly) (g poly)) 398 (let* ((lcm (universal-lcm (leading-monomial f) (leading-monomial g))) 399 (mf (divide lcm (leading-monomial f))) 400 (mg (divide lcm (leading-monomial g)))) 401 (multiple-value-bind (c cf cg) 402 (funcall (ring-ezgcd ring) (poly-lc f) (poly-lc g)) 403 (declare (ignore c)) 404 (subtract 405 (multiply cg (multiply mf f)) 406 (multiply cf (multiply mg g))))))) 407 408 395 409 #| 396 410 … … 403 417 404 418 405 (defun spoly (ring-and-order f g406 &aux407 (ring (ro-ring ring-and-order)))408 "It yields the S-polynomial of polynomials F and G."409 (declare (type ring-and-order ring-and-order) (type poly f g))410 (let* ((lcm (monom-lcm (poly-lm f) (poly-lm g)))411 (mf (monom-div lcm (poly-lm f)))412 (mg (monom-div lcm (poly-lm g))))413 (declare (type monom mf mg))414 (multiple-value-bind (c cf cg)415 (funcall (ring-ezgcd ring) (poly-lc f) (poly-lc g))416 (declare (ignore c))417 (poly-sub418 ring-and-order419 (scalar-times-poly ring cg (monom-times-poly mf f))420 (scalar-times-poly ring cf (monom-times-poly mg g))))))421 419 422 420
Note:
See TracChangeset
for help on using the changeset viewer.