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-11T08:36:52-07:00 (8 years ago)
Author:
Marek Rychlik
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/f4grobner/fast-add.lisp

    r4443 r4447  
    11(in-package "POLYNOMIAL")
    22
    3 (defun fast-add (p q order-fn add-fn &aux result result-last)
    4   (assert (not (eq p q)))
     3(defun fast-and-risky-add (p q order-fn add-fn &aux result result-last)
     4  (when (and p q (eq p q)) (warn "FAST-AND-RISKY-ADD: ~S is EQ to ~S" p q))
    55  (flet ((add-to-result (x)
    66           (assert (consp x))
     
    4444                 (setf q tmp))
    4545               ))))))))
     46
     47(defun fast-add (p q order-fn add-fn)
     48  (let ((r1 (slow-add p q order-fn add-fn))
     49        (r2 (fast-and-risky-add p q order-fn add-fn)))
     50    (unless (every #'universal-equalp r1 r2)
     51      (format t "~&Error in addition of ~%~A~% and~%~A~% should be:~%" (mapcar #'->list p) (mapcar #'->list q))
     52      (princ (mapcar #'->list r1))
     53      (format t "~&Actually is:~%")
     54      (princ (mapcar #'->list r2))
     55      )
     56    r2))
     57       
     58   
     59
Note: See TracChangeset for help on using the changeset viewer.