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 937


Ignore:
Timestamp:
2015-06-09T19:16:09-07:00 (10 years ago)
Author:
Marek Rychlik
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/f4grobner/termlist.lisp

    r936 r937  
    220220                   
    221221
    222 (defun termlist-expt (ring poly n &aux (dim (monom-dimension (termlist-lm poly))))
    223   (declare (type fixnum n dim) (ring ring))
     222(defun termlist-expt (ring-and-order poly n
     223                      &aux
     224                        (ring (ro-ring ring-and-order))
     225                        (dim (monom-dimension (termlist-lm poly))))
     226  (declare (type fixnum n dim) (ring-and-order ring-and-order))
    224227  (cond
    225228   ((minusp n) (error "termlist-expt: Negative exponent."))
     
    227230   (t
    228231    (do ((k 1 (ash k 1))
    229          (q poly (termlist-mul ring q q))       ;keep squaring
    230          (p (termlist-unit ring dim) (if (not (zerop (logand k n))) (termlist-mul ring p q) p)))
     232         (q poly (termlist-mul ring-and-order q q)) ;keep squaring
     233         (p (termlist-unit ring dim) (if (not (zerop (logand k n))) (termlist-mul ring-and-order p q) p)))
    231234        ((> k n) p)
    232235      (declare (fixnum k))))))
Note: See TracChangeset for help on using the changeset viewer.