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 2790 for branches/f4grobner


Ignore:
Timestamp:
2015-06-20T21:12:20-07:00 (10 years ago)
Author:
Marek Rychlik
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/f4grobner/polynomial.lisp

    r2789 r2790  
    190190  (mapc #'unary-minus (poly-termlist self))
    191191  self)
     192
     193
     194(defun term-mul-lst (ring term1 term2)
     195  "A special version of term multiplication. Returns (LIST TERM) where
     196TERM is the product of the terms TERM1 TERM2, or NIL when the product
     197is 0. This definition takes care of divisors of 0 in the coefficient
     198ring."
     199  (let ((c (r* (term-coeff term1) (term-coeff term2))))
     200    (unless (r-zerop c)
     201      (list (make-instance 'term
     202                           :monom (r* (term-monom term1) (term-monom term2))
     203                           :coeff c)))))
     204
     205(defun multiply-term-by-termlist (term termlist)
     206  (mapcan #'(lambda (term-termlist) (term-mul-lst term term-termlist)) termlist))
     207
     208(defun multiply-termlist-by-term (termlist term)
     209  (mapcan #'(lambda (term-termlist) (term-mul-lst term-termlist term)) termlist))
    192210
    193211
Note: See TracChangeset for help on using the changeset viewer.