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.

Changeset 56


Ignore:
Timestamp:
2015-06-05T11:18:10-07:00 (9 years ago)
Author:
Marek Rychlik
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/f4grobner/grobner.lisp

    r54 r56  
    299299;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    300300
    301 (defun spoly (ring f g)
    302   "It yields the S-polynomial of polynomials F and G."
    303   (declare (type poly f g))
    304   (let* ((lcm (monom-lcm (poly-lm f) (poly-lm g)))
    305           (mf (monom-div lcm (poly-lm f)))
    306           (mg (monom-div lcm (poly-lm g))))
    307     (declare (type monom mf mg))
    308     (multiple-value-bind (c cf cg)
    309         (funcall (ring-ezgcd ring) (poly-lc f) (poly-lc g))
    310       (declare (ignore c))
    311       (poly-sub
    312        ring
    313        (scalar-times-poly ring cg (monom-times-poly mf f))
    314        (scalar-times-poly ring cf (monom-times-poly mg g))))))
    315 
    316 
    317 (defun poly-primitive-part (ring p)
    318   "Divide polynomial P with integer coefficients by gcd of its
    319 coefficients and return the result."
    320   (declare (type poly p))
    321   (if (poly-zerop p)
    322       (values p 1)
    323     (let ((c (poly-content ring p)))
    324       (values (make-poly-from-termlist (mapcar
    325                           #'(lambda (x)
    326                               (make-term (term-monom x)
    327                                          (funcall (ring-div ring) (term-coeff x) c)))
    328                           (poly-termlist p))
    329                          (poly-sugar p))
    330                c))))
    331 
    332 (defun poly-content (ring p)
    333   "Greatest common divisor of the coefficients of the polynomial P. Use the RING structure
    334 to compute the greatest common divisor."
    335   (declare (type poly p))
    336   (reduce (ring-gcd ring) (mapcar #'term-coeff (rest (poly-termlist p))) :initial-value (poly-lc p)))
    337301
    338302
Note: See TracChangeset for help on using the changeset viewer.