Commit c45f51ff authored by liam's avatar liam

Add householder, move blas to linear-algebra, load sorting.

git-svn-id: svn+ssh://pop/opt/space/mathematics/gsl/trunk@3066 a3d8a0fb-c1db-0310-ace7-a616afeb9e30
parent 18b94082
......@@ -3,7 +3,7 @@
; description: Definition of GSLL system
; date:
; author: Liam Healy
; modified: Thu May 4 2006 - 23:43
; modified: Thu May 11 2006 - 18:05
;********************************************************
;;; $Id: $
......@@ -69,16 +69,18 @@
(:file "vector" :depends-on (data))
(:file "matrix" :depends-on (data))
(:file "permutation" :depends-on (data))
(:file "combination" :depends-on (data))
(:file "blas1" :depends-on (vector))
(:file "blas2" :depends-on (vector matrix))
(:file "blas3" :depends-on (blas2 matrix))))
(:file "combination" :depends-on (data))))
(:file "sorting" :depends-on (init))
(:module linear-algebra
:depends-on (init data)
:components
((:file "lu")
((:file "blas1")
(:file "blas2")
(:file "blas3" :depends-on (blas2))
(:file "lu")
(:file "qr")
(:file "qrpt")
(:file "svd")
(:file "cholesky")
(:file "diagonal")))))
(:file "diagonal")
(:file "householder")))))
......@@ -3,7 +3,7 @@
; description: Cholesky Decomposition
; date: Wed May 3 2006 - 16:38
; author: Liam Healy
; modified: Wed May 3 2006 - 16:48
; modified: Wed May 10 2006 - 10:05
;********************************************************
;;; $Id: $
......@@ -12,20 +12,7 @@
;;; A symmetric, positive definite square matrix @math{A} has a Cholesky
;;; decomposition into a product of a lower triangular matrix @math{L} and
;;; its transpose @math{L^T},
;;; @tex
;;; \beforedisplay
;;; $$
;;; A = L L^T
;;; $$
;;; \afterdisplay
;;; @end tex
;;; @ifinfo
;;; @example
;;; A = L L^T
;;; @end example
;;; @end ifinfo
;;; @noindent
;;; This is sometimes referred to as taking the square-root of a matrix. The
;;; Cholesky decomposition can only be carried out when all the eigenvalues
;;; of the matrix are positive. This decomposition can be used to convert
......
;********************************************************
; file: householder.lisp
; description: Householder Transformations
; date: Wed May 10 2006 - 10:03
; author: Liam Healy
; modified: Thu May 11 2006 - 17:53
;********************************************************
;;; $Id: $
;;; For householder-transform, it would be nice to be able to pick the
;;; order of arguments returned (reverse).
(in-package :gsl)
;;;;****************************************************************************
;;;; Householder transformations
;;;;****************************************************************************
;;; A Householder transformation is a rank-1 modification of the identity
;;; matrix which can be used to zero out selected elements of a vector. A
;;; Householder matrix @math{P} takes the form,
;;; P = I - \tau v v^T
;;; where @math{v} is a vector (called the @dfn{Householder vector}) and
;;; @math{\tau = 2/(v^T v)}. The functions described in this section use the
;;; rank-1 structure of the Householder matrix to create and apply
;;; Householder transformations efficiently.
(defun-gsl householder-transform ((v gsl-vector-c))
"gsl_linalg_householder_transform"
:documentation "Prepare a Householder transformation @math{P = I - \tau v
v^T} which can be used to zero all the elements of the input vector except
the first. Returned values are the transformation, which is stored
in the vector @var{v}, and the scalar @math{\tau}."
:invalidate (v)
:c-return-value :return
:return (:double)
:return-input (v))
(defun-gsl householder-HM ((tau :double) (v gsl-vector-c) (A gsl-matrix-c))
"gsl_linalg_householder_hm"
:documentation "Apply the Householder matrix @math{P} defined by the
scalar @var{tau} and the vector @var{v} to the left-hand side of the
matrix @var{A}. On output the result @math{P A} is stored in @var{A}."
:invalidate (A)
:return-input (A))
(defun-gsl householder-MH ((tau :double) (v gsl-vector-c) (A gsl-matrix-c))
"gsl_linalg_householder_mh"
:documentation "Apply the Householder matrix @math{P} defined by the
scalar @var{tau} and the vector @var{v} to the right-hand side of the
matrix @var{A}. On output the result @math{A P} is stored in @var{A}."
:invalidate (A)
:return-input (A))
(defun-gsl householder-Hv ((tau :double) (v gsl-vector-c) (w gsl-vector-c))
"gsl_linalg_householder_hv"
:documentation "Apply the Householder transformation @math{P} defined by
the scalar @var{tau} and the vector @var{v} to the vector @var{w}. On
output the result @math{P w} is stored in @var{w}."
:invalidate (w)
:return-input (w))
;;;;****************************************************************************
;;;; Householder solver for linear systems
;;;;****************************************************************************
(defun-gsl householder-solve ((A gsl-matrix-c) (b gsl-vector-c) (x gsl-vector-c))
"gsl_linalg_HH_solve"
:documentation "Solve the system @math{A x = b} directly using
Householder transformations. On output the solution is stored in @var{x}
and @var{b} is not modified. The matrix @var{A} is destroyed by the
Householder transformations."
:invalidate (x A)
:return-input (x))
(defun-gsl householder-svx ((A gsl-matrix-c) (x gsl-vector-c))
"gsl_linalg_HH_svx"
:documentation "Solve the system @math{A x = b} in-place using
Householder transformations. On input @var{x} should contain the
right-hand side @math{b}, which is replaced by the solution on output. The
matrix @var{A} is destroyed by the Householder transformations."
:invalidate (x A)
:return-input (x))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment