diff --git a/data/permutation.lisp b/data/permutation.lisp index b336d17067739d4ca2aef646b08cc9a5069c5bb4..8030cb8d345d7edc9acdeb5f14c20db1ab9d50cc 100644 --- a/data/permutation.lisp +++ b/data/permutation.lisp @@ -1,6 +1,6 @@ ;; Permutations ;; Liam Healy, Sun Mar 26 2006 - 11:51 -;; Time-stamp: <2009-06-06 09:49:18EDT permutation.lisp> +;; Time-stamp: <2009-11-14 10:52:43EST permutation.lisp> ;; $Id$ (in-package :gsl) @@ -106,6 +106,7 @@ "A pointer to the array of elements in the permutation p.") +(export 'validp) (defgeneric validp (object) (:documentation ; FDL "Check that the object p is valid.")) diff --git a/init/body-expand.lisp b/init/body-expand.lisp index c88c1fe681f0e5373c0d63762d20c4016c1551cf..19fea05e330518428cfb2e6eac6fb58a1a30294e 100644 --- a/init/body-expand.lisp +++ b/init/body-expand.lisp @@ -1,6 +1,6 @@ ;; Expand the body of a defmfun ;; Liam Healy 2009-04-13 22:07:13EDT body-expand.lisp -;; Time-stamp: <2009-05-03 22:18:13EDT body-expand.lisp> +;; Time-stamp: <2009-11-14 10:19:46EST body-expand.lisp> ;; $Id: $ (in-package :gsl) @@ -27,19 +27,6 @@ (make-symbol (string (st-symbol sd))) (st-type sd)))))) -(defun substitute-symbols (substlist st-list) - "Substitute in the new symbols for the old in the st list." - (loop for pair in substlist - with answer = st-list - do - (setf answer - (subst - (st-symbol (second pair)) - (first pair) - answer - :test 'st-symbol)) - finally (return answer))) - ;;; This function should never be called even when FSBV is absent, ;;; because the potential callers should all have #-fsbv ;;; conditionalization. It is here just so that body-expand can diff --git a/init/generate-examples.lisp b/init/generate-examples.lisp index e3549ec29ae3675d5d5229bf1f62da5e9c8fda20..a33b97ed4a01d7f6c48356e0a5b70da156c15bc1 100644 --- a/init/generate-examples.lisp +++ b/init/generate-examples.lisp @@ -1,6 +1,6 @@ ;; Define examples. ;; Liam Healy 2008-09-07 21:00:48EDT generate-tests.lisp -;; Time-stamp: <2009-02-11 22:44:32EST generate-examples.lisp> +;; Time-stamp: <2009-11-14 10:22:05EST generate-examples.lisp> ;; $Id: $ ;;; Define examples that can be displayed by users with the function @@ -75,15 +75,6 @@ -82 75 -30 -71 44 48 88 121 106) "A sequence of random integers ranging between -255 and 255.") -(defun make-vector-from-pool (type length &optional (starting 0)) - "Make a vector of the specified element type and length using the - pool data for the type and starting at the specified point in the pool." - (make-marray - type - :dimensions length - :initial-contents - (make-list-from-pool type length starting))) - (defun make-list-from-pool (type length &optional (starting 0)) "Make a list for :initial-contents of the specified element type and length using the pool data for the type and starting at the diff --git a/init/types.lisp b/init/types.lisp index e33f2d2a602fdedf13bf8082de816cc798f4b5a4..5e498dcbca5c97e21dce01847131e687e3bbcf76 100644 --- a/init/types.lisp +++ b/init/types.lisp @@ -1,6 +1,6 @@ ;; Number types used by GSL functions, and specification conversion ;; Liam Healy 2008-12-31 21:06:34EST types.lisp -;; Time-stamp: <2009-05-25 16:34:12EDT types.lisp> +;; Time-stamp: <2009-11-14 10:54:53EST types.lisp> ;; $Id: $ (in-package :gsl) @@ -207,16 +207,3 @@ "The CL type from the CFFI element type." (unless (eq cffi-type :pointer) (lookup-type cffi-type *cstd-cl-type-mapping*))) - -(defun splice-name (base-name type keyword) - "Make a new C name for a data function from a base name." - (let ((pos (search keyword base-name))) - (when pos - (let ((insert (+ pos (length keyword))) - (gsltype (cl-gsl type))) - (concatenate 'string - (subseq base-name 0 insert) - (if (zerop (length gsltype)) "" "_") - (cl-gsl type) - (subseq base-name insert)))))) - diff --git a/linear-algebra/diagonal.lisp b/linear-algebra/diagonal.lisp index 41a2ee0c523c766fe4acce9851cd0cd9f5244c09..03505c3f0a802fa93d68c6880928f744f14b3e3f 100644 --- a/linear-algebra/diagonal.lisp +++ b/linear-algebra/diagonal.lisp @@ -1,6 +1,6 @@ ;; Tridiagonal and Bidiagonal matrices ;; Liam Healy, Thu May 4 2006 - 15:43 -;; Time-stamp: <2008-12-07 18:31:38EST diagonal.lisp> +;; Time-stamp: <2009-11-14 09:22:50EST diagonal.lisp> ;; $Id$ (in-package :gsl) @@ -211,3 +211,40 @@ ( e_0 d_1 e_1 0 ) ( 0 e_1 d_2 e_2 ) ( e_3 0 e_2 d_3 )") + +;;;;**************************************************************************** +;;;; Example +;;;;**************************************************************************** + +(defun solve-tridiagonal-example (&optional (n 6)) + "Solution differential equation + y=1 with boundary conditions y(0)=(n-1)^2, y(n-1)=0. + + The solution is the sequence: (n-1)^2, (n-2)^2, ... 9, 4, 2, 1, 0 + + Desicretization of y leads to a tridiagonal system of equations + (y_(i-1)-2_i+y_(i+1))/2 = 1 for 1 < i < (n - 2) + + The boundary conditions are implemented as + y(0)=(n-1)^2 + y(n-1)=0" + (labels ((mvec (dimension &key initial-element) + "Shorthand for initializing gsll vectors" + (if initial-element + (make-marray 'double-float :dimensions dimension :initial-element initial-element) + (make-marray 'double-float :dimensions dimension)))) + (let ((x (mvec n)) + (b (mvec n :initial-element 1d0)) + (diag (mvec n :initial-element -1d0)) + (superdiag (mvec (1- n) :initial-element 0.5d0)) + (subdiag (mvec (1- n) :initial-element 0.5d0))) + (setf + ;; i=0 matrix elements + (maref diag 0) 1d0 + (maref superdiag 0) 0d0 + (maref b 0) (coerce (expt (1- n) 2) 'double-float) + ;; i=n-1 matrix elements + (maref diag (1- n)) 1d0 + (maref subdiag (- n 2)) 0d0 + (maref b (1- n)) 0d0) + (solve-tridiagonal diag superdiag subdiag b x)))) diff --git a/special-functions/dilogarithm.lisp b/special-functions/dilogarithm.lisp index 76b4e49d6f0a717ec7efae41294943b8bef6438b..48878e1cf8a101150b05a28556771985e76e0db6 100644 --- a/special-functions/dilogarithm.lisp +++ b/special-functions/dilogarithm.lisp @@ -1,11 +1,11 @@ ;; Dilogarithm ;; Liam Healy, Fri Mar 17 2006 - 18:44 -;; Time-stamp: <2008-10-21 22:57:50EDT dilogarithm.lisp> -;; $Id$ +;; Time-stamp: <2009-11-14 10:27:52EST dilogarithm.lisp> (in-package :gsl) ;;; dilog merge complex and real +(export 'dilogarithm) (defgeneric dilogarithm (x) (:documentation ; FDL "The dilogarithm.")) diff --git a/special-functions/psi.lisp b/special-functions/psi.lisp index caf95ddbde55505767f58daf18a2193edac5e4d7..f1f5e4d4902d5a99dad96de6eb5e558c3d52276c 100644 --- a/special-functions/psi.lisp +++ b/special-functions/psi.lisp @@ -1,6 +1,6 @@ ;; Psi (digamma) functions ;; Liam Healy, Mon May 1 2006 - 22:11 -;; Time-stamp: <2008-10-25 11:27:13EDT psi.lisp> +;; Time-stamp: <2009-11-14 10:56:27EST psi.lisp> ;; $Id$ (in-package :gsl) @@ -36,6 +36,7 @@ ;;;; Trigamma Function ;;;;**************************************************************************** +(export 'psi-1) (defgeneric psi-1 (x) ;; FDL (:documentation "The Trigamma function."))