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.

source: branches/f4grobner/test8.lisp

Last change on this file was 4463, checked in by Marek Rychlik, 8 years ago
File size: 665 bytes
Line 
1(in-package :polynomial)
2
3(proclaim '(special p0 q0 p q p+q-good p+q-risky))
4
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)))))
7
8(setf p (poly-termlist p0))
9(setf q (poly-termlist q0))
10
11(setf p+q-good (mapcar #'->list (slow-add (mapcar #'copy:copy-instance p) (mapcar #'copy:copy-instance q) #'lex> #'add-to)))
12
13(setf p+q-risky (mapcar #'->list (fast-and-risky-add (mapcar #'copy:copy-instance p) (mapcar #'copy:copy-instance q) #'lex> #'add-to)))
14
15(assert (equal p+q-good p+q-risky) nil "Two methods gave different results.")
Note: See TracBrowser for help on using the repository browser.