From 1dfe67eeb1da69766016c6d5cf8636474a368e9d Mon Sep 17 00:00:00 2001 From: AJ Rossini Date: Tue, 13 Nov 2007 10:17:45 +0100 Subject: [PATCH] removed complex type from CLS. unittest clean up. --- bayes.lsp | 3 ++- ls-user.lisp | 9 ++++++--- lsmath.lsp | 12 +++++++----- nonlin.lsp | 13 +++++++------ regression.lsp | 3 ++- statistics.lsp | 3 ++- unittests.lisp | 15 ++++++++------- 7 files changed, 34 insertions(+), 24 deletions(-) diff --git a/bayes.lsp b/bayes.lsp index b2b5b27..1a34fec 100644 --- a/bayes.lsp +++ b/bayes.lsp @@ -24,7 +24,8 @@ expt + - * / ** mod rem abs 1+ 1- log exp sqrt sin cos tan asin acos atan sinh cosh tanh asinh acosh atanh float random truncate floor ceiling round minusp zerop plusp evenp oddp - < <= = /= >= > complex conjugate realpart imagpart phase + < <= = /= >= > ;; complex + conjugate realpart imagpart phase min max logand logior logxor lognot ffloor fceiling ftruncate fround signum cis) (:export *bayes-model-proto*)) diff --git a/ls-user.lisp b/ls-user.lisp index e31db56..86fdd1a 100644 --- a/ls-user.lisp +++ b/ls-user.lisp @@ -25,7 +25,8 @@ should be packaged up elsewhere for reproducibility.") expt + - * / ** mod rem abs 1+ 1- log exp sqrt sin cos tan asin acos atan sinh cosh tanh asinh acosh atanh float random truncate floor ceiling round minusp zerop plusp evenp oddp - < <= = /= >= > complex conjugate realpart imagpart phase + < <= = /= >= > ;;complex + conjugate realpart imagpart phase min max logand logior logxor lognot ffloor fceiling ftruncate fround signum cis) (:export @@ -59,7 +60,8 @@ should be packaged up elsewhere for reproducibility.") ^ ** expt + - * / mod rem pmin pmax abs 1+ 1- log exp sqrt sin cos tan asin acos atan sinh cosh tanh asinh acosh atanh float random truncate floor ceiling round minusp zerop plusp evenp oddp < <= = - /= >= > complex conjugate realpart imagpart phase min max + /= >= > ;; complex + conjugate realpart imagpart phase min max logand logior logxor lognot ffloor fceiling ftruncate fround signum cis @@ -140,7 +142,8 @@ done for a user- or analysis-package.") expt + - * / ** mod rem abs 1+ 1- log exp sqrt sin cos tan asin acos atan sinh cosh tanh asinh acosh atanh float random truncate floor ceiling round minusp zerop plusp evenp oddp - < <= = /= >= > complex conjugate realpart imagpart phase + < <= = /= >= > > ;; complex + conjugate realpart imagpart phase min max logand logior logxor lognot ffloor fceiling ftruncate fround signum cis diff --git a/lsmath.lsp b/lsmath.lsp index c20e7b3..1baa4b0 100644 --- a/lsmath.lsp +++ b/lsmath.lsp @@ -23,13 +23,15 @@ (:shadow expt + - * / ** mod rem abs 1+ 1- log exp sqrt sin cos tan asin acos atan sinh cosh tanh asinh acosh atanh float random truncate floor ceiling round minusp zerop plusp evenp oddp - < <= = /= >= > complex conjugate realpart imagpart phase + < <= = /= >= > ;; complex + conjugate realpart imagpart phase min max logand logior logxor lognot ffloor fceiling ftruncate fround signum cis) (:export ^ ** expt + - * / mod rem pmin pmax abs 1+ 1- log exp sqrt sin cos tan asin acos atan sinh cosh tanh asinh acosh atanh float random truncate floor ceiling round minusp zerop plusp evenp oddp < <= = - /= >= > complex conjugate realpart imagpart phase min max + /= >= > ;; complex + conjugate realpart imagpart phase min max logand logior logxor lognot ffloor fceiling ftruncate fround signum cis) (:documentation "Vectorization of numerical functions")) @@ -38,8 +40,8 @@ ;;; Patch up some type definitions -(deftype float () 'common-lisp:float) -(deftype complex () 'common-lisp:complex) +;;(deftype float () 'common-lisp:float) +;;(deftype complex () 'common-lisp:complex) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; @@ -101,7 +103,7 @@ (make-rv-function-1 >= common-lisp:>=) (make-rv-function-1 > common-lisp:>) -(make-rv-function-1 complex common-lisp:complex) +;;(make-rv-function-1 complex common-lisp:complex) (make-rv-function realpart common-lisp:realpart x) (make-rv-function imagpart common-lisp:imagpart x) (make-rv-function conjugate common-lisp:conjugate x) diff --git a/nonlin.lsp b/nonlin.lsp index de75fdd..cf34ed8 100644 --- a/nonlin.lsp +++ b/nonlin.lsp @@ -22,12 +22,13 @@ (:shadowing-import-from :lisp-stat-object-system slot-value call-method call-next-method) (:shadowing-import-from :lisp-stat-math - expt + - * / ** mod rem abs 1+ 1- log exp sqrt sin cos tan - asin acos atan sinh cosh tanh asinh acosh atanh float random - truncate floor ceiling round minusp zerop plusp evenp oddp - < <= = /= >= > complex conjugate realpart imagpart phase - min max logand logior logxor lognot ffloor fceiling - ftruncate fround signum cis) + expt + - * / ** mod rem abs 1+ 1- log exp sqrt sin cos tan + asin acos atan sinh cosh tanh asinh acosh atanh float random + truncate floor ceiling round minusp zerop plusp evenp oddp + < <= = /= >= > ;; complex + conjugate realpart imagpart phase + min max logand logior logxor lognot ffloor fceiling + ftruncate fround signum cis) (:export nreg-model nreg-model-proto mean-function theta-hat epsilon count-limit verbose)) diff --git a/regression.lsp b/regression.lsp index fe3bcc8..781fc6d 100644 --- a/regression.lsp +++ b/regression.lsp @@ -33,7 +33,8 @@ expt + - * / ** mod rem abs 1+ 1- log exp sqrt sin cos tan asin acos atan sinh cosh tanh asinh acosh atanh float random truncate floor ceiling round minusp zerop plusp evenp oddp - < <= = /= >= > complex conjugate realpart imagpart phase + < <= = /= >= > ;; complex + conjugate realpart imagpart phase min max logand logior logxor lognot ffloor fceiling ftruncate fround signum cis) (:export regression-model regression-model-proto x y intercept sweep-matrix diff --git a/statistics.lsp b/statistics.lsp index 5ace130..c7b8dec 100644 --- a/statistics.lsp +++ b/statistics.lsp @@ -25,7 +25,8 @@ expt + - * / ** mod rem abs 1+ 1- log exp sqrt sin cos tan asin acos atan sinh cosh tanh asinh acosh atanh float random truncate floor ceiling round minusp zerop plusp evenp oddp - < <= = /= >= > complex conjugate realpart imagpart phase + < <= = /= >= > ;; complex + conjugate realpart imagpart phase min max logand logior logxor lognot ffloor fceiling ftruncate fround signum cis) (:export standard-deviation quantile median interquartile-range diff --git a/unittests.lisp b/unittests.lisp index cf004da..fa43fd1 100644 --- a/unittests.lisp +++ b/unittests.lisp @@ -17,7 +17,8 @@ expt + - * / ** mod rem abs 1+ 1- log exp sqrt sin cos tan ;; lsmath asin acos atan sinh cosh tanh asinh acosh atanh float random truncate floor ceiling round minusp zerop plusp evenp oddp - < <= = /= >= > complex conjugate realpart imagpart phase + < <= = /= >= > ;; complex + conjugate realpart imagpart phase min max logand logior logxor lognot ffloor fceiling ftruncate fround signum cis) (:export run-lisp-stat-tests run-lisp-stat-test scoreboard)) @@ -59,19 +60,19 @@ (defgeneric numerical= (a b &key tol)) (defmethod numerical= ((a real) (b real) &key (tol 0.00001)) ;; real)) - (print (format nil " equality pred for real a=%l real b=%l" a b)) + (print (format nil " equality pred for real a=~w real b=~w" a b)) (< (abs (- a b)) tol)) (defmethod numerical= ((a integer) (b integer) &key (tol 0.1)) ;; real)) - (print (format nil " equality pred for int a=~l int b=~l" (list a b))) + (print (format nil " equality pred for int a=~w int b=~w" a b)) (< (abs (- a b)) tol)) -(defmethod numerical= ((a complex) (b complex) &key (tol 0.00001)) ;; real)) - (< (abs (- a b)) tol)) +;;(defmethod numerical= ((a complex) (b complex) &key (tol 0.00001)) ;; real)) +;; (< (abs (- a b)) tol)) ;; can we use sequence for both array and list? I think so. (defmethod numerical= ((a sequence) (b sequence) &key (tol 0.00001)) - (print (format nil "checking equality for list a %l list b=%l" a b)) + (print (format nil "checking equality for list a ~w list b=~w" a b)) (if (and (= (length a) (length b)) (> (length a) 0) (numerical= (car a) (car b) :tol tol)) @@ -130,7 +131,7 @@ (numerical= 2.0 2.1 :tol 0.5) (numerical= 2 2) (numerical= 2 3) -(numerical= 2.0 (list 2.1 2.0 2.2)) +;;(numerical= 2.0 (list 2.1 2.0 2.2)) -- 2.11.4.GIT