Commit ef3e446f authored by Liam Healy's avatar Liam Healy

Small fixes

Combination #'copy-to-destination had permutation instead of
combination.  Only :compile-toplevel in eval-when for
maref-function-picker to prevent warning messages.  Non-symmetric
eigenvalues-eiegenvectors-nonsymm now return both eigenvalues and
eigenvectors; this function evidently doesn't support
set-parameters-nonsymmetric so that has been removed.
parent 419e70d4
;; Combinations
;; Liam Healy, Sun Mar 26 2006 - 11:51
;; Time-stamp: <2009-01-11 21:18:14EST combination.lisp>
;; Time-stamp: <2009-01-12 09:40:18EST combination.lisp>
;; $Id$
(in-package :gsl)
......@@ -79,7 +79,7 @@
"Initialize the combination c to the lexicographically
last combination, i.e. (n-k,n-k+1,...,n-1).")
(defmfun copy-to-destination ((source permutation) (destination permutation))
(defmfun copy-to-destination ((source combination) (destination combination))
(((mpointer destination) :pointer)
((mpointer source) :pointer))
;; Get/set array or elements: cl-array, maref
;; Liam Healy 2008-08-27 22:43:10EDT maref.lisp
;; Time-stamp: <2008-12-28 18:09:19EST maref.lisp>
;; Time-stamp: <2009-01-12 09:43:16EST maref.lisp>
;; $Id: $
(in-package :gsl)
......@@ -89,7 +89,7 @@
;;; callback functions in solve-minimize-fit and in #'cl-array method
;;; for pointers.
(eval-when (:compile-toplevel :load-toplevel)
(eval-when (:compile-toplevel)
(defun maref-function-picker (type-symbol category ffrestargs &optional value-symbol)
"Generate sexp to select on the various gsl_{vector,matrix}*_{get,set} functions."
(cons 'cond
;; Eigenvectors and eigenvalues
;; Liam Healy, Sun May 21 2006 - 19:52
;; Time-stamp: <2009-01-11 10:35:06EST eigensystems.lisp>
;; Time-stamp: <2009-01-12 10:22:00EST eigensystems.lisp>
;; $Id$
(in-package :gsl)
......@@ -210,7 +210,7 @@
(make-marray '(complex double-float) :dimensions (dimensions A)))
(ws (make-eigen-nonsymmv (dim0 A)))
compute-shur-form balance shur-vectors
(if (eql shur-vectors t)
......@@ -223,15 +223,11 @@
(((mpointer A) :pointer)
((mpointer eigenvalues) :pointer) ((mpointer eigenvectors) :pointer)
((mpointer ws) :pointer) ((mpointer sv) :pointer)))
:before ; this applies for evec-eval too, right?
((set-parameters-nonsymmetric ws compute-shur-form balance))
:gsl-version (1 9)
:switch (shur-vectors)
:inputs (A)
:outputs (A eigenvalues eigenvectors)
(cffi:foreign-slot-value (mpointer ws) 'gsl-nonsymm-ws 'n-evals))
:return (eigenvalues eigenvectors)
:documentation ; FDL
"Compute eigenvalues and right eigenvectors of the n-by-n real
nonsymmetric matrix A. It first calls #'eigenvalues-nonsymm to
......@@ -242,34 +238,7 @@
t to have it automatically made. The computed eigenvectors are
normalized to have unit magnitude. On output, the upper portion of A
contains the Schur form T. If #'eigenvalues-nonsymm fails, no
eigenvectors are computed, and an error code is returned.
If compute-shur-form is true, the full Schur form T will be computed.
If it is set to nil, T will not be computed (this is
the default setting). Computing the full Schur form requires
approximately 1.5-2 times the number of flops.
If balance is true, a balancing transformation is applied to the
matrix prior to computing eigenvalues. This transformation is
designed to make the rows and columns of the matrix have comparable
norms, and can result in more accurate eigenvalues for matrices
whose entries vary widely in magnitude. See Balancing for more
information. Note that the balancing transformation does not
preserve the orthogonality of the Schur vectors, so if you wish to
compute the Schur vectors with you will obtain the Schur vectors of
the balanced matrix instead of the original matrix. The relationship
will be
T = Q^t D^(-1) A D Q
where Q is the matrix of Schur vectors for the balanced matrix, and D
is the balancing transformation. Then this function will compute
a matrix Z which satisfies
T = Z^(-1) A Z
with Z = D Q. Note that Z will not be orthogonal. For this reason,
balancing is not performed by default.")
eigenvectors are computed, and an error code is returned.")
;;;; Sorting Eigenvalues and Eigenvectors
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