Changeset 937
- Timestamp:
- 2015-06-09T19:16:09-07:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/f4grobner/termlist.lisp
r936 r937 220 220 221 221 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)) 224 227 (cond 225 228 ((minusp n) (error "termlist-expt: Negative exponent.")) … … 227 230 (t 228 231 (do ((k 1 (ash k 1)) 229 (q poly (termlist-mul ring q q));keep squaring230 (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))) 231 234 ((> k n) p) 232 235 (declare (fixnum k))))))
Note:
See TracChangeset
for help on using the changeset viewer.