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 4373


Ignore:
Timestamp:
2016-06-06T19:49:20-07:00 (9 years ago)
Author:
Marek Rychlik
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/f4grobner/ring.lisp

    r4354 r4373  
    7878  (:documentation "Solves the diophantine system: X=C*X1, Y=C*X2,
    7979C=GCD(X,Y).  It returns three values: C, X1 and Y1. The result may be obtained by
    80 the Euclidean algorithm."))
     80the Euclidean algorithm.")
     81  (:method ((x t) (y t) &aux (c (universal-gcd x y)))
     82    (values c (divide x c) (divide y c))))
    8183
    8284(defgeneric universal-equalp (self other)
     
    99101should be returned upon every call."))
    100102
     103(defun add (summand &rest more-summands)
     104  "Successively Adds to SUMMAND the elements of MORE-SUMMANDS. The first SUMMAND must not be destructively modified.
     105Instead, a copy of factor should be made and returned as the value of
     106this function."
     107  (:method ((summand t) &rest more-summands)
     108    (reduce #'add-to more-summands :initial-value (copy-instance summand))))
     109
    101110(defgeneric multiply (factor &rest more-factors)
    102111  (:documentation "Successively multiplies factor FACTOR by the remaining arguments
Note: See TracChangeset for help on using the changeset viewer.