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 2446


Ignore:
Timestamp:
2015-06-19T09:58:49-07:00 (9 years ago)
Author:
Marek Rychlik
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/f4grobner/polynomial.lisp

    r2445 r2446  
    134134  (length (poly-termlist self)))
    135135
    136 (defun poly-reset-sugar (p)
    137   "(Re)sets the sugar of a polynomial P to the sugar of (POLY-TERMLIST P).
    138 Thus, the sugar is set to the maximum sugar of all monomials of P, or -1
    139 if P is a zero polynomial."
    140   (declare (type poly p))
    141   (setf (poly-sugar p) (termlist-sugar (poly-termlist p)))
    142   p)
    143 
    144 (defun scalar-times-poly (ring c p)
    145   "The scalar product of scalar C by a polynomial P. The sugar of the
    146 original polynomial becomes the sugar of the result."
    147   (declare (type ring ring) (type poly p))
    148   (make-poly-from-termlist (scalar-times-termlist ring c (poly-termlist p)) (poly-sugar p)))
     136(defmethod scalar-multiply ((self poly) scalar)
     137  "The scalar product of a polynomial SELF by a scalar SCALAR."
     138  (mapc #'(lambda (term) (scalar-multiply term scalar)) (poly-termlist self))
     139  self)
    149140
    150141(defun scalar-times-poly-1 (ring c p)
Note: See TracChangeset for help on using the changeset viewer.