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.

Ignore:
Timestamp:
2016-06-14T19:35:34-07:00 (8 years ago)
Author:
Marek Rychlik
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/f4grobner/test8.lisp

    r4447 r4463  
    11(in-package :polynomial)
     2
    23(proclaim '(special p0 q0 p q p+q-good p+q-risky))
    34
    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)))))
    67
    78(setf p (poly-termlist p0))
    89(setf q (poly-termlist q0))
    910
    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)))
    1112
    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)))
    1314
    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.