Commit 7c36d17f authored by liam's avatar liam

New name maref (was gsl-aref), m*, m+, etc. Basis spline example now

gives results, not checked.


git-svn-id: svn+ssh://pop/opt/space/mathematics/gsl/trunk@3304 a3d8a0fb-c1db-0310-ace7-a616afeb9e30
parent 2ceb2dca
;; Basis splines.
;; Liam Healy 2008-02-18 14:43:20EST basis-splines.lisp
;; Time-stamp: <2008-02-18 15:48:50EST basis-splines.lisp>
;; Time-stamp: <2008-02-23 19:36:35EST basis-splines.lisp>
;; $Id: $
(in-package :gsl)
......@@ -51,7 +51,7 @@
(defmfun evaluate-bspline (x B workspace)
"gsl_bspline_eval"
((x :double) (B :pointer) (workspace :pointer))
((x :double) ((pointer B) :pointer) (workspace :pointer))
:documentation ; FDL
"Evaluate all B-spline basis functions at the position x and store
them in the GSL vector B, so that the ith element of B is B_i(x).
......@@ -84,21 +84,21 @@
(sigma 0.1d0))
;; The data to be fitted.
(dotimes (i ndata)
(let* ((xi (* i (/ 15 (1- ndata))))
(let* ((xi (coerce (* i (/ 15 (1- ndata))) 'double-float))
(yi (+ (* (cos xi) (exp (* -0.1d0 xi)))
(gaussian rng sigma))))
(setf (gsl-aref x i) xi
(gsl-aref y i) yi
(gsl-aref w i) (/ (expt sigma 2)))))
(setf (maref x i) xi
(maref y i) yi
(maref w i) (/ (expt sigma 2)))))
;; Uniform breakpoints [0, 15]
(uniform-knots 0.0d0 15.0d0 bw)
;; Fit matrix
(dotimes (i ndata)
;; Compute B_j
(evaluate-bspline (gsl-aref x i) B bw)
(evaluate-bspline (maref x i) B bw)
;; Fill in row i of X
(dotimes (j ncoeffs)
(setf (gsl-aref Xmatrix i j) (gsl-aref B j))))
(setf (maref Xmatrix i j) (maref B j))))
;; Do the fit
(weighted-linear-mfit Xmatrix w y c cov mw)
;; Return the smoothed curve
......
;; Combinations
;; Liam Healy, Sun Mar 26 2006 - 11:51
;; Time-stamp: <2008-02-17 10:01:38EST combination.lisp>
;; Time-stamp: <2008-02-23 18:49:21EST combination.lisp>
;; $Id: $
(in-package :gsl)
......@@ -25,7 +25,7 @@
;;;; Getting values
;;;;****************************************************************************
(defmfun gsl-aref ((combination gsl-combination) &rest indices)
(defmfun maref ((combination gsl-combination) &rest indices)
"gsl_combination_get"
(((pointer combination) :pointer) ((first indices) size))
:type :method
......@@ -38,7 +38,7 @@
(make-sequence 'list (combination-size object)))))
(loop for i from 0
below (min (length seq) (combination-size object))
do (setf (elt seq i) (gsl-aref object i)))
do (setf (elt seq i) (maref object i)))
seq))
;;;;****************************************************************************
......
;; Using GSL bulk data (vectors, matrices, etc.) storage.
;; Liam Healy, Sun Mar 26 2006 - 16:32
;; Time-stamp: <2008-02-17 09:18:27EST data.lisp>
;; Time-stamp: <2008-02-23 18:57:18EST data.lisp>
;; $Id: $
(in-package :gsl)
......@@ -57,11 +57,11 @@
(:documentation "The CL type of an element."))
;;; Accessing elements
(export 'gsl-aref)
(defgeneric gsl-aref (object &rest indices)
(export 'maref)
(defgeneric maref (object &rest indices)
(:documentation "An element of the data."))
(defgeneric (setf gsl-aref) (value object &rest indices)
(defgeneric (setf maref) (value object &rest indices)
(:method :after (value (object gsl-data) &rest indices)
(push indices (cl-invalid object)))
(:documentation "Set an element of the data."))
......@@ -300,13 +300,13 @@
(t sequence))))
(loop for i from 0
below (min (length seq) total-size)
do (setf (elt seq i) (gsl-aref object i)))
do (setf (elt seq i) (maref object i)))
seq)
;; set selected
(let ((seq (data-cache object)))
(mapc (lambda (is)
(let ((i (first is)))
(setf (elt seq i) (gsl-aref object i))))
(setf (elt seq i) (maref object i))))
(cl-invalid object))
seq)))
;; Around method looks for cached value and returns it if valid;
......@@ -330,7 +330,7 @@
(:method (sequence (object gsl-data))
(loop for i from 0
below (min (length sequence) (apply #'* (storage-size object)))
do (setf (gsl-aref object i) (elt sequence i))))
do (setf (maref object i) (elt sequence i))))
(:method :after (source (object gsl-data))
(setf (cl-invalid object) t)))
......@@ -372,24 +372,24 @@
;;;; Arithmetic operations
;;;;****************************************************************************
(export '(gsl+ gsl- gsl* gsl/ gsl*c gsl+c))
(export '(m+ m- m* m/ m*c m+c))
(defgeneric gsl+ (a b)
(defgeneric m+ (a b)
(:documentation "Add."))
(defgeneric gsl- (a b)
(defgeneric m- (a b)
(:documentation "Subtract."))
(defgeneric gsl* (a b)
(defgeneric m* (a b)
(:documentation "Multiply."))
(defgeneric gsl/ (a b)
(defgeneric m/ (a b)
(:documentation "Divide."))
(defgeneric gsl+c (a x)
(defgeneric m+c (a x)
(:documentation "Add scalar."))
(defgeneric gsl*c (a x)
(defgeneric m*c (a x)
(:documentation "Multiply by scalar."))
;;;;****************************************************************************
......
;; Matrices
;; Liam Healy, Sun Mar 26 2006 - 11:51
;; Time-stamp: <2008-02-17 09:45:48EST matrix.lisp>
;; Time-stamp: <2008-02-23 18:57:17EST matrix.lisp>
;; $Id: $
(in-package :gsl)
......@@ -67,7 +67,7 @@
;;;; Getting values
;;;;****************************************************************************
(defmfun-mdsfc gsl-aref ((matrix gsl-matrix) &rest indices)
(defmfun-mdsfc maref ((matrix gsl-matrix) &rest indices)
"gsl_matrix_get"
(((pointer matrix) :pointer)
((first indices) size)
......@@ -104,14 +104,14 @@
below
(min (array-dimension arr 1) (second (storage-size object)))
do
(setf (aref arr i j) (gsl-aref object i j))))
(setf (aref arr i j) (maref object i j))))
arr))
;;;;****************************************************************************
;;;; Setting values
;;;;****************************************************************************
(defmfun-mdsfc (setf gsl-aref) (value (matrix gsl-matrix) &rest indices)
(defmfun-mdsfc (setf maref) (value (matrix gsl-matrix) &rest indices)
"gsl_matrix_set"
(((pointer matrix) :pointer)
((first indices) size)
......@@ -138,7 +138,7 @@
below
(min (array-dimension array 1) (second (storage-size object)))
do
(setf (gsl-aref object i j) (aref array i j)))))
(setf (maref object i j) (aref array i j)))))
(defmfun-mdsfc set-all ((object gsl-matrix) value)
"gsl_matrix_set_all"
......@@ -457,7 +457,7 @@
;;;; Arithmetic operations
;;;;****************************************************************************
(defmfun-mdsfc gsl+ ((a gsl-matrix) (b gsl-matrix))
(defmfun-mdsfc m+ ((a gsl-matrix) (b gsl-matrix))
"gsl_matrix_add"
(((pointer a) gsl-matrix-c) ((pointer b) gsl-matrix-c))
:invalidate (a)
......@@ -466,7 +466,7 @@
a'_i = a_i + b_i. The two matrices must have the
same dimensions.")
(defmfun-mdsfc gsl- ((a gsl-matrix) (b gsl-matrix))
(defmfun-mdsfc m- ((a gsl-matrix) (b gsl-matrix))
"gsl_matrix_sub" (((pointer a) gsl-matrix-c) ((pointer b) gsl-matrix-c))
:invalidate (a)
:documentation ; FDL
......@@ -474,7 +474,7 @@
a, a'_i = a_i - b_i. The two matrices must have the
same dimensions.")
(defmfun-mdsfc gsl* ((a gsl-matrix) (b gsl-matrix))
(defmfun-mdsfc m* ((a gsl-matrix) (b gsl-matrix))
"gsl_matrix_mul_elements"
(((pointer a) gsl-matrix-c) ((pointer b) gsl-matrix-c))
:invalidate (a)
......@@ -483,7 +483,7 @@
matrix b, a'(i,j) = a(i,j) * b(i,j). The two matrices must have the
same dimensions.")
(defmfun-mdsfc gsl/ ((a gsl-matrix) (b gsl-matrix))
(defmfun-mdsfc m/ ((a gsl-matrix) (b gsl-matrix))
"gsl_matrix_div_elements"
(((pointer a) gsl-matrix-c) ((pointer b) gsl-matrix-c))
:invalidate (a)
......@@ -492,14 +492,14 @@
matrix b, a'(i,j) = a(i,j) / b(i,j). The two matrices must have the
same dimensions.")
(defmfun-mdsfc gsl*c ((a gsl-matrix) x)
(defmfun-mdsfc m*c ((a gsl-matrix) x)
"gsl_matrix_scale" (((pointer a) gsl-matrix-c) (x :c-base-type))
:invalidate (a)
:documentation ; FDL
"Multiply the elements of matrix a by the constant
factor x, a'(i,j) = x a(i,j).")
(defmfun-mdsfc gsl+c ((a gsl-matrix) x)
(defmfun-mdsfc m+c ((a gsl-matrix) x)
"gsl_matrix_add_constant" (((pointer a) gsl-matrix-c) (x :c-base-type))
:invalidate (a)
:documentation ; FDL
......@@ -577,9 +577,9 @@
#|
(make-tests matrix-fixnum
(letm ((intmat (matrix-fixnum 2 2))) ;(setf gsl-aref), gsl-aref
(setf (gsl-aref intmat 0 1) 77)
(gsl-aref intmat 0 1))
(letm ((intmat (matrix-fixnum 2 2))) ;(setf maref), maref
(setf (maref intmat 0 1) 77)
(maref intmat 0 1))
(letm ((intmat (matrix-fixnum 2 2))) ;(setf data)
(setf (data intmat) #2A((4 6) (8 2)))
(data intmat))
......@@ -637,8 +637,8 @@
(LIST 77)
(MULTIPLE-VALUE-LIST
(LETM ((INTMAT (MATRIX-FIXNUM 2 2)))
(SETF (GSL-AREF INTMAT 0 1) 77)
(GSL-AREF INTMAT 0 1))))
(SETF (MAREF INTMAT 0 1) 77)
(MAREF INTMAT 0 1))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST #2A((4 6) (8 2)))
(MULTIPLE-VALUE-LIST
......@@ -741,14 +741,14 @@
(loop for i from 0 below 10
do
(loop for j from 0 below 3
do (setf (gsl-aref mat i j) (+ 0.23d0 j (* 100 i)))))
do (setf (maref mat i j) (+ 0.23d0 j (* 100 i)))))
(data mat))
(letm ((mat (matrix-double #2A((1.0d0 2.0d0) (3.0d0 4.0d0))))
(ans (matrix-double 2 2)))
(copy ans mat)
(data ans))
(letm ((mat (matrix-double #2A((1.0d0 2.0d0) (3.0d0 4.0d0)))))
(gsl* mat mat)
(m* mat mat)
(data mat)))
|#
......@@ -769,7 +769,7 @@
(LETM ((MAT (MATRIX-DOUBLE 10 3)))
(LOOP FOR I FROM 0 BELOW 10 DO
(LOOP FOR J FROM 0 BELOW 3 DO
(SETF (GSL-AREF MAT I J)
(SETF (MAREF MAT I J)
(+ 0.23d0 J (* 100 I)))))
(DATA MAT))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
......@@ -782,5 +782,5 @@
(LIST #2A((1.0d0 4.0d0) (9.0d0 16.0d0)))
(MULTIPLE-VALUE-LIST
(LETM ((MAT (MATRIX-DOUBLE #2A((1.0d0 2.0d0) (3.0d0 4.0d0)))))
(GSL* MAT MAT) (DATA MAT)))))
(M* MAT MAT) (DATA MAT)))))
;; Permutations
;; Liam Healy, Sun Mar 26 2006 - 11:51
;; Time-stamp: <2008-02-17 09:56:49EST permutation.lisp>
;; Time-stamp: <2008-02-23 18:49:22EST permutation.lisp>
;; $Id: $
(in-package :gsl)
......@@ -24,7 +24,7 @@
;;;; Getting values
;;;;****************************************************************************
(defmfun gsl-aref ((permutation gsl-permutation) &rest indices)
(defmfun maref ((permutation gsl-permutation) &rest indices)
"gsl_permutation_get"
(((pointer permutation) :pointer) ((first indices) size))
:type :method
......@@ -250,9 +250,9 @@
#|
(make-tests
permutation
(letm ((perm-1 (permutation 4 t))) ;gsl-aref
(letm ((perm-1 (permutation 4 t))) ;maref
(set-identity perm-1)
(gsl-aref perm-1 2))
(maref perm-1 2))
(letm ((perm-1 (permutation 4 t))) ;data
(set-identity perm-1)
(data perm-1))
......@@ -299,7 +299,7 @@
(MULTIPLE-VALUE-LIST
(LETM ((PERM-1 (PERMUTATION 4 T)))
(SET-IDENTITY PERM-1)
(GSL-AREF PERM-1 2))))
(MAREF PERM-1 2))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST #(0 1 2 3))
(MULTIPLE-VALUE-LIST
......
;; Vectors
;; Liam Healy, Sun Mar 26 2006 - 11:51
;; Time-stamp: <2008-02-17 16:19:47EST vector.lisp>
;; Time-stamp: <2008-02-23 18:57:18EST vector.lisp>
;; $Id: $
(in-package :gsl)
......@@ -25,7 +25,7 @@
;;; Need to build real vector out of view pointer.
;;; Need to #'cl-invalidate when (setf gsl-aref) called, see Mon Nov 26 2007.
;;; Need to #'cl-invalidate when (setf maref) called, see Mon Nov 26 2007.
;;;;****************************************************************************
......@@ -116,7 +116,7 @@ deallocated with the vector.
;;;; Getting values
;;;;****************************************************************************
(defmfun-vdsfc gsl-aref ((vector gsl-vector) &rest indices)
(defmfun-vdsfc maref ((vector gsl-vector) &rest indices)
"gsl_vector_get"
(((pointer vector) :pointer) ((first indices) size))
:c-return :c-base-type
......@@ -140,7 +140,7 @@ deallocated with the vector.
;;;; Setting values
;;;;****************************************************************************
(defmfun-vdsfc (setf gsl-aref) (value (vector gsl-vector) &rest indices)
(defmfun-vdsfc (setf maref) (value (vector gsl-vector) &rest indices)
"gsl_vector_set"
(((pointer vector) :pointer) ((first indices) size) (value :c-base-type))
:c-return :void
......@@ -293,7 +293,7 @@ deallocated with the vector.
;;;; Arithmetic operations
;;;;****************************************************************************
(defmfun-vdsf gsl+ ((a gsl-vector) (b gsl-vector))
(defmfun-vdsf m+ ((a gsl-vector) (b gsl-vector))
"gsl_vector_add" (((pointer a) gsl-vector-c) ((pointer b) gsl-vector-c))
:invalidate (a)
:documentation ; FDL
......@@ -301,34 +301,34 @@ deallocated with the vector.
vector a, a'_i = a_i + b_i. The two vectors must have the
same length.")
(defmfun-vdsf gsl- ((a gsl-vector) (b gsl-vector))
(defmfun-vdsf m- ((a gsl-vector) (b gsl-vector))
"gsl_vector_sub" (((pointer a) gsl-vector-c) ((pointer b) gsl-vector-c))
:invalidate (a)
:documentation ; FDL
"Subtract the elements of vector b from the elements of
vector a, a'_i = a_i - b_i. The two vectors must have the same length.")
(defmfun-vdsf gsl* ((a gsl-vector) (b gsl-vector))
(defmfun-vdsf m* ((a gsl-vector) (b gsl-vector))
"gsl_vector_mul" (((pointer a) gsl-vector-c) ((pointer b) gsl-vector-c))
:invalidate (a)
:documentation ; FDL
"Multiply the elements of vector a by the elements of
vector b, a'_i = a_i * b_i. The two vectors must have the same length.")
(defmfun-vdsf gsl/ ((a gsl-vector) (b gsl-vector))
(defmfun-vdsf m/ ((a gsl-vector) (b gsl-vector))
"gsl_vector_div" (((pointer a) gsl-vector-c) ((pointer b) gsl-vector-c))
:invalidate (a)
:documentation ; FDL
"Divide the elements of vector a by the elements of
vector b, a'_i = a_i / b_i. The two vectors must have the same length.")
(defmfun-vdsf gsl*c ((a gsl-vector) x)
(defmfun-vdsf m*c ((a gsl-vector) x)
"gsl_vector_scale" (((pointer a) gsl-vector-c) (x :double))
:invalidate (a)
:documentation ; FDL
"Multiply the elements of vector a by the constant factor x, a'_i = x a_i.")
(defmfun-vdsf gsl+c ((a gsl-vector) x)
(defmfun-vdsf m+c ((a gsl-vector) x)
"gsl_vector_add_constant" (((pointer a) gsl-vector-c) (x :double))
:invalidate (a)
:documentation ; FDL
......@@ -398,9 +398,9 @@ deallocated with the vector.
#|
(make-tests
vector-fixnum
(letm ((intvec (vector-fixnum 4))) ;(setf gsl-aref), gsl-aref
(setf (gsl-aref intvec 1) 77)
(gsl-aref intvec 1))
(letm ((intvec (vector-fixnum 4))) ;(setf maref), maref
(setf (maref intvec 1) 77)
(maref intvec 1))
(letm ((intvec (vector-fixnum 4))) ;(setf data)
(setf (data intvec) #(4 6 8 2))
(data intvec))
......@@ -446,8 +446,8 @@ deallocated with the vector.
(LIST 77)
(MULTIPLE-VALUE-LIST
(LETM ((INTVEC (VECTOR-FIXNUM 4)))
(SETF (GSL-AREF INTVEC 1) 77)
(GSL-AREF INTVEC 1))))
(SETF (MAREF INTVEC 1) 77)
(MAREF INTVEC 1))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST #(4 6 8 2))
(MULTIPLE-VALUE-LIST
......@@ -536,9 +536,9 @@ deallocated with the vector.
(make-tests
vector-double
(letm ((vec (vector-double 3)))
(setf (gsl-aref vec 0) -3.21d0
(gsl-aref vec 1) 1.0d0
(gsl-aref vec 2) 12.8d0
(setf (maref vec 0) -3.21d0
(maref vec 1) 1.0d0
(maref vec 2) 12.8d0
(cl-invalid vec) t)
(data vec))
(letm ((vec (vector-double 3)))
......@@ -560,9 +560,9 @@ deallocated with the vector.
(LIST #(-3.21d0 1.0d0 12.8d0))
(MULTIPLE-VALUE-LIST
(LETM ((VEC (VECTOR-DOUBLE 3)))
(SETF (GSL-AREF VEC 0) -3.21d0
(GSL-AREF VEC 1) 1.0d0
(GSL-AREF VEC 2) 12.8d0
(SETF (MAREF VEC 0) -3.21d0
(MAREF VEC 1) 1.0d0
(MAREF VEC 2) 12.8d0
(CL-INVALID VEC) T)
(DATA VEC))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
......
<!-- -*- mode: HTML; time-stamp-line-limit: -8; -*- -->
<!-- -*- mode: HTML; time-stamp-line-limit: -18; -*- -->
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<html xmlns="http://www.nw3.org/1999/xhtml">
<head>
<link rel="stylesheet" href="style.css" type="text/css"/>
<title>GSLL Development</title>
......@@ -39,6 +39,11 @@
equivalent probably won't be done, unless there is a need to have it
present for some other GSL functionality that isn't present in CL.
</li>
<li>Data types that are not defined in Common Lisp portably (such as
uint) may not be well supported. Others may be added but it
may be difficult to do so in a portable way. There are several
macros that should make this relatively easy.
</li>
</ul>
<h3>Status</h3>
......@@ -51,6 +56,10 @@
It is possible that the library API will change but probably not
substantially; most of the remaining work involves added functions.
Although many of the file output functions have been ported, none
have been tested, and they likely will need additional C or support
from other libraries.
<p>
There seem to be differences in the random number generators
between amd64 and i386, so many regression tests fail as the
......@@ -96,16 +105,13 @@
<pre>
(lisp-unit:run-tests)
</pre>
and expect a two failures on amd64, none? on i386.
See <a href="documentation.html">documentation</a> regarding known failures.
</p>
<hr>
<address><a href="mailto:">Liam Healy</a></address>
<small>
Time-stamp: <2008-02-18 00:25:04EST index.html>
<!-- Liam Healy 2008-02-18 11:36:11EST development.html -->
<!-- Time-stamp: <2008-02-18 12:50:26EST development.html> -->
<!-- $Id: $ -->
Time-stamp: <2008-02-23 19:08:21EST development.html>
</small>
<!-- hhmts end -->
</div>
......
<!-- -*- mode: HTML; time-stamp-line-limit: -8; -*- -->
<!-- -*- mode: HTML; time-stamp-line-limit: -18; -*- -->
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
......@@ -79,32 +79,47 @@ are functions whose symbols are exported so that an arglist prompt
will be visible; however, the function should not be used outside a
let binding.
<h3>Data</h3>
<h3>Data: vectors, matrices, etc.</h3>
<div class="content">
<p>
Collectively, vectors, matrices, histograms and the like are called
<i>data</i>. There many different types supported by GSL, but GSLL
has implemented only a few of these: complex, double-float,
single-float, and fixnum, because those types are defined by
the Common Lisp standard. Others may be added but it may be
difficult to do so in a portable way. There are several macros that
should make this relatively easy.
<i>data</i>. There are many different types of vectors and matrices
supported by GSL, but GSLL has implemented only a few of these:
complex, double-float, single-float, and fixnum, because those types
are defined by the Common Lisp standard.
<p>Vectors and matrices can be converted to and from their Lisp
counterparts with <code>data</code> and <code>(setf data)</code>.
Setting the GSL value to a Lisp value at initialization
can be done within the <code>letm</code> by giving the Lisp value as
the first argument after the type, for example
<pre>
(letm ((vec (vector-double #(-3.21d0 1.0d0 12.8d0))))
(data vec))
</pre>
Individual elements of data may be accessed with <code>maref</code>,
either directly or in a <code>setf</code>.
<h3>Status</h3>
<div class="content">
Consistent with the <a href="development.html">development</a>
philosophy, most of the interface to the library is done. Notes
particular chapters:
on particular chapters:
<ul>
<li><a href="Vectors-and-Matrices.html">Vectors and Matrices</a>
are done for integer, real, double, complex.
Subvectors and views don't work. Other element types may be
difficult to port due to lack of CL definition.
<base href="http://www.gnu.org/software/gsl/manual/html_node/">
<base
href="http://www.gnu.org/software/gsl/manual/html_node/">
<li>Functions that provide file input and output to files are not tested and
likely will need other definitions (perhaps in C) to function
properly, unless CFFI and the CL platform provide C stream
compatibility.
<li>Some <a href="Sorting.html">sorting</a> functions fail on amd64 platforms,
perhaps because of lack of unsigned integer vectors.
<li><a href="BLAS-Support.html">BLAS</a> is completed, but with only very
limited testing.
<li><a href="Fast-Fourier-Transforms.html">FFTs</a> has not been done
<li><a href="Fast-Fourier-Transforms.html">FFTs</a> have not been done
because GSL does not supply an example and it is not clear how it
used. Contributions welcome.
<li><a href="Simulated-Annealing.html">Simulated Annealing</a> has
......@@ -114,17 +129,30 @@ let binding.
<li><a href="Discrete-Hankel-Transforms.html">Discrete Hankel
Transforms</a> has been done but there is no example given in the GSL
manual.
<li><a href="Basis-Splines.html">Basis splines</a> have yet to be tested.
<li><a href="Basis-Splines.html">Basis splines</a> example runs, but
the GSL documentation does not provide the result for comparison.
</ul>
<p>
There are failures observed in the regression tests
<code>(lisp-unit:run-tests)</code>:
<ul>
<li>CLISP shows three "foreign callout errors". Remedy unknown.
<li>Sorting shows two failures on amd64 platforms. This is possibly
because of the use of integer vectors to store unsigned integer
vectors.
<li>There are several regression failures that are apparently due to
changes in GSL between versions 1.8 and 1.10. These are:
beta, chi-squared, dirichlet, elliptic-functions, fdist,
gamma-randist, negative-binomial.
</ul>
<div class="footer">
<hr>
<address><a href="mailto:">Liam Healy</a></address>
<!-- Created: Feb 25 2005 -->
<!-- hhmts start -->
<small>
Time-stamp: <2008-02-18 14:56:02EST documentation.html>
Time-stamp: <2008-02-23 19:45:14EST documentation.html>
</small>
<!-- hhmts end -->
</div>
......
<!-- -*- mode: HTML; time-stamp-line-limit: -8; -*- -->
<!-- -*- mode: HTML; time-stamp-line-limit: -18; -*- -->
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
......@@ -28,13 +28,14 @@
getting quick answers, even for someone not intending
to program in Lisp.
</p>
<p>This code should be considered alpha but it is largely usable
<p>This code should be considered alpha and is still under
development, but it is largely usable
now, with some GSL capability not yet available. See
Development section below.</p>
<p>This software is distributed under the <a
href="http://www.cliki.net/LLGPL">LLGPL</a>
and <a href="http://www.gnu.org/copyleft/fdl.html">FDL</a>.
See COPYING.</p>
See COPYING. There is absolutely no warranty.</p>
</div>
<h3>Examples</h3>
......@@ -85,7 +86,9 @@ debugger invoked on a GSL-ERROR in thread #<THREAD "initial thread" {10032258C1}
common-lisp-controller</a>, install with
<code>clc-register-user-package</code> and then within Lisp
<code>(clc:clc-require :gsll)</code>.
<p>GSLL has been tested with SBCL on Debian i386 and amd64.</p>
<p>GSLL has been tested with <a
href="http://sbcl.sourceforge.net/">SBCL</a> and <a
href="http://clisp.cons.org/">CLISP</a> on Debian i386 and amd64.</p>
</div>
<h3>Additional information</h3>
......@@ -121,7 +124,7 @@ svn checkout svn://common-lisp.net/project/gsll/subversion/trunk</pre>.</p>
<!-- Created: Feb 25 2005 -->
<!-- hhmts start -->
<small>
Time-stamp: <2008-02-18 12:51:51EST index.html>
Time-stamp: <2008-02-23 19:02:16EST index.html>
</small>
<!-- hhmts end -->
</div>
......
;; Histogram operations
;; Liam Healy, Mon Jan 1 2007 - 16:47
;; Time-stamp: <2008-02-17 17:10:53EST operations.lisp>
;; Time-stamp: <2008-02-23 18:57:17EST operations.lisp>
;; $Id: $
(in-package :gsl)
......@@ -30,11 +30,11 @@
;;; GSL documentation does not state what the return value for the
;;; C function means; assumed to be error code.
(defmfun gsl+-1 (histogram1 histogram2)
(defmfun m+-1 (histogram1 histogram2)
"gsl_histogram_add"
(((pointer histogram1) :pointer) ((pointer histogram2) :pointer))
:export nil
:index gsl+
:index m+
:documentation ; FDL
"Add the contents of the bins in histogram2 to the
corresponding bins of histogram1 i.e. h'_1(i) =
......@@ -43,32 +43,32 @@
;;; GSL documentation does not state what the return value for the
;;; C function means; assumed to be error code.
(defmfun gsl+-2 (histogram1 histogram2)
(defmfun m+-2 (histogram1 histogram2)
"gsl_histogram2d_add"
(((pointer histogram1) :pointer) ((pointer histogram2) :pointer))
:export nil
:index gsl+
:index m+
:documentation ; FDL
"Add the contents of the bins in histogram2 to the
corresponding bins of histogram1 i.e. h'_1(i) =
h_1(i) + h_2(i). The two histograms must have identical bin
ranges.")
(defmethod gsl+ ((histogram1 histogram) (histogram2 histogram))
(defmethod m+ ((histogram1 histogram) (histogram2 histogram))
;; FDL
"Add the contents of the bins in histogram2 to the
corresponding bins of histogram1 i.e. h'_1(i) =
h_1(i) + h_2(i). The two histograms must have identical bin
ranges."
(histo-1d2d histogram1 gsl+ (histogram2)))
(histo-1d2d histogram1 m+ (histogram2)))
;;; GSL documentation does not state what the return value for the
;;; C function means; assumed to be error code.
(defmfun gsl--1 (histogram1 histogram2)
(defmfun m--1 (histogram1 histogram2)
"gsl_histogram_sub"
(((pointer histogram1) :pointer) ((pointer histogram2) :pointer))
:export nil
:index gsl-
:index m-
:documentation ; FDL
"Subtract the contents of the bins in histogram2 from the
corresponding bins of histogram1 i.e. h'_1(i) = h_1(i) -
......@@ -76,17 +76,17 @@
;;; GSL documentation does not state what the return value for the
;;; C function means; assumed to be error code.
(defmfun gsl--2 (histogram1 histogram2)
(defmfun m--2 (histogram1 histogram2)
"gsl_histogram2d_sub"
(((pointer histogram1) :pointer) ((pointer histogram2) :pointer))
:export nil
:index gsl-
:index m-
:documentation ; FDL
"Subtract the contents of the bins in histogram2 from the
corresponding bins of histogram1 i.e. h'_1(i) = h_1(i) -
h_2(i). The two histograms must have identical bin ranges.")
(defmethod gsl- ((histogram1 histogram) (histogram2 histogram))
(defmethod m- ((histogram1 histogram) (histogram2 histogram))
;; FDL
"Subtract the contents of the bins in histogram2 from the
corresponding bins of histogram1 i.e. h'_1(i) = h_1(i) -
......@@ -95,11 +95,11 @@
;;; GSL documentation does not state what the return value for the
;;; C function means; assumed to be error code.
(defmfun gsl*-1 (histogram1 histogram2)
(defmfun m*-1 (histogram1 histogram2)
"gsl_histogram_mul"
(((pointer histogram1) :pointer) ((pointer histogram2) :pointer))
:export nil
:index gsl*
:index m*
:documentation ; FDL
"Multiply the contents of the bins of histogram1 by the
contents of the corresponding bins in histogram2
......@@ -108,32 +108,32 @@
;;; GSL documentation does not state what the return value for the
;;; C function means; assumed to be error code.
(defmfun gsl*-2 (histogram1 histogram2)