Skip to content
Snippets Groups Projects
Commit 79a0f72c authored by Liam Healy's avatar Liam Healy
Browse files

Minor fixes; documentation update

LU-decomposition now returns signum as a second value.  Remove unused
*sizet-type*.  Update index.html with clbuild installation procedure
provided by Glen Henshaw and how to run the tests.
parent d2018a78
No related branches found
No related tags found
No related merge requests found
;; Permutations
;; Liam Healy, Sun Mar 26 2006 - 11:51
;; Time-stamp: <2008-12-31 21:10:05EST permutation.lisp>
;; Time-stamp: <2009-01-08 10:28:06EST permutation.lisp>
;; $Id$
(in-package :gsl)
......@@ -17,8 +17,6 @@
:reader element-type :allocation :class))
(:documentation "GSL permutations."))
;;(pushnew (cons 'permutation *sizet-type*) *class-element-type* :test #'equal)
(cffi:defcstruct gsl-permutation-c ; The GSL struct
(size sizet)
(data :pointer))
......
......@@ -107,20 +107,13 @@ GSLL should work in any Common Lisp implementation and platform
combination for which the following are supported:</p>
<ul>
<li><a href="http://www.gnu.org/software/gsl/">GSL</a>
(<a href="http://packages.debian.org/lenny/libgsl0ldbl">libgsl0ldbl</a>
in Debian/Ubuntu)
</li>
<li><a href="http://common-lisp.net/project/cffi/">CFFI</a>,
version 0.10.0 or newer;
only platforms and implementations which have callbacks and
foreign-funcall support will work
(<a href="http://packages.debian.org/lenny/cl-cffi">cl-cffi</a>
in Debian/Ubuntu)
version 0.10.0 or newer; callbacks and <code>foreign-funcall</code> must be supported
</li>
<li><a href="http://www.cliki.net/trivial-garbage">trivial-garbage</a>
<li><a href="http://common-lisp.net/project/cl-utilities/">cl-utilities</a>
(<a href="http://packages.debian.org/lenny/cl-utilities">cl-utilities</a>
in Debian/Ubuntu)</li>
</li>
<li><a href="http://www.cliki.net/asdf">ASDF</a></li></ul>
<p>GSLL has been tested with
......@@ -135,20 +128,64 @@ foreign-funcall support will work
</p>
<h2>Download and Install</h2>
<h3>With <a href="http://git.or.cz">git</a> and asdf</h3>
<a name="getit"/>
<p>Use <a href="http://git.or.cz">git</a> to download:
<pre>
git clone git://repo.or.cz/gsll.git
</pre>
<p>Download/update:
<ul>
<li><code>git clone git://repo.or.cz/gsll.git</code></li>
<li><code>git pull</code> in the <code>gsll</code> directory
afterwards to update</li>
</ul>
<p>The <a href="http://repo.or.cz/w/gsll.git"> repository web page</a>
can be used to browse or retrieve a compressed tarball (click the most
recent "snapshot" link).
You will need to make a link of <code>gsll.asd</code> and
optionally <code>gsll-tests.asd</code> to some directory known to ASDF.
Then in Lisp, load the system:
<pre>(asdf:operate 'asdf:load-op :gsll)</pre>
<p>and if you wish to run the test suite,
<pre>(asdf:operate 'asdf:load-op :gsll-tests)</pre>
<ul>
<li><code>(asdf:operate 'asdf:load-op :gsll)</code></li>
</ul>
<h3>With <a href="http://common-lisp.net/project/clbuild/">clbuild</a></h3>
<p>
Add the following to <code>wnpp-projects</code>:
<ul>
<li><code>gsll get_git git://repo.or.cz/gsll.git</code></li>
<li><code>trivial-garbage get_darcs http://common-lisp.net/~loliveira/darcs/trivial-garbage</code></li>
<li><code>cl-utilities get_cvs_clnet</code></li>
</ul>
<p>and add
<ul>
<li><code>gsll cffi trivial-garbage cl-utilities</code></li>
</ul>
<p>
to <code>dependencies</code> and execute
from within the clbuild directory:
<ul>
<li><code>sudo ./clbuild update gsll</code></li>
</ul>
<h3>With Debian or Ubuntu</h3>
<ul>
<li><code>sudo aptitude install libgsl0-dev cl-cffi cl-utilities</code></li>
<li><code>git clone git://repo.or.cz/gsll.git</code></li>
<li><code>darcs get http://common-lisp.net/~loliveira/darcs/trivial-garbage</code></li>
<li><code>clc-register-user-package trivial-garbage/trivial-garbage.asd</code></li>
<li><code>clc-register-user-package gsll/gsll.asd</code></li>
<li><code>clc-register-user-package gsll/gsll-tests.asd</code></li>
</ul>
<p>
After starting your Lisp implementation,
<ul>
<li><code>(clc:clc-require :gsll)</code></li>
</ul>
<h3>Test suite</h3>
<p>The test suite may be run with
<ul>
<li><code>(asdf:operate 'asdf:load-op :gsll-tests)</code></li>
<li><code>(in-package :gsl)</code></li>
<li><code>(lisp-unit:run-tests)</code></li>
</ul>
<p>Please see the file documentation/status.text for known failures.
<h3>License</h3>
<p>
This software is distributed under
the <a href="http://www.cliki.net/LLGPL">LLGPL</a>
......@@ -278,9 +315,9 @@ eigen-symm eigen-symmv eigen-herm eigen-hermv
monte-carlo-plain monte-carlo-miser monte-carlo-vegas
</pre>
<p>
An instance each may be created with a function that whose name is
"make-" followed by the class name, e.g. <code>make-histogram</code>.
The arguments that the function takes depends on the class.
An instance may be created with a function whose name is "make-"
followed by the class name, e.g. <code>make-histogram</code>. The
arguments that the function takes depends on the class.
</p>
<h3>Additional definitions</h3>
......@@ -317,7 +354,7 @@ version should still be considered alpha.
<!-- Created: Feb 25 2005 -->
<!-- hhmts start -->
<small>
Time-stamp: <2009-01-07 22:25:08EST index.html>
Time-stamp: <2009-01-08 13:28:20EST index.html>
</small>
<!-- hhmts end -->
</div>
......
;; Permissible types
;; Liam Healy 2008-12-31 21:06:34EST types.lisp
;; Time-stamp: <2008-12-31 21:52:33EST types.lisp>
;; Time-stamp: <2009-01-08 10:28:04EST types.lisp>
;; $Id: $
(in-package :gsl)
......@@ -9,18 +9,13 @@
;;;; Types for CFFI (will eventually be in CFFI)
;;;;****************************************************************************
(defvar *sizet-type* nil
"The CL type for size_t.")
(case
(cffi:foreign-type-size :long)
(cffi:foreign-type-size :long)
(8
(push :int64 *features*)
(setf *sizet-type* '(unsigned-byte 64))
(cffi:defctype sizet :uint64))
(4
(push :int32 *features*)
(setf *sizet-type* '(unsigned-byte 32))
(cffi:defctype sizet :uint32))
(t (error "Size of :long unrecognized")))
......
;; LU decomposition
;; Liam Healy, Thu Apr 27 2006 - 12:42
;; Time-stamp: <2008-12-30 22:32:38EST lu.lisp>
;; Time-stamp: <2009-01-08 12:15:52EST lu.lisp>
;; $Id$
(in-package :gsl)
......@@ -11,7 +11,7 @@
:definition :generic
:inputs (A)
:outputs (A p)
:return (A)
:return (A signum)
:element-types :doubles
:documentation ; FDL
"Factorize the square matrix A into the LU decomposition PA = LU,
......@@ -21,12 +21,12 @@
diagonal) contains L. The diagonal elements of L are unity, and are
not stored.
The permutation matrix P is encoded in the permutation
p. The j-th column of the matrix P is given by the
k-th column of the identity matrix, where k = p_j the
j-th element of the permutation vector. The sign of the
permutation is given by signum. It has the value (-1)^n,
where n is the number of interchanges in the permutation.
The permutation matrix P is encoded in the permutation p. The j-th
column of the matrix P is given by the k-th column of the identity
matrix, where k = p_j the j-th element of the permutation
vector. The sign of the permutation is returned as the second
value; it is the value (-1)^n, where n is the number of
interchanges in the permutation.
The algorithm used in the decomposition is Gaussian Elimination with
partial pivoting (Golub & Van Loan, Matrix Computations,
......@@ -52,7 +52,7 @@
:inputs (LU p)
:outputs (x)
:element-types :doubles
:documentation ; FLD
:documentation ; FDL
"Solve the square system A x = b in-place
using the LU decomposition of A into
(LU, p). On input x should contain the right-hand
......@@ -94,23 +94,22 @@
(defmfun LU-determinant ((LU matrix) signum)
("gsl_linalg" :complex "_LU_det")
(((mpointer LU) :pointer) (signum :int))
:c-return :double
:definition :generic
:inputs (LU)
:element-types :doubles
:c-return :double
:documentation ; FDL
"Compute the determinant of a matrix from its LU
decomposition, LU. The determinant is computed as the product of the
diagonal elements of U and the sign of the row permutation signum.")
(defmfun LU-log-determinant ((LU matrix))
("gsl_linalg" :complex "_LU_lndet")
(((mpointer LU) :pointer))
:c-return :double
:definition :generic
:inputs (LU)
:element-types :doubles
:c-return :double
:documentation ; FDL
"The logarithm of the absolute value of the
determinant of a matrix A, ln|det(A)|, from its LU decomposition,
......@@ -120,10 +119,10 @@
(defmfun LU-sgndet ((LU matrix) signum)
("gsl_linalg" :complex "_LU_sgndet")
(((mpointer LU) :pointer) (signum :int))
:c-return :int
:definition :generic
:inputs (LU)
:element-types :doubles
:c-return :int
:documentation ; FDL
"Compute the sign or phase factor of the determinant of a matrix A,
det(A)/|det(A)|, from its LU decomposition, LU.")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment