Changeset 4463 for branches/f4grobner/test8.lisp
- Timestamp:
- 2016-06-14T19:35:34-07:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/f4grobner/test8.lisp
r4447 r4463 1 1 (in-package :polynomial) 2 2 3 (proclaim '(special p0 q0 p q p+q-good p+q-risky)) 3 4 4 (setf p0 (alist->poly ( nreverse '(((2 0 0) . 2) ((1 1 0) . 1) ((1 0 0) . 1) ((0 1 0) . -1) ((0 0 0) . 2)))))5 (setf q0 (alist->poly ( nreverse '(((2 0 0) . 2) ((0 1 0) . -1) ((0 0 0) . 2)))))5 (setf p0 (alist->poly (reverse '(((2 0 0) . 2) ((1 1 0) . 1) ((1 0 0) . 1) ((0 1 0) . -1) ((0 0 0) . 2))))) 6 (setf q0 (alist->poly (reverse '(((2 0 0) . 2) ((0 1 0) . -1) ((0 0 0) . 2))))) 6 7 7 8 (setf p (poly-termlist p0)) 8 9 (setf q (poly-termlist q0)) 9 10 10 (setf p+q-good (mapcar #'->list (slow-add p q#'lex> #'add-to)))11 (setf p+q-good (mapcar #'->list (slow-add (mapcar #'copy:copy-instance p) (mapcar #'copy:copy-instance q) #'lex> #'add-to))) 11 12 12 (setf p+q-risky (mapcar #'->list (fast-and-risky-add p q#'lex> #'add-to)))13 (setf p+q-risky (mapcar #'->list (fast-and-risky-add (mapcar #'copy:copy-instance p) (mapcar #'copy:copy-instance q) #'lex> #'add-to))) 13 14 14 ;;(assert (equal p+q-good p+q-risky) nil "Two methods gave different results.")15 (assert (equal p+q-good p+q-risky) nil "Two methods gave different results.")
Note:
See TracChangeset
for help on using the changeset viewer.