Commit e803849a authored by liam's avatar liam

Add linear least squares fitting. Define generic functions so that

warnings are suppressed.


git-svn-id: svn+ssh://pop/opt/space/mathematics/gsl/trunk@3274 a3d8a0fb-c1db-0310-ace7-a616afeb9e30
parent 0a78898d
This diff is collapsed.
;******************************************************** ;; Permutations
; file: permutation.lisp ;; Liam Healy, Sun Mar 26 2006 - 11:51
; description: Permutations ;; Time-stamp: <2008-01-21 11:12:01EST permutation.lisp>
; date: Sun Mar 26 2006 - 11:51 ;; $Id: $
; author: Liam M. Healy
; modified: Sun Jun 4 2006 - 21:02
;********************************************************
;;; $Id: $
(in-package :gsl) (in-package :gsl)
...@@ -33,7 +29,7 @@ ...@@ -33,7 +29,7 @@
(((pointer permutation) :pointer) ((first indices) :size)) (((pointer permutation) :pointer) ((first indices) :size))
:type :method :type :method
:c-return :size :c-return :size
:documentation "The ith element of the permutation.") :documentation "The ith element of the permutation.") ; FDL
;;;;**************************************************************************** ;;;;****************************************************************************
;;;; Setting values ;;;; Setting values
...@@ -44,9 +40,9 @@ ...@@ -44,9 +40,9 @@
(((pointer permutation) :pointer)) (((pointer permutation) :pointer))
:type :method :type :method
:c-return :void :c-return :void
:documentation :documentation ; FDL
"Initialize the permutation @var{p} to the identity, i.e. "Initialize the permutation p to the identity, i.e.
@math{(0,1,2,@dots{},n-1)}.") (0,1,2,@dots{},n-1).")
(defun-gsl copy ((destination gsl-permutation) (source gsl-permutation)) (defun-gsl copy ((destination gsl-permutation) (source gsl-permutation))
"gsl_permutation_memcpy" "gsl_permutation_memcpy"
...@@ -54,18 +50,17 @@ ...@@ -54,18 +50,17 @@
((pointer source) gsl-permutation-c)) ((pointer source) gsl-permutation-c))
:type :method :type :method
:invalidate (destination) :invalidate (destination)
:documentation :documentation ; FDL
"Copy the elements of the permutation @var{src} into the "Copy the elements of the permutation source into the
permutation @var{dest}. The two permutations must have the same size.") permutation destination. The two permutations must have the same size.")
(defun-gsl swap-elements ((p gsl-permutation) i j) (defun-gsl swap-elements ((p gsl-permutation) i j)
"gsl_permutation_swap" "gsl_permutation_swap"
(((pointer p) gsl-permutation-c) (i :size) (j :size)) (((pointer p) gsl-permutation-c) (i :size) (j :size))
:type :method :type :method
:invalidate (p) :invalidate (p)
:documentation :documentation ; FDL
"Exchanges the @var{i}-th and @var{j}-th elements of the "Exchanges the ith and jth elements of the permutation p.")
permutation @var{p}.")
;;;;**************************************************************************** ;;;;****************************************************************************
;;;; Permutation properties ;;;; Permutation properties
...@@ -74,26 +69,26 @@ ...@@ -74,26 +69,26 @@
(defun-gsl permutation-size (p) (defun-gsl permutation-size (p)
"gsl_permutation_size" "gsl_permutation_size"
(((pointer p) gsl-permutation-c)) (((pointer p) gsl-permutation-c))
:c-return :size :c-return :size ; FDL
:documentation :documentation
"The size of the permutation @var{p}.") "The size of the permutation p.")
(defun-gsl permutation-data (p) (defun-gsl permutation-data (p)
"gsl_permutation_data" "gsl_permutation_data"
(((pointer p) gsl-permutation-c)) (((pointer p) gsl-permutation-c))
:c-return :pointer :c-return :pointer
:documentation :documentation ; FDL
"A pointer to the array of elements in the "A pointer to the array of elements in the
permutation @var{p}.") permutation p.")
(defun-gsl data-valid ((permutation gsl-permutation)) (defun-gsl data-valid ((permutation gsl-permutation))
"gsl_permutation_valid" "gsl_permutation_valid"
(((pointer permutation) :pointer)) (((pointer permutation) :pointer))
:type :method :type :method
:c-return :boolean :c-return :boolean
:documentation :documentation ; FDL
"Check that the permutation @var{p} is valid. The @var{n} "Check that the permutation p is valid. The n
elements should contain each of the numbers 0 to @math{@var{n}-1} once and only elements should contain each of the numbers 0 to n-1 once and only
once.") once.")
;;;;**************************************************************************** ;;;;****************************************************************************
...@@ -105,26 +100,26 @@ ...@@ -105,26 +100,26 @@
(((pointer p) gsl-permutation-c)) (((pointer p) gsl-permutation-c))
:invalidate (p) :invalidate (p)
:c-return :void :c-return :void
:documentation :documentation ; FDL
"Reverse the order of the elements of the permutation @var{p}.") "Reverse the order of the elements of the permutation p.")
(defun-gsl permutation-inverse (inv p) (defun-gsl permutation-inverse (inv p)
"gsl_permutation_inverse" "gsl_permutation_inverse"
(((pointer inv) gsl-permutation-c) ((pointer p) gsl-permutation-c)) (((pointer inv) gsl-permutation-c) ((pointer p) gsl-permutation-c))
:invalidate (inv) :invalidate (inv)
:documentation :documentation ; FDL
"Find the inverse of the permutation @var{p}.") "Find the inverse of the permutation p.")
(defun-gsl permutation-next (p) (defun-gsl permutation-next (p)
"gsl_permutation_next" "gsl_permutation_next"
(((pointer p) gsl-permutation-c)) (((pointer p) gsl-permutation-c))
:c-return :success-failure :c-return :success-failure
:invalidate (p) :invalidate (p)
:documentation :documentation ; FDL
"Advance the permutation @var{p} to the next permutation "Advance the permutation p to the next permutation
in lexicographic order and return p and T. If no further in lexicographic order and return p and T. If no further
permutations are available, return p and NIL with permutations are available, return p and NIL with
@var{p} unmodified. Starting with the identity permutation and p unmodified. Starting with the identity permutation and
repeatedly applying this function will iterate through all possible repeatedly applying this function will iterate through all possible
permutations of a given order.") permutations of a given order.")
...@@ -133,11 +128,11 @@ ...@@ -133,11 +128,11 @@
(((pointer p) gsl-permutation-c)) (((pointer p) gsl-permutation-c))
:c-return :success-failure :c-return :success-failure
:invalidate (p) :invalidate (p)
:documentation :documentation ; FDL
"Step backwards from the permutation @var{p} to the "Step backwards from the permutation p to the
previous permutation in lexicographic order, returning p and T. previous permutation in lexicographic order, returning p and T.
If no previous permutation is available, return If no previous permutation is available, return
p and NIL with @var{p} unmodified.") p and NIL with p unmodified.")
;;;;**************************************************************************** ;;;;****************************************************************************
;;;; Applying Permutations ;;;; Applying Permutations
...@@ -146,41 +141,47 @@ ...@@ -146,41 +141,47 @@
(defun-gsl permute (p data stride n) (defun-gsl permute (p data stride n)
"gsl_permute" "gsl_permute"
(((pointer p) gsl-permutation-c) (data :pointer) (stride :size) (n :size)) (((pointer p) gsl-permutation-c) (data :pointer) (stride :size) (n :size))
:documentation :documentation ; FDL
"Apply the permutation @var{p} to the array @var{data} of "Apply the permutation p to the array data of
size @var{n} with stride @var{stride}.") size n with stride stride.")
(defun-gsl permute-inverse (p data stride n) (defun-gsl permute-inverse (p data stride n)
"gsl_permute_inverse" "gsl_permute_inverse"
(((pointer p) gsl-permutation-c) (data :pointer) (stride :size) (n :size)) (((pointer p) gsl-permutation-c) (data :pointer) (stride :size) (n :size))
:documentation :documentation ; FDL
"Apply the inverse of the permutation @var{p} to the array @var{data} of "Apply the inverse of the permutation p to the array data of
size @var{n} with stride @var{stride}.") size n with stride.")
(export 'permute-vector)
(defgeneric permute-vector (permutation vector)
(:documentation ; FDL
"Apply the permutation p to the elements of the
vector v considered as a row-vector acted on by a permutation
matrix from the right, v' = v P. The jth column of the
permutation matrix P is given by the p_j-th column of the
identity matrix. The permutation p and the vector v must
have the same length."))
(defun-gsl-vdsfc permute-vector (p (v gsl-vector)) (defun-gsl-vdsfc permute-vector (p (v gsl-vector))
"gsl_permute_vector" "gsl_permute_vector"
(((pointer p) gsl-permutation-c) ((pointer v) gsl-vector-c)) (((pointer p) gsl-permutation-c) ((pointer v) gsl-vector-c))
:invalidate (v) :invalidate (v))
:documentation
"Apply the permutation @var{p} to the elements of the (export 'permute-vector-inverse)
vector @var{v}, considered as a row-vector acted on by a permutation (defgeneric permute-vector-inverse (permutation vector)
matrix from the right, @math{v' = v P}. The @math{j}-th column of the (:documentation ; FDL
permutation matrix @math{P} is given by the @math{p_j}-th column of the "Apply the inverse of the permutation p to the
identity matrix. The permutation @var{p} and the vector @var{v} must elements of the vector v considered as a row-vector acted on by
have the same length.") an inverse permutation matrix from the right, v' = v P^T. Note
that for permutation matrices the inverse is the same as the transpose.
The jth column of the permutation matrix P is given by
the p_j-th column of the identity matrix. The permutation p
and the vector v must have the same length."))
(defun-gsl-vdsfc permute-vector-inverse (p (v gsl-vector)) (defun-gsl-vdsfc permute-vector-inverse (p (v gsl-vector))
"gsl_permute_vector_inverse" "gsl_permute_vector_inverse"
(((pointer p) gsl-permutation-c) ((pointer v) gsl-vector-c)) (((pointer p) gsl-permutation-c) ((pointer v) gsl-vector-c))
:invalidate (v) :invalidate (v))
:documentation
"Apply the inverse of the permutation @var{p} to the
elements of the vector @var{v}, considered as a row-vector acted on by
an inverse permutation matrix from the right, @math{v' = v P^T}. Note
that for permutation matrices the inverse is the same as the transpose.
The @math{j}-th column of the permutation matrix @math{P} is given by
the @math{p_j}-th column of the identity matrix. The permutation @var{p}
and the vector @var{v} must have the same length.")
(defun-gsl permutation* (p pa pb) (defun-gsl permutation* (p pa pb)
"gsl_permutation_mul" "gsl_permutation_mul"
...@@ -188,10 +189,10 @@ ...@@ -188,10 +189,10 @@
((pointer pa) gsl-permutation-c) ((pointer pa) gsl-permutation-c)
((pointer pb) gsl-permutation-c)) ((pointer pb) gsl-permutation-c))
:invalidate (p) :invalidate (p)
:documentation :documentation ; FDL
"Combine the two permutations @var{pa} and @var{pb} into a "Combine the two permutations pa and pb into a
single permutation @var{p}, where @math{p = pa . pb}. The permutation single permutation p where p = pa . pb. The permutation
@var{p} is equivalent to applying @math{pb} first and then @var{pa}.") p is equivalent to applying pb first and then pa.")
;;;;**************************************************************************** ;;;;****************************************************************************
;;;; Permutations in cyclic form ;;;; Permutations in cyclic form
...@@ -201,24 +202,24 @@ ...@@ -201,24 +202,24 @@
"gsl_permutation_linear_to_canonical" "gsl_permutation_linear_to_canonical"
(((pointer q) gsl-permutation-c) ((pointer p) gsl-permutation-c)) (((pointer q) gsl-permutation-c) ((pointer p) gsl-permutation-c))
:invalidate (q) :invalidate (q)
:documentation :documentation ; FDL
"Compute the canonical form of the permutation @var{p} and "Compute the canonical form of the permutation p and
stores it in the output argument @var{q}.") stores it in the output argument q.")
(defun-gsl canonical-to-linear (p q) (defun-gsl canonical-to-linear (p q)
"gsl_permutation_canonical_to_linear" "gsl_permutation_canonical_to_linear"
(((pointer p) gsl-permutation-c) ((pointer q) gsl-permutation-c)) (((pointer p) gsl-permutation-c) ((pointer q) gsl-permutation-c))
:invalidate (p) :invalidate (p)
:documentation :documentation ; FDL
"Convert a permutation @var{q} in canonical form back into "Convert a permutation q in canonical form back into
linear form storing it in the output argument @var{p}.") linear form storing it in the output argument p.")
(defun-gsl inversions (p) (defun-gsl inversions (p)
"gsl_permutation_inversions" (((pointer p) gsl-permutation-c)) "gsl_permutation_inversions" (((pointer p) gsl-permutation-c))
:c-return :size :c-return :size
:documentation :documentation ; FDL
"Count the number of inversions in the permutation "Count the number of inversions in the permutation
@var{p}. An inversion is any pair of elements that are not in order. p. An inversion is any pair of elements that are not in order.
For example, the permutation 2031 has three inversions, corresponding to For example, the permutation 2031 has three inversions, corresponding to
the pairs (2,0) (2,1) and (3,1). The identity permutation has no the pairs (2,0) (2,1) and (3,1). The identity permutation has no
inversions.") inversions.")
...@@ -226,16 +227,15 @@ ...@@ -226,16 +227,15 @@
(defun-gsl linear-cycles (p) (defun-gsl linear-cycles (p)
"gsl_permutation_linear_cycles" (((pointer p) gsl-permutation-c)) "gsl_permutation_linear_cycles" (((pointer p) gsl-permutation-c))
:c-return :size :c-return :size
:documentation :documentation ; FDL
"Count the number of cycles in the permutation @var{p}, given in linear form.") "Count the number of cycles in the permutation p, given in linear form.")
(defun-gsl canonical-cycles (p) (defun-gsl canonical-cycles (p)
"gsl_permutation_canonical_cycles" "gsl_permutation_canonical_cycles"
(((pointer p) gsl-permutation-c)) (((pointer p) gsl-permutation-c))
:c-return :size :c-return :size
:documentation :documentation ; FDL
"Count the number of cycles in the permutation @var{q}, "Count the number of cycles in the permutation q, given in canonical form.")
given in canonical form.")
;;;;**************************************************************************** ;;;;****************************************************************************
;;;; Examples and unit test ;;;; Examples and unit test
......
;******************************************************** ;; Eigenvectors and eigenvalues
; file: eigensystems.lisp ;; Liam Healy, Sun May 21 2006 - 19:52
; description: Eigenvectors and eigenvalues ;; Time-stamp: <2008-01-21 11:30:57EST eigensystems.lisp>
; date: Sun May 21 2006 - 19:52 ;; $Id: $
; author: Liam M. Healy
; modified: Tue Jul 4 2006 - 23:09
;********************************************************
;;; $Id: $
(in-package :gsl) (in-package :gsl)
...@@ -45,33 +41,38 @@ ...@@ -45,33 +41,38 @@
(defun-gsl eigen-symm-alloc (n) (defun-gsl eigen-symm-alloc (n)
"gsl_eigen_symm_alloc" ((n :size)) "gsl_eigen_symm_alloc" ((n :size))
:documentation "Allocate a workspace for computing eigenvalues of :documentation ; FDL
@var{n}-by-@var{n} real symmetric matrices. The size of the workspace "Allocate a workspace for computing eigenvalues of
is @math{O(2n)}." n-by-n real symmetric matrices. The size of the workspace
is O(2n)."
:c-return :pointer) :c-return :pointer)
(defun-gsl eigen-symm-free (w) (defun-gsl eigen-symm-free (w)
"gsl_eigen_symm_free" ((w :pointer)) "gsl_eigen_symm_free" ((w :pointer))
:c-return :void :c-return :void
:documentation "Free the memory associated with the workspace @var{w}.") :documentation ; FDL
"Free the memory associated with the workspace w.")
(defun-gsl eigen-symmv-alloc (n) (defun-gsl eigen-symmv-alloc (n)
"gsl_eigen_symmv_alloc" ((n :size)) "gsl_eigen_symmv_alloc" ((n :size))
:documentation "Allocate a workspace for computing eigenvalues and :documentation ; FDL
eigenvectors of @var{n}-by-@var{n} real symmetric matrices. The size of "Allocate a workspace for computing eigenvalues and
the workspace is @math{O(4n)}." eigenvectors of n-by-n real symmetric matrices. The size of
the workspace is O(4n)."
:c-return :pointer) :c-return :pointer)
(defun-gsl eigen-symmv-free (w) (defun-gsl eigen-symmv-free (w)
"gsl_eigen_symmv_free" ((w :pointer)) "gsl_eigen_symmv_free" ((w :pointer))
:c-return :void :c-return :void
:documentation "Free the memory associated with the workspace @var{w}.") :documentation ; FDL
"Free the memory associated with the workspace w.")
(defun-gsl eigenvalues-symmetric (A eval ws) (defun-gsl eigenvalues-symmetric (A eval ws)
"gsl_eigen_symm" ((A gsl-matrix-c) (eval gsl-vector-c) (ws :pointer)) "gsl_eigen_symm" ((A gsl-matrix-c) (eval gsl-vector-c) (ws :pointer))
:documentation "Eigenvalues of the real symmetric matrix :documentation ; FDL
@var{A}. Additional workspace of the appropriate size must be provided "Eigenvalues of the real symmetric matrix
in @var{w}. The diagonal and lower triangular part of @var{A} are A. Additional workspace of the appropriate size must be provided
in w. The diagonal and lower triangular part of A are
destroyed during the computation, but the strict upper triangular part destroyed during the computation, but the strict upper triangular part
is not referenced. The eigenvalues are stored in the vector @var{eval} is not referenced. The eigenvalues are stored in the vector @var{eval}
and are unordered." and are unordered."
...@@ -81,13 +82,14 @@ ...@@ -81,13 +82,14 @@
(defun-gsl eigenvalues-eigenvectors-symmetric (A eval evec ws) (defun-gsl eigenvalues-eigenvectors-symmetric (A eval evec ws)
"gsl_eigen_symmv" "gsl_eigen_symmv"
((A gsl-matrix-c) (eval gsl-vector-c) (evec gsl-matrix-c) (ws :pointer)) ((A gsl-matrix-c) (eval gsl-vector-c) (evec gsl-matrix-c) (ws :pointer))
:documentation "The eigenvalues and eigenvectors of the real :documentation ; FDL
symmetric matrix @var{A}. Additional workspace of the appropriate size "The eigenvalues and eigenvectors of the real
must be provided in @var{w}. The diagonal and lower triangular part of symmetric matrix A. Additional workspace of the appropriate size
@var{A} are destroyed during the computation, but the strict upper must be provided in w. The diagonal and lower triangular part of
A are destroyed during the computation, but the strict upper
triangular part is not referenced. The eigenvalues are stored in the triangular part is not referenced. The eigenvalues are stored in the
vector @var{eval} and are unordered. The corresponding eigenvectors are vector eval and are unordered. The corresponding eigenvectors are
stored in the columns of the matrix @var{evec}. For example, the stored in the columns of the matrix evec. For example, the
eigenvector in the first column corresponds to the first eigenvalue. eigenvector in the first column corresponds to the first eigenvalue.
The eigenvectors are guaranteed to be mutually orthogonal and normalised The eigenvectors are guaranteed to be mutually orthogonal and normalised
to unit magnitude." to unit magnitude."
...@@ -100,23 +102,25 @@ ...@@ -100,23 +102,25 @@
(defun-gsl eigen-herm-alloc (n) (defun-gsl eigen-herm-alloc (n)
"gsl_eigen_herm_alloc" ((n :size)) "gsl_eigen_herm_alloc" ((n :size))
:documentation "Allocate a workspace for computing eigenvalues of :documentation ; FDL
@var{n}-by-@var{n} complex hermitian matrices. The size of the workspace "Allocate a workspace for computing eigenvalues of
is @math{O(3n)}." n-by-n complex hermitian matrices. The size of the workspace
is O(3n)."
:c-return :pointer) :c-return :pointer)
(defun-gsl eigen-herm-free (w) (defun-gsl eigen-herm-free (w)
"gsl_eigen_herm_free" ((w :pointer)) "gsl_eigen_herm_free" ((w :pointer))
:c-return :void :c-return :void
:documentation "Free the memory associated with the workspace @var{w}.") :documentation ; FDL
"Free the memory associated with the workspace w.")
(defun-gsl eigenvalues-hermitian (A eval w) (defun-gsl eigenvalues-hermitian (A eval w)
"gsl_eigen_herm" "gsl_eigen_herm"
(((pointer A) gsl-matrix-c) ((pointer eval) gsl-vector-c) (w :pointer)) (((pointer A) gsl-matrix-c) ((pointer eval) gsl-vector-c) (w :pointer))
:documentation :documentation ; FDL
"Compute the eigenvalues of the complex hermitian matrix "Compute the eigenvalues of the complex hermitian matrix
@var{A}. Additional workspace of the appropriate size must be provided A. Additional workspace of the appropriate size must be provided
in @var{w}. The diagonal and lower triangular part of @var{A} are in w. The diagonal and lower triangular part of A are
destroyed during the computation, but the strict upper triangular part destroyed during the computation, but the strict upper triangular part
is not referenced. The imaginary parts of the diagonal are assumed to be is not referenced. The imaginary parts of the diagonal are assumed to be
zero and are not referenced. The eigenvalues are stored in the vector zero and are not referenced. The eigenvalues are stored in the vector
...@@ -126,29 +130,31 @@ ...@@ -126,29 +130,31 @@
(defun-gsl eigen-hermv-alloc (n) (defun-gsl eigen-hermv-alloc (n)
"gsl_eigen_hermv_alloc" ((n :size)) "gsl_eigen_hermv_alloc" ((n :size))
:documentation "Allocate a workspace for computing eigenvalues and :documentation ; FDL
eigenvectors of @var{n}-by-@var{n} complex hermitian matrices. The size of "Allocate a workspace for computing eigenvalues and
the workspace is @math{O(5n)}." eigenvectors of n-by-n complex hermitian matrices. The size of
the workspace is O(5n)."
:c-return :pointer) :c-return :pointer)
(defun-gsl eigen-hermv-free (w) (defun-gsl eigen-hermv-free (w)
"gsl_eigen_hermv_free" ((w :pointer)) "gsl_eigen_hermv_free" ((w :pointer))
:c-return :void :c-return :void
:documentation "Free the memory associated with the workspace @var{w}.") :documentation ; FDL
"Free the memory associated with the workspace w.")
(defun-gsl eigenvalues-eigenvectors-hermitian (A eval evec w) (defun-gsl eigenvalues-eigenvectors-hermitian (A eval evec w)
"gsl_eigen_hermv" "gsl_eigen_hermv"
(((pointer A) gsl-matrix-c) ((pointer eval) gsl-vector-c) (((pointer A) gsl-matrix-c) ((pointer eval) gsl-vector-c)
((pointer evec) gsl-matrix-c) (w :pointer)) ((pointer evec) gsl-matrix-c) (w :pointer))
:documentation :documentation ; FDL
"Compute the eigenvalues and eigenvectors of the complex "Compute the eigenvalues and eigenvectors of the complex
hermitian matrix @var{A}. Additional workspace of the appropriate size hermitian matrix A. Additional workspace of the appropriate size
must be provided in @var{w}. The diagonal and lower triangular part of must be provided in w. The diagonal and lower triangular part of
@var{A} are destroyed during the computation, but the strict upper A are destroyed during the computation, but the strict upper
triangular part is not referenced. The imaginary parts of the diagonal triangular part is not referenced. The imaginary parts of the diagonal
are assumed to be zero and are not referenced. The eigenvalues are are assumed to be zero and are not referenced. The eigenvalues are
stored in the vector @var{eval} and are unordered. The corresponding stored in the vector eval and are unordered. The corresponding
complex eigenvectors are stored in the columns of the matrix @var{evec}. complex eigenvectors are stored in the columns of the matrix evec.
For example, the eigenvector in the first column corresponds to the For example, the eigenvector in the first column corresponds to the
first eigenvalue. The eigenvectors are guaranteed to be mutually first eigenvalue. The eigenvectors are guaranteed to be mutually
orthogonal and normalised to unit magnitude." orthogonal and normalised to unit magnitude."
...@@ -163,15 +169,19 @@ ...@@ -163,15 +169,19 @@
"gsl_eigen_sort_t from /usr/include/gsl/gsl_eigen.h." "gsl_eigen_sort_t from /usr/include/gsl/gsl_eigen.h."
:value-ascending :value-descending :absolute-ascending :absolute-descending) :value-ascending :value-descending :absolute-ascending :absolute-descending)
(export 'sort-eigenvalues-eigenvectors)
(defgeneric sort-eigenvalues-eigenvectors (eval evec sort-type)
(:documentation ; FDL
"Simultaneously sort the eigenvalues stored in the vector
eval and the corresponding real eigenvectors stored in the columns
of the matrix evec into ascending or descending order according to
the value of the parameter sort-type: :value-ascending,
:value-descending, :absolute-ascending, :absolute-descending."))
(defun-gsl sort-eigenvalues-eigenvectors (defun-gsl sort-eigenvalues-eigenvectors
((eval gsl-vector-double) evec sort-type) ((eval gsl-vector-double) evec sort-type)
"gsl_eigen_symmv_sort" "gsl_eigen_symmv_sort"
((eval gsl-vector-c) (evec gsl-matrix-c) (sort-type eigen-sort-type)) ((eval gsl-vector-c) (evec gsl-matrix-c) (sort-type eigen-sort-type))
:documentation "Simultaneously sort the eigenvalues stored in the vector
@var{eval} and the corresponding real eigenvectors stored in the columns
of the matrix @var{evec} into ascending or descending order according to
the value of the parameter @var{sort_type}, :value-ascending,
:value-descending, :absolute-ascending, :absolute-descending."
:type :method :type :method
:invalidate (eval evec)) :invalidate (eval evec))
...@@ -179,10 +189,6 @@ ...@@ -179,10 +189,6 @@
((eval gsl-vector-complex) evec sort-type) ((eval gsl-vector-complex) evec sort-type)
"gsl_eigen_hermv_sort" "gsl_eigen_hermv_sort"
((eval gsl-vector-c) (evec gsl-matrix-c) (sort-type eigen-sort-type)) ((eval gsl-vector-c) (evec gsl-matrix-c) (sort-type eigen-sort-type))
:documentation "Simultaneously sort the eigenvalues stored in the vector
@var{eval} and the corresponding complex eigenvectors stored in the
columns of the matrix @var{evec} into ascending or descending order
according to the value of the parameter @var{sort_type}."
:type :method :type :method
:invalidate (eval evec)) :invalidate (eval evec))
......
;******************************************************** ;; Mathematical functions
; file: mathematical.lisp ;; Liam Healy, Wed Mar 8 2006 - 22:09
; description: Mathematical functions ;; Time-stamp: <2008-01-21 18:01:09EST mathematical.lisp>
; date: Wed Mar 8 2006 - 22:09 ;; $Id: $
; author: Liam M. Healy
; modified: Mon May 29 2006 - 23:06
;********************************************************
(in-package :gsl) (in-package :gsl)
...@@ -83,11 +80,13 @@ ...@@ -83,11 +80,13 @@
:documentation :documentation
"exp(x)-1, computed in a way that is accurate for small x.") "exp(x)-1, computed in a way that is accurate for small x.")
(defun-gsl hypotenuse (x y) (defun-gsl hypotenuse* (x y)
;; This is redundant; there is "gsl_sf_hypot_e" defined as
;; #'hyptoenuse.
"gsl_hypot" ((x :double) (y :double)) "gsl_hypot" ((x :double) (y :double))
:c-return :double