From edenny at common-lisp.net Fri Mar 4 01:52:40 2005 From: edenny at common-lisp.net (Edgar Denny) Date: Fri, 4 Mar 2005 02:52:40 +0100 (CET) Subject: [cl-gsl-cvs] CVS update: cl-gsl/ffi.lisp Message-ID: <20050304015240.331428866C@common-lisp.net> Update of /project/cl-gsl/cvsroot/cl-gsl In directory common-lisp.net:/tmp/cvs-serv32738 Modified Files: ffi.lisp Log Message: Add functions needed by vector.lisp. Date: Fri Mar 4 02:52:39 2005 Author: edenny Index: cl-gsl/ffi.lisp diff -u cl-gsl/ffi.lisp:1.1.1.1 cl-gsl/ffi.lisp:1.2 --- cl-gsl/ffi.lisp:1.1.1.1 Wed Mar 2 02:04:53 2005 +++ cl-gsl/ffi.lisp Fri Mar 4 02:52:38 2005 @@ -57,7 +57,7 @@ ;; ---------------------------------------------------------------------- ;; TODO: size_t may not always be unsigned long, could also be unsigned int. -(define-foreign-type (size-t :unsigned-long)) +(define-foreign-type size-t :unsigned-long) (def-foreign-struct gsl-complex (dat (:array :double 2))) @@ -212,16 +212,27 @@ (complex (uffi:deref-array dat-array :float 0) (uffi:deref-array dat-array :float 1)))) +;; FIXME: this returns a pointer to a gsl-complex. Is this correct? +;; How do we free it? +;; Replace with a with-complex->gsl-complex macro that cleans up after +;; itself (defun complex->gsl-complex (z) (let* ((z-ptr (uffi:allocate-foreign-object 'gsl-complex)) - (uffi:get-slot-pointer z-ptr 'double-ptr 'cl-gsl::dat)) - )) + (dat-array (uffi:get-slot-value z-ptr (:array :float) 'cl-gsl::dat))) + (setf (uffi:deref-array dat-array :double 0) (realpart z)) + (setf (uffi:deref-array dat-array :double 1) (imagpart z)) + z-ptr)) +;; FIXME: see above (defun complex->gsl-complex-float (z) - (let ((z-ptr (uffi:allocate-foreign-object 'gsl-complex-float))) - )) + (let* ((z-ptr (uffi:allocate-foreign-object 'gsl-complex-float)) + (dat-array (uffi:get-slot-value z-ptr (:array :float) 'cl-gsl::dat))) + (setf (uffi:deref-array dat-array :double 0) (realpart z)) + (setf (uffi:deref-array dat-array :double 1) (imagpart z)) + z-ptr)) -;; TODO: generalize to all supported types + +;; TODO: generalize to all supported types? (defun lisp-vec->c-array (v) (declare (vector v)) (let* ((len (length v)) @@ -230,7 +241,7 @@ (setf (uffi:deref-array c-ptr :double i) (aref v i))) c-ptr)) -;; TODO: generalize to all supported types +;; TODO: generalize to all supported types? (defun c-array->lisp-vec (c-ptr len) (let ((lisp-vec (make-array len :element-type 'double-float))) (dotimes (i len) From edenny at common-lisp.net Fri Mar 4 01:55:11 2005 From: edenny at common-lisp.net (Edgar Denny) Date: Fri, 4 Mar 2005 02:55:11 +0100 (CET) Subject: [cl-gsl-cvs] CVS update: cl-gsl/package.lisp Message-ID: <20050304015511.9EA6D8866C@common-lisp.net> Update of /project/cl-gsl/cvsroot/cl-gsl In directory common-lisp.net:/tmp/cvs-serv308 Modified Files: package.lisp Log Message: Add exported symbols to package cl-gsl-vector. Date: Fri Mar 4 02:55:10 2005 Author: edenny Index: cl-gsl/package.lisp diff -u cl-gsl/package.lisp:1.1.1.1 cl-gsl/package.lisp:1.2 --- cl-gsl/package.lisp:1.1.1.1 Wed Mar 2 02:04:53 2005 +++ cl-gsl/package.lisp Fri Mar 4 02:55:10 2005 @@ -37,10 +37,12 @@ #:define-foreign-type #:def-foreign-struct #:gsl-complex->complex + #:gsl-complex-float->complex #:lisp-vec->c-array #:complex-packed-array->lisp-vec + #:complex->gsl-complex + #:complex->gsl-complex-float #:c-array->lisp-vec - #:defconstant-export #:register-constants )) @@ -92,10 +94,34 @@ (:nicknames #:gsl-vector) (:use #:cl #:cl-gsl) (:export + #:free #:make-vector #:get-element #:set-element #:set-all #:set-zero #:set-basis + #:write-to-binary-file + #:write-to-file + #:read-from-binary-file + #:read-from-file + #:subvector + #:subvector-with-stride + #:copy + #:swap + #:swap-elements + #:reverse-vector + #:add + #:sub + #:mul + #:div + #:scale + #:add-constant + #:max-value + #:min-value + #:max-index + #:min-index + #:min-max-indicies + #:min-max-values + #:isnull )) From edenny at common-lisp.net Fri Mar 4 01:56:06 2005 From: edenny at common-lisp.net (Edgar Denny) Date: Fri, 4 Mar 2005 02:56:06 +0100 (CET) Subject: [cl-gsl-cvs] CVS update: cl-gsl/vector.lisp Message-ID: <20050304015606.CB4368866C@common-lisp.net> Update of /project/cl-gsl/cvsroot/cl-gsl In directory common-lisp.net:/tmp/cvs-serv328 Modified Files: vector.lisp Log Message: Make file actually compile. Date: Fri Mar 4 02:56:04 2005 Author: edenny Index: cl-gsl/vector.lisp diff -u cl-gsl/vector.lisp:1.1.1.1 cl-gsl/vector.lisp:1.2 --- cl-gsl/vector.lisp:1.1.1.1 Wed Mar 2 02:04:53 2005 +++ cl-gsl/vector.lisp Fri Mar 4 02:56:03 2005 @@ -107,63 +107,89 @@ ((v1 ,type-ptr)) :int) - (defun-foreign ,(concatenate 'string "gsl_" type-string "_add") - ((va ,type-ptr) - (vb ,type-ptr)) - :int) - - (defun-foreign ,(concatenate 'string "gsl_" type-string "_sub") - ((va ,type-ptr) - (vb ,type-ptr)) - :int) - - (defun-foreign ,(concatenate 'string "gsl_" type-string "_mul") - ((va ,type-ptr) - (vb ,type-ptr)) - :int) - - (defun-foreign ,(concatenate 'string "gsl_" type-string "_div") - ((va ,type-ptr) - (vb ,type-ptr)) - :int) - - (defun-foreign ,(concatenate 'string "gsl_" type-string "_scale") - ((vec ,type-ptr) - (x ,type-val)) - :int) - - (defun-foreign ,(concatenate 'string "gsl_" type-string "_add_constant") - ((vec ,type-ptr) - (x ,type-val)) - :int) - - (defun-foreign ,(concatenate 'string "gsl_" type-string "_max") - ((vec ,type-ptr)) - ,type-val) - - (defun-foreign ,(concatenate 'string "gsl_" type-string "_min") - ((vec ,type-ptr)) - ,type-val) - - (defun-foreign ,(concatenate 'string "gsl_" type-string "_minmax") - ((vec ,type-ptr) - (min ,type-val-ptr) - (max ,type-val-ptr)) - :void) - - (defun-foreign ,(concatenate 'string "gsl_" type-string "_max_index") - ((vec ,type-ptr)) - size-t) - - (defun-foreign ,(concatenate 'string "gsl_" type-string "_min_index") - ((vec ,type-ptr)) - size-t) - - (defun-foreign ,(concatenate 'string "gsl_" type-string "_minmax_index") - ((vec ,type-ptr) - (min size-t-ptr) - (max size-t-ptr)) - :void) + ,(unless (or (eq typ 'complex-double-float) + (eq typ 'complex-single-float)) + `(defun-foreign ,(concatenate 'string "gsl_" type-string "_add") + ((va ,type-ptr) + (vb ,type-ptr)) + :int)) + + ,(unless (or (eq typ 'complex-double-float) + (eq typ 'complex-single-float)) + `(defun-foreign ,(concatenate 'string "gsl_" type-string "_sub") + ((va ,type-ptr) + (vb ,type-ptr)) + :int)) + + ,(unless (or (eq typ 'complex-double-float) + (eq typ 'complex-single-float)) + `(defun-foreign ,(concatenate 'string "gsl_" type-string "_mul") + ((va ,type-ptr) + (vb ,type-ptr)) + :int)) + + ,(unless (or (eq typ 'complex-double-float) + (eq typ 'complex-single-float)) + `(defun-foreign ,(concatenate 'string "gsl_" type-string "_div") + ((va ,type-ptr) + (vb ,type-ptr)) + :int)) + + ,(unless (or (eq typ 'complex-double-float) + (eq typ 'complex-single-float)) + `(defun-foreign ,(concatenate 'string "gsl_" type-string "_scale") + ((vec ,type-ptr) + (x ,type-val)) + :int)) + + ,(unless (or (eq typ 'complex-double-float) + (eq typ 'complex-single-float)) + `(defun-foreign ,(concatenate 'string + "gsl_" type-string "_add_constant") + ((vec ,type-ptr) + (x ,type-val)) + :int)) + + ,(unless (or (eq typ 'complex-double-float) + (eq typ 'complex-single-float)) + `(defun-foreign ,(concatenate 'string "gsl_" type-string "_max") + ((vec ,type-ptr)) + ,type-val)) + + ,(unless (or (eq typ 'complex-double-float) + (eq typ 'complex-single-float)) + `(defun-foreign ,(concatenate 'string "gsl_" type-string "_min") + ((vec ,type-ptr)) + ,type-val)) + + ,(unless (or (eq typ 'complex-double-float) + (eq typ 'complex-single-float)) + `(defun-foreign ,(concatenate 'string "gsl_" type-string "_minmax") + ((vec ,type-ptr) + (min ,type-val-ptr) + (max ,type-val-ptr)) + :void)) + + ,(unless (or (eq typ 'complex-double-float) + (eq typ 'complex-single-float)) + `(defun-foreign ,(concatenate 'string "gsl_" type-string "_max_index") + ((vec ,type-ptr)) + size-t)) + + ,(unless (or (eq typ 'complex-double-float) + (eq typ 'complex-single-float)) + `(defun-foreign ,(concatenate 'string "gsl_" type-string "_min_index") + ((vec ,type-ptr)) + size-t)) + + ,(unless (or (eq typ 'complex-double-float) + (eq typ 'complex-single-float)) + `(defun-foreign ,(concatenate 'string + "gsl_" type-string "_minmax_index") + ((vec ,type-ptr) + (min size-t-ptr) + (max size-t-ptr)) + :void)) (defun-foreign ,(concatenate 'string "gsl_" type-string "_isnull") ((vec ,type-ptr)) @@ -218,7 +244,7 @@ element-type) (defun alloc (v) - (declare (gsl-vec v)) + (assert (eq 'gsl (type-of v))) (ecase (gsl-vec-element-type v) ('integer (setf (gsl-vec-ptr v) (gsl-vector-int-alloc (gsl-vec-size v)))) @@ -233,7 +259,7 @@ (defun free (v) - (declare (gsl-vec v)) + (assert (eq 'gsl (type-of v))) (ecase (gsl-vec-element-type v) ('integer (gsl-vector-int-free (gsl-vec-ptr v))) @@ -251,7 +277,7 @@ (defun get-element (v i) - (declare (gsl-vec v)) + (assert (eq 'gsl (type-of v))) (assert (typep i 'integer)) (assert (< i (gsl-vec-size v))) (ecase (gsl-vec-element-type v) @@ -269,7 +295,7 @@ (defun set-element (v i x) - (declare (gsl-vec v)) + (assert (eq 'gsl (type-of v))) (assert (eq (type-of x) (gsl-vec-element-type v))) (assert (typep i 'integer)) (assert (< i (gsl-vec-size v))) @@ -291,7 +317,7 @@ (defun set-all (v x) - (declare (gsl-vec v)) + (assert (eq 'gsl (type-of v))) (assert (eq (type-of x) (gsl-vec-element-type v))) (ecase (gsl-vec-element-type v) ('integer @@ -308,7 +334,7 @@ (complex->gsl-complex x))))) (defun set-zero (v) - (declare (gsl-vec v)) + (assert (eq 'gsl (type-of v))) (ecase (gsl-vec-element-type v) ('integer (gsl-vector-int-set-zero (gsl-vec-ptr v))) @@ -317,15 +343,13 @@ ('double-float (gsl-vector-set-zero (gsl-vec-ptr v))) ('complex-single-float - (gsl-vector-complex-float-set-zero (gsl-vec-ptr v) - (complex->gsl-complex-float))) + (gsl-vector-complex-float-set-zero (gsl-vec-ptr v))) ('complex-double-float - (gsl-vector-complex-set-zero (gsl-vec-ptr v) - (complex->gsl-complex))))) + (gsl-vector-complex-set-zero (gsl-vec-ptr v))))) (defun set-basis (v i) - (declare (gsl-vec v)) + (assert (eq 'gsl (type-of v))) (assert (typep i 'integer)) (assert (< i (gsl-vec-size v))) (ecase (gsl-vec-element-type v) @@ -349,7 +373,7 @@ (assert (find element-type '(integer single-float double-float complex-single-float double-single-float))) (let ((v (make-gsl-vec :size size :element-type element-type))) - (setf (gsl-vec-ptr v) (gsl-vector:alloc v)) + (setf (gsl-vec-ptr v) (alloc v)) (cond ((and initial-element initial-contents) (error "cannot define both initial-element and initial-contents keys")) @@ -372,83 +396,86 @@ (defun write-to-binary-file (file-name v) - (declare (gsl-vector v)) + (assert (eq 'gsl (type-of v))) (let ((status)) - (with-cstring (c-file-name file-name) + (uffi:with-cstring (c-file-name file-name) (setq status (ecase (gsl-vec-element-type v) ('integer (wrap-gsl-vector-int-fwrite c-file-name (gsl-vec-ptr v))) ('single-float - (gsl-vector-float-fwrite c-file-name (gsl-vec-ptr v))) + (wrap-gsl-vector-float-fwrite c-file-name (gsl-vec-ptr v))) ('double-float - (gsl-vector-fwrite c-file-name (gsl-vec-ptr v))) + (wrap-gsl-vector-fwrite c-file-name (gsl-vec-ptr v))) ('complex-single-float - (gsl-vector-complex-float-fwrite c-file-name (gsl-vec-ptr v))) + (wrap-gsl-vector-complex-float-fwrite c-file-name + (gsl-vec-ptr v))) ('complex-double-float - (gsl-vector-complex-fwrite c-file-name (gsl-vec-ptr v)))))) + (wrap-gsl-vector-complex-fwrite c-file-name (gsl-vec-ptr v)))))) status)) (defun write-to-file (file-name v) - (declare (gsl-vector v)) + (assert (eq 'gsl (type-of v))) (let ((status)) - (with-cstring (c-file-name file-name) + (uffi:with-cstring (c-file-name file-name) (setq status (ecase (gsl-vec-element-type v) ('integer (wrap-gsl-vector-int-fprintf c-file-name (gsl-vec-ptr v))) ('single-float - (gsl-vector-float-fprintf c-file-name (gsl-vec-ptr v))) + (wrap-gsl-vector-float-fprintf c-file-name (gsl-vec-ptr v))) ('double-float - (gsl-vector-fprintf c-file-name (gsl-vec-ptr v))) + (wrap-gsl-vector-fprintf c-file-name (gsl-vec-ptr v))) ('complex-single-float - (gsl-vector-complex-float-fprintf c-file-name (gsl-vec-ptr v))) + (wrap-gsl-vector-complex-float-fprintf c-file-name + (gsl-vec-ptr v))) ('complex-double-float - (gsl-vector-complex-fprintf c-file-name (gsl-vec-ptr v)))))) + (wrap-gsl-vector-complex-fprintf c-file-name (gsl-vec-ptr v)))))) status)) (defun read-from-binary-file (file-name size element-type) - (let ((v (make-vector :size size :element-type element-type)) + (let ((v (make-vector size :element-type element-type)) (status)) - (with-cstring (c-file-name file-name) + (uffi:with-cstring (c-file-name file-name) (setq status (ecase (gsl-vec-element-type v) ('integer (wrap-gsl-vector-int-fread c-file-name (gsl-vec-ptr v))) ('single-float - (gsl-vector-float-fread c-file-name (gsl-vec-ptr v))) + (wrap-gsl-vector-float-fread c-file-name (gsl-vec-ptr v))) ('double-float - (gsl-vector-fread c-file-name (gsl-vec-ptr v))) + (wrap-gsl-vector-fread c-file-name (gsl-vec-ptr v))) ('complex-single-float - (gsl-vector-complex-float-fread c-file-name (gsl-vec-ptr v))) + (wrap-gsl-vector-complex-float-fread c-file-name (gsl-vec-ptr v))) ('complex-double-float - (gsl-vector-complex-fread c-file-name (gsl-vec-ptr v)))))) + (wrap-gsl-vector-complex-fread c-file-name (gsl-vec-ptr v)))))) (values v status))) (defun read-from-file (file-name size element-type) - (let ((v (make-vector :size size :element-type element-type)) + (let ((v (make-vector size :element-type element-type)) (status)) - (with-cstring (c-file-name file-name) + (uffi:with-cstring (c-file-name file-name) (setq status (ecase (gsl-vec-element-type v) ('integer (wrap-gsl-vector-int-fscanf c-file-name (gsl-vec-ptr v))) ('single-float - (gsl-vector-float-fscanf c-file-name (gsl-vec-ptr v))) + (wrap-gsl-vector-float-fscanf c-file-name (gsl-vec-ptr v))) ('double-float - (gsl-vector-fscanf c-file-name (gsl-vec-ptr v))) + (wrap-gsl-vector-fscanf c-file-name (gsl-vec-ptr v))) ('complex-single-float - (gsl-vector-complex-float-fscanf c-file-name (gsl-vec-ptr v))) + (wrap-gsl-vector-complex-float-fscanf c-file-name + (gsl-vec-ptr v))) ('complex-double-float - (gsl-vector-complex-fscanf c-file-name (gsl-vec-ptr v)))))) + (wrap-gsl-vector-complex-fscanf c-file-name (gsl-vec-ptr v)))))) (values v status))) (defun subvector (v offset n) - (declare (gsl-vector v)) + (assert (eq 'gsl (type-of v))) (assert (typep offset 'integer)) (assert (typep n 'integer)) (assert (< (+ offset n) (gsl-vec-size v))) @@ -471,7 +498,7 @@ (defun subvector-with-stride (v offset stride n) - (declare (gsl-vector v)) + (assert (eq 'gsl (type-of v))) (assert (typep offset 'integer)) (assert (typep stride 'integer)) (assert (typep n 'integer)) @@ -500,8 +527,8 @@ (defun copy (v-src) - (let* ((v-dest (make-vector :size (gsl-vec-size v-src) - :element-type (gsl-vec-element-type v-src))) + (let* ((v-dest (make-vector (gsl-vec-size v-src) + :element-type (gsl-vec-element-type v-src))) (status (ecase (gsl-vec-element-type v-src) ('integer (gsl-vector-int-memcpy (gsl-vec-ptr v-dest) @@ -522,7 +549,8 @@ (defun swap (va vb) - (declare (gsl-vec va) (gsl-vec vb)) + (assert (eq 'gsl (type-of va))) + (assert (eq 'gsl (type-of vb))) (assert (eq (gsl-vec-element-type va) (gsl-vec-element-type vb))) (assert (= (gsl-vec-size va) (gsl-vec-size vb))) (let ((status @@ -541,7 +569,7 @@ (defun swap-elements (v i j) - (declare (gsl-vec v) (integer i) (integer j)) + (assert (eq 'gsl (type-of v))) (assert (typep i 'integer)) (assert (typep j 'integer)) (assert (< i (gsl-vec-size v))) @@ -562,7 +590,7 @@ (defun reverse-vector (v) - (declare (gsl-vec v)) + (assert (eq 'gsl (type-of v))) (let ((status (ecase (gsl-vec-element-type v) ('integer @@ -579,7 +607,8 @@ (defun add (va vb) - (declare (gsl-vec va) (gsl-vec vb)) + (assert (eq 'gsl (type-of va))) + (assert (eq 'gsl (type-of vb))) (assert (eq (gsl-vec-element-type va) (gsl-vec-element-type vb))) (assert (= (gsl-vec-size va) (gsl-vec-size vb))) (let ((status @@ -589,16 +618,13 @@ ('single-float (gsl-vector-float-add (gsl-vec-ptr va) (gsl-vec-ptr vb))) ('double-float - (gsl-vector-add (gsl-vec-ptr va) (gsl-vec-ptr vb))) - ('complex-single-float - (gsl-vector-complex-float-add (gsl-vec-ptr va) (gsl-vec-ptr vb))) - ('complex-double-float - (gsl-vector-complex-add (gsl-vec-ptr va) (gsl-vec-ptr vb)))))) + (gsl-vector-add (gsl-vec-ptr va) (gsl-vec-ptr vb)))))) (values va status))) (defun sub (va vb) - (declare (gsl-vec va) (gsl-vec vb)) + (assert (eq 'gsl (type-of va))) + (assert (eq 'gsl (type-of vb))) (assert (eq (gsl-vec-element-type va) (gsl-vec-element-type vb))) (assert (= (gsl-vec-size va) (gsl-vec-size vb))) (let ((status @@ -608,15 +634,12 @@ ('single-float (gsl-vector-float-sub (gsl-vec-ptr va) (gsl-vec-ptr vb))) ('double-float - (gsl-vector-sub (gsl-vec-ptr va) (gsl-vec-ptr vb))) - ('complex-single-float - (gsl-vector-complex-float-sub (gsl-vec-ptr va) (gsl-vec-ptr vb))) - ('complex-double-float - (gsl-vector-complex-sub (gsl-vec-ptr va) (gsl-vec-ptr vb)))))) + (gsl-vector-sub (gsl-vec-ptr va) (gsl-vec-ptr vb)))))) (values va status))) (defun mul (va vb) - (declare (gsl-vec va) (gsl-vec vb)) + (assert (eq 'gsl (type-of va))) + (assert (eq 'gsl (type-of vb))) (assert (eq (gsl-vec-element-type va) (gsl-vec-element-type vb))) (assert (= (gsl-vec-size va) (gsl-vec-size vb))) (let ((status @@ -626,16 +649,13 @@ ('single-float (gsl-vector-float-mul (gsl-vec-ptr va) (gsl-vec-ptr vb))) ('double-float - (gsl-vector-mul (gsl-vec-ptr va) (gsl-vec-ptr vb))) - ('complex-single-float - (gsl-vector-complex-float-mul (gsl-vec-ptr va) (gsl-vec-ptr vb))) - ('complex-double-float - (gsl-vector-complex-mul (gsl-vec-ptr va) (gsl-vec-ptr vb)))))) + (gsl-vector-mul (gsl-vec-ptr va) (gsl-vec-ptr vb)))))) (values va status))) (defun div (va vb) - (declare (gsl-vec va) (gsl-vec vb)) + (assert (eq 'gsl (type-of va))) + (assert (eq 'gsl (type-of vb))) (assert (eq (gsl-vec-element-type va) (gsl-vec-element-type vb))) (assert (= (gsl-vec-size va) (gsl-vec-size vb))) (let ((status @@ -645,16 +665,12 @@ ('single-float (gsl-vector-float-div (gsl-vec-ptr va) (gsl-vec-ptr vb))) ('double-float - (gsl-vector-div (gsl-vec-ptr va) (gsl-vec-ptr vb))) - ('complex-single-float - (gsl-vector-complex-float-div (gsl-vec-ptr va) (gsl-vec-ptr vb))) - ('complex-double-float - (gsl-vector-complex-div (gsl-vec-ptr va) (gsl-vec-ptr vb)))))) + (gsl-vector-div (gsl-vec-ptr va) (gsl-vec-ptr vb)))))) (values va status))) (defun scale (v x) - (declare (gsl-vec v)) + (assert (eq 'gsl (type-of v))) (assert (eq (gsl-vec-element-type v) (type-of x))) (let ((status (ecase (gsl-vec-element-type v) @@ -663,16 +679,12 @@ ('single-float (gsl-vector-float-scale (gsl-vec-ptr v) x)) ('double-float - (gsl-vector-scale (gsl-vec-ptr v) x)) - ('complex-single-float - (gsl-vector-complex-float-scale (gsl-vec-ptr v) x)) - ('complex-double-float - (gsl-vector-complex-scale (gsl-vec-ptr v) x))))) + (gsl-vector-scale (gsl-vec-ptr v) x))))) (values v status))) (defun add-constant (v x) - (declare (gsl-vec v)) + (assert (eq 'gsl (type-of v))) (assert (eq (gsl-vec-element-type v) (type-of x))) (let ((status (ecase (gsl-vec-element-type v) @@ -681,98 +693,73 @@ ('single-float (gsl-vector-float-add-constant (gsl-vec-ptr v) x)) ('double-float - (gsl-vector-add-constant (gsl-vec-ptr v) x)) - ('complex-single-float - (gsl-vector-complex-float-add-constant (gsl-vec-ptr v) x)) - ('complex-double-float - (gsl-vector-complex-add-constant (gsl-vec-ptr v) x))))) + (gsl-vector-add-constant (gsl-vec-ptr v) x))))) (values v status))) (defun max-value (v) - (declare (gsl-vec v)) + (assert (eq 'gsl (type-of v))) (ecase (gsl-vec-element-type v) ('integer (gsl-vector-int-max (gsl-vec-ptr v))) ('single-float (gsl-vector-float-max (gsl-vec-ptr v))) ('double-float - (gsl-vector-max (gsl-vec-ptr v))) - ('complex-single-float - (gsl-vector-complex-float-max (gsl-vec-ptr v))) - ('complex-double-float - (gsl-vector-complex-max (gsl-vec-ptr v))))) + (gsl-vector-max (gsl-vec-ptr v))))) (defun min-value (v) - (declare (gsl-vec v)) + (assert (eq 'gsl (type-of v))) (ecase (gsl-vec-element-type v) ('integer (gsl-vector-int-min (gsl-vec-ptr v))) ('single-float (gsl-vector-float-min (gsl-vec-ptr v))) ('double-float - (gsl-vector-min (gsl-vec-ptr v))) - ('complex-single-float - (gsl-vector-complex-float-min (gsl-vec-ptr v))) - ('complex-double-float - (gsl-vector-complex-min (gsl-vec-ptr v))))) + (gsl-vector-min (gsl-vec-ptr v))))) (defun max-index (v) - (declare (gsl-vec v)) + (assert (eq 'gsl (type-of v))) (ecase (gsl-vec-element-type v) ('integer (gsl-vector-int-max-index (gsl-vec-ptr v))) ('single-float (gsl-vector-float-max-index (gsl-vec-ptr v))) ('double-float - (gsl-vector-max-index (gsl-vec-ptr v))) - ('complex-single-float - (gsl-vector-complex-float-max-index (gsl-vec-ptr v))) - ('complex-double-float - (gsl-vector-complex-max-index (gsl-vec-ptr v))))) + (gsl-vector-max-index (gsl-vec-ptr v))))) -(defun max-index (v) - (declare (gsl-vec v)) +(defun min-index (v) + (assert (eq 'gsl (type-of v))) (ecase (gsl-vec-element-type v) ('integer (gsl-vector-int-min-index (gsl-vec-ptr v))) ('single-float (gsl-vector-float-min-index (gsl-vec-ptr v))) ('double-float - (gsl-vector-min-index (gsl-vec-ptr v))) - ('complex-single-float - (gsl-vector-complex-float-min-index (gsl-vec-ptr v))) - ('complex-double-float - (gsl-vector-complex-min-index (gsl-vec-ptr v))))) - + (gsl-vector-min-index (gsl-vec-ptr v))))) (defun min-max-indicies (v) - (declare (gsl-vec v)) + (assert (eq 'gsl (type-of v))) (let ((min-ptr (uffi:allocate-foreign-object 'size-t)) (max-ptr (uffi:allocate-foreign-object 'size-t))) (ecase (gsl-vec-element-type v) ('integer - (gsl-vector-int-minmax-index (gsl-vec-ptr v))) + (gsl-vector-int-minmax-index (gsl-vec-ptr v) min-ptr max-ptr)) ('single-float - (gsl-vector-float-minmax-index (gsl-vec-ptr v))) + (gsl-vector-float-minmax-index (gsl-vec-ptr v) min-ptr max-ptr)) ('double-float - (gsl-vector-minmax-index (gsl-vec-ptr v))) - ('complex-single-float - (gsl-vector-complex-float-minmax-index (gsl-vec-ptr v))) - ('complex-double-float - (gsl-vector-complex-minmax-index (gsl-vec-ptr v)))) + (gsl-vector-minmax-index (gsl-vec-ptr v) min-ptr max-ptr))) (prog1 - (list (uffi:deref-pointer 'size-t min-ptr) - (uffi:deref-pointer 'size-t max-ptr)) + (list (uffi:deref-pointer min-ptr 'size-t) + (uffi:deref-pointer max-ptr 'size-t)) (uffi:free-foreign-object min-ptr) (uffi:free-foreign-object max-ptr)))) (defun min-max-values (v) - (declare (gsl-vec v)) + (assert (eq 'gsl (type-of v))) (destructuring-bind (min-index max-index) (min-max-indicies v) (list (get-element v min-index) @@ -780,7 +767,7 @@ (defun isnull (v) - (declare (gsl-vec v)) + (assert (eq 'gsl (type-of v))) (1/0->t/nil (ecase (gsl-vec-element-type v) ('integer (gsl-vector-int-isnull (gsl-vec-ptr v))) From edenny at common-lisp.net Fri Mar 4 01:57:02 2005 From: edenny at common-lisp.net (Edgar Denny) Date: Fri, 4 Mar 2005 02:57:02 +0100 (CET) Subject: [cl-gsl-cvs] CVS update: cl-gsl/ChangeLog Message-ID: <20050304015702.AFF738866C@common-lisp.net> Update of /project/cl-gsl/cvsroot/cl-gsl In directory common-lisp.net:/tmp/cvs-serv359 Added Files: ChangeLog Log Message: *** empty log message *** Date: Fri Mar 4 02:57:02 2005 Author: edenny From edenny at common-lisp.net Fri Mar 4 01:58:59 2005 From: edenny at common-lisp.net (Edgar Denny) Date: Fri, 4 Mar 2005 02:58:59 +0100 (CET) Subject: [cl-gsl-cvs] CVS update: cl-gsl/c/cwrapperstub.c Message-ID: <20050304015859.66A9D8866C@common-lisp.net> Update of /project/cl-gsl/cvsroot/cl-gsl/c In directory common-lisp.net:/tmp/cvs-serv380 Modified Files: cwrapperstub.c Log Message: Add needed wrappers for vector.lisp. Date: Fri Mar 4 02:58:58 2005 Author: edenny Index: cl-gsl/c/cwrapperstub.c diff -u cl-gsl/c/cwrapperstub.c:1.1.1.1 cl-gsl/c/cwrapperstub.c:1.2 --- cl-gsl/c/cwrapperstub.c:1.1.1.1 Wed Mar 2 02:04:53 2005 +++ cl-gsl/c/cwrapperstub.c Fri Mar 4 02:58:57 2005 @@ -388,32 +388,40 @@ gsl_vector *wrap_gsl_vector_subvector(gsl_vector *v, size_t offset, size_t n) { + gsl_vector *ret; gsl_vector_view v_view = gsl_vector_subvector(v, offset, n); - return &v_view.vector; + ret = &v_view.vector; + return ret; } gsl_vector_float *wrap_gsl_vector_float_subvector(gsl_vector_float *v, size_t offset, size_t n) { + gsl_vector_float *ret; gsl_vector_float_view v_view = gsl_vector_float_subvector(v, offset, n); - return &v_view.vector; + ret = &v_view.vector; + return ret; } gsl_vector_int *wrap_gsl_vector_int_subvector(gsl_vector_int *v, size_t offset, size_t n) { + gsl_vector_int *ret; gsl_vector_int_view v_view = gsl_vector_int_subvector(v, offset, n); - return &v_view.vector; + ret = &v_view.vector; + return ret; } gsl_vector_complex *wrap_gsl_vector_complex_subvector(gsl_vector_complex *v, size_t offset, size_t n) { + gsl_vector_complex *ret; gsl_vector_complex_view v_view = gsl_vector_complex_subvector(v, offset, n); - return &v_view.vector; + ret = &v_view.vector; + return ret; } gsl_vector_complex_float *wrap_gsl_vector_complex_float_subvector( @@ -421,9 +429,11 @@ size_t offset, size_t n) { + gsl_vector_complex_float *ret; gsl_vector_complex_float_view v_view = gsl_vector_complex_float_subvector(v, offset, n); - return &v_view.vector; + ret = &v_view.vector; + return ret; } /* ----------------------------------------------------------------- */ @@ -434,9 +444,11 @@ size_t stride, size_t n) { + gsl_vector *ret; gsl_vector_view v_view = gsl_vector_subvector_with_stride(v, offset, stride, n); - return &v_view.vector; + ret = &v_view.vector; + return ret; } gsl_vector_float *wrap_gsl_vector_float_subvector_with_stride( @@ -445,9 +457,11 @@ size_t stride, size_t n) { + gsl_vector_float *ret; gsl_vector_float_view v_view = gsl_vector_float_subvector_with_stride(v, offset, stride, n); - return &v_view.vector; + ret = &v_view.vector; + return ret; } gsl_vector_int *wrap_gsl_vector_int_subvector_with_stride( @@ -456,9 +470,11 @@ size_t stride, size_t n) { + gsl_vector_int *ret; gsl_vector_int_view v_view = gsl_vector_int_subvector_with_stride(v, offset, stride, n); - return &v_view.vector; + ret = &v_view.vector; + return ret; } gsl_vector_complex *wrap_gsl_vector_complex_subvector_with_stride( @@ -467,9 +483,11 @@ size_t stride, size_t n) { + gsl_vector_complex *ret; gsl_vector_complex_view v_view = gsl_vector_complex_subvector_with_stride(v, offset, stride, n); - return &v_view.vector; + ret = &v_view.vector; + return ret; } gsl_vector_complex_float *wrap_gsl_vector_complex_float_subvector_with_stride( @@ -478,7 +496,9 @@ size_t stride, size_t n) { + gsl_vector_complex_float *ret; gsl_vector_complex_float_view v_view = gsl_vector_complex_float_subvector_with_stride(v, offset, stride, n); - return &v_view.vector; + ret = &v_view.vector; + return ret; } From edenny at common-lisp.net Sat Mar 5 04:31:44 2005 From: edenny at common-lisp.net (Edgar Denny) Date: Sat, 5 Mar 2005 05:31:44 +0100 (CET) Subject: [cl-gsl-cvs] CVS update: cl-gsl/vector.lisp Message-ID: <20050305043144.2311388678@common-lisp.net> Update of /project/cl-gsl/cvsroot/cl-gsl In directory common-lisp.net:/tmp/cvs-serv27657 Modified Files: vector.lisp Log Message: Fixes for complex vectors. Date: Sat Mar 5 05:31:41 2005 Author: edenny Index: cl-gsl/vector.lisp diff -u cl-gsl/vector.lisp:1.2 cl-gsl/vector.lisp:1.3 --- cl-gsl/vector.lisp:1.2 Fri Mar 4 02:56:03 2005 +++ cl-gsl/vector.lisp Sat Mar 5 05:31:41 2005 @@ -40,12 +40,12 @@ (setq type-val :int) (setq type-val-ptr '(* :int)) (setq type-string "vector_int")) - ((eq typ 'complex-double-float) + ((equal typ '(complex (double-float))) (setq type-ptr 'gsl-vector-complex-ptr) (setq type-val 'gsl-complex) (setq type-val-ptr '(* gsl-complex)) (setq type-string "vector_complex")) - ((eq typ 'complex-single-float) + ((equal typ '(complex (single-float))) (setq type-ptr 'gsl-vector-complex-float-ptr) (setq type-val 'gsl-complex-float) (setq type-val-ptr '(* gsl-complex-float)) @@ -107,83 +107,83 @@ ((v1 ,type-ptr)) :int) - ,(unless (or (eq typ 'complex-double-float) - (eq typ 'complex-single-float)) + ,(unless (or (equal typ '(complex (double-float))) + (equal typ '(complex (single-float)))) `(defun-foreign ,(concatenate 'string "gsl_" type-string "_add") ((va ,type-ptr) (vb ,type-ptr)) :int)) - ,(unless (or (eq typ 'complex-double-float) - (eq typ 'complex-single-float)) + ,(unless (or (equal typ '(complex (double-float))) + (equal typ '(complex (single-float)))) `(defun-foreign ,(concatenate 'string "gsl_" type-string "_sub") ((va ,type-ptr) (vb ,type-ptr)) :int)) - ,(unless (or (eq typ 'complex-double-float) - (eq typ 'complex-single-float)) + ,(unless (or (equal typ '(complex (double-float))) + (equal typ '(complex (single-float)))) `(defun-foreign ,(concatenate 'string "gsl_" type-string "_mul") ((va ,type-ptr) (vb ,type-ptr)) :int)) - ,(unless (or (eq typ 'complex-double-float) - (eq typ 'complex-single-float)) + ,(unless (or (equal typ '(complex (double-float))) + (equal typ '(complex (single-float)))) `(defun-foreign ,(concatenate 'string "gsl_" type-string "_div") ((va ,type-ptr) (vb ,type-ptr)) :int)) - ,(unless (or (eq typ 'complex-double-float) - (eq typ 'complex-single-float)) + ,(unless (or (equal typ '(complex (double-float))) + (equal typ '(complex (single-float)))) `(defun-foreign ,(concatenate 'string "gsl_" type-string "_scale") ((vec ,type-ptr) (x ,type-val)) :int)) - ,(unless (or (eq typ 'complex-double-float) - (eq typ 'complex-single-float)) + ,(unless (or (equal typ '(complex (double-float))) + (equal typ '(complex (single-float)))) `(defun-foreign ,(concatenate 'string "gsl_" type-string "_add_constant") ((vec ,type-ptr) (x ,type-val)) :int)) - ,(unless (or (eq typ 'complex-double-float) - (eq typ 'complex-single-float)) + ,(unless (or (equal typ '(complex (double-float))) + (equal typ '(complex (single-float)))) `(defun-foreign ,(concatenate 'string "gsl_" type-string "_max") ((vec ,type-ptr)) ,type-val)) - ,(unless (or (eq typ 'complex-double-float) - (eq typ 'complex-single-float)) + ,(unless (or (equal typ '(complex (double-float))) + (equal typ '(complex (single-float)))) `(defun-foreign ,(concatenate 'string "gsl_" type-string "_min") ((vec ,type-ptr)) ,type-val)) - ,(unless (or (eq typ 'complex-double-float) - (eq typ 'complex-single-float)) + ,(unless (or (equal typ '(complex (double-float))) + (equal typ '(complex (single-float)))) `(defun-foreign ,(concatenate 'string "gsl_" type-string "_minmax") ((vec ,type-ptr) (min ,type-val-ptr) (max ,type-val-ptr)) :void)) - ,(unless (or (eq typ 'complex-double-float) - (eq typ 'complex-single-float)) + ,(unless (or (equal typ '(complex (double-float))) + (equal typ '(complex (single-float)))) `(defun-foreign ,(concatenate 'string "gsl_" type-string "_max_index") ((vec ,type-ptr)) size-t)) - ,(unless (or (eq typ 'complex-double-float) - (eq typ 'complex-single-float)) + ,(unless (or (equal typ '(complex (double-float))) + (equal typ '(complex (single-float)))) `(defun-foreign ,(concatenate 'string "gsl_" type-string "_min_index") ((vec ,type-ptr)) size-t)) - ,(unless (or (eq typ 'complex-double-float) - (eq typ 'complex-single-float)) + ,(unless (or (equal typ '(complex (double-float))) + (equal typ '(complex (single-float)))) `(defun-foreign ,(concatenate 'string "gsl_" type-string "_minmax_index") ((vec ,type-ptr) @@ -234,8 +234,8 @@ (def-vector-type-funcs% double-float) (def-vector-type-funcs% single-float) (def-vector-type-funcs% integer) -(def-vector-type-funcs% complex-double-float) -(def-vector-type-funcs% complex-single-float) +(def-vector-type-funcs% (complex (double-float))) +(def-vector-type-funcs% (complex (single-float))) (defstruct gsl-vec ;; TODO: print-function ? @@ -244,134 +244,146 @@ element-type) (defun alloc (v) - (assert (eq 'gsl (type-of v))) - (ecase (gsl-vec-element-type v) - ('integer + (assert (eq 'gsl-vec (type-of v))) + (cond + ((eq (gsl-vec-element-type v) 'integer) (setf (gsl-vec-ptr v) (gsl-vector-int-alloc (gsl-vec-size v)))) - ('single-float + ((eq (gsl-vec-element-type v) 'single-float) (setf (gsl-vec-ptr v) (gsl-vector-float-alloc (gsl-vec-size v)))) - ('double-float + ((eq (gsl-vec-element-type v) 'double-float) (setf (gsl-vec-ptr v) (gsl-vector-alloc (gsl-vec-size v)))) - ('complex-single-float + ((equal (gsl-vec-element-type v) '(complex (single-float))) (setf (gsl-vec-ptr v) (gsl-vector-complex-float-alloc (gsl-vec-size v)))) - ('complex-double-float - (setf (gsl-vec-ptr v) (gsl-vector-complex-alloc (gsl-vec-size v)))))) + ((equal (gsl-vec-element-type v) '(complex (double-float))) + (setf (gsl-vec-ptr v) (gsl-vector-complex-alloc (gsl-vec-size v)))) + (t + (error "No matching type")))) (defun free (v) - (assert (eq 'gsl (type-of v))) - (ecase (gsl-vec-element-type v) - ('integer + (assert (eq 'gsl-vec (type-of v))) + (cond + ((eq (gsl-vec-element-type v) 'integer) (gsl-vector-int-free (gsl-vec-ptr v))) - ('single-float + ((eq (gsl-vec-element-type v) 'single-float) (gsl-vector-float-free (gsl-vec-ptr v))) - ('double-float + ((eq (gsl-vec-element-type v) 'double-float) (gsl-vector-free (gsl-vec-ptr v))) - ('complex-single-float + ((equal (gsl-vec-element-type v) '(complex (single-float))) (gsl-vector-complex-float-free (gsl-vec-ptr v))) - ('complex-double-float - (gsl-vector-complex-free (gsl-vec-ptr v)))) + ((equal (gsl-vec-element-type v) '(complex (double-float))) + (gsl-vector-complex-free (gsl-vec-ptr v))) + (t + (error "No matching type"))) (setf (gsl-vec-ptr v) nil) (setf (gsl-vec-size v) nil) (setf (gsl-vec-element-type v) nil)) (defun get-element (v i) - (assert (eq 'gsl (type-of v))) + (assert (eq 'gsl-vec (type-of v))) (assert (typep i 'integer)) (assert (< i (gsl-vec-size v))) - (ecase (gsl-vec-element-type v) - ('integer + (cond + ((eq (gsl-vec-element-type v) 'integer) (gsl-vector-int-get (gsl-vec-ptr v) i)) - ('single-float + ((eq (gsl-vec-element-type v) 'single-float) (gsl-vector-float-get (gsl-vec-ptr v) i)) - ('double-float + ((eq (gsl-vec-element-type v) 'double-float) (gsl-vector-get (gsl-vec-ptr v) i)) - ('complex-single-float + ((equal (gsl-vec-element-type v) '(complex (single-float))) (gsl-complex-float->complex (gsl-vector-complex-float-get (gsl-vec-ptr v) i))) - ('complex-double-float - (gsl-complex->complex (gsl-vector-complex-get (gsl-vec-ptr v) i))))) + ((equal (gsl-vec-element-type v) '(complex (double-float))) + (gsl-complex->complex (gsl-vector-complex-get (gsl-vec-ptr v) i))) + (t + (error "No matching type")))) (defun set-element (v i x) - (assert (eq 'gsl (type-of v))) - (assert (eq (type-of x) (gsl-vec-element-type v))) + (assert (eq 'gsl-vec (type-of v))) + (assert (typep x (gsl-vec-element-type v))) (assert (typep i 'integer)) (assert (< i (gsl-vec-size v))) - (ecase (gsl-vec-element-type v) - ('integer + (cond + ((eq (gsl-vec-element-type v) 'integer) (gsl-vector-int-set (gsl-vec-ptr v) i x)) - ('single-float + ((eq (gsl-vec-element-type v) 'single-float) (gsl-vector-float-set (gsl-vec-ptr v) i x)) - ('double-float + ((eq (gsl-vec-element-type v) 'double-float) (gsl-vector-set (gsl-vec-ptr v) i x)) - ('complex-single-float - (gsl-vector-complex-float-set (gsl-vec-ptr v) - i + ((equal (gsl-vec-element-type v) '(complex (single-float))) + (gsl-vector-complex-float-set (gsl-vec-ptr v) i (complex->gsl-complex-float x))) - ('complex-double-float - (gsl-vector-complex-set (gsl-vec-ptr v) - i - (complex->gsl-complex x))))) + ((equal (gsl-vec-element-type v) '(complex (double-float))) + (gsl-vector-complex-set (gsl-vec-ptr v) i (complex->gsl-complex x))) + (t + (error "No matching type")))) (defun set-all (v x) - (assert (eq 'gsl (type-of v))) - (assert (eq (type-of x) (gsl-vec-element-type v))) - (ecase (gsl-vec-element-type v) - ('integer + (assert (eq 'gsl-vec (type-of v))) + (assert (typep x (gsl-vec-element-type v))) + (cond + ((eq (gsl-vec-element-type v) 'integer) (gsl-vector-int-set-all (gsl-vec-ptr v) x)) - ('single-float + ((eq (gsl-vec-element-type v) 'single-float) (gsl-vector-float-set-all (gsl-vec-ptr v) x)) - ('double-float + ((eq (gsl-vec-element-type v) 'double-float) (gsl-vector-set-all (gsl-vec-ptr v) x)) - ('complex-single-float + ((equal (gsl-vec-element-type v) '(complex (single-float))) (gsl-vector-complex-float-set-all (gsl-vec-ptr v) (complex->gsl-complex-float x))) - ('complex-double-float - (gsl-vector-complex-set-all (gsl-vec-ptr v) - (complex->gsl-complex x))))) + ((equal (gsl-vec-element-type v) '(complex (double-float))) + (gsl-vector-complex-set-all (gsl-vec-ptr v) (complex->gsl-complex x))) + (t + (error "No matching type")))) + (defun set-zero (v) - (assert (eq 'gsl (type-of v))) - (ecase (gsl-vec-element-type v) - ('integer + (assert (eq 'gsl-vec (type-of v))) + (cond + ((eq (gsl-vec-element-type v) 'integer) (gsl-vector-int-set-zero (gsl-vec-ptr v))) - ('single-float + ((eq (gsl-vec-element-type v) 'single-float) (gsl-vector-float-set-zero (gsl-vec-ptr v))) - ('double-float + ((eq (gsl-vec-element-type v) 'double-float) (gsl-vector-set-zero (gsl-vec-ptr v))) - ('complex-single-float + ((equal (gsl-vec-element-type v) '(complex (single-float))) (gsl-vector-complex-float-set-zero (gsl-vec-ptr v))) - ('complex-double-float - (gsl-vector-complex-set-zero (gsl-vec-ptr v))))) + ((equal (gsl-vec-element-type v) '(complex (double-float))) + (gsl-vector-complex-set-zero (gsl-vec-ptr v))) + (t + (error "No matching type")))) (defun set-basis (v i) - (assert (eq 'gsl (type-of v))) + (assert (eq 'gsl-vec (type-of v))) (assert (typep i 'integer)) (assert (< i (gsl-vec-size v))) - (ecase (gsl-vec-element-type v) - ('integer + (cond + ((eq (gsl-vec-element-type v) 'integer) (gsl-vector-int-set-basis (gsl-vec-ptr v) i)) - ('single-float + ((eq (gsl-vec-element-type v) 'single-float) (gsl-vector-float-set-basis (gsl-vec-ptr v) i)) - ('double-float + ((eq (gsl-vec-element-type v) 'double-float) (gsl-vector-set-basis (gsl-vec-ptr v) i)) - ('complex-single-float + ((equal (gsl-vec-element-type v) '(complex (single-float))) (gsl-vector-complex-float-set-basis (gsl-vec-ptr v) (complex->gsl-complex-float i))) - ('complex-double-float + ((equal (gsl-vec-element-type v) '(complex (double-float))) (gsl-vector-complex-set-basis (gsl-vec-ptr v) - (complex->gsl-complex i))))) + (complex->gsl-complex i))) + (t + (error "No matching type")))) (defun make-vector (size &key (element-type 'double-float) initial-element initial-contents) (assert (typep size 'integer)) (assert (find element-type '(integer single-float double-float - complex-single-float double-single-float))) + (complex (single-float)) + (complex (double-float))) :test #'equal)) (let ((v (make-gsl-vec :size size :element-type element-type))) (setf (gsl-vec-ptr v) (alloc v)) (cond @@ -396,42 +408,47 @@ (defun write-to-binary-file (file-name v) - (assert (eq 'gsl (type-of v))) + (assert (eq 'gsl-vec (type-of v))) (let ((status)) + ;; TODO: check if uffi:with-string returns a result, docs unclear. (uffi:with-cstring (c-file-name file-name) (setq status - (ecase (gsl-vec-element-type v) - ('integer + (cond + ((eq (gsl-vec-element-type v) 'integer) (wrap-gsl-vector-int-fwrite c-file-name (gsl-vec-ptr v))) - ('single-float + ((eq (gsl-vec-element-type v) 'single-float) (wrap-gsl-vector-float-fwrite c-file-name (gsl-vec-ptr v))) - ('double-float + ((eq (gsl-vec-element-type v) 'double-float) (wrap-gsl-vector-fwrite c-file-name (gsl-vec-ptr v))) - ('complex-single-float + ((equal (gsl-vec-element-type v) '(complex (single-float))) (wrap-gsl-vector-complex-float-fwrite c-file-name (gsl-vec-ptr v))) - ('complex-double-float - (wrap-gsl-vector-complex-fwrite c-file-name (gsl-vec-ptr v)))))) + ((equal (gsl-vec-element-type v) '(complex (double-float))) + (wrap-gsl-vector-complex-fwrite c-file-name (gsl-vec-ptr v))) + (t + (error "No matching type"))))) status)) (defun write-to-file (file-name v) - (assert (eq 'gsl (type-of v))) + (assert (eq 'gsl-vec (type-of v))) (let ((status)) (uffi:with-cstring (c-file-name file-name) (setq status - (ecase (gsl-vec-element-type v) - ('integer + (cond + ((eq (gsl-vec-element-type v) 'integer) (wrap-gsl-vector-int-fprintf c-file-name (gsl-vec-ptr v))) - ('single-float + ((eq (gsl-vec-element-type v) 'single-float) (wrap-gsl-vector-float-fprintf c-file-name (gsl-vec-ptr v))) - ('double-float + ((eq (gsl-vec-element-type v) 'double-float) (wrap-gsl-vector-fprintf c-file-name (gsl-vec-ptr v))) - ('complex-single-float + ((equal (gsl-vec-element-type v) '(complex (single-float))) (wrap-gsl-vector-complex-float-fprintf c-file-name (gsl-vec-ptr v))) - ('complex-double-float - (wrap-gsl-vector-complex-fprintf c-file-name (gsl-vec-ptr v)))))) + ((equal (gsl-vec-element-type v) '(complex (double-float))) + (wrap-gsl-vector-complex-fprintf c-file-name (gsl-vec-ptr v))) + (t + (error "No matching type"))))) status)) @@ -440,17 +457,19 @@ (status)) (uffi:with-cstring (c-file-name file-name) (setq status - (ecase (gsl-vec-element-type v) - ('integer + (cond + ((eq (gsl-vec-element-type v) 'integer) (wrap-gsl-vector-int-fread c-file-name (gsl-vec-ptr v))) - ('single-float + ((eq (gsl-vec-element-type v) 'single-float) (wrap-gsl-vector-float-fread c-file-name (gsl-vec-ptr v))) - ('double-float + ((eq (gsl-vec-element-type v) 'double-float) (wrap-gsl-vector-fread c-file-name (gsl-vec-ptr v))) - ('complex-single-float + ((equal (gsl-vec-element-type v) '(complex (single-float))) (wrap-gsl-vector-complex-float-fread c-file-name (gsl-vec-ptr v))) - ('complex-double-float - (wrap-gsl-vector-complex-fread c-file-name (gsl-vec-ptr v)))))) + ((equal (gsl-vec-element-type v) '(complex (double-float))) + (wrap-gsl-vector-complex-fread c-file-name (gsl-vec-ptr v))) + (t + (error "No matching type"))))) (values v status))) @@ -459,23 +478,25 @@ (status)) (uffi:with-cstring (c-file-name file-name) (setq status - (ecase (gsl-vec-element-type v) - ('integer + (cond + ((eq (gsl-vec-element-type v) 'integer) (wrap-gsl-vector-int-fscanf c-file-name (gsl-vec-ptr v))) - ('single-float + ((eq (gsl-vec-element-type v) 'single-float) (wrap-gsl-vector-float-fscanf c-file-name (gsl-vec-ptr v))) - ('double-float + ((eq (gsl-vec-element-type v) 'double-float) (wrap-gsl-vector-fscanf c-file-name (gsl-vec-ptr v))) - ('complex-single-float + ((equal (gsl-vec-element-type v) '(complex (single-float))) (wrap-gsl-vector-complex-float-fscanf c-file-name (gsl-vec-ptr v))) - ('complex-double-float - (wrap-gsl-vector-complex-fscanf c-file-name (gsl-vec-ptr v)))))) + ((equal (gsl-vec-element-type v) '(complex (double-float))) + (wrap-gsl-vector-complex-fscanf c-file-name (gsl-vec-ptr v))) + (t + (error "No matching type"))))) (values v status))) (defun subvector (v offset n) - (assert (eq 'gsl (type-of v))) + (assert (eq 'gsl-vec (type-of v))) (assert (typep offset 'integer)) (assert (typep n 'integer)) (assert (< (+ offset n) (gsl-vec-size v))) @@ -483,22 +504,24 @@ ;; allocate any foreign memory for the subvector. (let ((v-sub (make-gsl-vec :size n :element-type (gsl-vec-element-type v)))) (setf (gsl-vec-ptr v-sub) - (ecase (gsl-vec-element-type v) - ('integer + (cond + ((eq (gsl-vec-element-type v) 'integer) (wrap-gsl-vector-int-subvector (gsl-vec-ptr v) offset n)) - ('single-float + ((eq (gsl-vec-element-type v) 'single-float) (wrap-gsl-vector-float-subvector (gsl-vec-ptr v) offset n)) - ('double-float + ((eq (gsl-vec-element-type v) 'double-float) (wrap-gsl-vector-subvector (gsl-vec-ptr v) offset n)) - ('complex-single-float + ((equal (gsl-vec-element-type v) '(complex (single-float))) (wrap-gsl-vector-complex-float-subvector (gsl-vec-ptr v) offset n)) - ('complex-double-float - (wrap-gsl-vector-complex-subvector (gsl-vec-ptr v) offset n)))) + ((equal (gsl-vec-element-type v) '(complex (double-float))) + (wrap-gsl-vector-complex-subvector (gsl-vec-ptr v) offset n)) + (t + (error "No matching type")))) v-sub)) (defun subvector-with-stride (v offset stride n) - (assert (eq 'gsl (type-of v))) + (assert (eq 'gsl-vec (type-of v))) (assert (typep offset 'integer)) (assert (typep stride 'integer)) (assert (typep n 'integer)) @@ -507,250 +530,287 @@ ;; allocate any foreign memory for the subvector. (let ((v-sub (make-gsl-vec :size n :element-type (gsl-vec-element-type v)))) (setf (gsl-vec-ptr v-sub) - (ecase (gsl-vec-element-type v) - ('integer + (cond + ((eq (gsl-vec-element-type v) 'integer) (wrap-gsl-vector-int-subvector-with-stride (gsl-vec-ptr v) offset stride n)) - ('single-float + ((eq (gsl-vec-element-type v) 'single-float) (wrap-gsl-vector-float-subvector-with-stride (gsl-vec-ptr v) offset stride n)) - ('double-float + ((eq (gsl-vec-element-type v) 'double-float) (wrap-gsl-vector-subvector-with-stride (gsl-vec-ptr v) offset stride n)) - ('complex-single-float + ((equal (gsl-vec-element-type v) '(complex (single-float))) (wrap-gsl-vector-complex-float-subvector-with-stride (gsl-vec-ptr v) offset stride n)) - ('complex-double-float + ((equal (gsl-vec-element-type v) '(complex (double-float))) (wrap-gsl-vector-complex-subvector-with-stride (gsl-vec-ptr v) - offset stride n)))) + offset stride n)) + (t + (error "No matching type")))) v-sub)) (defun copy (v-src) + (assert (eq 'gsl-vec (type-of v-src))) (let* ((v-dest (make-vector (gsl-vec-size v-src) :element-type (gsl-vec-element-type v-src))) - (status (ecase (gsl-vec-element-type v-src) - ('integer + (status (cond + ((eq (gsl-vec-element-type v-src) 'integer) (gsl-vector-int-memcpy (gsl-vec-ptr v-dest) (gsl-vec-ptr v-src))) - ('single-float + ((eq (gsl-vec-element-type v-src) 'single-float) (gsl-vector-float-memcpy (gsl-vec-ptr v-dest) (gsl-vec-ptr v-src))) - ('double-float + ((eq (gsl-vec-element-type v-src) 'double-float) (gsl-vector-memcpy (gsl-vec-ptr v-dest) (gsl-vec-ptr v-src))) - ('complex-single-float + ((equal (gsl-vec-element-type v-src) + '(complex (single-float))) (gsl-vector-complex-float-memcpy (gsl-vec-ptr v-dest) (gsl-vec-ptr v-src))) - ('complex-double-float + ((equal (gsl-vec-element-type v-src) + '(complex (double-float))) (gsl-vector-complex-memcpy (gsl-vec-ptr v-dest) - (gsl-vec-ptr v-src)))))) + (gsl-vec-ptr v-src))) + (t + (error "No matching type"))))) (values v-dest status))) (defun swap (va vb) - (assert (eq 'gsl (type-of va))) - (assert (eq 'gsl (type-of vb))) + (assert (eq 'gsl-vec (type-of va))) + (assert (eq 'gsl-vec (type-of vb))) (assert (eq (gsl-vec-element-type va) (gsl-vec-element-type vb))) (assert (= (gsl-vec-size va) (gsl-vec-size vb))) (let ((status - (ecase (gsl-vec-element-type va) - ('integer + (cond + ((eq (gsl-vec-element-type va) 'integer) (gsl-vector-int-swap (gsl-vec-ptr va) (gsl-vec-ptr vb))) - ('single-float + ((eq (gsl-vec-element-type va) 'single-float) (gsl-vector-float-swap (gsl-vec-ptr va) (gsl-vec-ptr vb))) - ('double-float + ((eq (gsl-vec-element-type va) 'double-float) (gsl-vector-swap (gsl-vec-ptr va) (gsl-vec-ptr vb))) - ('complex-single-float + ((equal (gsl-vec-element-type va) '(complex (single-float))) (gsl-vector-complex-float-swap (gsl-vec-ptr va) (gsl-vec-ptr vb))) - ('complex-double-float - (gsl-vector-complex-swap (gsl-vec-ptr va) (gsl-vec-ptr vb)))))) - (values va status))) + ((equal (gsl-vec-element-type va) '(complex (double-float))) + (gsl-vector-complex-swap (gsl-vec-ptr va) (gsl-vec-ptr vb))) + (t + (error "No matching type"))))) + (values va status))) (defun swap-elements (v i j) - (assert (eq 'gsl (type-of v))) + (assert (eq 'gsl-vec (type-of v))) (assert (typep i 'integer)) (assert (typep j 'integer)) (assert (< i (gsl-vec-size v))) (assert (< j (gsl-vec-size v))) (let ((status - (ecase (gsl-vec-element-type v) - ('integer + (cond + ((eq (gsl-vec-element-type v) 'integer) (gsl-vector-int-swap-elements (gsl-vec-ptr v) i j)) - ('single-float + ((eq (gsl-vec-element-type v) 'single-float) (gsl-vector-float-swap-elements (gsl-vec-ptr v) i j)) - ('double-float + ((eq (gsl-vec-element-type v) 'double-float) (gsl-vector-swap-elements (gsl-vec-ptr v) i j)) - ('complex-single-float + ((equal (gsl-vec-element-type v) '(complex (single-float))) (gsl-vector-complex-float-swap-elements (gsl-vec-ptr v) i j)) - ('complex-double-float - (gsl-vector-complex-swap-elements (gsl-vec-ptr v) i j))))) + ((equal (gsl-vec-element-type v) '(complex (double-float))) + (gsl-vector-complex-swap-elements (gsl-vec-ptr v) i j)) + (t + (error "No matching type"))))) (values v status))) (defun reverse-vector (v) - (assert (eq 'gsl (type-of v))) + (assert (eq 'gsl-vec (type-of v))) (let ((status - (ecase (gsl-vec-element-type v) - ('integer + (cond + ((eq (gsl-vec-element-type v) 'integer) (gsl-vector-int-reverse (gsl-vec-ptr v))) - ('single-float + ((eq (gsl-vec-element-type v) 'single-float) (gsl-vector-float-reverse (gsl-vec-ptr v))) - ('double-float + ((eq (gsl-vec-element-type v) 'double-float) (gsl-vector-reverse (gsl-vec-ptr v))) - ('complex-single-float + ((equal (gsl-vec-element-type v) '(complex (single-float))) (gsl-vector-complex-float-reverse (gsl-vec-ptr v))) - ('complex-double-float - (gsl-vector-complex-reverse (gsl-vec-ptr v)))))) + ((equal (gsl-vec-element-type v) '(complex (double-float))) + (gsl-vector-complex-reverse (gsl-vec-ptr v))) + (t + (error "No matching type"))))) (values v status))) (defun add (va vb) - (assert (eq 'gsl (type-of va))) - (assert (eq 'gsl (type-of vb))) + (assert (eq 'gsl-vec (type-of va))) + (assert (eq 'gsl-vec (type-of vb))) (assert (eq (gsl-vec-element-type va) (gsl-vec-element-type vb))) (assert (= (gsl-vec-size va) (gsl-vec-size vb))) (let ((status - (ecase (gsl-vec-element-type va) - ('integer + (cond + ((eq (gsl-vec-element-type va) 'integer) (gsl-vector-int-add (gsl-vec-ptr va) (gsl-vec-ptr vb))) - ('single-float + ((eq (gsl-vec-element-type va) 'single-float) (gsl-vector-float-add (gsl-vec-ptr va) (gsl-vec-ptr vb))) - ('double-float - (gsl-vector-add (gsl-vec-ptr va) (gsl-vec-ptr vb)))))) + ((eq (gsl-vec-element-type va) 'double-float) + (gsl-vector-add (gsl-vec-ptr va) (gsl-vec-ptr vb))) + (t + (error "No matching type"))))) (values va status))) (defun sub (va vb) - (assert (eq 'gsl (type-of va))) - (assert (eq 'gsl (type-of vb))) + (assert (eq 'gsl-vec (type-of va))) + (assert (eq 'gsl-vec (type-of vb))) (assert (eq (gsl-vec-element-type va) (gsl-vec-element-type vb))) (assert (= (gsl-vec-size va) (gsl-vec-size vb))) (let ((status - (ecase (gsl-vec-element-type va) - ('integer + (cond + ((eq (gsl-vec-element-type va) 'integer) (gsl-vector-int-sub (gsl-vec-ptr va) (gsl-vec-ptr vb))) - ('single-float + ((eq (gsl-vec-element-type va) 'single-float) (gsl-vector-float-sub (gsl-vec-ptr va) (gsl-vec-ptr vb))) - ('double-float - (gsl-vector-sub (gsl-vec-ptr va) (gsl-vec-ptr vb)))))) + ((eq (gsl-vec-element-type va) 'double-float) + (gsl-vector-sub (gsl-vec-ptr va) (gsl-vec-ptr vb))) + (t + (error "No matching type"))))) (values va status))) + (defun mul (va vb) - (assert (eq 'gsl (type-of va))) - (assert (eq 'gsl (type-of vb))) + (assert (eq 'gsl-vec (type-of va))) + (assert (eq 'gsl-vec (type-of vb))) (assert (eq (gsl-vec-element-type va) (gsl-vec-element-type vb))) (assert (= (gsl-vec-size va) (gsl-vec-size vb))) (let ((status - (ecase (gsl-vec-element-type va) - ('integer + (cond + ((eq (gsl-vec-element-type va) 'integer) (gsl-vector-int-mul (gsl-vec-ptr va) (gsl-vec-ptr vb))) - ('single-float + ((eq (gsl-vec-element-type va) 'single-float) (gsl-vector-float-mul (gsl-vec-ptr va) (gsl-vec-ptr vb))) - ('double-float - (gsl-vector-mul (gsl-vec-ptr va) (gsl-vec-ptr vb)))))) + ((eq (gsl-vec-element-type va) 'double-float) + (gsl-vector-mul (gsl-vec-ptr va) (gsl-vec-ptr vb))) + (t + (error "No matching type"))))) (values va status))) (defun div (va vb) - (assert (eq 'gsl (type-of va))) - (assert (eq 'gsl (type-of vb))) + (assert (eq 'gsl-vec (type-of va))) + (assert (eq 'gsl-vec (type-of vb))) (assert (eq (gsl-vec-element-type va) (gsl-vec-element-type vb))) (assert (= (gsl-vec-size va) (gsl-vec-size vb))) (let ((status - (ecase (gsl-vec-element-type va) - ('integer + (cond + ((eq (gsl-vec-element-type va) 'integer) (gsl-vector-int-div (gsl-vec-ptr va) (gsl-vec-ptr vb))) - ('single-float + ((eq (gsl-vec-element-type va) 'single-float) (gsl-vector-float-div (gsl-vec-ptr va) (gsl-vec-ptr vb))) - ('double-float - (gsl-vector-div (gsl-vec-ptr va) (gsl-vec-ptr vb)))))) + ((eq (gsl-vec-element-type va) 'double-float) + (gsl-vector-div (gsl-vec-ptr va) (gsl-vec-ptr vb))) + (t + (error "No matching type"))))) (values va status))) (defun scale (v x) - (assert (eq 'gsl (type-of v))) - (assert (eq (gsl-vec-element-type v) (type-of x))) + (assert (eq 'gsl-vec (type-of v))) + (assert (typep x (gsl-vec-element-type v))) (let ((status - (ecase (gsl-vec-element-type v) - ('integer + (cond + ((eq (gsl-vec-element-type v) 'integer) (gsl-vector-int-scale (gsl-vec-ptr v) x)) - ('single-float + ((eq (gsl-vec-element-type v) 'single-float) (gsl-vector-float-scale (gsl-vec-ptr v) x)) - ('double-float - (gsl-vector-scale (gsl-vec-ptr v) x))))) + ((eq (gsl-vec-element-type v) 'double-float) + (gsl-vector-scale (gsl-vec-ptr v) x)) + (t + (error "No matching type"))))) (values v status))) (defun add-constant (v x) - (assert (eq 'gsl (type-of v))) - (assert (eq (gsl-vec-element-type v) (type-of x))) + (assert (eq 'gsl-vec (type-of v))) + (assert (typep x (gsl-vec-element-type v))) (let ((status - (ecase (gsl-vec-element-type v) - ('integer + (cond + ((eq (gsl-vec-element-type v) 'integer) (gsl-vector-int-add-constant (gsl-vec-ptr v) x)) - ('single-float + ((eq (gsl-vec-element-type v) 'single-float) (gsl-vector-float-add-constant (gsl-vec-ptr v) x)) - ('double-float - (gsl-vector-add-constant (gsl-vec-ptr v) x))))) + ((eq (gsl-vec-element-type v) 'double-float) + (gsl-vector-add-constant (gsl-vec-ptr v) x)) + (t + (error "No matching type"))))) (values v status))) (defun max-value (v) - (assert (eq 'gsl (type-of v))) - (ecase (gsl-vec-element-type v) - ('integer + (assert (eq 'gsl-vec (type-of v))) + (cond + ((eq (gsl-vec-element-type v) 'integer) (gsl-vector-int-max (gsl-vec-ptr v))) - ('single-float + ((eq (gsl-vec-element-type v) 'single-float) (gsl-vector-float-max (gsl-vec-ptr v))) - ('double-float - (gsl-vector-max (gsl-vec-ptr v))))) + ((eq (gsl-vec-element-type v) 'double-float) + (gsl-vector-max (gsl-vec-ptr v))) + (t + (error "No matching type")))) (defun min-value (v) - (assert (eq 'gsl (type-of v))) - (ecase (gsl-vec-element-type v) - ('integer + (assert (eq 'gsl-vec (type-of v))) + (cond + ((eq (gsl-vec-element-type v) 'integer) (gsl-vector-int-min (gsl-vec-ptr v))) - ('single-float + ((eq (gsl-vec-element-type v) 'single-float) (gsl-vector-float-min (gsl-vec-ptr v))) - ('double-float - (gsl-vector-min (gsl-vec-ptr v))))) + ((eq (gsl-vec-element-type v) 'double-float) + (gsl-vector-min (gsl-vec-ptr v))) + (t + (error "No matching type")))) (defun max-index (v) - (assert (eq 'gsl (type-of v))) - (ecase (gsl-vec-element-type v) - ('integer + (assert (eq 'gsl-vec (type-of v))) + (cond + ((eq (gsl-vec-element-type v) 'integer) (gsl-vector-int-max-index (gsl-vec-ptr v))) - ('single-float + ((eq (gsl-vec-element-type v) 'single-float) (gsl-vector-float-max-index (gsl-vec-ptr v))) - ('double-float - (gsl-vector-max-index (gsl-vec-ptr v))))) + ((eq (gsl-vec-element-type v) 'double-float) + (gsl-vector-max-index (gsl-vec-ptr v))) + (t + (error "No matching type")))) (defun min-index (v) - (assert (eq 'gsl (type-of v))) - (ecase (gsl-vec-element-type v) - ('integer + (assert (eq 'gsl-vec (type-of v))) + (cond + ((eq (gsl-vec-element-type v) 'integer) (gsl-vector-int-min-index (gsl-vec-ptr v))) - ('single-float + ((eq (gsl-vec-element-type v) 'single-float) (gsl-vector-float-min-index (gsl-vec-ptr v))) - ('double-float - (gsl-vector-min-index (gsl-vec-ptr v))))) + ((eq (gsl-vec-element-type v) 'double-float) + (gsl-vector-min-index (gsl-vec-ptr v))) + (t + (error "No matching type")))) + (defun min-max-indicies (v) - (assert (eq 'gsl (type-of v))) + (assert (eq 'gsl-vec (type-of v))) (let ((min-ptr (uffi:allocate-foreign-object 'size-t)) (max-ptr (uffi:allocate-foreign-object 'size-t))) - (ecase (gsl-vec-element-type v) - ('integer + (cond + ((eq (gsl-vec-element-type v) 'integer) (gsl-vector-int-minmax-index (gsl-vec-ptr v) min-ptr max-ptr)) - ('single-float + ((eq (gsl-vec-element-type v) 'single-float) (gsl-vector-float-minmax-index (gsl-vec-ptr v) min-ptr max-ptr)) - ('double-float - (gsl-vector-minmax-index (gsl-vec-ptr v) min-ptr max-ptr))) + ((eq (gsl-vec-element-type v) 'double-float) + (gsl-vector-minmax-index (gsl-vec-ptr v) min-ptr max-ptr)) + (t + (error "No matching type"))) (prog1 (list (uffi:deref-pointer min-ptr 'size-t) (uffi:deref-pointer max-ptr 'size-t)) @@ -759,7 +819,7 @@ (defun min-max-values (v) - (assert (eq 'gsl (type-of v))) + (assert (eq 'gsl-vec (type-of v))) (destructuring-bind (min-index max-index) (min-max-indicies v) (list (get-element v min-index) @@ -767,18 +827,20 @@ (defun isnull (v) - (assert (eq 'gsl (type-of v))) - (1/0->t/nil (ecase (gsl-vec-element-type v) - ('integer + (assert (eq 'gsl-vec (type-of v))) + (1/0->t/nil (cond + ((eq (gsl-vec-element-type v) 'integer) (gsl-vector-int-isnull (gsl-vec-ptr v))) - ('single-float + ((eq (gsl-vec-element-type v) 'single-float) (gsl-vector-float-isnull (gsl-vec-ptr v))) - ('double-float + ((eq (gsl-vec-element-type v) 'double-float) (gsl-vector-isnull (gsl-vec-ptr v))) - ('complex-single-float + ((equal (gsl-vec-element-type v) '(complex (single-float))) (gsl-vector-complex-float-isnull (gsl-vec-ptr v))) - ('complex-double-float - (gsl-vector-complex-isnull (gsl-vec-ptr v)))))) + ((equal (gsl-vec-element-type v) '(complex (double-float))) + (gsl-vector-complex-isnull (gsl-vec-ptr v))) + (t + (error "No matching type"))))) ;; Function: gsl_vector_view gsl_vector_complex_real (gsl_vector_complex *v) ;; Function: gsl_vector_view gsl_vector_complex_imag (gsl_vector_complex *v) From edenny at common-lisp.net Sat Mar 5 04:35:16 2005 From: edenny at common-lisp.net (Edgar Denny) Date: Sat, 5 Mar 2005 05:35:16 +0100 (CET) Subject: [cl-gsl-cvs] CVS update: cl-gsl/ChangeLog Message-ID: <20050305043516.237A888678@common-lisp.net> Update of /project/cl-gsl/cvsroot/cl-gsl In directory common-lisp.net:/tmp/cvs-serv27705 Modified Files: ChangeLog Log Message: *** empty log message *** Date: Sat Mar 5 05:35:15 2005 Author: edenny Index: cl-gsl/ChangeLog diff -u cl-gsl/ChangeLog:1.1 cl-gsl/ChangeLog:1.2 --- cl-gsl/ChangeLog:1.1 Fri Mar 4 02:57:01 2005 +++ cl-gsl/ChangeLog Sat Mar 5 05:35:15 2005 @@ -1,3 +1,7 @@ +2005-03-05 Edgar Denny + + * vector.lisp: Fixes for complex vectors. + 2005-03-04 Edgar Denny * vector.lisp: Make file actually compile. From edenny at common-lisp.net Mon Mar 7 02:03:26 2005 From: edenny at common-lisp.net (Edgar Denny) Date: Mon, 7 Mar 2005 03:03:26 +0100 (CET) Subject: [cl-gsl-cvs] CVS update: cl-gsl/enum.lisp Message-ID: <20050307020326.1994C88677@common-lisp.net> Update of /project/cl-gsl/cvsroot/cl-gsl In directory common-lisp.net:/tmp/cvs-serv21664 Modified Files: enum.lisp Log Message: add +prec-default+ Date: Mon Mar 7 03:03:24 2005 Author: edenny Index: cl-gsl/enum.lisp diff -u cl-gsl/enum.lisp:1.1.1.1 cl-gsl/enum.lisp:1.2 --- cl-gsl/enum.lisp:1.1.1.1 Wed Mar 2 02:04:53 2005 +++ cl-gsl/enum.lisp Mon Mar 7 03:03:21 2005 @@ -56,6 +56,7 @@ (+eof+ 32))) (register-constants ((+prec-double+ 0) + (+prec-default+ 0) (+prec-single+ 1) (+prec-approx+ 2))) From edenny at common-lisp.net Mon Mar 7 02:05:35 2005 From: edenny at common-lisp.net (Edgar Denny) Date: Mon, 7 Mar 2005 03:05:35 +0100 (CET) Subject: [cl-gsl-cvs] CVS update: cl-gsl/sf.lisp Message-ID: <20050307020535.74A0588677@common-lisp.net> Update of /project/cl-gsl/cvsroot/cl-gsl In directory common-lisp.net:/tmp/cvs-serv21923 Modified Files: sf.lisp Log Message: Fixes for airy functions. Date: Mon Mar 7 03:05:23 2005 Author: edenny Index: cl-gsl/sf.lisp diff -u cl-gsl/sf.lisp:1.1.1.1 cl-gsl/sf.lisp:1.2 --- cl-gsl/sf.lisp:1.1.1.1 Wed Mar 2 02:04:53 2005 +++ cl-gsl/sf.lisp Mon Mar 7 03:05:21 2005 @@ -123,7 +123,7 @@ ((x :double) (mode gsl-mode-t) (result gsl-sf-result-ptr)) - :double) + :int) (defun-wrapper% "airy_Bi" ((x :double) @@ -134,7 +134,7 @@ ((x :double) (mode gsl-mode-t) (result gsl-sf-result-ptr)) - :double) + :int) (defun-wrapper% "airy_Ai_scaled" ((x :double) @@ -145,7 +145,7 @@ ((x :double) (mode gsl-mode-t) (result gsl-sf-result-ptr)) - :double) + :int) (defun-wrapper% "airy_Bi_scaled" ((x :double) @@ -156,7 +156,7 @@ ((x :double) (mode gsl-mode-t) (result gsl-sf-result-ptr)) - :double) + :int) (defun-wrapper% "airy_Ai_deriv" ((x :double) @@ -167,7 +167,7 @@ ((x :double) (mode gsl-mode-t) (result gsl-sf-result-ptr)) - :double) + :int) (defun-wrapper% "airy_Bi_deriv" ((x :double) @@ -178,7 +178,7 @@ ((x :double) (mode gsl-mode-t) (result gsl-sf-result-ptr)) - :double) + :int) (defun-wrapper% "airy_Ai_deriv_scaled" ((x :double) @@ -189,7 +189,7 @@ ((x :double) (mode gsl-mode-t) (result gsl-sf-result-ptr)) - :double) + :int) (defun-wrapper% "airy_Bi_deriv_scaled" ((x :double) @@ -200,51 +200,43 @@ ((x :double) (mode gsl-mode-t) (result gsl-sf-result-ptr)) - :double) + :int) (defun-wrapper% "airy_zero_Ai" - ((x :double) - (mode gsl-mode-t)) + ((x :unsigned-int)) :double) (defun-wrapper% "airy_zero_Ai_e" - ((x :double) - (mode gsl-mode-t) + ((x :unsigned-int) (result gsl-sf-result-ptr)) - :double) + :int) (defun-wrapper% "airy_zero_Bi" - ((x :double) - (mode gsl-mode-t)) + ((x :unsigned-int)) :double) (defun-wrapper% "airy_zero_Bi_e" - ((x :double) - (mode gsl-mode-t) + ((x :unsigned-int) (result gsl-sf-result-ptr)) - :double) + :int) (defun-wrapper% "airy_zero_Ai_deriv" - ((x :double) - (mode gsl-mode-t)) + ((x :unsigned-int)) :double) (defun-wrapper% "airy_zero_Ai_deriv_e" - ((x :double) - (mode gsl-mode-t) + ((x :unsigned-int) (result gsl-sf-result-ptr)) - :double) + :int) (defun-wrapper% "airy_zero_Bi_deriv" - ((x :double) - (mode gsl-mode-t)) + ((x :unsigned-int)) :double) (defun-wrapper% "airy_zero_Bi_deriv_e" - ((x :double) - (mode gsl-mode-t) + ((x :unsigned-int) (result gsl-sf-result-ptr)) - :double) + :int) ;;; Bessel Functions From edenny at common-lisp.net Mon Mar 7 02:08:46 2005 From: edenny at common-lisp.net (Edgar Denny) Date: Mon, 7 Mar 2005 03:08:46 +0100 (CET) Subject: [cl-gsl-cvs] CVS update: cl-gsl/test/test-sf.lisp Message-ID: <20050307020846.9CC5788677@common-lisp.net> Update of /project/cl-gsl/cvsroot/cl-gsl/test In directory common-lisp.net:/tmp/cvs-serv21976 Modified Files: test-sf.lisp Log Message: Added lots of unit tests. Date: Mon Mar 7 03:08:27 2005 Author: edenny Index: cl-gsl/test/test-sf.lisp diff -u cl-gsl/test/test-sf.lisp:1.1.1.1 cl-gsl/test/test-sf.lisp:1.2 --- cl-gsl/test/test-sf.lisp:1.1.1.1 Wed Mar 2 02:04:53 2005 +++ cl-gsl/test/test-sf.lisp Mon Mar 7 03:08:25 2005 @@ -21,23 +21,884 @@ (defconstant +dbl-epsilon+ 2.2204460492503131d-16) -(defconstant +tol0+ (* 2.0d0 +dbl-epsilon+)) -(defconstant +tol1+ (* 16.0d0 +dbl-epsilon+)) -(defconstant +tol2+ (* 256.0d0 +dbl-epsilon+)) -(defconstant +tol3+ (* 2048.0d0 +dbl-epsilon+)) -(defconstant +tol4+ (* 16384.0d0 +dbl-epsilon+)) -(defconstant +tol5+ (* 131072.0d0 +dbl-epsilon+)) -(defconstant +tol6+ (* 1048576.0d0 +dbl-epsilon+)) +(defconstant +tol0+ (/ +dbl-epsilon+ 2.0d0)) +(defconstant +tol+1+ (* +tol0+ 10.0d0)) +(defconstant +tol-1+ (/ +tol0+ 10.0d0)) +(defconstant +tol+2+ (* +tol0+ 100.0d0)) +(defconstant +tol-2+ (/ +tol0+ 100.0d0)) (defconstant +sf+ "sf") (defun tol< (x y tol) (< (abs (- x y)) tol)) -(deftest "clausen" :category +sf+ - :test-fn #'(lambda () - (tol< (gsl-sf:clausen (/ gsl-math:+pi+ 20.0d0)) - 0.4478882448133546d0 +tol0+))) +(defmacro sf-deftest (func-name-str param-list result tolerance) + `(deftest ,func-name-str :category +sf+ + :test-fn #'(lambda () + (tol< (,(kmrcl:concat-symbol-pkg 'gsl-sf + func-name-str) + , at param-list) + ,result ,tolerance)))) +(defmacro sf-deftest-e (func-name-str param-list result tolerance status) + `(deftest ,func-name-str :category +sf+ + :test-fn #'(lambda () + (multiple-value-bind (result error status) + (,(kmrcl:concat-symbol-pkg 'gsl-sf + func-name-str) + , at param-list) + (declare (ignore error)) + (and (tol< result ,result ,tolerance) + (= status ,status)))))) -;; TEST_SF(s, gsl_sf_clausen_e, (M_PI/6.0, &r), 0.8643791310538927, TEST_TOL0, GSL_SUCCESS); +;; airy-ai +(sf-deftest "airy-ai" (-5.0d0 gsl:+prec-default+) 0.3507610090241142d0 +tol0+) + +;; airy-ai-e +(sf-deftest-e "airy-ai-e" (-5.0d0 gsl:+prec-default+) + 0.3507610090241142d0 +tol0+ gsl:+success+) + +;; airy-bi +(sf-deftest "airy-bi" (-5.0d0 gsl:+prec-default+) -0.1383691349016005d0 +tol0+) + +;; airy-bi-e +(sf-deftest-e "airy-bi-e" (-5.0d0 gsl:+prec-default+) + -0.1383691349016005d0 +tol0+ gsl:+success+) + +;; airy-ai-scaled +(sf-deftest "airy-ai-scaled" (-5.0d0 gsl:+prec-default+) + 0.3507610090241142d0 +tol0+) + +;; airy-ai-scaled-e +(sf-deftest-e "airy-ai-scaled-e" (-5.0d0 gsl:+prec-default+) + 0.3507610090241142d0 +tol0+ gsl:+success+) + +;; airy-bi-scaled +(sf-deftest "airy-bi-scaled" (-5.0d0 gsl:+prec-default+) + -0.1383691349016005d0 +tol0+) + +;; airy-bi-scaled-e +(sf-deftest-e "airy-bi-scaled-e" (-5.0d0 gsl:+prec-default+) + -0.1383691349016005d0 +tol0+ gsl:+success+) + +;; airy-ai-deriv +(sf-deftest "airy-ai-deriv" (-5.0d0 gsl:+prec-default+) + 0.3271928185544435d0 +tol+1+) + +;; airy-ai-deriv-e +(sf-deftest-e "airy-ai-deriv-e" (-5.0d0 gsl:+prec-default+) + 0.3271928185544435d0 +tol+1+ gsl:+success+) + +;; airy-bi-deriv +(sf-deftest "airy-bi-deriv" (-5.0d0 gsl:+prec-default+) + 0.778411773001899d0 +tol+1+) + +;; airy-bi-deriv-e +(sf-deftest-e "airy-bi-deriv-e" (-5.0d0 gsl:+prec-default+) + 0.778411773001899d0 +tol+1+ gsl:+success+) + +;; airy-ai-deriv-scaled +(sf-deftest "airy-ai-deriv-scaled" (-5.0d0 gsl:+prec-default+) + 0.3271928185544435d0 +tol+1+) + +;; airy-ai-deriv-scaled-e +(sf-deftest-e "airy-ai-deriv-scaled-e" (-5.0d0 gsl:+prec-default+) + 0.3271928185544435d0 +tol+1+ gsl:+success+) + +;; airy-bi-deriv-scaled +(sf-deftest "airy-bi-deriv-scaled" (-5.0d0 gsl:+prec-default+) + 0.778411773001899d0 +tol+1+) + +;; airy-bi-deriv-scaled-e +(sf-deftest-e "airy-bi-deriv-scaled-e" (-5.0d0 gsl:+prec-default+) + 0.778411773001899d0 +tol+1+ gsl:+success+) + +;; airy-zero-ai +(sf-deftest "airy-zero-ai" (2) -4.087949444130970617d0 +tol0+) + +;; airy-zero-ai-e +(sf-deftest-e "airy-zero-ai-e" (2) + -4.087949444130970617d0 +tol0+ gsl:+success+) + +;; airy-zero-bi +(sf-deftest "airy-zero-bi" (2) -3.271093302836352716d0 +tol0+) + +;; airy-zero-bi-e +(sf-deftest-e "airy-zero-bi-e" (2) + -3.271093302836352716d0 +tol0+ gsl:+success+) + +;; airy-zero-ai-deriv +(sf-deftest "airy-zero-ai-deriv" (2) -3.248197582179836561d0 +tol0+) + +;; airy-zero-ai-deriv-e +(sf-deftest-e "airy-zero-ai-deriv-e" (2) + -3.248197582179836561d0 +tol0+ gsl:+success+) + +;; airy-zero-bi-deriv +(sf-deftest "airy-zero-bi-deriv" (2) -4.073155089071828216d0 +tol0+) + +;; airy-zero-bi-deriv-e +(sf-deftest-e "airy-zero-bi-deriv-e" (2) + -4.073155089071828216d0 +tol0+ gsl:+success+) + +;; bessel-c-j0 +;; bessel-c-j0-e +;; bessel-c-j1 +;; bessel-c-j1-e +;; bessel-c-jn +;; bessel-c-jn-e +;; bessel-c-jn-array +;; bessel-c-y0 +;; bessel-c-y0-e +;; bessel-c-y1 +;; bessel-c-y1-e +;; bessel-c-yn +;; bessel-c-yn-e +;; bessel-c-yn-array +;; bessel-c-i0 +;; bessel-c-i0-e +;; bessel-c-i1 +;; bessel-c-i1-e +;; bessel-c-in +;; bessel-c-in-e +;; bessel-c-in-array +;; bessel-c-i0-scaled +;; bessel-c-i0-scaled-e +;; bessel-c-i1-scaled +;; bessel-c-i1-scaled-e +;; bessel-c-in-scaled +;; bessel-c-in-scaled-e +;; bessel-c-in-scaled-array +;; bessel-c-k0 +;; bessel-c-k0-e +;; bessel-c-k1 +;; bessel-c-k1-e +;; bessel-c-kn +;; bessel-c-kn-e +;; bessel-c-kn-array +;; bessel-c-k0-scaled +;; bessel-c-k0-scaled-e +;; bessel-c-k1-scaled +;; bessel-c-k1-scaled-e +;; bessel-c-kn-scaled +;; bessel-c-kn-scaled-e +;; bessel-c-kn-scaled-array +;; bessel-s-j0 +;; bessel-s-j0-e +;; bessel-s-j1 +;; bessel-s-j1-e +;; bessel-s-j2 +;; bessel-s-j2-e +;; bessel-s-jl +;; bessel-s-ji-e +;; bessel-s-jl-array +;; bessel-s-y0 +;; bessel-s-y0-e +;; bessel-s-y1 +;; bessel-s-y1-e +;; bessel-s-y2 +;; bessel-s-y2-e +;; bessel-s-yl +;; bessel-s-yl-e +;; bessel-s-yl-array +;; bessel-s-i0-scaled +;; bessel-s-i0-scaled-e +;; bessel-s-i1-scaled +;; bessel-s-i1-scaled-e +;; bessel-s-i2-scaled +;; bessel-s-i2-scaled-e +;; bessel-s-il-scaled +;; bessel-s-il-scaled-e +;; bessel-s-il-scaled-array +;; bessel-s-k0-scaled +;; bessel-s-k0-scaled-e +;; bessel-s-k1-scaled +;; bessel-s-k1-scaled-e +;; bessel-s-k2-scaled +;; bessel-s-k2-scaled-e +;; bessel-s-kl-scaled +;; bessel-s-kl-scaled-e +;; bessel-s-kl-scaled-array +;; bessel-c-jnu +;; bessel-c-jnu-e +;; bessel-c-ynu +;; bessel-c-ynu-e +;; bessel-c-inu +;; bessel-c-inu-e +;; bessel-c-inu-scaled +;; bessel-c-inu-scaled-e +;; bessel-c-knu +;; bessel-c-knu-e +;; bessel-c-lnknu +;; bessel-c-lnknu-e +;; bessel-c-knu-scaled +;; bessel-c-knu-scaled-e +;; bessel-c-zero-j0 +;; bessel-c-zero-j0-e +;; bessel-c-zero-j1 +;; bessel-c-zero-j1-e +;; bessel-c-zero-jnu +;; bessel-c-zero-jnu-e + +;; clausen +(sf-deftest "clausen" ((/ gsl-math:+pi+ 20.0d0)) 0.4478882448133546d0 +tol0+) + +;; clausen-e +(sf-deftest-e "clausen-e" ((/ gsl-math:+pi+ 6.0d0)) + 0.8643791310538927d0 +tol0+ gsl:+success+) + +;; hydrogenic-r-1 +;; hydrogenic-r-1-e +;; hydrogenic-r +;; hydrogenic-r-e +;; coulomb-CL-e +;; coupling-3j +(sf-deftest "coupling-3j" (0 1 1 0 1 -1) (sqrt (/ 1.0d0 2.0d0)) +tol0+) + +;; coupling-3j-e +(sf-deftest-e "coupling-3j-e" (0 1 1 0 1 -1) + (sqrt (/ 1.0d0 2.0d0)) +tol0+ gsl:+success+) + +;; coupling-6j +(sf-deftest "coupling-6j" (2 2 4 2 2 2) (/ 1.0d0 6.0d0) +tol0+) + +;; coupling-6j-e +(sf-deftest-e "coupling-6j-e" (2 2 4 2 2 2) (/ 1.0d0 6.0d0) +tol0+ gsl:+success+) + +;; coupling-9j +(sf-deftest "coupling-9j" (4 2 4 3 3 2 1 1 2) + (/ (sqrt (/ 1.0d0 6.0d0)) -10.0d0) +tol0+) + +;; coupling-9j-e +(sf-deftest-e "coupling-9j-e" (4 2 4 3 3 2 1 1 2) + (/ (sqrt (/ 1.0d0 6.0d0)) -10.0d0) +tol0+ gsl:+success+) + +;; dawson +(sf-deftest "dawson" (0.5d0) 0.4244363835020222959d0 +tol0+) + +;; dawson-e +(sf-deftest-e "dawson-e" (0.5d0) 0.4244363835020222959d0 +tol0+ gsl:+success+) + +;; debye-1 +(sf-deftest "debye-1" (0.1d0) 0.975277750004723276d0 +tol0+) + +;; debye-1-e" +(sf-deftest-e "debye-1-e" (0.1d0) 0.975277750004723276d0 +tol0+ gsl:+success+) + +;; debye-2 +(sf-deftest "debye-2" (0.1d0) 0.967083287045302664d0 +tol0+) + +;; debye-2-e +(sf-deftest-e "debye-2-e" (0.1d0) 0.967083287045302664d0 +tol0+ gsl:+success+) + +;; debye-3 +(sf-deftest "debye-3" (0.1d0) 0.962999940487211048d0 +tol0+) + +;; debye-3-e +(sf-deftest-e "debye-3-e" (0.1d0) 0.962999940487211048d0 +tol0+ gsl:+success+) + +;; debye-4 +(sf-deftest "debye-4" (0.1d0) 0.960555486124335944d0 +tol0+) + +;; debye-4-e +(sf-deftest-e "debye-4-e" (0.1d0) 0.960555486124335944d0 +tol0+ gsl:+success+) + +;; dilog +;; dilog-e +;; multiply-e +;; multiply-err-e +;; ellint-kcomp +(sf-deftest "ellint-kcomp" (0.99d0 gsl:+prec-default+) + 3.3566005233611923760d0 +tol+1+) + +;; ellint-kcomp-e +(sf-deftest-e "ellint-kcomp-e" (0.99d0 gsl:+prec-default+) + 3.3566005233611923760d0 +tol+1+ gsl:+success+) + +;; ellint-ecomp +(sf-deftest "ellint-ecomp" (0.99d0 gsl:+prec-default+) + 1.0284758090288040010d0 +tol+1+) + +;; ellint-ecomp-e +(sf-deftest-e "ellint-ecomp-e" (0.99d0 gsl:+prec-default+) + 1.0284758090288040010d0 +tol+1+ gsl:+success+) + +;; ellint-f +(sf-deftest "ellint-f" ((/ gsl-math:+pi+ 3.0d0) 0.99d0 gsl:+prec-default+) + 1.3065333392738763d0 +tol0+) + +;; ellint-f-e +(sf-deftest-e "ellint-f-e" ((/ gsl-math:+pi+ 3.0d0) 0.99d0 gsl:+prec-default+) + 1.3065333392738763d0 +tol0+ gsl:+success+) + +;; ellint-e +(sf-deftest "ellint-e" ((/ gsl-math:+pi+ 3.0d0) 0.99d0 gsl:+prec-default+) + 0.8704819220377943536d0 +tol+1+) + +;; ellint-e-e +(sf-deftest-e "ellint-e-e" ((/ gsl-math:+pi+ 3.0d0) 0.99d0 gsl:+prec-default+) + 0.8704819220377943536d0 +tol+1+ gsl:+success+) + +;; ellint-p +(sf-deftest "ellint-p" ((/ gsl-math:+pi+ 3.0d0) 0.99d0 0.5d0 gsl:+prec-default+) + 1.1288726598764096d0 +tol0+) + +;; ellint-p-e +(sf-deftest-e "ellint-p-e" + ((/ gsl-math:+pi+ 3.0d0) 0.99d0 0.5d0 gsl:+prec-default+) + 1.1288726598764096d0 +tol0+ gsl:+success+) + +;; ellint-D +;; ellint-D-e +;; ellint-rc +(sf-deftest "ellint-rc" (1.0d0 2.0d0 gsl:+prec-default+) + 0.7853981633974482d0 +tol+1+) + +;; ellint-rc-e +(sf-deftest-e "ellint-rc-e" (1.0d0 2.0d0 gsl:+prec-default+) + 0.7853981633974482d0 +tol+1+ gsl:+success+) + +;; ellint-rd +(sf-deftest "ellint-rd" (5.0d-11 1.0d-10 1.0d0 gsl:+prec-default+) + 34.0932594919337362d0 +tol0+) + +;; ellint-rd-e +(sf-deftest-e "ellint-rd-e" (5.0d-11 1.0d-10 1.0d0 gsl:+prec-default+) + 34.0932594919337362d0 +tol0+ gsl:+success+) + +;; ellint-rf +(sf-deftest "ellint-rf" (5.0d-11 1.0d-10 1.0d0 gsl:+prec-default+) + 12.364419829794393d0 +tol0+) + +;; ellint-rf-e +(sf-deftest-e "ellint-rf-e" (5.0d-11 1.0d-10 1.0d0 gsl:+prec-default+) + 12.364419829794393d0 +tol0+ gsl:+success+) + +;; ellint-RJ +;; ellint-RJ-e +;; erf +(sf-deftest "erf" (-10.0d0) -1.0d0 +tol0+) + +;; erf-e +(sf-deftest-e "erf-e" (-10.0d0) -1.0d0 +tol0+ gsl:+success+) + +;; erfc +(sf-deftest "erfc" (-10.0d0) 2.0d0 +tol0+) + +;; erfc-e +(sf-deftest-e "erfc-e" (-10.0d0) 2.0d0 +tol0+ gsl:+success+) + +;; log-erfc +(sf-deftest "log-erfc" (-1.0d0) (log 1.842700792949714869d0) +tol+1+) + +;; log-erfc-e +(sf-deftest-e "log-erfc-e" (-1.0d0) + (log 1.842700792949714869d0) +tol+1+ gsl:+success+) + +;; erf-z +(sf-deftest "erf-z" (1.0d0) 0.24197072451914334980d0 +tol0+) + +;; erf-z-e +(sf-deftest-e "erf-z-e" (1.0d0) 0.24197072451914334980d0 +tol0+ gsl:+success+) + +;; erf-q +(sf-deftest "erf-q" (10.0d0) 7.619853024160526066d-24 +tol-2+) + +;; erf-q-e +(sf-deftest-e "erf-q-e" (10.0d0) 7.619853024160526066d-24 +tol-2+ gsl:+success+) + +;; hazard +(sf-deftest "hazard" (1.0d0) 1.5251352761609812091d0 +tol0+) + +;; hazard-e +(sf-deftest-e "hazard-e" (1.0d0) 1.5251352761609812091d0 +tol0+ gsl:+success+) + +;; exp-e +;; exp-mult +(sf-deftest "exp-mult" (-10.0d0 1.0d-6) (* 1.0d-6 (exp -10.0d0)) +tol0+) + +;; exp-mult-e +(sf-deftest-e "exp-mult-e" (-10.0d0 1.0d-6) + (* 1.0d-6 (exp -10.0d0)) +tol0+ gsl:+success+) + +;; expm1 +(sf-deftest "expm1" (-0.001d0) -0.00099950016662500845d0 +tol0+) + +;; expm1-e +(sf-deftest-e "expm1-e" (-0.001d0) + -0.00099950016662500845d0 +tol0+ gsl:+success+) + +;; exprel +(sf-deftest "exprel" (-0.001d0) 0.9995001666250084d0 +tol+1+) + +;; exprel-e +(sf-deftest-e "exprel-e" (-0.001d0) + 0.9995001666250084d0 +tol+1+ gsl:+success+) + +;; exprel-2 +(sf-deftest "exprel-2" (-10.0d0) 0.18000090799859524970d0 +tol0+) + +;; exprel-2-e +(sf-deftest-e "exprel-2-e" (-10.0d0) + 0.18000090799859524970d0 +tol0+ gsl:+success+) + +;; exprel-n +(sf-deftest "exprel-n" (3 -1000.0d0) 0.00299400600000000000d0 +tol0+) + +;; exprel-n-e +(sf-deftest-e "exprel-n-e" (3 -1000.0d0) + 0.00299400600000000000d0 +tol0+ gsl:+success+) + +;; exp-err-e +;; exp-mult-err-e +;; expint-e1 +(sf-deftest "expint-e1" (-1.0d0) -1.8951178163559367555d0 +tol+1+) + +;; expint-e1-e +(sf-deftest-e "expint-e1-e" (-1.0d0) + -1.8951178163559367555d0 +tol+1+ gsl:+success+) + +;; expint-e2 +(sf-deftest "expint-e2" (-1.0d0) 0.8231640121031084799d0 +tol+1+) + +;; expint-e2-e +(sf-deftest-e "expint-e2-e" (-1.0d0) + 0.8231640121031084799d0 +tol+1+ gsl:+success+) + +;; expint-ei +(sf-deftest "expint-ei" (-1.0d0) -0.21938393439552027368d0 +tol0+) + +;; expint-ei-e +(sf-deftest-e "expint-ei-e" (-1.0d0) + -0.21938393439552027368d0 +tol0+ gsl:+success+) + +;; shi +(sf-deftest "shi" (-1.0d0) -1.0572508753757285146d0 +tol+1+) + +;; shi-e +(sf-deftest-e "shi-e" (-1.0d0) -1.0572508753757285146d0 +tol+1+ gsl:+success+) + +;; chi +(sf-deftest "chi" (-1.0d0) 0.8378669409802082409d0 +tol+1+) + +;; chi-e +(sf-deftest-e "chi-e" (-1.0d0) 0.8378669409802082409d0 +tol+1+ gsl:+success+) + +;; expint-3 +(sf-deftest "expint-3" (0.1d0) 0.09997500714119079665122d0 +tol0+) + +;; expint-3-e +(sf-deftest-e "expint-3-e" (0.1d0) + 0.09997500714119079665122d0 +tol0+ gsl:+success+) + +;; si +(sf-deftest "si" (-1.0d0) -0.9460830703671830149d0 +tol0+) + +;; si-e +(sf-deftest-e "si-e" (-1.0d0) -0.9460830703671830149d0 +tol0+ gsl:+success+) + +;; ci +(sf-deftest "ci" ((/ 1.0d0 4294967296.0d0)) -21.603494113016717041d0 +tol0+) + +;; ci-e +(sf-deftest-e "ci-e" ((/ 1.0d0 4294967296.0d0)) + -21.603494113016717041d0 +tol0+ gsl:+success+) + +;; atanint +(sf-deftest "atanint" (2.0d0) 1.57601540344632342236d0 +tol0+) + +;; atanint-e +(sf-deftest-e "atanint-e" (2.0d0) + 1.57601540344632342236d0 +tol0+ gsl:+success+) + +;; fermi-dirac-m1 +(sf-deftest "fermi-dirac-m1" (-1.0d0) 0.26894142136999512075d0 +tol0+) + +;; fermi-dirac-m1-e +(sf-deftest-e "fermi-dirac-m1-e" (-1.0d0) + 0.26894142136999512075d0 +tol0+ gsl:+success+) + +;; fermi-dirac-0 +(sf-deftest "fermi-dirac-0" (-1.0d0) 0.313261687518222834055d0 +tol0+) + +;; fermi-dirac-0-e +(sf-deftest-e "fermi-dirac-0-e" (-1.0d0) + 0.31326168751822283405d0 +tol0+ gsl:+success+) + +;; fermi-dirac-1 +(sf-deftest "fermi-dirac-1" (-2.0d0) 0.13101248471442377127d0 +tol0+) + +;; fermi-dirac-1-e +(sf-deftest-e "fermi-dirac-1-e" (-2.0d0) + 0.13101248471442377127d0 +tol0+ gsl:+success+) + +;; fermi-dirac-2 +(sf-deftest "fermi-dirac-2" (-1.0d0) 0.3525648792978077590d0 +tol0+) + +;; fermi-dirac-2-e +(sf-deftest-e "fermi-dirac-2-e" (-1.0d0) + 0.3525648792978077590d0 +tol0+ gsl:+success+) + +;; fermi-dirac-int +(sf-deftest "fermi-dirac-int" (3 0.1d0) 1.0414170610956165759d0 +tol+1+) + +;; fermi-dirac-int-e +(sf-deftest-e "fermi-dirac-int-e" (3 0.1d0) + 1.0414170610956165759d0 +tol+1+ gsl:+success+) + +;; fermi-dirac-mhalf +(sf-deftest "fermi-dirac-mhalf" (-2.0d0) 0.12366562180120994266d0 +tol0+) + +;; fermi-dirac-mhalf-e +(sf-deftest-e "fermi-dirac-mhalf-e" (-2.0d0) + 0.12366562180120994266d0 +tol0+ gsl:+success+) + +;; fermi-dirac-half +(sf-deftest "fermi-dirac-half" (-2.0d0) 0.12929851332007559106d0 +tol0+) + +;; fermi-dirac-half-e +(sf-deftest-e "fermi-dirac-half-e" (-2.0d0) + 0.12929851332007559106d0 +tol0+ gsl:+success+) + +;; fermi-dirac-3half +(sf-deftest "fermi-dirac-3half" (-1.0d0) 0.3466747947990574170d0 +tol0+) + +;; fermi-dirac-3half-e +(sf-deftest-e "fermi-dirac-3half-e" (-1.0d0) + 0.3466747947990574170d0 +tol0+ gsl:+success+) + +;; fermi-dirac-inc-0 +;; fermi-dirac-inc-0-e +;; gamma +;; gamma-e +;; lngamma +;; lngamma-e +;; gammastar +;; gammastar-e +;; gammainv +;; gammainv-e +;; taylorcoeff +;; taylorcoeff-e +;; fact +;; fact-e +;; doublefact +;; doublefact-e +;; lnfact +;; lnfact-e +;; lndoublefact +;; lndoublefact-e +;; choose +;; choose-e +;; lnchoose +;; lnchoose-e +;; poch +;; poch-e +;; lnpoch +;; lnpoch-e +;; pochrel +;; pochrel-e +;; gamma-inc-Q +;; gamma-inc-Q-e +;; gamma-inc-P +;; gamma-inc-P-e +;; gamma-inc +;; gamma-inc-e +;; beta +;; beta-e +;; lnbeta +;; lnbeta-e +;; beta-inc +;; beta-inc-e +;; gegenpoly-1 +(sf-deftest "gegenpoly-1" (-0.2d0 1.0d0) -0.4d0 +tol0+) + +;; gegenpoly-2 +(sf-deftest "gegenpoly-2" (-0.2d0 0.5d0) 0.12d0 +tol0+) + +;; gegenpoly-3 +(sf-deftest "gegenpoly-3" (-0.2d0 0.5d0) 0.112d0 +tol0+) + +;; gegenpoly-1-e +(sf-deftest-e "gegenpoly-1-e" (-0.2d0 1.0d0) -0.4d0 +tol0+ gsl:+success+) + +;; gegenpoly-2-e +(sf-deftest-e "gegenpoly-2-e" (-0.2d0 0.5d0) 0.12d0 +tol0+ gsl:+success+) + +;; gegenpoly-3-e +(sf-deftest-e "gegenpoly-3-e" (-0.2d0 0.5d0) 0.112d0 +tol0+ gsl:+success+) + +;; gegenpoly-n +(sf-deftest "gegenpoly-n" (10 1.0d0 1.0d0) 11.0d0 +tol0+) + +;; gegenpoly-n-e +(sf-deftest-e "gegenpoly-n-e" (10 1.0d0 1.0d0) 11.0d0 +tol0+ gsl:+success+) + +;; gegenpoly-array +;; hyperg-0F1 +;; hyperg-0F1-e +;; hyperg-1F1-int +;; hyperg-1F1-int-e +;; hyperg-1F1 +;; hyperg-1F1-e +;; hyperg-U-int +;; hyperg-U-int-e +;; hyperg-U-int-e10-e +;; hyperg-U +;; hyperg-U-e +;; hyperg-U-e10-e +;; hyperg-2F1 +;; hyperg-2F1-e +;; hyperg-2F1-conj +;; hyperg-2F1-conj-e +;; hyperg-2F1-renorm +;; hyperg-2F1-renorm-e +;; hyperg-2F1-conj-renorm +;; hyperg-2F1-conj-renorm-e +;; hyperg-2F0 +;; hyperg-2F0-e +;; laguerre-1 +(sf-deftest "laguerre-1" (0.5d0 -1.0d0) 2.5d0 +tol0+) + +;; laguerre-2 +(sf-deftest "laguerre-2" (0.5d0 -1.0d0) 4.875d0 +tol0+) + +;; laguerre-3 +(sf-deftest "laguerre-3" (0.5d0 -1.0d0) 8.479166666666666667d0 +tol0+) + +;; laguerre-1-e +(sf-deftest-e "laguerre-1-e" (0.5d0 -1.0d0) 2.5d0 +tol0+ gsl:+success+) + +;; laguerre-2-e +(sf-deftest-e "laguerre-2-e" (0.5d0 -1.0d0) 4.875d0 +tol0+ gsl:+success+) + +;; laguerre-3-e +(sf-deftest-e "laguerre-3-e" (0.5d0 -1.0d0) + 8.479166666666666667d0 +tol0+ gsl:+success+) + +;; laguerre-n +(sf-deftest "laguerre-n" (4 2.0d0 0.5d0) 6.752604166666666667d0 +tol+2+) + +;; laguerre-n-e +(sf-deftest-e "laguerre-n-e" (4 2.0d0 0.5d0) + 6.752604166666666667d0 +tol+2+ gsl:+success+) + +;; lambert-w0 +(sf-deftest "lambert-w0" (1.0d0) 0.567143290409783872999969d0 +tol0+) + +;; lambert-w0-e +(sf-deftest-e "lambert-w0-e" (1.0d0) + 0.567143290409783872999969d0 +tol0+ gsl:+success+) + +;; lambert-wm1 +(sf-deftest "lambert-wm1" (1.0d0) 0.567143290409783872999969d0 +tol0+) + +;; lambert-wm1-e +(sf-deftest-e "lambert-wm1-e" (1.0d0) + 0.567143290409783872999969d0 +tol0+ gsl:+success+) + +;; legendre-P1 +;; legendre-P2 +;; legendre-P3 +;; legendre-P1-e +;; legendre-P2-e +;; legendre-P3-e +;; legendre-Pl +;; legendre-Pl-e +;; legendre-Pl-array +;; legendre-Q0 +;; legendre-Q0-e +;; legendre-Q1 +;; legendre-Q1-e +;; legendre-Ql +;; legendre-Ql-e +;; legendre-Plm +;; legendre-Plm-e +;; legendre-sphPlm +;; legendre-sphPlm-e +;; legendre-array-size +;; conicalP-half +;; conicalP-half-e +;; conicalP-mhalf +;; conicalP-mhalf-e +;; conicalP-0 +;; conicalP-0-e +;; conicalP-1 +;; conicalP-1-e +;; conicalP-sph-reg +;; conicalP-sph-reg-e +;; conicalP-cyl-reg +;; conicalP-cyl-reg-e +;; legendre-H3d-0 +;; legendre-H3d-0-e +;; legendre-H3d-1 +;; legendre-H3d-1-e +;; legendre-H3d +;; legendre-H3d-e +;; legendre-H3d-array +;; log-e +;; log-abs +(sf-deftest "log-abs" (-1.1d0) 0.095310179804324860045d0 +tol0+) + +;; log-abs-e +(sf-deftest-e "log-abs-e" (-1.1d0) 0.09531017980432486004d0 +tol0+ gsl:+success+) + +;; log-1plusx +(sf-deftest "log-1plusx" (0.49d0) 0.3987761199573677730d0 +tol0+) + +;; log-1plusx-e +(sf-deftest-e "log-1plusx-e" (0.49d0) + 0.3987761199573677730d0 +tol0+ gsl:+success+) + +;; log-1plusx-mx +(sf-deftest "log-1plusx-mx" (0.49d0) -0.09122388004263222704d0 +tol0+) + +;; log-1plusx-mx-e +(sf-deftest-e "log-1plusx-mx-e" (0.49d0) + -0.09122388004263222704d0 +tol0+ gsl:+success+) + +;; pow-int +;; pow-int-e +;; psi-int +(sf-deftest "psi-int" (1) -0.57721566490153286060d0 +tol0+) + +;; psi-int-e +(sf-deftest-e "psi-int-e" (1) + -0.57721566490153286060d0 +tol0+ gsl:+success+) + +;; psi +(sf-deftest "psi" (5000.0d0) 8.517093188082904107d0 +tol0+) + +;; psi-e +(sf-deftest-e "psi-e" (5000.0d0) + 8.517093188082904107d0 +tol0+ gsl:+success+) + +;; psi-1piy +(sf-deftest "psi-1piy" (0.8d0) -0.07088340212750589223d0 +tol0+) + +;; psi-1piy-e +(sf-deftest-e "psi-1piy-e" (0.8d0) + -0.07088340212750589223d0 +tol0+ gsl:+success+) + +;; psi-1-int +(sf-deftest "psi-1-int" (1) 1.6449340668482264364d0 +tol0+) + +;; psi-1-int-e +(sf-deftest-e "psi-1-int-e" (1) 1.6449340668482264364d0 +tol0+ gsl:+success+) + +;; psi-1 +(sf-deftest "psi-1" (1.0d0) 1.6449340668482264365d0 +tol0+) + +;; psi-1-e +(sf-deftest-e "psi-1-e" (1.0d0) 1.6449340668482264365d0 +tol0+ gsl:+success+) + +;; psi-n +(sf-deftest "psi-n" (1 1.0d0) 1.6449340668482264364d0 +tol0+) + +;; psi-n-e +(sf-deftest-e "psi-n-e" (1 1.0d0) 1.6449340668482264364d0 +tol0+ gsl:+success+) + +;; synchrotron-1 +(sf-deftest "synchrotron-1" (0.01d0) 0.444972504114210632d0 +tol0+) + +;; synchrotron-1-e +(sf-deftest-e "synchrotron-1-e" (0.01d0) + 0.444972504114210632d0 +tol0+ gsl:+success+) + +;; synchrotron-2 +(sf-deftest "synchrotron-2" (0.01d0) 0.23098077342226277732d0 +tol+1+) + +;; synchrotron-2-e +(sf-deftest-e "synchrotron-2-e" (0.01d0) + 0.23098077342226277732d0 +tol+1+ gsl:+success+) + +;; transport-2 +(sf-deftest "transport-2" (3.0d0) 2.41105004901695346199d0 +tol0+) + +;; transport-2-e +(sf-deftest-e "transport-2-e" (3.0d0) + 2.41105004901695346199d0 +tol0+ gsl:+success+) + +;; transport-3 +(sf-deftest "transport-3" (1.0d0) 0.479841006572417499939d0 +tol0+) + +;; transport-3-e +(sf-deftest-e "transport-3-e" (1.0d0) + 0.479841006572417499939d0 +tol0+ gsl:+success+) + +;; transport-4 +(sf-deftest "transport-4" (1.0d0) 0.31724404523442648241d0 +tol0+) + +;; transport-4-e +(sf-deftest-e "transport-4-e" (1.0d0) + 0.31724404523442648241d0 +tol0+ gsl:+success+) + +;; transport-5 +(sf-deftest "transport-5" (1.0d0) 0.236615879239094789259153d0 +tol0+) + +;; transport-5-e +(sf-deftest-e "transport-5-e" (1.0d0) + 0.236615879239094789259153d0 +tol0+ gsl:+success+) + + +;; sin-e +;; cos-e +;; hypot +;; hypot-e +;; sinc +;; sinc-e +;; lnsinh +;; lnsinh-e +;; lncosh +;; lncosh-e +;; angle-restrict-symm +;; angle-restrict-symm-e +;; angle-restrict-pos +;; angle-restrict-pos-e +;; sin-err-e +;; cos-err-e +;; zeta-int +(sf-deftest "zeta-int" (5) 1.0369277551433699263313655d0 +tol0+) + +;; zeta-int-e +(sf-deftest-e "zeta-int-e" (5) + 1.0369277551433699263313655d0 +tol0+ gsl:+success+) + +;; zeta +(sf-deftest "zeta" (-0.5d0) -0.207886224977354566017307d0 +tol+1+) + +;; zeta-e +(sf-deftest-e "zeta-e" (-0.5d0) + -0.207886224977354566017307d0 +tol+1+ gsl:+success+) + +;; zetam1-int +(sf-deftest "zetam1-int" (-5) -1.003968253968253968253968d0 +tol+1+) + +;; zetam1-int-e +(sf-deftest-e "zetam1-int-e" (-5) + -1.003968253968253968253968d0 +tol+1+ gsl:+success+) + +;; zetam1 +(sf-deftest "zetam1" (0.5d0) -2.460354508809586812889499d0 +tol+1+) + +;; zetam1-e +(sf-deftest-e "zetam1-e" (0.5d0) + -2.460354508809586812889499d0 +tol+1+ gsl:+success+) + +;; hzeta +(sf-deftest "hzeta" (2.0d0 1.0d0) 1.6449340668482264365d0 +tol0+) + +;; hzeta-e +(sf-deftest-e "hzeta-e" (2.0d0 1.0d0) + 1.6449340668482264365d0 +tol0+ gsl:+success+) + +;; eta-int +(sf-deftest "eta-int" (5) 0.9721197704469093059d0 +tol0+) + +;; eta-int-e +(sf-deftest-e "eta-int-e" (5) 0.9721197704469093059d0 +tol0+ gsl:+success+) + +;; eta +(sf-deftest "eta" (-5.0d0) 0.25d0 +tol0+) + +;; eta-e +(sf-deftest-e "eta-e" (-5.0d0) 0.25d0 +tol0+ gsl:+success+) From edenny at common-lisp.net Mon Mar 7 02:12:37 2005 From: edenny at common-lisp.net (Edgar Denny) Date: Mon, 7 Mar 2005 03:12:37 +0100 (CET) Subject: [cl-gsl-cvs] CVS update: cl-gsl/ChangeLog Message-ID: <20050307021237.EA6E788677@common-lisp.net> Update of /project/cl-gsl/cvsroot/cl-gsl In directory common-lisp.net:/tmp/cvs-serv22028 Modified Files: ChangeLog Log Message: *** empty log message *** Date: Mon Mar 7 03:12:33 2005 Author: edenny Index: cl-gsl/ChangeLog diff -u cl-gsl/ChangeLog:1.2 cl-gsl/ChangeLog:1.3 --- cl-gsl/ChangeLog:1.2 Sat Mar 5 05:35:15 2005 +++ cl-gsl/ChangeLog Mon Mar 7 03:12:32 2005 @@ -1,3 +1,11 @@ +2005-03-07 Edgar Denny + + * test/test-sf.lisp: Added lots of unit tests. + + * sf.lisp: Fixes for airy functions. + + * enum.lisp: add +prec-default+ + 2005-03-05 Edgar Denny * vector.lisp: Fixes for complex vectors. From edenny at common-lisp.net Tue Mar 8 03:33:43 2005 From: edenny at common-lisp.net (Edgar Denny) Date: Tue, 8 Mar 2005 04:33:43 +0100 (CET) Subject: [cl-gsl-cvs] CVS update: cl-gsl/sf.lisp Message-ID: <20050308033343.54A3888663@common-lisp.net> Update of /project/cl-gsl/cvsroot/cl-gsl In directory common-lisp.net:/tmp/cvs-serv10913 Modified Files: sf.lisp Log Message: Fix typo revealed by unit tests. Date: Tue Mar 8 04:33:42 2005 Author: edenny Index: cl-gsl/sf.lisp diff -u cl-gsl/sf.lisp:1.2 cl-gsl/sf.lisp:1.3 --- cl-gsl/sf.lisp:1.2 Mon Mar 7 03:05:21 2005 +++ cl-gsl/sf.lisp Tue Mar 8 04:33:41 2005 @@ -567,7 +567,7 @@ (x :double)) :double) -(defun-wrapper% ("bessel_jl_e" bessel-s-ji-e) +(defun-wrapper% ("bessel_jl_e" bessel-s-jl-e) ((l :int) (x :double) (result gsl-sf-result-ptr)) From edenny at common-lisp.net Tue Mar 8 03:34:18 2005 From: edenny at common-lisp.net (Edgar Denny) Date: Tue, 8 Mar 2005 04:34:18 +0100 (CET) Subject: [cl-gsl-cvs] CVS update: cl-gsl/test/test-sf.lisp Message-ID: <20050308033418.9C53488663@common-lisp.net> Update of /project/cl-gsl/cvsroot/cl-gsl/test In directory common-lisp.net:/tmp/cvs-serv10932 Modified Files: test-sf.lisp Log Message: More unit tests added. Date: Tue Mar 8 04:34:17 2005 Author: edenny Index: cl-gsl/test/test-sf.lisp diff -u cl-gsl/test/test-sf.lisp:1.2 cl-gsl/test/test-sf.lisp:1.3 --- cl-gsl/test/test-sf.lisp:1.2 Mon Mar 7 03:08:25 2005 +++ cl-gsl/test/test-sf.lisp Tue Mar 8 04:34:16 2005 @@ -26,6 +26,8 @@ (defconstant +tol-1+ (/ +tol0+ 10.0d0)) (defconstant +tol+2+ (* +tol0+ 100.0d0)) (defconstant +tol-2+ (/ +tol0+ 100.0d0)) +(defconstant +tol+3+ (* +tol0+ 1000.0d0)) +(defconstant +tol-3+ (/ +tol0+ 1000.0d0)) (defconstant +sf+ "sf") @@ -142,103 +144,322 @@ -4.073155089071828216d0 +tol0+ gsl:+success+) ;; bessel-c-j0 +(sf-deftest "bessel-c-j0" (0.1d0) 0.99750156206604003230d0 +tol0+) + ;; bessel-c-j0-e +(sf-deftest-e "bessel-c-j0-e" (0.1d0) + 0.99750156206604003230d0 +tol0+ gsl:+success+) + ;; bessel-c-j1 +(sf-deftest "bessel-c-j1" (0.1d0) 0.04993752603624199756d0 +tol0+) + ;; bessel-c-j1-e +(sf-deftest-e "bessel-c-j1-e" (0.1d0) + 0.04993752603624199756d0 +tol0+ gsl:+success+) + ;; bessel-c-jn +(sf-deftest "bessel-c-jn" (10 20.0d0) 0.18648255802394508321d0 +tol+1+) + ;; bessel-c-jn-e +(sf-deftest-e "bessel-c-jn-e" (10 20.0d0) + 0.18648255802394508321d0 +tol+1+ gsl:+success+) + ;; bessel-c-jn-array ;; bessel-c-y0 +(sf-deftest "bessel-c-y0" (0.1d0) -1.5342386513503668441d0 +tol0+) + ;; bessel-c-y0-e +(sf-deftest-e "bessel-c-y0-e" (0.1d0) + -1.5342386513503668441d0 +tol0+ gsl:+success+) + ;; bessel-c-y1 +(sf-deftest "bessel-c-y1" (0.1d0) -6.45895109470202698800d0 +tol0+) + ;; bessel-c-y1-e +(sf-deftest-e "bessel-c-y1-e" (0.1d0) + -6.45895109470202698800d0 +tol0+ gsl:+success+) + ;; bessel-c-yn +(sf-deftest "bessel-c-jn" (10 20.0d0) 0.18648255802394508321d0 +tol0+) + ;; bessel-c-yn-e +(sf-deftest-e "bessel-c-jn-e" (10 20.0d0) + 0.18648255802394508321d0 +tol0+ gsl:+success+) + ;; bessel-c-yn-array ;; bessel-c-i0 +(sf-deftest "bessel-c-i0" (0.1d0) 1.0025015629340956014d0 +tol0+) + ;; bessel-c-i0-e +(sf-deftest-e "bessel-c-i0-e" (0.1d0) + 1.0025015629340956014d0 +tol0+ gsl:+success+) + ;; bessel-c-i1 +(sf-deftest "bessel-c-i1" (0.1d0) 0.05006252604709269211d0 +tol0+) + ;; bessel-c-i1-e +(sf-deftest-e "bessel-c-i1-e" (0.1d0) + 0.05006252604709269211d0 +tol0+ gsl:+success+) + ;; bessel-c-in +(sf-deftest "bessel-c-in" (5 2.0d0) 0.009825679323131702321d0 +tol0+) + ;; bessel-c-in-e +(sf-deftest-e "bessel-c-in-e" (5 2.0d0) + 0.009825679323131702321d0 +tol0+ gsl:+success+) + ;; bessel-c-in-array ;; bessel-c-i0-scaled +(sf-deftest "bessel-c-i0-scaled" (0.1d0) 0.90710092578230109640d0 +tol0+) + ;; bessel-c-i0-scaled-e +(sf-deftest-e "bessel-c-i0-scaled-e" (0.1d0) + 0.90710092578230109640d0 +tol0+ gsl:+success+) + ;; bessel-c-i1-scaled +(sf-deftest "bessel-c-i1-scaled" (0.1d0) 0.04529844680880932501d0 +tol0+) + ;; bessel-c-i1-scaled-e +(sf-deftest-e "bessel-c-i1-scaled-e" (0.1d0) + 0.04529844680880932501d0 +tol0+ gsl:+success+) + ;; bessel-c-in-scaled +(sf-deftest "bessel-c-in-scaled" (5 2.0d0) 0.0013297610941881578142d0 +tol0+) + ;; bessel-c-in-scaled-e +(sf-deftest-e "bessel-c-in-scaled-e" (5 2.0d0) + 0.0013297610941881578142d0 +tol0+ gsl:+success+) + ;; bessel-c-in-scaled-array ;; bessel-c-k0 +(sf-deftest "bessel-c-k0" (2.0d0) 0.11389387274953343565d0 +tol0+) + ;; bessel-c-k0-e +(sf-deftest-e "bessel-c-k0-e" (2.0d0) + 0.11389387274953343565d0 +tol0+ gsl:+success+) + ;; bessel-c-k1 +(sf-deftest "bessel-c-k1" (2.0d0) 0.13986588181652242728d0 +tol0+) + ;; bessel-c-k1-e +(sf-deftest-e "bessel-c-k1-e" (2.0d0) + 0.13986588181652242728d0 +tol0+ gsl:+success+) + ;; bessel-c-kn +(sf-deftest "bessel-c-kn" (5 2.0d0) 9.431049100596467443d0 +tol+2+) + ;; bessel-c-kn-e +(sf-deftest-e "bessel-c-kn-e" (5 2.0d0) + 9.431049100596467443d0 +tol+2+ gsl:+success+) + ;; bessel-c-kn-array ;; bessel-c-k0-scaled +(sf-deftest "bessel-c-k0-scaled" (2.0d0) 0.8415682150707714179d0 +tol+1+) + ;; bessel-c-k0-scaled-e +(sf-deftest-e "bessel-c-k0-scaled-e" (2.0d0) + 0.8415682150707714179d0 +tol+1+ gsl:+success+) + ;; bessel-c-k1-scaled +(sf-deftest "bessel-c-k1-scaled" (2.0d0) 1.0334768470686885732d0 +tol0+) + ;; bessel-c-k1-scaled-e +(sf-deftest-e "bessel-c-k1-scaled-e" (2.0d0) + 1.0334768470686885732d0 +tol0+ gsl:+success+) + ;; bessel-c-kn-scaled +(sf-deftest "bessel-c-kn-scaled" (5 2.0d0) 69.68655087607675118d0 +tol+3+) + ;; bessel-c-kn-scaled-e +(sf-deftest-e "bessel-c-kn-scaled-e" (5 2.0d0) + 69.68655087607675118d0 +tol+3+ gsl:+success+) + ;; bessel-c-kn-scaled-array ;; bessel-s-j0 +(sf-deftest "bessel-s-j0" (1.0d0) 0.84147098480789650670d0 +tol0+) + ;; bessel-s-j0-e +(sf-deftest-e "bessel-s-j0-e" (1.0d0) + 0.84147098480789650670d0 +tol0+ gsl:+success+) + ;; bessel-s-j1 +(sf-deftest "bessel-s-j1" (1.0d0) 0.30116867893975678925d0 +tol0+) + ;; bessel-s-j1-e +(sf-deftest-e "bessel-s-j1-e" (1.0d0) + 0.30116867893975678925d0 +tol0+ gsl:+success+) + ;; bessel-s-j2 +(sf-deftest "bessel-s-j2" (1.0d0) 0.06203505201137386110d0 +tol0+) + ;; bessel-s-j2-e +(sf-deftest-e "bessel-s-j2-e" (1.0d0) + 0.06203505201137386110d0 +tol0+ gsl:+success+) + ;; bessel-s-jl -;; bessel-s-ji-e +(sf-deftest "bessel-s-jl" (10 10.0d0) 0.06460515449256426427d0 +tol0+) + +;; bessel-s-jl-e +(sf-deftest-e "bessel-s-jl-e" (10 10.0d0) + 0.06460515449256426427d0 +tol0+ gsl:+success+) + ;; bessel-s-jl-array ;; bessel-s-y0 +(sf-deftest "bessel-s-y0" (1.0d0) -0.5403023058681397174d0 +tol0+) + ;; bessel-s-y0-e +(sf-deftest-e "bessel-s-y0-e" (1.0d0) + -0.5403023058681397174d0 +tol0+ gsl:+success+) + ;; bessel-s-y1 +(sf-deftest "bessel-s-y1" (1.0d0) -1.3817732906760362241d0 +tol0+) + ;; bessel-s-y1-e +(sf-deftest-e "bessel-s-y1-e" (1.0d0) + -1.3817732906760362241d0 +tol0+ gsl:+success+) + ;; bessel-s-y2 +(sf-deftest "bessel-s-y2" (1.0d0) -3.605017566159968955d0 +tol0+) + ;; bessel-s-y2-e +(sf-deftest-e "bessel-s-y2-e" (1.0d0) + -3.605017566159968955d0 +tol0+ gsl:+success+) + ;; bessel-s-yl +(sf-deftest "bessel-s-yl" (0 1.0d0) -0.54030230586813972d0 +tol0+) + ;; bessel-s-yl-e +(sf-deftest-e "bessel-s-yl-e" (0 1.0d0) + -0.54030230586813972d0 +tol0+ gsl:+success+) + ;; bessel-s-yl-array ;; bessel-s-i0-scaled +(sf-deftest "bessel-s-i0-scaled" (2.0d0) 0.24542109027781645493d0 +tol0+) + ;; bessel-s-i0-scaled-e +(sf-deftest-e "bessel-s-i0-scaled-e" (2.0d0) + 0.24542109027781645493d0 +tol0+ gsl:+success+) + ;; bessel-s-i1-scaled +(sf-deftest "bessel-s-i1-scaled" (2.0d0) 0.131868364583275317610d0 +tol0+) + ;; bessel-s-i1-scaled-e +(sf-deftest-e "bessel-s-i1-scaled-e" (2.0d0) + 0.131868364583275317610d0 +tol0+ gsl:+success+) + ;; bessel-s-i2-scaled +(sf-deftest "bessel-s-i2-scaled" (2.0d0) 0.0476185434029034785100d0 +tol0+) + ;; bessel-s-i2-scaled-e +(sf-deftest-e "bessel-s-i2-scaled-e" (2.0d0) + 0.0476185434029034785100d0 +tol0+ gsl:+success+) + ;; bessel-s-il-scaled +(sf-deftest "bessel-s-il-scaled" (5 2.0d0) 0.0004851564602127540059d0 +tol0+) + ;; bessel-s-il-scaled-e +(sf-deftest-e "bessel-s-il-scaled-e" (5 2.0d0) + 0.0004851564602127540059d0 +tol0+ gsl:+success+) + ;; bessel-s-il-scaled-array ;; bessel-s-k0-scaled +(sf-deftest "bessel-s-k0-scaled" (2.0d0) 0.7853981633974483096d0 +tol0+) + ;; bessel-s-k0-scaled-e +(sf-deftest-e "bessel-s-k0-scaled-e" (2.0d0) + 0.7853981633974483096d0 +tol0+ gsl:+success+) + ;; bessel-s-k1-scaled +(sf-deftest "bessel-s-k1-scaled" (2.0d0) 1.1780972450961724644d0 +tol0+) + ;; bessel-s-k1-scaled-e +(sf-deftest-e "bessel-s-k1-scaled-e" (2.0d0) + 1.1780972450961724644d0 +tol0+ gsl:+success+) + ;; bessel-s-k2-scaled +(sf-deftest "bessel-s-k2-scaled" (2.0d0) 2.5525440310417070063d0 +tol0+) + ;; bessel-s-k2-scaled-e +(sf-deftest-e "bessel-s-k2-scaled-e" (2.0d0) + 2.5525440310417070063d0 +tol0+ gsl:+success+) + ;; bessel-s-kl-scaled +(sf-deftest "bessel-s-kl-scaled" (5 2.0d0) 138.10735829492005119d0 +tol0+) + ;; bessel-s-kl-scaled-e +(sf-deftest-e "bessel-s-kl-scaled-e" (5 2.0d0) + 138.10735829492005119d0 +tol0+ gsl:+success+) + ;; bessel-s-kl-scaled-array ;; bessel-c-jnu +(sf-deftest "bessel-c-jnu" (1.0d0 1.0d0) 0.4400505857449335160d0 +tol0+) + ;; bessel-c-jnu-e +(sf-deftest-e "bessel-c-jnu-e" (1.0d0 1.0d0) + 0.4400505857449335160d0 +tol0+ gsl:+success+) + ;; bessel-c-ynu +(sf-deftest "bessel-c-ynu" (1.0d0 1.0d0) -0.7812128213002887165d0 +tol+1+) + ;; bessel-c-ynu-e +(sf-deftest-e "bessel-c-ynu-e" (1.0d0 1.0d0) + -0.7812128213002887165d0 +tol+1+ gsl:+success+) + ;; bessel-c-inu +(sf-deftest "bessel-c-inu" (1.0d0 1.0d0) 0.5651591039924850272d0 +tol0+) + ;; bessel-c-inu-e +(sf-deftest-e "bessel-c-inu-e" (1.0d0 1.0d0) + 0.5651591039924850272d0 +tol0+ gsl:+success+) + ;; bessel-c-inu-scaled +(sf-deftest "bessel-c-inu-scaled" (1.0d0 1.0d0) 0.20791041534970844887d0 +tol0+) + ;; bessel-c-inu-scaled-e +(sf-deftest-e "bessel-c-inu-scaled-e" (1.0d0 1.0d0) + 0.20791041534970844887d0 +tol0+ gsl:+success+) + ;; bessel-c-knu +(sf-deftest "bessel-c-knu" (1.0d0 1.0d0) 0.6019072301972345747d0 +tol0+) + ;; bessel-c-knu-e +(sf-deftest-e "bessel-c-knu-e" (1.0d0 1.0d0) + 0.6019072301972345747d0 +tol0+ gsl:+success+) + ;; bessel-c-lnknu +(sf-deftest "bessel-c-lnknu" (1.0d0 1.0d0) -0.5076519482107523309d0 +tol0+) + ;; bessel-c-lnknu-e +(sf-deftest-e "bessel-c-lnknu-e" (1.0d0 1.0d0) + -0.5076519482107523309d0 +tol0+ gsl:+success+) + ;; bessel-c-knu-scaled +(sf-deftest "bessel-c-knu-scaled" (1.0d0 1.0d0) 1.6361534862632582465d0 +tol0+) + ;; bessel-c-knu-scaled-e +(sf-deftest-e "bessel-c-knu-scaled-e" (1.0d0 1.0d0) + 1.6361534862632582465d0 +tol0+ gsl:+success+) + ;; bessel-c-zero-j0 +(sf-deftest "bessel-c-zero-j0" (1) 2.404825557695771d0 +tol+1+) + ;; bessel-c-zero-j0-e +(sf-deftest-e "bessel-c-zero-j0-e" (1) + 2.404825557695771d0 +tol+1+ gsl:+success+) + ;; bessel-c-zero-j1 +(sf-deftest "bessel-c-zero-j1" (1) 3.831705970207512d0 +tol+2+) + ;; bessel-c-zero-j1-e +(sf-deftest-e "bessel-c-zero-j1-e" (1) + 3.831705970207512d0 +tol+2+ gsl:+success+) + ;; bessel-c-zero-jnu +(sf-deftest "bessel-c-zero-jnu" (0.0d0 1) 2.404825557695771d0 +tol+2+) + ;; bessel-c-zero-jnu-e +(sf-deftest-e "bessel-c-zero-jnu-e" (0.0d0 1) + 2.404825557695771d0 +tol+2+ gsl:+success+) ;; clausen (sf-deftest "clausen" ((/ gsl-math:+pi+ 20.0d0)) 0.4478882448133546d0 +tol0+) @@ -634,28 +855,77 @@ (sf-deftest-e "gegenpoly-n-e" (10 1.0d0 1.0d0) 11.0d0 +tol0+ gsl:+success+) ;; gegenpoly-array -;; hyperg-0F1 -;; hyperg-0F1-e -;; hyperg-1F1-int -;; hyperg-1F1-int-e -;; hyperg-1F1 -;; hyperg-1F1-e -;; hyperg-U-int -;; hyperg-U-int-e -;; hyperg-U-int-e10-e -;; hyperg-U -;; hyperg-U-e -;; hyperg-U-e10-e -;; hyperg-2F1 -;; hyperg-2F1-e -;; hyperg-2F1-conj -;; hyperg-2F1-conj-e -;; hyperg-2F1-renorm -;; hyperg-2F1-renorm-e -;; hyperg-2F1-conj-renorm -;; hyperg-2F1-conj-renorm-e -;; hyperg-2F0 -;; hyperg-2F0-e +;; hyperg-0f1 +(sf-deftest "hyperg-0f1" (1.0d0 0.5d0) 1.5660829297563505373d0 +tol+1+) + +;; hyperg-0f1-e +(sf-deftest-e "hyperg-0f1-e" (1.0d0 0.5d0) + 1.5660829297563505373d0 +tol+1+ gsl:+success+) + +;; hyperg-1f1-int +(sf-deftest "hyperg-1f1-int" (1 1 0.5d0) 1.6487212707001281468d0 +tol0+) + +;; hyperg-1f1-int-e +(sf-deftest-e "hyperg-1f1-int-e" (1 1 0.5d0) + 1.6487212707001281468d0 +tol0+ gsl:+success+) + +;; hyperg-1f1 +(sf-deftest "hyperg-1f1" (1.5d0 2.5d0 1.0d0) 1.8834451238277954398d0 +tol0+) + +;; hyperg-1f1-e +(sf-deftest-e "hyperg-1f1-e" (1.5d0 2.5d0 1.0d0) + 1.8834451238277954398d0 +tol0+ gsl:+success+) + +;; hyperg-u-int +(sf-deftest "hyperg-u-int" (1 1 2.0d0) 0.3613286168882225847d0 +tol0+) + +;; hyperg-u-int-e +(sf-deftest-e "hyperg-u-int-e" (1 1 2.0d0) + 0.3613286168882225847d0 +tol0+ gsl:+success+) + +;; hyperg-u-int-e10-e +;; hyperg-u +(sf-deftest "hyperg-u" (0.0001d0 1.0d0 1.0d0) 0.9999999925484179084d0 +tol+2+) + +;; hyperg-u-e +(sf-deftest-e "hyperg-u-e" (0.0001d0 1.0d0 1.0d0) + 0.9999999925484179084d0 +tol+2+ gsl:+success+) + +;; hyperg-u-e10-e +;; hyperg-2f1 +(sf-deftest "hyperg-2f1" (8.0d0 -8.0d0 1.0d0 0.5d0) + 0.13671875d0 +tol0+) + +;; hyperg-2f1-e +(sf-deftest-e "hyperg-2f1-e" (8.0d0 -8.0d0 1.0d0 0.5d0) + 0.13671875d0 +tol0+ gsl:+success+) + +;; hyperg-2f1-conj +(sf-deftest "hyperg-2f1-conj" (1.0d0 1.0d0 1.0d0 0.5d0) + 3.352857095662929028d0 +tol+2+) + +;; hyperg-2f1-conj-e +(sf-deftest-e "hyperg-2f1-conj-e" (1.0d0 1.0d0 1.0d0 0.5d0) + 3.352857095662929028d0 +tol+2+ gsl:+success+) + +;; hyperg-2f1-renorm +(sf-deftest "hyperg-2f1-renorm" (8.0d0 -8.0d0 1.0d0 0.5d0) + 0.13671875d0 +tol0+) + +;; hyperg-2f1-renorm-e +(sf-deftest-e "hyperg-2f1-renorm-e" (8.0d0 -8.0d0 1.0d0 0.5d0) + 0.13671875d0 +tol0+ gsl:+success+) + +;; hyperg-2f1-conj-renorm +(sf-deftest "hyperg-2f1-conj-renorm" (9.0d0 9.0d0 -1.5d0 -0.99d0) + 0.10834020229476124874d0 +tol0+) + +;; hyperg-2f1-conj-renorm-e +(sf-deftest-e "hyperg-2f1-conj-renorm-e" (9.0d0 9.0d0 -1.5d0 -0.99d0) + 0.10834020229476124874d0 +tol0+ gsl:+success+) + +;; hyperg-2f0 +;; hyperg-2f0-e ;; laguerre-1 (sf-deftest "laguerre-1" (0.5d0 -1.0d0) 2.5d0 +tol0+) From edenny at common-lisp.net Tue Mar 8 03:36:00 2005 From: edenny at common-lisp.net (Edgar Denny) Date: Tue, 8 Mar 2005 04:36:00 +0100 (CET) Subject: [cl-gsl-cvs] CVS update: cl-gsl/ChangeLog Message-ID: <20050308033600.AAFFE88663@common-lisp.net> Update of /project/cl-gsl/cvsroot/cl-gsl In directory common-lisp.net:/tmp/cvs-serv10968 Modified Files: ChangeLog Log Message: *** empty log message *** Date: Tue Mar 8 04:35:59 2005 Author: edenny Index: cl-gsl/ChangeLog diff -u cl-gsl/ChangeLog:1.3 cl-gsl/ChangeLog:1.4 --- cl-gsl/ChangeLog:1.3 Mon Mar 7 03:12:32 2005 +++ cl-gsl/ChangeLog Tue Mar 8 04:35:58 2005 @@ -1,4 +1,10 @@ -2005-03-07 Edgar Denny +2005-03-08 Edgar Denny + + * test/test-sf.lisp: More unit tests added. + + * sf.lisp: Fix typo revealed by unit tests. + +2005-03-07 Edgar Denny * test/test-sf.lisp: Added lots of unit tests. From edenny at common-lisp.net Wed Mar 9 03:10:30 2005 From: edenny at common-lisp.net (Edgar Denny) Date: Wed, 9 Mar 2005 04:10:30 +0100 (CET) Subject: [cl-gsl-cvs] CVS update: cl-gsl/sf.lisp Message-ID: <20050309031030.79DAC88665@common-lisp.net> Update of /project/cl-gsl/cvsroot/cl-gsl In directory common-lisp.net:/tmp/cvs-serv25644 Modified Files: sf.lisp Log Message: Fix bugs detected by unit tests. Date: Wed Mar 9 04:10:29 2005 Author: edenny Index: cl-gsl/sf.lisp diff -u cl-gsl/sf.lisp:1.3 cl-gsl/sf.lisp:1.4 --- cl-gsl/sf.lisp:1.3 Tue Mar 8 04:33:41 2005 +++ cl-gsl/sf.lisp Wed Mar 9 04:10:28 2005 @@ -900,12 +900,16 @@ :int) (defun-wrapper% ("hydrogenicR" hydrogenic-r) - ((z :double) + ((n :int) + (l :int) + (z :double) (r :double)) :double) (defun-wrapper% ("hydrogenicR_e" hydrogenic-r-e) - ((z :double) + ((n :int) + (l :int) + (z :double) (r :double) (result gsl-sf-result-ptr)) :int) @@ -1728,12 +1732,14 @@ (defun-wrapper% "beta_inc" ((a :double) - (b :double)) + (b :double) + (x :double)) :double) (defun-wrapper% "beta_inc_e" ((a :double) (b :double) + (x :double) (result gsl-sf-result-ptr)) :int) From edenny at common-lisp.net Wed Mar 9 03:11:05 2005 From: edenny at common-lisp.net (Edgar Denny) Date: Wed, 9 Mar 2005 04:11:05 +0100 (CET) Subject: [cl-gsl-cvs] CVS update: cl-gsl/test/test-sf.lisp Message-ID: <20050309031105.C63D788665@common-lisp.net> Update of /project/cl-gsl/cvsroot/cl-gsl/test In directory common-lisp.net:/tmp/cvs-serv25663 Modified Files: test-sf.lisp Log Message: Additional unit tests. Date: Wed Mar 9 04:11:04 2005 Author: edenny Index: cl-gsl/test/test-sf.lisp diff -u cl-gsl/test/test-sf.lisp:1.3 cl-gsl/test/test-sf.lisp:1.4 --- cl-gsl/test/test-sf.lisp:1.3 Tue Mar 8 04:34:16 2005 +++ cl-gsl/test/test-sf.lisp Wed Mar 9 04:11:04 2005 @@ -469,9 +469,19 @@ 0.8643791310538927d0 +tol0+ gsl:+success+) ;; hydrogenic-r-1 +(sf-deftest "hydrogenic-r-1" (3.0d0 2.0d0) 0.025759948256148471036d0 +tol0+) + ;; hydrogenic-r-1-e +(sf-deftest-e "hydrogenic-r-1-e" (3.0d0 2.0d0) + 0.025759948256148471036d0 +tol0+ gsl:+success+) + ;; hydrogenic-r +(sf-deftest "hydrogenic-r" (4 2 3.0d0 2.0d0) 0.14583027278668431009d0 +tol0+) + ;; hydrogenic-r-e +(sf-deftest-e "hydrogenic-r-e" (4 2 3.0d0 2.0d0) + 0.14583027278668431009d0 +tol0+ gsl:+success+) + ;; coulomb-CL-e ;; coupling-3j (sf-deftest "coupling-3j" (0 1 1 0 1 -1) (sqrt (/ 1.0d0 2.0d0)) +tol0+) @@ -525,7 +535,11 @@ (sf-deftest-e "debye-4-e" (0.1d0) 0.960555486124335944d0 +tol0+ gsl:+success+) ;; dilog +(sf-deftest "dilog" (0.1d0) 0.1026177910993911d0 +tol0+) + ;; dilog-e +(sf-deftest-e "dilog-e" (0.1d0) 0.1026177910993911d0 +tol0+ gsl:+success+) + ;; multiply-e ;; multiply-err-e ;; ellint-kcomp @@ -791,45 +805,136 @@ ;; fermi-dirac-inc-0 ;; fermi-dirac-inc-0-e ;; gamma +(sf-deftest "gamma" ((+ 1.0d0 (/ 1.0d0 4096.0d0))) + 0.9998591371459403421d0 +tol0+) + ;; gamma-e +(sf-deftest-e "gamma-e" ((+ 1.0d0 (/ 1.0d0 4096.0d0))) + 0.9998591371459403421d0 +tol0+ gsl:+success+) + ;; lngamma +(sf-deftest "lngamma" (-0.1d0) 2.368961332728788655d0 +tol+1+) + ;; lngamma-e +(sf-deftest-e "lngamma-e" (-0.1d0) + 2.368961332728788655d0 +tol+1+ gsl:+success+) + ;; gammastar +(sf-deftest "gammastar" (1.5d0) 1.0563442442685598666d0 +tol0+) + ;; gammastar-e +(sf-deftest-e "gammastar-e" (1.5d0) + 1.0563442442685598666d0 +tol0+ gsl:+success+) + ;; gammainv +(sf-deftest "gammainv" (1.0d0) 1.0d0 +tol0+) + ;; gammainv-e +(sf-deftest-e "gammainv-e" (1.0d0) 1.0d0 +tol0+ gsl:+success+) + ;; taylorcoeff +(sf-deftest "taylorcoeff" (10 5.0d0) 2.6911444554673721340d0 +tol0+) + ;; taylorcoeff-e +(sf-deftest-e "taylorcoeff-e" (10 5.0d0) + 2.6911444554673721340d0 +tol0+ gsl:+success+) + ;; fact +(sf-deftest "fact" (0) 1.0d0 +tol0+) + ;; fact-e +(sf-deftest-e "fact-e" (0) 1.0d0 +tol0+ gsl:+success+) + ;; doublefact +(sf-deftest "doublefact" (0) 1.0d0 +tol0+) + ;; doublefact-e +(sf-deftest-e "doublefact-e" (0) 1.0d0 +tol0+ gsl:+success+) + ;; lnfact +(sf-deftest "lnfact" (7) 8.525161361065414300d0 +tol0+) + ;; lnfact-e +(sf-deftest-e "lnfact-e" (7) 8.525161361065414300d0 +tol0+ gsl:+success+) + ;; lndoublefact +(sf-deftest "lndoublefact" (7) 4.653960350157523371d0 +tol0+) + ;; lndoublefact-e +(sf-deftest-e "lndoublefact-e" (7) 4.653960350157523371d0 +tol0+ gsl:+success+) + ;; choose +(sf-deftest "choose" (7 3) 35.0d0 +tol0+) + ;; choose-e +(sf-deftest-e "choose-e" (7 3) 35.0d0 +tol0+ gsl:+success+) + ;; lnchoose +(sf-deftest "lnchoose" (7 3) 3.555348061489413680d0 +tol+1+) + ;; lnchoose-e +(sf-deftest-e "lnchoose-e" (7 3) 3.555348061489413680d0 +tol+1+ gsl:+success+) + ;; poch +(sf-deftest "poch" (5.0d0 2.0d0) 30.0d0 +tol+2+) + ;; poch-e +(sf-deftest-e "poch-e" (5.0d0 2.0d0) 30.0d0 +tol+2+ gsl:+success+) + ;; lnpoch +(sf-deftest "lnpoch" (5.0d0 2.0d0) 3.401197381662155375d0 +tol+1+) + ;; lnpoch-e +(sf-deftest-e "lnpoch-e" (5.0d0 2.0d0) + 3.401197381662155375d0 +tol+1+ gsl:+success+) + ;; pochrel +(sf-deftest "pochrel" (5.0d0 2.0d0) (/ 29.0d0 2.0d0) +tol+2+) + ;; pochrel-e -;; gamma-inc-Q -;; gamma-inc-Q-e -;; gamma-inc-P -;; gamma-inc-P-e +(sf-deftest-e "pochrel-e" (5.0d0 2.0d0) (/ 29.0d0 2.0d0) +tol+2+ gsl:+success+) + +;; gamma-inc-q +(sf-deftest "gamma-inc-q" (1.0d0 1.01d0) 0.3642189795715233198d0 +tol0+) + +;; gamma-inc-q-e +(sf-deftest-e "gamma-inc-q-e" (1.0d0 1.01d0) + 0.3642189795715233198d0 +tol0+ gsl:+success+) + +;; gamma-inc-p +(sf-deftest "gamma-inc-p" (1.0d0 1.01d0) 0.6357810204284766802d0 +tol0+) + +;; gamma-inc-p-e +(sf-deftest-e "gamma-inc-p-e" (1.0d0 1.01d0) + 0.6357810204284766802d0 +tol0+ gsl:+success+) + ;; gamma-inc +(sf-deftest "gamma-inc" (-0.5d0 0.1d0) 3.4017693366916154163d0 +tol+2+) + ;; gamma-inc-e +(sf-deftest-e "gamma-inc-e" (-0.5d0 0.1d0) + 3.4017693366916154163d0 +tol+2+ gsl:+success+) + ;; beta +(sf-deftest "beta" (1.0d0 5.0d0) 0.2d0 +tol0+) + ;; beta-e +(sf-deftest-e "beta-e" (1.0d0 5.0d0) 0.2d0 +tol0+ gsl:+success+) + ;; lnbeta +(sf-deftest "lnbeta" (0.1d0 0.1d0) 2.9813614810376273949d0 +tol+1+) + ;; lnbeta-e +(sf-deftest-e "lnbeta-e" (0.1d0 0.1d0) + 2.9813614810376273949d0 +tol+1+ gsl:+success+) + ;; beta-inc +(sf-deftest "beta-inc" (0.1d0 1.0d0 0.5d0) 0.9330329915368074160d0 +tol0+) + ;; beta-inc-e +(sf-deftest-e "beta-inc-e" (0.1d0 1.0d0 0.5d0) + 0.9330329915368074160d0 +tol0+ gsl:+success+) + ;; gegenpoly-1 (sf-deftest "gegenpoly-1" (-0.2d0 1.0d0) -0.4d0 +tol0+) @@ -966,45 +1071,133 @@ (sf-deftest-e "lambert-wm1-e" (1.0d0) 0.567143290409783872999969d0 +tol0+ gsl:+success+) -;; legendre-P1 -;; legendre-P2 -;; legendre-P3 -;; legendre-P1-e -;; legendre-P2-e -;; legendre-P3-e -;; legendre-Pl -;; legendre-Pl-e +;; legendre-p1 +(sf-deftest "legendre-p1" (0.5d0) 0.5d0 +tol0+) + +;; legendre-p2 +(sf-deftest "legendre-p2" (0.5d0) -0.125d0 +tol0+) + +;; legendre-p3 +(sf-deftest "legendre-p3" (0.5d0) -0.4375d0 +tol0+) + +;; legendre-p1-e +(sf-deftest-e "legendre-p1-e" (0.5d0) 0.5d0 +tol0+ gsl:+success+) + +;; legendre-p2-e +(sf-deftest-e "legendre-p2-e" (0.5d0) -0.125d0 +tol0+ gsl:+success+) + +;; legendre-p3-e +(sf-deftest-e "legendre-p3-e" (0.5d0) -0.4375d0 +tol0+ gsl:+success+) + +;; legendre-pl +(sf-deftest "legendre-pl" (1 0.5d0) 0.5d0 +tol0+) + +;; legendre-pl-e +(sf-deftest-e "legendre-pl-e" (1 0.5d0) 0.5d0 +tol0+ gsl:+success+) + ;; legendre-Pl-array ;; legendre-Q0 +(sf-deftest "legendre-q0" (-0.5d0) -0.5493061443340548457d0 +tol0+) + ;; legendre-Q0-e +(sf-deftest-e "legendre-q0-e" (-0.5d0) + -0.5493061443340548457d0 +tol0+ gsl:+success+) + ;; legendre-Q1 +(sf-deftest "legendre-q1" (-0.5d0) -0.7253469278329725772d0 +tol+1+) + ;; legendre-Q1-e +(sf-deftest-e "legendre-q1-e" (-0.5d0) + -0.7253469278329725772d0 +tol+1+ gsl:+success+) + ;; legendre-Ql +(sf-deftest "legendre-ql" (10 -0.5d0) -0.29165813966586752393d0 +tol0+) + ;; legendre-Ql-e -;; legendre-Plm -;; legendre-Plm-e -;; legendre-sphPlm -;; legendre-sphPlm-e +(sf-deftest-e "legendre-ql-e" (10 -0.5d0) + -0.29165813966586752393d0 +tol0+ gsl:+success+) + +;; legendre-plm +(sf-deftest "legendre-plm" (10 0 0.5d0) -0.18822860717773437500d0 +tol0+) + +;; legendre-plm-e +(sf-deftest-e "legendre-plm-e" (10 0 0.5d0) + -0.18822860717773437500d0 +tol0+ gsl:+success+) + +;; legendre-sphplm +(sf-deftest "legendre-sphplm" (10 0 0.5d0) -0.24332702369300133776d0 +tol0+) + +;; legendre-sphplm-e +(sf-deftest-e "legendre-sphplm-e" (10 0 0.5d0) + -0.24332702369300133776d0 +tol0+ gsl:+success+) + ;; legendre-array-size -;; conicalP-half -;; conicalP-half-e -;; conicalP-mhalf -;; conicalP-mhalf-e -;; conicalP-0 -;; conicalP-0-e -;; conicalP-1 -;; conicalP-1-e -;; conicalP-sph-reg -;; conicalP-sph-reg-e -;; conicalP-cyl-reg -;; conicalP-cyl-reg-e -;; legendre-H3d-0 -;; legendre-H3d-0-e -;; legendre-H3d-1 -;; legendre-H3d-1-e -;; legendre-H3d -;; legendre-H3d-e -;; legendre-H3d-array +;; conicalp-half +(sf-deftest "conicalp-half" (0.0d0 0.5d0) 0.8573827581049917129d0 +tol0+) + +;; conicalp-half-e +(sf-deftest-e "conicalp-half-e" (0.0d0 0.5d0) + 0.8573827581049917129d0 +tol0+ gsl:+success+) + +;; conicalp-mhalf +(sf-deftest "conicalp-mhalf" (0.0d0 0.5d0) 0.8978491247257322404d0 +tol+1+) + +;; conicalp-mhalf-e +(sf-deftest-e "conicalp-mhalf-e" (0.0d0 0.5d0) + 0.8978491247257322404d0 +tol+1+ gsl:+success+) + +;; conicalp-0 +(sf-deftest "conicalp-0" (0.0d0 0.5d0) 1.0731820071493643751d0 +tol+1+) + +;; conicalp-0-e +(sf-deftest-e "conicalp-0-e" (0.0d0 0.5d0) + 1.0731820071493643751d0 +tol+1+ gsl:+success+) + +;; conicalp-1 +(sf-deftest "conicalp-1" (0.0d0 0.5d0) 0.14933621085538265636d0 +tol0+) + +;; conicalp-1-e +(sf-deftest-e "conicalp-1-e" (0.0d0 0.5d0) + 0.14933621085538265636d0 +tol0+ gsl:+success+) + +;; conicalp-sph-reg +(sf-deftest "conicalp-sph-reg" (2 1.0d0 -0.5d0) + 1.6406279287008789526d0 +tol+1+) + +;; conicalp-sph-reg-e +(sf-deftest-e "conicalp-sph-reg-e" (2 1.0d0 -0.5d0) + 1.6406279287008789526d0 +tol+1+ gsl:+success+) + +;; conicalp-cyl-reg +(sf-deftest "conicalp-cyl-reg" (2 1.0d0 -0.5d0) + 2.2048510472375258708d0 +tol+1+) + +;; conicalp-cyl-reg-e +(sf-deftest-e "conicalp-cyl-reg-e" (2 1.0d0 -0.5d0) + 2.2048510472375258708d0 +tol+1+ gsl:+success+) + +;; legendre-h3d-0 +(sf-deftest "legendre-h3d-0" (1.0d0 1.0d0) 0.7160229153604338713d0 +tol+1+) + +;; legendre-h3d-0-e +(sf-deftest-e "legendre-h3d-0-e" (1.0d0 1.0d0) + 0.7160229153604338713d0 +tol+1+ gsl:+success+) + +;; legendre-h3d-1 +(sf-deftest "legendre-h3d-1" (1.0d0 1.0d0) 0.3397013994799344639d0 +tol0+) + +;; legendre-h3d-1-e +(sf-deftest-e "legendre-h3d-1-e" (1.0d0 1.0d0) + 0.3397013994799344639d0 +tol0+ gsl:+success+) + +;; legendre-h3d +(sf-deftest "legendre-h3d" (5 1.0d0 1.0d0) 0.011498635037491577728d0 +tol0+) + +;; legendre-h3d-e +(sf-deftest-e "legendre-h3d-e" (5 1.0d0 1.0d0) + 0.011498635037491577728d0 +tol0+ gsl:+success+) + +;; legendre-h3d-array ;; log-e ;; log-abs (sf-deftest "log-abs" (-1.1d0) 0.095310179804324860045d0 +tol0+) From edenny at common-lisp.net Wed Mar 9 03:11:52 2005 From: edenny at common-lisp.net (Edgar Denny) Date: Wed, 9 Mar 2005 04:11:52 +0100 (CET) Subject: [cl-gsl-cvs] CVS update: cl-gsl/ChangeLog Message-ID: <20050309031152.4AC7B88665@common-lisp.net> Update of /project/cl-gsl/cvsroot/cl-gsl In directory common-lisp.net:/tmp/cvs-serv25684 Modified Files: ChangeLog Log Message: *** empty log message *** Date: Wed Mar 9 04:11:50 2005 Author: edenny Index: cl-gsl/ChangeLog diff -u cl-gsl/ChangeLog:1.4 cl-gsl/ChangeLog:1.5 --- cl-gsl/ChangeLog:1.4 Tue Mar 8 04:35:58 2005 +++ cl-gsl/ChangeLog Wed Mar 9 04:11:50 2005 @@ -1,3 +1,7 @@ +2005-03-09 Edgar Denny + + * test-sf.lisp: Additional unit tests. + 2005-03-08 Edgar Denny * test/test-sf.lisp: More unit tests added. From edenny at common-lisp.net Sun Mar 13 00:48:26 2005 From: edenny at common-lisp.net (Edgar Denny) Date: Sun, 13 Mar 2005 01:48:26 +0100 (CET) Subject: [cl-gsl-cvs] CVS update: cl-gsl/poly.lisp Message-ID: <20050313004826.4009B884E2@common-lisp.net> Update of /project/cl-gsl/cvsroot/cl-gsl In directory common-lisp.net:/tmp/cvs-serv17913 Modified Files: poly.lisp Log Message: Added divided difference functions. Date: Sun Mar 13 01:48:25 2005 Author: edenny Index: cl-gsl/poly.lisp diff -u cl-gsl/poly.lisp:1.1.1.1 cl-gsl/poly.lisp:1.2 --- cl-gsl/poly.lisp:1.1.1.1 Wed Mar 2 02:04:53 2005 +++ cl-gsl/poly.lisp Sun Mar 13 01:48:25 2005 @@ -170,72 +170,72 @@ (ret-val)) (setq ret-val (gsl-poly-complex-solve a-ptr len w z-ptr)) (gsl-poly-complex-workspace-free w) - (prog1 - ;; FIXME: where is ret-val in result? + (multiple-value-prog1 (values (complex-packed-array->lisp-vec z-ptr (* 2 (1- len))) ret-val) (uffi:free-foreign-object z-ptr)))) ;; ---------------------------------------------------------------------- -;; (defun-foreign "gsl_poly_dd_int" -;; ((dd double-ptr) -;; (xa double-ptr) -;; (ya double-ptr) -;; (size :unsigned-long)) -;; :int) - -;; (defun-foreign "gsl_poly_dd_eval" -;; ((dd double-ptr) -;; (xa double-ptr) -;; (size :unsigned-long) -;; (x :double)) -;; :double) - -;; (defun-foreign "gsl_poly_dd_taylor" -;; ((c double-ptr) -;; (xp :double) -;; (dd double-ptr) -;; (xa double-ptr) -;; (size :unsigned-long) -;; (w double-ptr)) -;; :int) - - -;; (defun dd-int (xa ya) -;; (let* ((xa-ptr (lisp-vec->c-array xa)) -;; (ya-ptr (lisp-vec->c-array ya)) -;; (len (length xa)) -;; (dd-ptr (uffi:allocate-foreign-object :double len)) -;; (ret-val)) -;; (setq ret-val (gsl-poly-dd-init dd-ptr xa-ptr ya-ptr len)) - - - -;; Function: int gsl_poly_dd_init (double dd[], const double xa[], const double ya[], size_t size) -;; This function computes a divided-difference representation of the interpolating polynomial for the points (xa, ya) stored in the arrays xa and ya of length size. -;; On output the divided-differences of (xa,ya) are stored in the array dd, also of length size. - -;; Function: double gsl_poly_dd_eval (const double dd[], const double xa[], const size_t size, const double x) -;; This function evaluates the polynomial stored in divided-difference form in the arrays dd and xa of length size at the point x. - -;; Function: int gsl_poly_dd_taylor (double c[], double xp, const double dd[], const double xa[], size_t size, double w[]) -;; This function converts the divided-difference representation of a polynomial to a Taylor expansion. The divided-difference representation is supplied in the -;; arrays dd and xa of length size. On output the Taylor coefficients of the polynomial expanded about the point xp are stored in the array c also of length size. A -;; workspace of length size must be provided in the array w. - - - +(defun-foreign "gsl_poly_dd_init" + ((dd double-ptr) + (xa double-ptr) + (ya double-ptr) + (size :unsigned-long)) + :int) + +(defun dd-init (xa ya) + (let* ((xa-ptr (lisp-vec->c-array xa)) + (ya-ptr (lisp-vec->c-array ya)) + (len (length xa)) + (dd-ptr (uffi:allocate-foreign-object :double len)) + (ret-val)) + (setq ret-val (gsl-poly-dd-init dd-ptr xa-ptr ya-ptr len)) + (multiple-value-prog1 + (values (c-array->lisp-vec dd-ptr len) ret-val) + (uffi:free-foreign-object xa-ptr) + (uffi:free-foreign-object ya-ptr) + (uffi:free-foreign-object dd-ptr)))) +;; ---------------------------------------------------------------------- -;; #define GSL_REAL(z) ((z).dat[0]) -;; #define GSL_IMAG(z) ((z).dat[1]) -;; #define GSL_COMPLEX_P(zp) ((zp)->dat) -;; #define GSL_COMPLEX_P_REAL(zp) ((zp)->dat[0]) -;; #define GSL_COMPLEX_P_IMAG(zp) ((zp)->dat[1]) -;; #define GSL_COMPLEX_EQ(z1,z2) (((z1).dat[0] == (z2).dat[0]) && ((z1).dat[1] == (z2).dat[1])) +(defun-foreign "gsl_poly_dd_eval" + ((dd double-ptr) + (xa double-ptr) + (size :unsigned-long) + (x :double)) + :double) + +(defun dd-eval (dd xa x) + (let ((dd-ptr (lisp-vec->c-array dd)) + (xa-ptr (lisp-vec->c-array xa)) + (len (length dd))) + (prog1 + (gsl-poly-dd-eval dd-ptr xa-ptr len x) + (uffi:free-foreign-object xa-ptr) + (uffi:free-foreign-object dd-ptr)))) -;; #define GSL_SET_COMPLEX(zp,x,y) do {(zp)->dat[0]=(x); (zp)->dat[1]=(y);} while(0) -;; #define GSL_SET_REAL(zp,x) do {(zp)->dat[0]=(x);} while(0) -;; #define GSL_SET_IMAG(zp,y) do {(zp)->dat[1]=(y);} while(0) +;; ---------------------------------------------------------------------- -;; #define GSL_SET_COMPLEX_PACKED(zp,n,x,y) do {*((zp)+2*(n))=(x); *((zp)+(2*(n)+1))=(y);} while(0) +(defun-foreign "gsl_poly_dd_taylor" + ((c double-ptr) + (xp :double) + (dd double-ptr) + (xa double-ptr) + (size :unsigned-long) + (w double-ptr)) + :int) + +(defun dd-taylor (xp dd xa) + (let* ((dd-ptr (lisp-vec->c-array dd)) + (xa-ptr (lisp-vec->c-array xa)) + (len (length dd)) + (w-ptr (uffi:allocate-foreign-object :double len)) + (c-ptr (uffi:allocate-foreign-object :double len)) + (ret-val)) + (setq ret-val (gsl-poly-dd-taylor c-ptr xp dd-ptr xa-ptr len w-ptr)) + (multiple-value-prog1 + (values (c-array->lisp-vec c-ptr len) ret-val) + (uffi:free-foreign-object w-ptr) + (uffi:free-foreign-object xa-ptr) + (uffi:free-foreign-object dd-ptr) + (uffi:free-foreign-object c-ptr)))) From edenny at common-lisp.net Sun Mar 13 00:49:36 2005 From: edenny at common-lisp.net (Edgar Denny) Date: Sun, 13 Mar 2005 01:49:36 +0100 (CET) Subject: [cl-gsl-cvs] CVS update: cl-gsl/test/cl-gsl-test.asd Message-ID: <20050313004936.BCA75884E2@common-lisp.net> Update of /project/cl-gsl/cvsroot/cl-gsl/test In directory common-lisp.net:/tmp/cvs-serv17936 Modified Files: cl-gsl-test.asd Log Message: Added tolerance and test-poly files to the dependencies. Date: Sun Mar 13 01:49:36 2005 Author: edenny Index: cl-gsl/test/cl-gsl-test.asd diff -u cl-gsl/test/cl-gsl-test.asd:1.1.1.1 cl-gsl/test/cl-gsl-test.asd:1.2 --- cl-gsl/test/cl-gsl-test.asd:1.1.1.1 Wed Mar 2 02:04:53 2005 +++ cl-gsl/test/cl-gsl-test.asd Sun Mar 13 01:49:36 2005 @@ -32,5 +32,7 @@ :depends-on (:clunit :cl-gsl) :components ((:file "package") - (:file "test-sf" :depends-on ("package")) + (:file "tolerance" :depends-on ("package")) + (:file "test-sf" :depends-on ("tolerance")) + (:file "test-poly" :depends-on ("tolerance")) )) From edenny at common-lisp.net Sun Mar 13 00:50:50 2005 From: edenny at common-lisp.net (Edgar Denny) Date: Sun, 13 Mar 2005 01:50:50 +0100 (CET) Subject: [cl-gsl-cvs] CVS update: cl-gsl/test/test-sf.lisp Message-ID: <20050313005050.7F77F884E2@common-lisp.net> Update of /project/cl-gsl/cvsroot/cl-gsl/test In directory common-lisp.net:/tmp/cvs-serv17962 Modified Files: test-sf.lisp Log Message: Moved tolerance functions to a separate file. Date: Sun Mar 13 01:50:49 2005 Author: edenny Index: cl-gsl/test/test-sf.lisp diff -u cl-gsl/test/test-sf.lisp:1.4 cl-gsl/test/test-sf.lisp:1.5 --- cl-gsl/test/test-sf.lisp:1.4 Wed Mar 9 04:11:04 2005 +++ cl-gsl/test/test-sf.lisp Sun Mar 13 01:50:49 2005 @@ -19,20 +19,7 @@ (in-package #:cl-gsl-test) -(defconstant +dbl-epsilon+ 2.2204460492503131d-16) - -(defconstant +tol0+ (/ +dbl-epsilon+ 2.0d0)) -(defconstant +tol+1+ (* +tol0+ 10.0d0)) -(defconstant +tol-1+ (/ +tol0+ 10.0d0)) -(defconstant +tol+2+ (* +tol0+ 100.0d0)) -(defconstant +tol-2+ (/ +tol0+ 100.0d0)) -(defconstant +tol+3+ (* +tol0+ 1000.0d0)) -(defconstant +tol-3+ (/ +tol0+ 1000.0d0)) - (defconstant +sf+ "sf") - -(defun tol< (x y tol) - (< (abs (- x y)) tol)) (defmacro sf-deftest (func-name-str param-list result tolerance) `(deftest ,func-name-str :category +sf+ From edenny at common-lisp.net Sun Mar 13 00:52:03 2005 From: edenny at common-lisp.net (Edgar Denny) Date: Sun, 13 Mar 2005 01:52:03 +0100 (CET) Subject: [cl-gsl-cvs] CVS update: cl-gsl/test/test-poly.lisp Message-ID: <20050313005203.E202A884E2@common-lisp.net> Update of /project/cl-gsl/cvsroot/cl-gsl/test In directory common-lisp.net:/tmp/cvs-serv17987 Added Files: test-poly.lisp Log Message: Initial checkin. Date: Sun Mar 13 01:52:02 2005 Author: edenny From edenny at common-lisp.net Sun Mar 13 00:52:45 2005 From: edenny at common-lisp.net (Edgar Denny) Date: Sun, 13 Mar 2005 01:52:45 +0100 (CET) Subject: [cl-gsl-cvs] CVS update: cl-gsl/test/tolerance.lisp Message-ID: <20050313005245.A88B0884E2@common-lisp.net> Update of /project/cl-gsl/cvsroot/cl-gsl/test In directory common-lisp.net:/tmp/cvs-serv18007 Added Files: tolerance.lisp Log Message: Initial checkin. Date: Sun Mar 13 01:52:44 2005 Author: edenny From edenny at common-lisp.net Sun Mar 13 00:55:32 2005 From: edenny at common-lisp.net (Edgar Denny) Date: Sun, 13 Mar 2005 01:55:32 +0100 (CET) Subject: [cl-gsl-cvs] CVS update: cl-gsl/ChangeLog Message-ID: <20050313005532.8F450884E2@common-lisp.net> Update of /project/cl-gsl/cvsroot/cl-gsl In directory common-lisp.net:/tmp/cvs-serv18042 Modified Files: ChangeLog Log Message: *** empty log message *** Date: Sun Mar 13 01:55:30 2005 Author: edenny Index: cl-gsl/ChangeLog diff -u cl-gsl/ChangeLog:1.5 cl-gsl/ChangeLog:1.6 --- cl-gsl/ChangeLog:1.5 Wed Mar 9 04:11:50 2005 +++ cl-gsl/ChangeLog Sun Mar 13 01:55:30 2005 @@ -1,3 +1,12 @@ +2005-03-13 Edgar Denny + + * tolerance.lisp, test-poly.lisp: Initial checkin. + + * test-sf.lisp: Moved tolerance functions to a separate file. + + * cl-gsl-test.asd: + Added tolerance and test-poly files to the dependencies. + 2005-03-09 Edgar Denny * test-sf.lisp: Additional unit tests. From edenny at common-lisp.net Tue Mar 15 03:15:22 2005 From: edenny at common-lisp.net (Edgar Denny) Date: Tue, 15 Mar 2005 04:15:22 +0100 (CET) Subject: [cl-gsl-cvs] CVS update: cl-gsl/ffi.lisp Message-ID: <20050315031522.E5C1288441@common-lisp.net> Update of /project/cl-gsl/cvsroot/cl-gsl In directory common-lisp.net:/tmp/cvs-serv30766 Modified Files: ffi.lisp Log Message: Changes needed for complex vectors. Date: Tue Mar 15 04:15:21 2005 Author: edenny Index: cl-gsl/ffi.lisp diff -u cl-gsl/ffi.lisp:1.2 cl-gsl/ffi.lisp:1.3 --- cl-gsl/ffi.lisp:1.2 Fri Mar 4 02:52:38 2005 +++ cl-gsl/ffi.lisp Tue Mar 15 04:15:20 2005 @@ -121,12 +121,12 @@ (def-foreign-struct gsl-block-complex (size :unsigned-long) - (data (* gsl-complex))) + (data (* :double))) (def-foreign-struct gsl-vector-complex (size :unsigned-long) (stride :unsigned-long) - (data (* gsl-complex)) + (data (* :double)) (g-block (* gsl-block-complex)) (owner :int)) @@ -137,12 +137,12 @@ (def-foreign-struct gsl-block-complex-float (size :unsigned-long) - (data (* gsl-complex-float))) + (data (* :float))) (def-foreign-struct gsl-vector-complex-float (size :unsigned-long) (stride :unsigned-long) - (data (* gsl-complex-float)) + (data (* :float)) (g-block (* gsl-block-complex-float)) (owner :int)) @@ -200,15 +200,15 @@ ;; ---------------------------------------------------------------------- -(defun gsl-complex->complex (z) - (declare (gsl-complex-def z)) - (let ((dat-array (uffi:get-slot-value z (:array :double) 'cl-gsl::dat))) +(defun gsl-complex->complex (z-ptr) + ;; TODO: this seems to work with pointers and values +;; (declare (gsl-complex-def z)) + (let ((dat-array (uffi:get-slot-value z-ptr '(:array :double) 'cl-gsl::dat))) (complex (uffi:deref-array dat-array :double 0) (uffi:deref-array dat-array :double 1)))) -(defun gsl-complex-float->complex (z) - (declare (gsl-complex-float-def z)) - (let ((dat-array (uffi:get-slot-value z (:array :float) 'cl-gsl::dat))) +(defun gsl-complex-float->complex (z-ptr) + (let ((dat-array (uffi:get-slot-value z-ptr '(:array :float) 'cl-gsl::dat))) (complex (uffi:deref-array dat-array :float 0) (uffi:deref-array dat-array :float 1)))) @@ -216,19 +216,19 @@ ;; How do we free it? ;; Replace with a with-complex->gsl-complex macro that cleans up after ;; itself -(defun complex->gsl-complex (z) +(defun complex->gsl-complex-ptr (z) (let* ((z-ptr (uffi:allocate-foreign-object 'gsl-complex)) - (dat-array (uffi:get-slot-value z-ptr (:array :float) 'cl-gsl::dat))) + (dat-array (uffi:get-slot-value z-ptr '(:array :double) 'cl-gsl::dat))) (setf (uffi:deref-array dat-array :double 0) (realpart z)) (setf (uffi:deref-array dat-array :double 1) (imagpart z)) z-ptr)) ;; FIXME: see above -(defun complex->gsl-complex-float (z) +(defun complex->gsl-complex-float-ptr (z) (let* ((z-ptr (uffi:allocate-foreign-object 'gsl-complex-float)) - (dat-array (uffi:get-slot-value z-ptr (:array :float) 'cl-gsl::dat))) - (setf (uffi:deref-array dat-array :double 0) (realpart z)) - (setf (uffi:deref-array dat-array :double 1) (imagpart z)) + (dat-array (uffi:get-slot-value z-ptr '(:array :float) 'cl-gsl::dat))) + (setf (uffi:deref-array dat-array :float 0) (realpart z)) + (setf (uffi:deref-array dat-array :float 1) (imagpart z)) z-ptr)) From edenny at common-lisp.net Tue Mar 15 03:15:59 2005 From: edenny at common-lisp.net (Edgar Denny) Date: Tue, 15 Mar 2005 04:15:59 +0100 (CET) Subject: [cl-gsl-cvs] CVS update: cl-gsl/package.lisp Message-ID: <20050315031559.D379088441@common-lisp.net> Update of /project/cl-gsl/cvsroot/cl-gsl In directory common-lisp.net:/tmp/cvs-serv31046 Modified Files: package.lisp Log Message: Changes needed for complex vectors. Date: Tue Mar 15 04:15:57 2005 Author: edenny Index: cl-gsl/package.lisp diff -u cl-gsl/package.lisp:1.2 cl-gsl/package.lisp:1.3 --- cl-gsl/package.lisp:1.2 Fri Mar 4 02:55:10 2005 +++ cl-gsl/package.lisp Tue Mar 15 04:15:57 2005 @@ -40,8 +40,8 @@ #:gsl-complex-float->complex #:lisp-vec->c-array #:complex-packed-array->lisp-vec - #:complex->gsl-complex - #:complex->gsl-complex-float + #:complex->gsl-complex-ptr + #:complex->gsl-complex-float-ptr #:c-array->lisp-vec #:defconstant-export #:register-constants @@ -94,6 +94,10 @@ (:nicknames #:gsl-vector) (:use #:cl #:cl-gsl) (:export + #:gsl-vec-size + #:gsl-vec-element-type + #:gsl-vec-ptr + #:free #:make-vector #:get-element From edenny at common-lisp.net Tue Mar 15 03:17:30 2005 From: edenny at common-lisp.net (Edgar Denny) Date: Tue, 15 Mar 2005 04:17:30 +0100 (CET) Subject: [cl-gsl-cvs] CVS update: cl-gsl/vector.lisp Message-ID: <20050315031730.7765F88441@common-lisp.net> Update of /project/cl-gsl/cvsroot/cl-gsl In directory common-lisp.net:/tmp/cvs-serv31424 Modified Files: vector.lisp Log Message: Can now actually set and get values from complex vectors. Bindings are still leaky though. Date: Tue Mar 15 04:17:29 2005 Author: edenny Index: cl-gsl/vector.lisp diff -u cl-gsl/vector.lisp:1.3 cl-gsl/vector.lisp:1.4 --- cl-gsl/vector.lisp:1.3 Sat Mar 5 05:31:41 2005 +++ cl-gsl/vector.lisp Tue Mar 15 04:17:29 2005 @@ -231,6 +231,38 @@ ,type-ptr)))) +(defun-foreign "gsl_vector_complex_float_ptr" + ((v gsl-vector-complex-float-ptr) + (i size-t)) + (* gsl-complex-float)) + +(defun-foreign "gsl_vector_complex_ptr" + ((v gsl-vector-complex-ptr) + (i size-t)) + (* gsl-complex)) + +(defun-foreign "wrap_gsl_vector_complex_float_set" + ((v gsl-vector-complex-float-ptr) + (i size-t) + (z (* gsl-complex-float))) + :void) + +(defun-foreign "wrap_gsl_vector_complex_set" + ((v gsl-vector-complex-ptr) + (i size-t) + (z (* gsl-complex))) + :void) + +(defun-foreign "wrap_gsl_vector_complex_float_set_all" + ((v gsl-vector-complex-float-ptr) + (z (* gsl-complex-float))) + :void) + +(defun-foreign "wrap_gsl_vector_complex_set_all" + ((v gsl-vector-complex-ptr) + (z (* gsl-complex))) + :void) + (def-vector-type-funcs% double-float) (def-vector-type-funcs% single-float) (def-vector-type-funcs% integer) @@ -292,10 +324,10 @@ ((eq (gsl-vec-element-type v) 'double-float) (gsl-vector-get (gsl-vec-ptr v) i)) ((equal (gsl-vec-element-type v) '(complex (single-float))) - (gsl-complex-float->complex (gsl-vector-complex-float-get - (gsl-vec-ptr v) i))) + (gsl-complex-float->complex + (gsl-vector-complex-float-ptr (gsl-vec-ptr v) i))) ((equal (gsl-vec-element-type v) '(complex (double-float))) - (gsl-complex->complex (gsl-vector-complex-get (gsl-vec-ptr v) i))) + (gsl-complex->complex (gsl-vector-complex-ptr (gsl-vec-ptr v) i))) (t (error "No matching type")))) @@ -313,10 +345,11 @@ ((eq (gsl-vec-element-type v) 'double-float) (gsl-vector-set (gsl-vec-ptr v) i x)) ((equal (gsl-vec-element-type v) '(complex (single-float))) - (gsl-vector-complex-float-set (gsl-vec-ptr v) i - (complex->gsl-complex-float x))) + (wrap-gsl-vector-complex-float-set (gsl-vec-ptr v) i + (complex->gsl-complex-float-ptr x))) ((equal (gsl-vec-element-type v) '(complex (double-float))) - (gsl-vector-complex-set (gsl-vec-ptr v) i (complex->gsl-complex x))) + (wrap-gsl-vector-complex-set (gsl-vec-ptr v) i + (complex->gsl-complex-ptr x))) (t (error "No matching type")))) @@ -332,10 +365,11 @@ ((eq (gsl-vec-element-type v) 'double-float) (gsl-vector-set-all (gsl-vec-ptr v) x)) ((equal (gsl-vec-element-type v) '(complex (single-float))) - (gsl-vector-complex-float-set-all (gsl-vec-ptr v) - (complex->gsl-complex-float x))) + (wrap-gsl-vector-complex-float-set-all (gsl-vec-ptr v) + (complex->gsl-complex-float-ptr x))) ((equal (gsl-vec-element-type v) '(complex (double-float))) - (gsl-vector-complex-set-all (gsl-vec-ptr v) (complex->gsl-complex x))) + (wrap-gsl-vector-complex-set-all (gsl-vec-ptr v) + (complex->gsl-complex-ptr x))) (t (error "No matching type")))) @@ -369,11 +403,9 @@ ((eq (gsl-vec-element-type v) 'double-float) (gsl-vector-set-basis (gsl-vec-ptr v) i)) ((equal (gsl-vec-element-type v) '(complex (single-float))) - (gsl-vector-complex-float-set-basis (gsl-vec-ptr v) - (complex->gsl-complex-float i))) + (gsl-vector-complex-float-set-basis (gsl-vec-ptr v) i)) ((equal (gsl-vec-element-type v) '(complex (double-float))) - (gsl-vector-complex-set-basis (gsl-vec-ptr v) - (complex->gsl-complex i))) + (gsl-vector-complex-set-basis (gsl-vec-ptr v) i)) (t (error "No matching type")))) @@ -864,3 +896,4 @@ ;; Function: gsl_vector_view gsl_vector_view_array_with_stride (double * base, size_t stride, size_t n) ;; Function: gsl_vector_const_view gsl_vector_const_view_array_with_stride (const double * base, size_t stride, size_t n) + From edenny at common-lisp.net Tue Mar 15 03:19:14 2005 From: edenny at common-lisp.net (Edgar Denny) Date: Tue, 15 Mar 2005 04:19:14 +0100 (CET) Subject: [cl-gsl-cvs] CVS update: cl-gsl/c/cwrapperstub.c Message-ID: <20050315031914.34D8688441@common-lisp.net> Update of /project/cl-gsl/cvsroot/cl-gsl/c In directory common-lisp.net:/tmp/cvs-serv31440 Modified Files: cwrapperstub.c Log Message: Added wrappers for getting and setting complex vectors. UFFI seems to require pointers to foreign structures. Date: Tue Mar 15 04:19:10 2005 Author: edenny Index: cl-gsl/c/cwrapperstub.c diff -u cl-gsl/c/cwrapperstub.c:1.2 cl-gsl/c/cwrapperstub.c:1.3 --- cl-gsl/c/cwrapperstub.c:1.2 Fri Mar 4 02:58:57 2005 +++ cl-gsl/c/cwrapperstub.c Tue Mar 15 04:19:08 2005 @@ -502,3 +502,34 @@ ret = &v_view.vector; return ret; } + +/* ----------------------------------------------------------------- */ + +void wrap_gsl_vector_complex_float_set(gsl_vector_complex_float *v, + const size_t i, + gsl_complex_float *z) +{ + v->data[2 * i * v->stride] = z->dat[0]; + v->data[(2 * i * v->stride) + 1] = z->dat[1]; +} + +void wrap_gsl_vector_complex_set(gsl_vector_complex *v, + const size_t i, + gsl_complex *z) +{ + v->data[2 * i * v->stride] = z->dat[0]; + v->data[(2 * i * v->stride) + 1] = z->dat[1]; +} + +void wrap_gsl_vector_complex_set_all(gsl_vector_complex *v, + gsl_complex *z) +{ + gsl_vector_complex_set_all(v , *z); +} + +void wrap_gsl_vector_complex_float_set_all(gsl_vector_complex_float *v, + gsl_complex_float *z) +{ + gsl_vector_complex_float_set_all(v , *z); +} + From edenny at common-lisp.net Tue Mar 15 03:20:58 2005 From: edenny at common-lisp.net (Edgar Denny) Date: Tue, 15 Mar 2005 04:20:58 +0100 (CET) Subject: [cl-gsl-cvs] CVS update: cl-gsl/test/cl-gsl-test.asd Message-ID: <20050315032058.005C288441@common-lisp.net> Update of /project/cl-gsl/cvsroot/cl-gsl/test In directory common-lisp.net:/tmp/cvs-serv31467 Modified Files: cl-gsl-test.asd Log Message: Add test-vector to list of files in defsystem. Date: Tue Mar 15 04:20:58 2005 Author: edenny Index: cl-gsl/test/cl-gsl-test.asd diff -u cl-gsl/test/cl-gsl-test.asd:1.2 cl-gsl/test/cl-gsl-test.asd:1.3 --- cl-gsl/test/cl-gsl-test.asd:1.2 Sun Mar 13 01:49:36 2005 +++ cl-gsl/test/cl-gsl-test.asd Tue Mar 15 04:20:57 2005 @@ -35,4 +35,5 @@ (:file "tolerance" :depends-on ("package")) (:file "test-sf" :depends-on ("tolerance")) (:file "test-poly" :depends-on ("tolerance")) + (:file "test-vector" :depends-on ("tolerance")) )) From edenny at common-lisp.net Tue Mar 15 03:21:52 2005 From: edenny at common-lisp.net (Edgar Denny) Date: Tue, 15 Mar 2005 04:21:52 +0100 (CET) Subject: [cl-gsl-cvs] CVS update: cl-gsl/test/test-vector.lisp Message-ID: <20050315032152.A6F1288441@common-lisp.net> Update of /project/cl-gsl/cvsroot/cl-gsl/test In directory common-lisp.net:/tmp/cvs-serv31491 Added Files: test-vector.lisp Log Message: Initial checkin. Date: Tue Mar 15 04:21:50 2005 Author: edenny From edenny at common-lisp.net Tue Mar 15 03:23:17 2005 From: edenny at common-lisp.net (Edgar Denny) Date: Tue, 15 Mar 2005 04:23:17 +0100 (CET) Subject: [cl-gsl-cvs] CVS update: cl-gsl/ChangeLog Message-ID: <20050315032317.3F2B788441@common-lisp.net> Update of /project/cl-gsl/cvsroot/cl-gsl In directory common-lisp.net:/tmp/cvs-serv31513 Modified Files: ChangeLog Log Message: *** empty log message *** Date: Tue Mar 15 04:23:16 2005 Author: edenny Index: cl-gsl/ChangeLog diff -u cl-gsl/ChangeLog:1.6 cl-gsl/ChangeLog:1.7 --- cl-gsl/ChangeLog:1.6 Sun Mar 13 01:55:30 2005 +++ cl-gsl/ChangeLog Tue Mar 15 04:23:15 2005 @@ -1,3 +1,19 @@ +2005-03-15 Edgar Denny + + * test/test-vector.lisp: Initial checkin. + + * test/cl-gsl-test.asd: Add test-vector to list of files in defsystem. + + * c/cwrapperstub.c: + Added wrappers for getting and setting complex vectors. UFFI seems to + require pointers to foreign structures. + + * vector.lisp: + Can now actually set and get values from complex vectors. Bindings are + still leaky though. + + * package.lisp, ffi.lisp: Changes needed for complex vectors. + 2005-03-13 Edgar Denny * tolerance.lisp, test-poly.lisp: Initial checkin. From edenny at common-lisp.net Mon Mar 21 03:44:32 2005 From: edenny at common-lisp.net (Edgar Denny) Date: Mon, 21 Mar 2005 04:44:32 +0100 (CET) Subject: [cl-gsl-cvs] CVS update: cl-gsl/doc/sf.tex Message-ID: <20050321034432.00E4D886FB@common-lisp.net> Update of /project/cl-gsl/cvsroot/cl-gsl/doc In directory common-lisp.net:/tmp/cvs-serv15708 Added Files: sf.tex Log Message: Initial checkin. Date: Mon Mar 21 04:44:32 2005 Author: edenny From edenny at common-lisp.net Mon Mar 21 03:53:14 2005 From: edenny at common-lisp.net (Edgar Denny) Date: Mon, 21 Mar 2005 04:53:14 +0100 (CET) Subject: [cl-gsl-cvs] CVS update: cl-gsl/doc/Makefile Message-ID: <20050321035314.AE6B3886FB@common-lisp.net> Update of /project/cl-gsl/cvsroot/cl-gsl/doc In directory common-lisp.net:/tmp/cvs-serv16534 Added Files: Makefile Log Message: Initial checkin. Date: Mon Mar 21 04:53:13 2005 Author: edenny From edenny at common-lisp.net Mon Mar 21 03:53:57 2005 From: edenny at common-lisp.net (Edgar Denny) Date: Mon, 21 Mar 2005 04:53:57 +0100 (CET) Subject: [cl-gsl-cvs] CVS update: cl-gsl/ChangeLog Message-ID: <20050321035357.65066886FB@common-lisp.net> Update of /project/cl-gsl/cvsroot/cl-gsl In directory common-lisp.net:/tmp/cvs-serv16561 Modified Files: ChangeLog Log Message: *** empty log message *** Date: Mon Mar 21 04:53:56 2005 Author: edenny Index: cl-gsl/ChangeLog diff -u cl-gsl/ChangeLog:1.7 cl-gsl/ChangeLog:1.8 --- cl-gsl/ChangeLog:1.7 Tue Mar 15 04:23:15 2005 +++ cl-gsl/ChangeLog Mon Mar 21 04:53:56 2005 @@ -1,3 +1,7 @@ +2005-03-21 Edgar Denny + + * Makefile, sf.tex: Initial checkin. + 2005-03-15 Edgar Denny * test/test-vector.lisp: Initial checkin. From edenny at common-lisp.net Wed Mar 23 03:00:35 2005 From: edenny at common-lisp.net (Edgar Denny) Date: Wed, 23 Mar 2005 04:00:35 +0100 (CET) Subject: [cl-gsl-cvs] CVS update: cl-gsl/doc/poly.tex Message-ID: <20050323030035.570C988678@common-lisp.net> Update of /project/cl-gsl/cvsroot/cl-gsl/doc In directory common-lisp.net:/tmp/cvs-serv16882 Added Files: poly.tex Log Message: Initial checkin. Date: Wed Mar 23 04:00:29 2005 Author: edenny From edenny at common-lisp.net Thu Mar 24 01:48:26 2005 From: edenny at common-lisp.net (Edgar Denny) Date: Thu, 24 Mar 2005 02:48:26 +0100 (CET) Subject: [cl-gsl-cvs] CVS update: cl-gsl/doc/math.tex Message-ID: <20050324014826.B669088671@common-lisp.net> Update of /project/cl-gsl/cvsroot/cl-gsl/doc In directory common-lisp.net:/tmp/cvs-serv31820 Added Files: math.tex Log Message: Initial checkin. Date: Thu Mar 24 02:48:25 2005 Author: edenny From edenny at common-lisp.net Thu Mar 24 01:50:46 2005 From: edenny at common-lisp.net (Edgar Denny) Date: Thu, 24 Mar 2005 02:50:46 +0100 (CET) Subject: [cl-gsl-cvs] CVS update: cl-gsl/ChangeLog Message-ID: <20050324015046.1C04F88671@common-lisp.net> Update of /project/cl-gsl/cvsroot/cl-gsl In directory common-lisp.net:/tmp/cvs-serv31859 Modified Files: ChangeLog Log Message: *** empty log message *** Date: Thu Mar 24 02:50:46 2005 Author: edenny Index: cl-gsl/ChangeLog diff -u cl-gsl/ChangeLog:1.8 cl-gsl/ChangeLog:1.9 --- cl-gsl/ChangeLog:1.8 Mon Mar 21 04:53:56 2005 +++ cl-gsl/ChangeLog Thu Mar 24 02:50:45 2005 @@ -1,6 +1,14 @@ +2005-03-24 Edgar Denny + + * doc/math.tex: Initial checkin. + +2005-03-23 Edgar Denny + + * doc/poly.tex: Initial checkin. + 2005-03-21 Edgar Denny - * Makefile, sf.tex: Initial checkin. + * doc/Makefile, doc/sf.tex: Initial checkin. 2005-03-15 Edgar Denny From edenny at common-lisp.net Thu Mar 24 03:47:27 2005 From: edenny at common-lisp.net (Edgar Denny) Date: Thu, 24 Mar 2005 04:47:27 +0100 (CET) Subject: [cl-gsl-cvs] CVS update: cl-gsl/doc/poly.tex Message-ID: <20050324034727.424C488671@common-lisp.net> Update of /project/cl-gsl/cvsroot/cl-gsl/doc In directory common-lisp.net:/tmp/cvs-serv5983 Modified Files: poly.tex Log Message: Fix 's. Date: Thu Mar 24 04:47:26 2005 Author: edenny Index: cl-gsl/doc/poly.tex diff -u cl-gsl/doc/poly.tex:1.1 cl-gsl/doc/poly.tex:1.2 --- cl-gsl/doc/poly.tex:1.1 Wed Mar 23 04:00:20 2005 +++ cl-gsl/doc/poly.tex Thu Mar 24 04:47:25 2005 @@ -34,15 +34,16 @@ This function evaluates the polynomial \(c_0 + c_1 x + c_2 x^2 + \dots + c_{len-1} x^{len-1}\) -using Horner\'s method for stability. \texttt{coeff-list} is a list +using Horner's method for stability. \texttt{coeff-list} is a list of the coefficients. \subsection*{6.2 Divided Difference Representation of Polynomials} -The functions described here manipulate polynomials stored in Newton\'s +The functions described here manipulate polynomials stored in Newton's divided-difference representation. The use of divided-differences is described in Abramowitz \& Stegun sections 25.1.4 and 25.2.26. + \func{dd-init}{ x-list y-list => dd-list, status} From edenny at common-lisp.net Thu Mar 24 03:48:44 2005 From: edenny at common-lisp.net (Edgar Denny) Date: Thu, 24 Mar 2005 04:48:44 +0100 (CET) Subject: [cl-gsl-cvs] CVS update: cl-gsl/doc/sf.tex Message-ID: <20050324034844.16A5388671@common-lisp.net> Update of /project/cl-gsl/cvsroot/cl-gsl/doc In directory common-lisp.net:/tmp/cvs-serv6348 Modified Files: sf.tex Log Message: Convert more of the math to images. Date: Thu Mar 24 04:48:43 2005 Author: edenny Index: cl-gsl/doc/sf.tex diff -u cl-gsl/doc/sf.tex:1.1 cl-gsl/doc/sf.tex:1.2 --- cl-gsl/doc/sf.tex:1.1 Mon Mar 21 04:44:31 2005 +++ cl-gsl/doc/sf.tex Thu Mar 24 04:48:41 2005 @@ -7,16 +7,17 @@ \Css{.monobold { font-weight: bold; font-family: monospace;}} \Css{.floatright { float: right;}} +\Css{.floatleft { float: left;}} +\Css{.floatclear { clear: both;}} \def\monobf#1{\ifHtml \HCode{} #1 \else \textbf{\texttt{#1}} \fi \ifHtml \HCode{} \fi} \def\func#1#2{\ifHtml \HCode{} \fi - {[}Function{]} \ifHtml \HCode{} \fi - \monobf{#1} \texttt{#2}} - -\setcounter{section}{6} + {[}Function{]} \ifHtml \HCode{} \fi + \monobf{#1} \texttt{#2} + \ifHtml \HCode{
 
} \fi} \section{Special Functions} @@ -81,12 +82,12 @@ The following precision levels are available for the mode argument, \begin{description} -\item [GSL\_PREC\_DOUBLE~]Double-precision, a relative accuracy of approximately - 2 {*} 10\^{}-16. -\item [GSL\_PREC\_SINGLE~]Single-precision, a relative accuracy of approximately - 10\^{}-7. -\item [GSL\_PREC\_APPROX~]Approximate values, a relative accuracy of -approximately 5 {*} 10\^{}-4. +\item [+prec-double+] Double-precision, a relative accuracy of approximately + \(2 * 10^{-16}\). +\item [+prec-single+] Single-precision, a relative accuracy of approximately + \(10^{-1}\). +\item [+prec-approx+] Approximate values, a relative accuracy of +approximately \(5 * 10^{-4}\). \end{description} The approximate mode provides the fastest evaluation at the lowest accuracy. @@ -94,47 +95,47 @@ \subsection{Airy Functions and Derivatives} -The Airy functions Ai(x) and Bi(x) are defined by the integral representations, -For further information see Abramowitz \& Stegun, Section 10.4. -The \HCode{} Airy functions \HCode{} are defined in the header file gsl\_sf\_airy.h. +The Airy functions \(Ai(x)\) and \(Bi(x)\) are defined by the integral +representations, -\subsubsection{Airy Functions} +$$Ai(x) = \frac{1}{\pi} \int_0^\infty \cos(\frac{1}{3} t^3 + xt) dt$$ + +$$Bi(x) = \frac{1}{\pi} \int_0^\infty (e^{-t^3/3} + \sin(\frac{1}{3} t^3 + xt)) dt$$ +for further information see Abramowitz \& Stegun, Section 10.4. + +\subsubsection{Airy Functions} \func{airy-ai}{x mode => result} \func{airy-ai-e}{x mode => result, error, status} -These routines compute the Airy function Ai(x) with an accuracy +These routines compute the Airy function \(Ai(x)\) with an accuracy specified by mode. \func{airy-bi}{x mode => result} \func{airy-bi-e}{x mode => result, error, status} -These routines compute the Airy function Bi(x) with an accuracy +These routines compute the Airy function \(Bi(x)\) with an accuracy specified by mode. \func{airy-ai-scaled}{ x mode => result} - \func{airy-ai-scaled-e}{ x mode => result, error, status} - These routines compute a scaled version of the Airy function -S\_A(x) Ai(x). For x>0 the scaling factor S\_A(x) is $\backslash$exp(+(2/3) -x\^{}(3/2)), and is 1 for x<0. +\(S_A(x) Ai(x)\). For \(x>0\) the scaling factor \(S_A(x)\) is +\(e^{+(2/3)x^{3/2}}\), and is 1 for \(x<0\). \func{airy-bi-scaled}{ x mode => result} - \func{airy-bi-scaled-e}{ x mode => result, error, status} - These routines compute a scaled version of the Airy function -S\_B(x) Bi(x). For x>0 the scaling factor S\_B(x) is exp(-(2/3) x\^{}(3/2)), -and is 1 for x<0. +\(S_B(x) Bi(x)\). For \(x>0\) the scaling factor \(S_B(x)\) is +\(e^{-(2/3) x^{3/2}}\), and is 1 for \(x<0\). \subsubsection{Derivatives of Airy Functions} @@ -145,7 +146,7 @@ \func{airy-ai-deriv-e}{ x mode => result, error, status} -These routines compute the Airy function derivative Ai\verb|'|(x) +These routines compute the Airy function derivative \(Ai'(x)\) with an accuracy specified by mode. \func{airy-bi-deriv}{ x mode => result} @@ -154,7 +155,7 @@ \func{airy-bi-deriv-e}{ x mode => result, error, status} -These routines compute the Airy function derivative Bi\verb|'|(x) +These routines compute the Airy function derivative \(Bi'(x)\) with an accuracy specified by mode. \func{airy-ai-deriv-scaled}{ x mode => result} @@ -163,7 +164,7 @@ These routines compute the derivative of the scaled Airy function -S\_A(x) Ai(x). +\(S_A(x) Ai(x)\). \func{airy-bi-deriv-scaled}{ x mode => result} @@ -172,7 +173,7 @@ These routines compute the derivative of the scaled Airy function -S\_B(x) Bi(x). +\(S_B(x) Bi(x)\). \subsubsection{Zeros of Airy Functions} @@ -184,7 +185,7 @@ These routines compute the location of the s-th zero of the -Airy function Ai(x). +Airy function \(Ai(x)\). \func{airy-zero-bi}{ s => result} @@ -193,7 +194,7 @@ These routines compute the location of the s-th zero of the -Airy function Bi(x). +Airy function \(Bi(x)\). \subsubsection{Zeros of Derivatives of Airy Functions} @@ -205,7 +206,7 @@ These routines compute the location of the s-th zero of the -Airy function derivative Ai\verb|'|(x). +Airy function derivative \(Ai'(x)\). \func{airy-zero-bi-deriv}{ s => result} @@ -214,7 +215,7 @@ These routines compute the location of the s-th zero of the -Airy function derivative Bi\verb|'|(x). +Airy function derivative \(Bi'(x)\). \subsection{Bessel Functions} @@ -260,7 +261,8 @@ This routine computes the values of the regular cylindrical -Bessel functions \(J_n(x)\) for n from nmin to nmax inclusive, storing +Bessel functions \(J_n(x)\) for \texttt{n} from \texttt{nmin} to +\texttt{nmax} inclusive, storing the results in the array result-array. The values are computed using recurrence relations, for efficiency, and therefore may differ slightly from the exact values. @@ -299,7 +301,8 @@ This routine computes the values of the irregular cylindrical -Bessel functions \(Y_n(x)\) for n from nmin to nmax inclusive, storing +Bessel functions \(Y_n(x)\) for \texttt{n} from \texttt{nmin} +to \texttt{nmax} inclusive, storing the results in the array result-array. The domain of the function is \(x>0\). The values are computed using recurrence relations, for efficiency, @@ -339,7 +342,8 @@ This routine computes the values of the regular modified cylindrical -Bessel functions \(I_n(x)\) for n from nmin to nmax inclusive, storing +Bessel functions \(I_n(x)\) for \texttt{n} from \texttt{nmin} to +\texttt{nmax} inclusive, storing the results in the array result-array. The start of the range nmin must be positive or zero. The values are computed using recurrence relations, for efficiency, and therefore may differ slightly from @@ -376,8 +380,8 @@ This routine computes the values of the scaled regular cylindrical -Bessel functions \(e^{-|x|} I_n(x)\) for n from nmin to -nmax inclusive, storing the results in the array result-array. The +Bessel functions \(e^{-|x|} I_n(x)\) for \texttt{n} from \texttt{nmin} to +\texttt{nmax} inclusive, storing the results in the array result-array. The start of the range nmin must be positive or zero. The values are computed using recurrence relations, for efficiency, and therefore may differ slightly from the exact values. From edenny at common-lisp.net Thu Mar 24 03:49:40 2005 From: edenny at common-lisp.net (Edgar Denny) Date: Thu, 24 Mar 2005 04:49:40 +0100 (CET) Subject: [cl-gsl-cvs] CVS update: cl-gsl/doc/constants.tex Message-ID: <20050324034940.4A6DE88671@common-lisp.net> Update of /project/cl-gsl/cvsroot/cl-gsl/doc In directory common-lisp.net:/tmp/cvs-serv6392 Added Files: constants.tex Log Message: Initial checkin. Date: Thu Mar 24 04:49:39 2005 Author: edenny From edenny at common-lisp.net Sun Mar 27 03:46:33 2005 From: edenny at common-lisp.net (Edgar Denny) Date: Sun, 27 Mar 2005 05:46:33 +0200 (CEST) Subject: [cl-gsl-cvs] CVS update: cl-gsl/doc/Makefile Message-ID: <20050327034633.E19DE884E2@common-lisp.net> Update of /project/cl-gsl/cvsroot/cl-gsl/doc In directory common-lisp.net:/tmp/cvs-serv27500 Modified Files: Makefile Log Message: modify clean. Date: Sun Mar 27 05:46:33 2005 Author: edenny Index: cl-gsl/doc/Makefile diff -u cl-gsl/doc/Makefile:1.1 cl-gsl/doc/Makefile:1.2 --- cl-gsl/doc/Makefile:1.1 Mon Mar 21 04:53:13 2005 +++ cl-gsl/doc/Makefile Sun Mar 27 05:46:32 2005 @@ -3,13 +3,13 @@ #### GNU Makefile clean: - $(RM) *.png *.4ct *.4tc *.aux *.css *.dvi *.html *.idv *.lg *.log *.tmp *.xref + $(RM) *.png *.4ct *.4tc *.aux *.css *.dvi *.html *.idv *.lg *.log *.tmp *.xref *.toc html: - htlatex sf.tex + htlatex cl-gsl-ref.tex html-without-png: - latex sf.tex - latex sf.tex - latex sf.tex - tex4ht sf - t4ht sf -p + latex cl-gsl-ref.tex + latex cl-gsl-ref.tex + latex cl-gsl-ref.tex + tex4ht cl-gsl-ref + t4ht cl-gsl-ref -p From edenny at common-lisp.net Sun Mar 27 03:47:21 2005 From: edenny at common-lisp.net (Edgar Denny) Date: Sun, 27 Mar 2005 05:47:21 +0200 (CEST) Subject: [cl-gsl-cvs] CVS update: cl-gsl/doc/constants.tex Message-ID: <20050327034721.AB31B884E2@common-lisp.net> Update of /project/cl-gsl/cvsroot/cl-gsl/doc In directory common-lisp.net:/tmp/cvs-serv27528 Modified Files: constants.tex Log Message: tex4ht fixes. Date: Sun Mar 27 05:47:20 2005 Author: edenny Index: cl-gsl/doc/constants.tex diff -u cl-gsl/doc/constants.tex:1.1 cl-gsl/doc/constants.tex:1.2 --- cl-gsl/doc/constants.tex:1.1 Thu Mar 24 04:49:39 2005 +++ cl-gsl/doc/constants.tex Sun Mar 27 05:47:20 2005 @@ -1,25 +1,5 @@ -\documentclass{article} -\usepackage[T1]{fontenc} -\usepackage[latin1]{inputenc} -\usepackage{tex4ht} - -\begin{document} - -\Css{.monobold { font-weight: bold; font-family: monospace;}} -\Css{.floatright { float: right;}} -\Css{.floatleft { float: left;}} -\Css{.floatclear { clear: both;}} - -\def\monobf#1{\ifHtml \HCode{} #1 - \else \textbf{\texttt{#1}} \fi - \ifHtml \HCode{} \fi} - -\def\func#1#2{\ifHtml \HCode{} \fi - {[}Function{]} \ifHtml \HCode{} \fi - \monobf{#1} \texttt{#2} - \ifHtml \HCode{
 
} \fi} -\section*{38 Physical Constants} +\section{Physical Constants} This chapter describes macros for the values of physical constants, such as the speed of light, c, and gravitational constant, G. The @@ -36,351 +16,351 @@ the header files themselves for the values of the constants used in the library. -\subsection*{38.1 Fundamental Constants} +\subsection{Fundamental Constants} \begin{description} -\item [+mksa-speed-of-light+] The speed of light in vacuum, c. +\item [\const{+mksa-speed-of-light+}] The speed of light in vacuum, c. -\item [+mksa-vacuum-permeability+] The permeability of free +\item [\const{+mksa-vacuum-permeability+}] The permeability of free space, \(\mu_0\). This constant is defined in the MKSA system only. -\item [+mksa-vacuum-permittivity+] The permittivity of free +\item [\const{+mksa-vacuum-permittivity+}] The permittivity of free space, \(\epsilon_0\). This constant is defined in the MKSA system only. -\item [+mksa-plancks-constant-h+] Planck's constant, h. +\item [\const{+mksa-plancks-constant-h+}] Planck's constant, h. -\item [+mksa-plancks-constant-hbar+] Planck's constant +\item [\const{+mksa-plancks-constant-hbar+}] Planck's constant divided by \(2\pi, \hbar\). -\item [+num-avogadro+] Avogadro's number, \(N_a\). +\item [\const{+num-avogadro+}] Avogadro's number, \(N_a\). -\item [+mksa-faraday+] The molar charge of 1 Faraday. +\item [\const{+mksa-faraday+}] The molar charge of 1 Faraday. -\item [+mksa-boltzmann+] The Boltzmann constant, k. +\item [\const{+mksa-boltzmann+}] The Boltzmann constant, k. -\item [+mksa-molar-mass+] The molar gas constant, \(R_0\). +\item [\const{+mksa-molar-mass+}] The molar gas constant, \(R_0\). -\item [+mksa-standard-gas-volume+] The standard gas volume, \(V_0\). +\item [\const{+mksa-standard-gas-volume+}] The standard gas volume, \(V_0\). -\item [+mksa-stefan-boltzmann-constant+] The Stefan-Boltzmann +\item [\const{+mksa-stefan-boltzmann-constant+}] The Stefan-Boltzmann radiation constant, \(\sigma\). -\item [+mksa-gauss+] The magnetic field of 1 Gauss. +\item [\const{+mksa-gauss+}] The magnetic field of 1 Gauss. -\item [+mksa-micro+] The length of 1 micron. +\item [\const{+mksa-micro+}] The length of 1 micron. -\item [+mksa-hectare+] The area of 1 hectare. +\item [\const{+mksa-hectare+}] The area of 1 hectare. -\item [+mksa-miles-per-hour+] The speed of 1 mile per hour. +\item [\const{+mksa-miles-per-hour+}] The speed of 1 mile per hour. -\item [+mksa-kilometers-per-hour+] The speed of 1 kilometer per hour. +\item [\const{+mksa-kilometers-per-hour+}] The speed of 1 kilometer per hour. \end{description} -\subsection*{38.2 Astronomy and Astrophysics} +\subsection{Astronomy and Astrophysics} \begin{description} -\item [+mksa-astronomical-unit+] The length of 1 astronomical +\item [\const{+mksa-astronomical-unit+}] The length of 1 astronomical unit (mean earth-sun distance), au. -\item [+mksa-gravitational-constant+] The gravitational constant, +\item [\const{+mksa-gravitational-constant+}] The gravitational constant, G. -\item [+mksa-light-year+] The distance of 1 light-year, ly. +\item [\const{+mksa-light-year+}] The distance of 1 light-year, ly. -\item [+mksa-parsec+] The distance of 1 parsec, pc. +\item [\const{+mksa-parsec+}] The distance of 1 parsec, pc. -\item [+mksa-grav-accel+] The standard gravitational acceleration +\item [\const{+mksa-grav-accel+}] The standard gravitational acceleration on Earth, g. -\item [+mksa-solar-mass+] The mass of the Sun. +\item [\const{+mksa-solar-mass+}] The mass of the Sun. \end{description} -\subsection*{38.3 Atomic and Nuclear Physics} +\subsection{Atomic and Nuclear Physics} \begin{description} -\item [+mksa-electron-charge+] The charge of the electron, e. +\item [\const{+mksa-electron-charge+}] The charge of the electron, e. -\item [+mksa-electron-volt+] The energy of 1 electron volt, eV. +\item [\const{+mksa-electron-volt+}] The energy of 1 electron volt, eV. -\item [+mksa-unified-atomic-mass+] The unified atomic mass, +\item [\const{+mksa-unified-atomic-mass+}] The unified atomic mass, amu. -\item [+mksa-mass-electron+] The mass of the electron, \(m_e\). +\item [\const{+mksa-mass-electron+}] The mass of the electron, \(m_e\). -\item [+mksa-mass-muon+] The mass of the muon, \(m_\mu\). +\item [\const{+mksa-mass-muon+}] The mass of the muon, \(m_\mu\). -\item [+mksa-mass-proton+] The mass of the proton, \(m_p\). +\item [\const{+mksa-mass-proton+}] The mass of the proton, \(m_p\). -\item [+mksa-mass-neutron+] The mass of the neutron, \(m_n\). +\item [\const{+mksa-mass-neutron+}] The mass of the neutron, \(m_n\). -\item [+num-fine-structure+] The electromagnetic fine structure +\item [\const{+num-fine-structure+}] The electromagnetic fine structure constant \(\alpha\). -\item [+mksa-rydberg+] The Rydberg constant, Ry, in units of +\item [\const{+mksa-rydberg+}] The Rydberg constant, Ry, in units of energy. This is related to the Rydberg inverse wavelength R by Ry = h c R. -\item [+mksa-bohr-radius+] The Bohr radius, \(a_0\). +\item [\const{+mksa-bohr-radius+}] The Bohr radius, \(a_0\). -\item [+mksa-angstrom+] The length of 1 angstrom. +\item [\const{+mksa-angstrom+}] The length of 1 angstrom. -\item [+mksa-barn+] The area of 1 barn. +\item [\const{+mksa-barn+}] The area of 1 barn. -\item [+mksa-bohr-magneton+] The Bohr Magneton, \(\mu_B\). +\item [\const{+mksa-bohr-magneton+}] The Bohr Magneton, \(\mu_B\). -\item [+mksa-nuclear-magneton+] The Nuclear Magneton, \(\mu_N\). +\item [\const{+mksa-nuclear-magneton+}] The Nuclear Magneton, \(\mu_N\). -\item [+mksa-electron-magnetic-moment+] The absolute value +\item [\const{+mksa-electron-magnetic-moment+}] The absolute value of the magnetic moment of the electron, \(\mu_e\). The physical magnetic moment of the electron is negative. -\item [+mksa-proton-magnetic-moment+] The magnetic moment of +\item [\const{+mksa-proton-magnetic-moment+}] The magnetic moment of the proton, \(\mu_p\). -\item [+mksa-thomson-cross-section+] The Thomson cross section, +\item [\const{+mksa-thomson-cross-section+}] The Thomson cross section, \(\sigma_T\). \end{description} -\subsection*{38.4 Measurement of Time} +\subsection{Measurement of Time} \begin{description} -\item [+mksa-minute+] The number of seconds in 1 minute. +\item [\const{+mksa-minute+}] The number of seconds in 1 minute. -\item [+mksa-hour+] The number of seconds in 1 hour. +\item [\const{+mksa-hour+}] The number of seconds in 1 hour. -\item [+mksa-day+] The number of seconds in 1 day. +\item [\const{+mksa-day+}] The number of seconds in 1 day. -\item [+mksa-week+] The number of seconds in 1 week. +\item [\const{+mksa-week+}] The number of seconds in 1 week. \end{description} -\subsection*{38.5 Imperial Units} +\subsection{Imperial Units} \begin{description} -\item [+mksa-inch+] The length of 1 inch. +\item [\const{+mksa-inch+}] The length of 1 inch. -\item [+mksa-foot+] The length of 1 foot. +\item [\const{+mksa-foot+}] The length of 1 foot. -\item [+mksa-yard+] The length of 1 yard. +\item [\const{+mksa-yard+}] The length of 1 yard. -\item [+mksa-mile+] The length of 1 mile. +\item [\const{+mksa-mile+}] The length of 1 mile. -\item [+mksa-mil+] The length of 1 mil (1/1000th of an inch). +\item [\const{+mksa-mil+}] The length of 1 mil (1/1000th of an inch). \end{description} -\subsection*{38.6 Nautical Units} +\subsection{Nautical Units} \begin{description} -\item [+mksa-nautical-mile+] The length of 1 nautical mile. +\item [\const{+mksa-nautical-mile+}] The length of 1 nautical mile. -\item [+mksa-fathom+] The length of 1 fathom. +\item [\const{+mksa-fathom+}] The length of 1 fathom. -\item [+mksa-knot+] The speed of 1 knot. +\item [\const{+mksa-knot+}] The speed of 1 knot. \end{description} -\subsection*{38.7 Printers Units} +\subsection{Printers Units} \begin{description} -\item [+mksa-point+] The length of 1 printer's point (1/72 inch). +\item [\const{+mksa-point+}] The length of 1 printer's point (1/72 inch). -\item [+mksa-texpoint+] The length of 1 \TeX{} point (1/72.27 inch). +\item [\const{+mksa-texpoint+}] The length of 1 \TeX{} point (1/72.27 inch). \end{description} -\subsection*{38.8 Volume} +\subsection{Volume} \begin{description} -\item [+mksa-acre+] The area of 1 acre. +\item [\const{+mksa-acre+}] The area of 1 acre. -\item [+mksa-liter+] The volume of 1 liter. +\item [\const{+mksa-liter+}] The volume of 1 liter. -\item [+mksa-us-gallon+] The volume of 1 US gallon. +\item [\const{+mksa-us-gallon+}] The volume of 1 US gallon. -\item [+mksa-canadian-gallon+] The volume of 1 Canadian gallon. +\item [\const{+mksa-canadian-gallon+}] The volume of 1 Canadian gallon. -\item [+mksa-uk-gallon+] The volume of 1 UK gallon. +\item [\const{+mksa-uk-gallon+}] The volume of 1 UK gallon. -\item [+mksa-quart+] The volume of 1 quart. +\item [\const{+mksa-quart+}] The volume of 1 quart. -\item [+mksa-pint+] The volume of 1 pint. +\item [\const{+mksa-pint+}] The volume of 1 pint. \end{description} -\subsection*{38.9 Mass and Weight} +\subsection{Mass and Weight} \begin{description} -\item [+mksa-pound-mass+] The mass of 1 pound. +\item [\const{+mksa-pound-mass+}] The mass of 1 pound. -\item [+mksa-ounce-mass+] The mass of 1 ounce. +\item [\const{+mksa-ounce-mass+}] The mass of 1 ounce. -\item [+mksa-ton+] The mass of 1 ton. +\item [\const{+mksa-ton+}] The mass of 1 ton. -\item [+mksa-metric-ton+] The mass of 1 metric ton (1000 kg). +\item [\const{+mksa-metric-ton+}] The mass of 1 metric ton (1000 kg). -\item [+mksa-uk-ton+] The mass of 1 UK ton. +\item [\const{+mksa-uk-ton+}] The mass of 1 UK ton. -\item [+mksa-troy-ounce+] The mass of 1 troy ounce. +\item [\const{+mksa-troy-ounce+}] The mass of 1 troy ounce. -\item [+mksa-carat+] The mass of 1 carat. +\item [\const{+mksa-carat+}] The mass of 1 carat. -\item [+mksa-gram-force+] The force of 1 gram weight. +\item [\const{+mksa-gram-force+}] The force of 1 gram weight. -\item [+mksa-pound-force+] The force of 1 pound weight. +\item [\const{+mksa-pound-force+}] The force of 1 pound weight. -\item [+mksa-kilopound-force+] The force of 1 kilopound weight. +\item [\const{+mksa-kilopound-force+}] The force of 1 kilopound weight. -\item [+mksa-poundal+] The force of 1 poundal. +\item [\const{+mksa-poundal+}] The force of 1 poundal. \end{description} -\subsection*{38.10 Thermal Energy and Power} +\subsection{Thermal Energy and Power} \begin{description} -\item [+mksa-calorie+] The energy of 1 calorie. +\item [\const{+mksa-calorie+}] The energy of 1 calorie. -\item [+mksa-btu+] The energy of 1 British Thermal Unit, btu. +\item [\const{+mksa-btu+}] The energy of 1 British Thermal Unit, btu. -\item [+mksa-therm+] The energy of 1 Therm. +\item [\const{+mksa-therm+}] The energy of 1 Therm. -\item [+mksa-horsepower+] The power of 1 horsepower. +\item [\const{+mksa-horsepower+}] The power of 1 horsepower. \end{description} -\subsection*{38.11 Pressure} +\subsection{Pressure} \begin{description} -\item [+mksa-bar+] The pressure of 1 bar. +\item [\const{+mksa-bar+}] The pressure of 1 bar. -\item [+mksa-std-atmosphere+] The pressure of 1 standard atmosphere. +\item [\const{+mksa-std-atmosphere+}] The pressure of 1 standard atmosphere. -\item [+mksa-torr+] The pressure of 1 torr. +\item [\const{+mksa-torr+}] The pressure of 1 torr. -\item [+mksa-meter-of-mercury+] The pressure of 1 meter of mercury. +\item [\const{+mksa-meter-of-mercury+}] The pressure of 1 meter of mercury. -\item [+mksa-inch-of-mercury+] The pressure of 1 inch of mercury. +\item [\const{+mksa-inch-of-mercury+}] The pressure of 1 inch of mercury. -\item [+mksa-inch-of-water+] The pressure of 1 inch of water. +\item [\const{+mksa-inch-of-water+}] The pressure of 1 inch of water. -\item [+mksa-psi+] The pressure of 1 pound per square inch. +\item [\const{+mksa-psi+}] The pressure of 1 pound per square inch. \end{description} -\subsection*{38.12 Viscosity} +\subsection{Viscosity} \begin{description} -\item [+mksa-poise+] The dynamic viscosity of 1 poise. +\item [\const{+mksa-poise+}] The dynamic viscosity of 1 poise. -\item [+mksa-stokes+] The kinematic viscosity of 1 stokes. +\item [\const{+mksa-stokes+}] The kinematic viscosity of 1 stokes. \end{description} -\subsection*{38.13 Light and Illumination} +\subsection{Light and Illumination} \begin{description} -\item [+mksa-stilb+] The luminance of 1 stilb. +\item [\const{+mksa-stilb+}] The luminance of 1 stilb. -\item [+mksa-lumen+] The luminous flux of 1 lumen. +\item [\const{+mksa-lumen+}] The luminous flux of 1 lumen. -\item [+mksa-lux+] The illuminance of 1 lux. +\item [\const{+mksa-lux+}] The illuminance of 1 lux. -\item [+mksa-phot+] The illuminance of 1 phot. +\item [\const{+mksa-phot+}] The illuminance of 1 phot. -\item [+mksa-footcandle+] The illuminance of 1 footcandle. +\item [\const{+mksa-footcandle+}] The illuminance of 1 footcandle. -\item [+mksa-lambert+] The luminance of 1 lambert. +\item [\const{+mksa-lambert+}] The luminance of 1 lambert. -\item [+mksa-footlambert+] The luminance of 1 footlambert. +\item [\const{+mksa-footlambert+}] The luminance of 1 footlambert. \end{description} -\subsection*{38.14 Radioactivity} +\subsection{Radioactivity} \begin{description} -\item [+mksa-curie+] The activity of 1 curie. +\item [\const{+mksa-curie+}] The activity of 1 curie. -\item [+mksa-roentgen+] The exposure of 1 roentgen. +\item [\const{+mksa-roentgen+}]The exposure of 1 roentgen. -\item [+mksa-rad+] The absorbed dose of 1 rad. +\item [\const{+mksa-rad+}] The absorbed dose of 1 rad. \end{description} -\subsection*{38.15 Force and Energy} +\subsection{Force and Energy} \begin{description} -\item [+mksa-newton+] The SI unit of force, 1 Newton. +\item [\const{+mksa-newton+}] The SI unit of force, 1 Newton. -\item [+mksa-dyne+] The force of 1 Dyne = \(10^{-5}\) Newton. +\item [\const{+mksa-dyne+}] The force of 1 Dyne = \(10^{-5}\) Newton. -\item [+mksa-joule+] The SI unit of energy, 1 Joule. +\item [\const{+mksa-joule+}] The SI unit of energy, 1 Joule. -\item [+mksa-erg+] The energy 1 erg = \(10^{-7}\) Joule. +\item [\const{+mksa-erg+}] The energy 1 erg = \(10^{-7}\) Joule. \end{description} -\subsection*{38.16 Prefixes} +\subsection{Prefixes} These constants are dimensionless scaling factors. \begin{description} -\item [+num-yotta+] \(10^{24}\) +\item [\const{+num-yotta+}] \(10^{24}\) -\item [+num-zetta+] \(10^{21}\) +\item [\const{+num-zetta+}] \(10^{21}\) -\item [+num-exa+] \(10^{18}\) +\item [\const{+num-exa+}] \(10^{18}\) -\item [+num-peta+] \(10^{15}\) +\item [\const{+num-peta+}] \(10^{15}\) -\item [+num-tera+] \(10^{12}\) +\item [\const{+num-tera+}] \(10^{12}\) -\item [+num-giga+] \(10^{9}\) +\item [\const{+num-giga+}] \(10^{9}\) -\item [+num-mega+] \(10^{6}\) +\item [\const{+num-mega+}] \(10^{6}\) -\item [+num-kilo+] \(10^{3}\) +\item [\const{+num-kilo+}] \(10^{3}\) -\item [+num-milli+] \(10^{-3}\) +\item [\const{+num-milli+}] \(10^{-3}\) -\item [+num-micro+] \(10^{-6}\) +\item [\const{+num-micro+}] \(10^{-6}\) -\item [+num-nano+] \(10^{-9}\) +\item [\const{+num-nano+}] \(10^{-9}\) -\item [+num-pico+] \(10^{-12}\) +\item [\const{+num-pico+}] \(10^{-12}\) -\item [+num-femto+] \(10^{-15}\) +\item [\const{+num-femto+}] \(10^{-15}\) -\item [+num-atto+] \(10^{-18}\) +\item [\const{+num-atto+}] \(10^{-18}\) -\item [+num-zepto+] \(10^{-21}\) +\item [\const{+num-zepto+}] \(10^{-21}\) -\item [+num-yocto+] \(10^{-24}\) +\item [\const{+num-yocto+}] \(10^{-24}\) \end{description} -\subsection*{38.17 Examples} +\subsection{Examples} The following program demonstrates the use of the physical constants in a calculation. In this case, the goal is to calculate the range @@ -425,7 +405,7 @@ -\subsection*{38.18 References and Further Reading} +\subsection{References and Further Reading} Further information on the values of physical constants is available from the NIST website, @@ -433,6 +413,3 @@ \begin{itemize} \item http://www.physics.nist.gov/cuu/Constants/index.html \end{itemize} - - -\end{document} From edenny at common-lisp.net Sun Mar 27 03:47:53 2005 From: edenny at common-lisp.net (Edgar Denny) Date: Sun, 27 Mar 2005 05:47:53 +0200 (CEST) Subject: [cl-gsl-cvs] CVS update: cl-gsl/doc/math.tex Message-ID: <20050327034753.8349A884E2@common-lisp.net> Update of /project/cl-gsl/cvsroot/cl-gsl/doc In directory common-lisp.net:/tmp/cvs-serv27544 Modified Files: math.tex Log Message: tex4ht fixes. Date: Sun Mar 27 05:47:52 2005 Author: edenny Index: cl-gsl/doc/math.tex diff -u cl-gsl/doc/math.tex:1.1 cl-gsl/doc/math.tex:1.2 --- cl-gsl/doc/math.tex:1.1 Thu Mar 24 02:48:24 2005 +++ cl-gsl/doc/math.tex Sun Mar 27 05:47:52 2005 @@ -1,65 +1,43 @@ -\documentclass{article} -\usepackage[T1]{fontenc} -\usepackage[latin1]{inputenc} -\usepackage{tex4ht} - -\begin{document} - -\Css{.monobold { font-weight: bold; font-family: monospace;}} -\Css{.floatright { float: right;}} -\Css{.floatleft { float: left;}} -\Css{.floatclear { clear: both;}} - -\def\monobf#1{\ifHtml \HCode{} #1 - \else \textbf{\texttt{#1}} \fi - \ifHtml \HCode{} \fi} - -\def\func#1#2{\ifHtml \HCode{} \fi - {[}Function{]} \ifHtml \HCode{} \fi - \monobf{#1} \texttt{#2} - \ifHtml \HCode{
 
} \fi} -\section*{4 Mathematical Constants} +\section{Mathematical Constants} The library ensures that the standard bsd mathematical constants are defined. For reference here is a list of the constants. \begin{description} -\item [+e+] The base of exponentials, \(e\) +\item [\const{+e+}] The base of exponentials, \(e\) -\item [+log2e+] The base-2 logarithm of e, \(\log_2(e)\) +\item [\const{+log2e+}] The base-2 logarithm of e, \(\log_2(e)\) -\item [+log10e+] The base-10 logarithm of e, \(\log_{10}(e)\) +\item [\const{+log10e+}] The base-10 logarithm of e, \(\log_{10}(e)\) -\item [+sqrt2+] The square root of two, \(\sqrt 2\) +\item [\const{+sqrt2+}] The square root of two, \(\sqrt 2\) -\item [+sqrt1/2+] The square root of one-half, \(\sqrt{1/2}\) +\item [\const{+sqrt1/2+}] The square root of one-half, \(\sqrt{1/2}\) -\item [+sqrt3+] The square root of three, \(\sqrt 3\) +\item [\const{+sqrt3+}] The square root of three, \(\sqrt 3\) -\item [+pi+] The constant pi, \(\pi\) +\item [\const{+pi+}] The constant pi, \(\pi\) -\item [+pi/2+] Pi divided by two, \(\pi/2\) +\item [\const{+pi/2+}] Pi divided by two, \(\pi/2\) -\item [+pi/4+] Pi divided by four, \(\pi/4\) +\item [\const{+pi/4+}] Pi divided by four, \(\pi/4\) -\item [+sqrtpi+] The square root of pi, \(\sqrt\pi\) +\item [\const{+sqrtpi+}] The square root of pi, \(\sqrt\pi\) -\item [+2/sqrtpi+] Two divided by the square root of pi, \(2/\sqrt\pi\) +\item [\const{+2/sqrtpi+}] Two divided by the square root of pi, \(2/\sqrt\pi\) -\item [+1/pi+] The reciprocal of pi, \(1/\pi\) +\item [\const{+1/pi+}] The reciprocal of pi, \(1/\pi\) -\item [+2/pi+] Twice the reciprocal of pi, \(2/\pi\) +\item [\const{+2/pi+}] Twice the reciprocal of pi, \(2/\pi\) -\item [+ln10+] The natural logarithm of ten, \(\ln(10)\) +\item [\const{+ln10+}] The natural logarithm of ten, \(\ln(10)\) -\item [+ln2+] The natural logarithm of two, \(\ln(2)\) +\item [\const{+ln2+}] The natural logarithm of two, \(\ln(2)\) -\item [+lnpi+] The natural logarithm of pi, \(\ln(\pi)\) +\item [\const{+lnpi+}] The natural logarithm of pi, \(\ln(\pi)\) -\item [+euler+] Euler's constant, \(\gamma\) +\item [\const{+euler+}] Euler's constant, \(\gamma\) \end{description} - -\end{document} From edenny at common-lisp.net Sun Mar 27 03:48:24 2005 From: edenny at common-lisp.net (Edgar Denny) Date: Sun, 27 Mar 2005 05:48:24 +0200 (CEST) Subject: [cl-gsl-cvs] CVS update: cl-gsl/doc/poly.tex Message-ID: <20050327034824.44DB7884E2@common-lisp.net> Update of /project/cl-gsl/cvsroot/cl-gsl/doc In directory common-lisp.net:/tmp/cvs-serv27559 Modified Files: poly.tex Log Message: tex4ht fixes. Date: Sun Mar 27 05:48:23 2005 Author: edenny Index: cl-gsl/doc/poly.tex diff -u cl-gsl/doc/poly.tex:1.2 cl-gsl/doc/poly.tex:1.3 --- cl-gsl/doc/poly.tex:1.2 Thu Mar 24 04:47:25 2005 +++ cl-gsl/doc/poly.tex Sun Mar 27 05:48:23 2005 @@ -1,25 +1,5 @@ -\documentclass{article} -\usepackage[T1]{fontenc} -\usepackage[latin1]{inputenc} -\usepackage{tex4ht} - -\begin{document} - -\Css{.monobold { font-weight: bold; font-family: monospace;}} -\Css{.floatright { float: right;}} -\Css{.floatleft { float: left;}} -\Css{.floatclear { clear: both;}} - -\def\monobf#1{\ifHtml \HCode{} #1 - \else \textbf{\texttt{#1}} \fi - \ifHtml \HCode{} \fi} - -\def\func#1#2{\ifHtml \HCode{} \fi - {[}Function{]} \ifHtml \HCode{} \fi - \monobf{#1} \texttt{#2} - \ifHtml \HCode{
 
} \fi} -\section*{6 Polynomials} +\section{Polynomials} This chapter describes functions for evaluating and solving polynomials. There are routines for finding real and complex roots of quadratic @@ -28,7 +8,7 @@ with real coefficients (of any order). -\subsection*{6.1 Polynomial Evaluation} +\subsection{Polynomial Evaluation} \func{poly-eval}{ coeff-list x => result} @@ -38,7 +18,7 @@ of the coefficients. -\subsection*{6.2 Divided Difference Representation of Polynomials} +\subsection{Divided Difference Representation of Polynomials} The functions described here manipulate polynomials stored in Newton's divided-difference representation. The use of divided-differences @@ -70,7 +50,7 @@ -\subsection*{6.3 Quadratic Equations} +\subsection{Quadratic Equations} \func{solve-quadratic}{ a b c => x0, x1, num-roots} @@ -108,7 +88,7 @@ components and then by their imaginary components. -\subsection*{6.4 Cubic Equations} +\subsection{Cubic Equations} \func{solve-cubic}{ a b c => x0, x1, x2, num-roots} @@ -141,7 +121,7 @@ by their real components and then by their imaginary components. -\subsection*{6.5 General Polynomial Equations} +\subsection{General Polynomial Equations} The roots of polynomial equations cannot be found analytically beyond @@ -164,11 +144,11 @@ reduction does not converge. -\subsection*{6.6 Examples} +\subsection{Examples} -\subsection*{6.7 References and Further Reading} +\subsection{References and Further Reading} The balanced-QR method and its error analysis are described in the following papers, @@ -191,6 +171,3 @@ \item Abramowitz and Stegun, \textsc{Handbook of Mathematical Functions}, Sections 25.1.4 and 25.2.26. \end{itemize} - - -\end{document} From edenny at common-lisp.net Sun Mar 27 03:48:52 2005 From: edenny at common-lisp.net (Edgar Denny) Date: Sun, 27 Mar 2005 05:48:52 +0200 (CEST) Subject: [cl-gsl-cvs] CVS update: cl-gsl/doc/sf.tex Message-ID: <20050327034852.D4751884E2@common-lisp.net> Update of /project/cl-gsl/cvsroot/cl-gsl/doc In directory common-lisp.net:/tmp/cvs-serv27575 Modified Files: sf.tex Log Message: tex4ht fixes. Date: Sun Mar 27 05:48:51 2005 Author: edenny Index: cl-gsl/doc/sf.tex diff -u cl-gsl/doc/sf.tex:1.2 cl-gsl/doc/sf.tex:1.3 --- cl-gsl/doc/sf.tex:1.2 Thu Mar 24 04:48:41 2005 +++ cl-gsl/doc/sf.tex Sun Mar 27 05:48:50 2005 @@ -1,28 +1,6 @@ -\documentclass{article} -\usepackage[T1]{fontenc} -\usepackage[latin1]{inputenc} -\usepackage{tex4ht} - -\begin{document} - -\Css{.monobold { font-weight: bold; font-family: monospace;}} -\Css{.floatright { float: right;}} -\Css{.floatleft { float: left;}} -\Css{.floatclear { clear: both;}} - -\def\monobf#1{\ifHtml \HCode{} #1 - \else \textbf{\texttt{#1}} \fi - \ifHtml \HCode{} \fi} - -\def\func#1#2{\ifHtml \HCode{} \fi - {[}Function{]} \ifHtml \HCode{} \fi - \monobf{#1} \texttt{#2} - \ifHtml \HCode{
 
} \fi} \section{Special Functions} -\tableofcontents[section,subsection,subsubsection] - \subsection{Usage} The special functions are available in two calling conventions, @@ -2865,5 +2843,3 @@ \item Y.Y. Luke, Algorithms for the Computation of Mathematical Functions, Academic Press, New York (1977). \end{itemize} -Last modified: Tue Feb 15 21:49:18 EST 2005 -\end{document} From edenny at common-lisp.net Sun Mar 27 03:49:47 2005 From: edenny at common-lisp.net (Edgar Denny) Date: Sun, 27 Mar 2005 05:49:47 +0200 (CEST) Subject: [cl-gsl-cvs] CVS update: cl-gsl/ChangeLog Message-ID: <20050327034947.103F7884E2@common-lisp.net> Update of /project/cl-gsl/cvsroot/cl-gsl In directory common-lisp.net:/tmp/cvs-serv27596 Modified Files: ChangeLog Log Message: *** empty log message *** Date: Sun Mar 27 05:49:46 2005 Author: edenny Index: cl-gsl/ChangeLog diff -u cl-gsl/ChangeLog:1.9 cl-gsl/ChangeLog:1.10 --- cl-gsl/ChangeLog:1.9 Thu Mar 24 02:50:45 2005 +++ cl-gsl/ChangeLog Sun Mar 27 05:49:46 2005 @@ -1,3 +1,9 @@ +2005-03-27 Edgar Denny + + * sf.tex, poly.tex, math.tex, constants.tex: tex4ht fixes. + + * Makefile: modify clean. + 2005-03-24 Edgar Denny * doc/math.tex: Initial checkin. From cl-gsl-cvs at common-lisp.net Tue Mar 29 01:47:12 2005 From: cl-gsl-cvs at common-lisp.net (cl-gsl-cvs at common-lisp.net) Date: Tue, 29 Mar 2005 03:47:12 +0200 (CEST) Subject: [cl-gsl-cvs] CVS update: cl-gsl/doc/index.html cl-gsl/doc/introduction.html cl-gsl/doc/poly.html cl-gsl/doc/sf.html Message-ID: <20050329014712.0678C88671@common-lisp.net> Update of /project/cl-gsl/cvsroot/cl-gsl/doc In directory common-lisp.net:/tmp/cvs-serv26956 Removed Files: index.html introduction.html poly.html sf.html Log Message: Remove html files. Date: Tue Mar 29 03:47:10 2005 Author: edenny