Changeset 3107
- Timestamp:
- 2015-06-22T07:48:57-07:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/f4grobner/polynomial.lisp
r3106 r3107 337 337 plist) 338 338 339 #| 340 341 (defun standard-sum (F plist 342 &aux 343 (k (length plist)) 344 (d (+ k (monom-dimension (poly-lt (car plist))))) 345 ;; Add k variables to f 346 (f (poly-list-add-variables f k)) 347 ;; Set PLIST to [U1*P1,U2*P2,...,UK*PK] 348 (plist (apply #'nconc (poly-standard-extension plist)))) 339 340 (defun standard-sum (plist 341 &aux 342 (plist (standard-extension plist)) 343 (nvars (poly-dimension (car plist)))) 349 344 "Calculate the polynomial U1*P1+U2*P2+...+UK*PK-1, where PLIST=[P1,P2,...,PK]. 350 345 Firstly, new K variables, U1, U2, ..., UK, are inserted into each … … 354 349 which is equivalent to using a lexicographic order on the first K 355 350 variables." 356 (setf (cdr (last (poly-termlist plist))) 357 ;; Add -1 as the last term 358 (list (make-term :monom (make-monom :dimension d) 359 :coeff (funcall (ring-uminus ring) (funcall (ring-unit ring)))))) 360 (append f (list plist))) 361 351 (flet ((subtract-1 (p) 352 (append-item p (make-instance 'term :coeff -1 :dimension nvars)))) 353 (make-instance 354 'poly 355 :termlist (mapcon #'poly-termlist plist)) 356 (setf plist (mapc #'subtract-1 plist))) 357 ) 358 359 360 #| 362 361 363 362
Note:
See TracChangeset
for help on using the changeset viewer.