- Timestamp:
- 2015-09-06T05:42:59-07:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/f4grobner/polynomial.lisp
r3679 r3682 444 444 :initial-value (leading-coefficient self)))) 445 445 446 (defgeneric poly-primitive-part (self) 447 (:documentation "Divide polynomial SELF by gcd of its 448 coefficients. Return SELF.") 449 (:method ((self poly)) 450 (if (universal-zerop object) 451 (values object 1) 452 (let ((c (poly-content object))) 453 (mapc #'(lambda (x) 454 (setf (term-coeff x) (divide (term-coeff x) c))) 455 (poly-termlist p)))) 456 self)) 457 458 446 459 #| 447 460 … … 451 464 (polysaturation-extension ring f (list p))) 452 465 453 (defun poly-primitive-part (ring p)454 "Divide polynomial P with integer coefficients by gcd of its455 coefficients and return the result."456 (declare (type ring ring) (type poly p))457 (if (poly-zerop p)458 (values p 1)459 (let ((c (poly-content ring p)))460 (values (make-poly-from-termlist461 (mapcar462 #'(lambda (x)463 (make-term :monom (term-monom x)464 :coeff (funcall (ring-div ring) (term-coeff x) c)))465 (poly-termlist p))466 (poly-sugar p))467 c))))468 466 469 467
Note:
See TracChangeset
for help on using the changeset viewer.