From 2ad949d80094951f48f0e8978a4ea531667ed6a0 Mon Sep 17 00:00:00 2001
From: Tim Daly
Date: Mon, 4 Apr 2016 01:33:02 0400
Subject: [PATCH] books/bookvol10.5 add BLAS and LAPACK documentation
Goal: Axiom Literate Programming

books/bookvol10.5.pamphlet 212291 ++++++++++++++++++++++++++++++++
changelog  4 +
patch  18 +
src/axiomwebsite/patches.html  4 +
4 files changed, 169486 insertions(+), 42831 deletions()
diff git a/books/bookvol10.5.pamphlet b/books/bookvol10.5.pamphlet
index 415e4a9..56d7521 100644
 a/books/bookvol10.5.pamphlet
+++ b/books/bookvol10.5.pamphlet
@@ 84127,20 +84127,692 @@ Man Page Details
(return (values nil nil nil nil nil nil nil nil nil nil nil))))))
\end{chunk}
+
+\chapter{LAPACK Overview}
+From the LAPACK User's Guide \cite{LAPA99}:
+
+We use the standard notation for a system of simultaneous linear equations:
+\[AX=b\]
+where $A$ is the {\bf coefficient matrix},
+$b$ is the {\bf right hand side},
+and $x$ is the {\bf solution}.
+$A$ is assumed to be a square matrix of order $n$, but some of the
+individual routines allow $A$ to be rectangular. If there are several
+right hand sides, we write
+\[AX=B\]
+where the columns of $B$ are the individual right hand sides,
+and the columns of $X$ are the corresponding solutions. The basic task
+is to compute $X$, given $A$ and $B$.
+
+If $A$ is upper or lower triangular, this can be solved by a straighforward
+process of backward or forward substitution. Otherwise, the solution is
+obtained after first factorizing $A$ as a product of triangular matrices
+(and possibly also a diagonal matrix or permutation matrix).
+
+The form of the factorization depends on the properties of the matrix $A$.
+LAPACK provides routines for the following types of matrices, based on the
+stated factorizations:
+
+\begin{itemize}
+\item {\bf general} matrices ($LU$ factorization with partial pivoting):
+\[A=PLU\]
+where $P$ is the permutation matrix, $L$ is lower triangular with unit
+diagonal elements (lower trapezoidal if $m>n$), and $U$ is upper
+triangular (upper trapezoidal if $m= n: find the least squares solution of
+ an overdetermined system, i.e., solve the least squares problem
+ minimize  B  A*X .
+
+ 2. If TRANS = 'N' and m < n: find the minimum norm solution of
+ an underdetermined system A * X = B.
+
+ 3. If TRANS = 'T' and m >= n: find the minimum norm solution of
+ an undetermined system A**T * X = B.
+
+ 4. If TRANS = 'T' and m < n: find the least squares solution of
+ an overdetermined system, i.e., solve the least squares problem
+ minimize  B  A**T * X .
+
+ Several right hand side vectors b and solution vectors x can be
+ handled in a single call; they are stored as the columns of the
+ MbyNRHS right hand side matrix B and the NbyNRHS solution
+ matrix X.
+
+Parameters:
+
+ TRANS
+ TRANS is CHARACTER*1
+ = 'N': the linear system involves A;
+ = 'T': the linear system involves A**T.
+
+ M
+ M is INTEGER
+ The number of rows of the matrix A. M >= 0.
+
+ N
+ N is INTEGER
+ The number of columns of the matrix A. N >= 0.
+
+ NRHS
+ NRHS is INTEGER
+ The number of right hand sides, i.e., the number of
+ columns of the matrices B and X. NRHS >=0.
+
+ A
+ A is DOUBLE PRECISION array, dimension (LDA,N)
+ On entry, the MbyN matrix A.
+ On exit,
+ if M >= N, A is overwritten by details of its QR
+ factorization as returned by DGEQRF;
+ if M < N, A is overwritten by details of its LQ
+ factorization as returned by DGELQF.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+
+ B
+ B is DOUBLE PRECISION array, dimension (LDB,NRHS)
+ On entry, the matrix B of right hand side vectors, stored
+ columnwise; B is MbyNRHS if TRANS = 'N', or NbyNRHS
+ if TRANS = 'T'.
+ On exit, if INFO = 0, B is overwritten by the solution
+ vectors, stored columnwise:
+ if TRANS = 'N' and m >= n, rows 1 to n of B contain the least
+ squares solution vectors; the residual sum of squares for the
+ solution in each column is given by the sum of squares of
+ elements N+1 to M in that column;
+ if TRANS = 'N' and m < n, rows 1 to N of B contain the
+ minimum norm solution vectors;
+ if TRANS = 'T' and m >= n, rows 1 to M of B contain the
+ minimum norm solution vectors;
+ if TRANS = 'T' and m < n, rows 1 to M of B contain the
+ least squares solution vectors; the residual sum of squares
+ for the solution in each column is given by the sum of
+ squares of elements M+1 to N in that column.
+
+ LDB
+ LDB is INTEGER
+ The leading dimension of the array B. LDB >= MAX(1,M,N).
+
+ WORK
+ WORK is DOUBLE PRECISION array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK.
+ LWORK >= max( 1, MN + max( MN, NRHS ) ).
+ For optimal performance,
+ LWORK >= max( 1, MN + max( MN, NRHS )*NB ).
+ where MN = min(M,N) and NB is the optimum block size.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value
+ > 0: if INFO = i, the ith diagonal element of the
+ triangular factor of A is zero, so that A does not have
+ full rank; the least squares solution could not be computed.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{dgels.f}
+\index{dgels.f}
+\begin{chunk}{dgels.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK dgels}
+
+\end{chunk}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{dgelsd}
+\label{dgelsd}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{dgelsd.input}
+)set break resume
+)sys rm f dgelsd.output
+)spool dgelsd.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{dgelsd.help}
+====================================================================
+dgelsd examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
SYNOPSIS
 SUBROUTINE DBDSDC( UPLO, COMPQ, N, D, E, U, LDU, VT, LDVT, Q, IQ, WORK,
 IWORK, INFO )
+ Functions/Subroutines
+ subroutine dgelsd (M, N, NRHS, A, LDA, B, LDB, S, RCOND, RANK, WORK,
+ LWORK, IWORK, INFO)
+ DGELSD computes the minimumnorm solution to a linear least
+ squares problem for GE matrices
 CHARACTER COMPQ, UPLO
+Function/Subroutine Documentation
+ subroutine dgelsd (integer M, integer N, integer NRHS, double precision,
+ dimension( lda, * ) A, integer LDA, double precision, dimension( ldb, *
+ ) B, integer LDB, double precision, dimension( * ) S, double precision
+ RCOND, integer RANK, double precision, dimension( * ) WORK, integer
+ LWORK, integer, dimension( * ) IWORK, integer INFO)
+ DGELSD computes the minimumnorm solution to a linear least squares
+ problem for GE matrices
 INTEGER INFO, LDU, LDVT, N
+Purpose:
+ DGELSD computes the minimumnorm solution to a real linear least
+ squares problem:
+ minimize 2norm( b  A*x )
+ using the singular value decomposition (SVD) of A. A is an MbyN
+ matrix which may be rankdeficient.
+
+ Several right hand side vectors b and solution vectors x can be
+ handled in a single call; they are stored as the columns of the
+ MbyNRHS right hand side matrix B and the NbyNRHS solution matrix X.
+
+ The problem is solved in three steps:
+ (1) Reduce the coefficient matrix A to bidiagonal form with
+ Householder transformations, reducing the original problem
+ into a "bidiagonal least squares problem" (BLS)
+ (2) Solve the BLS using a divide and conquer approach.
+ (3) Apply back all the Householder tranformations to solve
+ the original least squares problem.
+
+ The effective rank of A is determined by treating as zero those
+ singular values which are less than RCOND times the largest singular
+ value.
+
+ The divide and conquer algorithm makes very mild assumptions about
+ floating point arithmetic. It will work on machines with a guard
+ digit in add/subtract, or on those binary machines without guard
+ digits which subtract like the Cray XMP, Cray YMP, Cray C90, or
+ Cray2. It could conceivably fail on hexadecimal or decimal machines
+ without guard digits, but we know of none.
 INTEGER IQ( * ), IWORK( * )
+Parameters:
 DOUBLE PRECISION D( * ), E( * ), Q( * ), U( LDU, * ), VT(
 LDVT, * ), WORK( * )
+ M
+ M is INTEGER
+ The number of rows of A. M >= 0.
PURPOSE
 DBDSDC computes the singular value decomposition (SVD) of a real NbyN
 (upper or lower) bidiagonal matrix B: B = U * S * VT, using a divide
 and conquer method, where S is a diagonal matrix with nonnegative
 diagonal elements (the singular values of B), and U and VT are orthogo
 nal matrices of left and right singular vectors, respectively. DBDSDC
 can be used to compute all singular values, and optionally, singular
 vectors or singular vectors in compact form.
+ N
+ N is INTEGER
+ The number of columns of A. N >= 0.
 This code makes very mild assumptions about floating point arithmetic.
 It will work on machines with a guard digit in add/subtract, or on
 those binary machines without guard digits which subtract like the Cray
 XMP, Cray YMP, Cray C90, or Cray2. It could conceivably fail on
 hexadecimal or decimal machines without guard digits, but we know of
 none. See DLASD3 for details.
+ NRHS
+ NRHS is INTEGER
+ The number of right hand sides, i.e., the number of columns
+ of the matrices B and X. NRHS >= 0.
 The code currently calls DLASDQ if singular values only are desired.
 However, it can be slightly modified to compute singular values using
 the divide and conquer method.
+ A
+ A is DOUBLE PRECISION array, dimension (LDA,N)
+ On entry, the MbyN matrix A.
+ On exit, A has been destroyed.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+ B
+ B is DOUBLE PRECISION array, dimension (LDB,NRHS)
+ On entry, the MbyNRHS right hand side matrix B.
+ On exit, B is overwritten by the NbyNRHS solution
+ matrix X. If m >= n and RANK = n, the residual
+ sumofsquares for the solution in the ith column is given
+ by the sum of squares of elements n+1:m in that column.
ARGUMENTS
 UPLO (input) CHARACTER*1
 = 'U': B is upper bidiagonal.
 = 'L': B is lower bidiagonal.
+ LDB
+ LDB is INTEGER
+ The leading dimension of the array B. LDB >= max(1,max(M,N)).
 COMPQ (input) CHARACTER*1
 Specifies whether singular vectors are to be computed as fol
 lows:
 = 'N': Compute singular values only;
 = 'P': Compute singular values and compute singular vectors in
 compact form; = 'I': Compute singular values and singular vec
 tors.
+ S
+ S is DOUBLE PRECISION array, dimension (min(M,N))
+ The singular values of A in decreasing order.
+ The condition number of A in the 2norm = S(1)/S(min(m,n)).
+
+ RCOND
+ RCOND is DOUBLE PRECISION
+ RCOND is used to determine the effective rank of A.
+ Singular values S(i) <= RCOND*S(1) are treated as zero.
+ If RCOND < 0, machine precision is used instead.
+
+ RANK
+ RANK is INTEGER
+ The effective rank of A, i.e., the number of singular values
+ which are greater than RCOND*S(1).
+
+ WORK
+ WORK is DOUBLE PRECISION array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK. LWORK must be at least 1.
+ The exact minimum amount of workspace needed depends on M,
+ N and NRHS. As long as LWORK is at least
+ 12*N + 2*N*SMLSIZ + 8*N*NLVL + N*NRHS + (SMLSIZ+1)**2,
+ if M is greater than or equal to N or
+ 12*M + 2*M*SMLSIZ + 8*M*NLVL + M*NRHS + (SMLSIZ+1)**2,
+ if M is less than N, the code will execute correctly.
+ SMLSIZ is returned by ILAENV and is equal to the maximum
+ size of the subproblems at the bottom of the computation
+ tree (usually about 25), and
+ NLVL = MAX( 0, INT( LOG_2( MIN( M,N )/(SMLSIZ+1) ) ) + 1 )
+ For good performance, LWORK should generally be larger.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ IWORK
+ IWORK is INTEGER array, dimension (MAX(1,LIWORK))
+ LIWORK >= max(1, 3 * MINMN * NLVL + 11 * MINMN),
+ where MINMN = MIN( M,N ).
+ On exit, if INFO = 0, IWORK(1) returns the minimum LIWORK.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value.
+ > 0: the algorithm for computing the SVD failed to converge;
+ if INFO = i, i offdiagonal elements of an intermediate
+ bidiagonal form did not converge to zero.
 N (input) INTEGER
 The order of the matrix B. N >= 0.
+\end{chunk}
 D (input/output) DOUBLE PRECISION array, dimension (N)
 On entry, the n diagonal elements of the bidiagonal matrix B.
 On exit, if INFO=0, the singular values of B.
+\subsection{fortran code}
+\label{dgelsd.f}
+\index{dgelsd.f}
+\begin{chunk}{dgelsd.f}
+\end{chunk}
 E (input/output) DOUBLE PRECISION array, dimension (N1)
 On entry, the elements of E contain the offdiagonal elements of
 the bidiagonal matrix whose SVD is desired. On exit, E has
 been destroyed.
+\subsection{lisp code}
+\begin{chunk}{LAPACK dgelsd}
 U (output) DOUBLE PRECISION array, dimension (LDU,N)
 If COMPQ = 'I', then: On exit, if INFO = 0, U contains the
 left singular vectors of the bidiagonal matrix. For other val
 ues of COMPQ, U is not referenced.
+\end{chunk}
 LDU (input) INTEGER
 The leading dimension of the array U. LDU >= 1. If singular
 vectors are desired, then LDU >= max( 1, N ).
 VT (output) DOUBLE PRECISION array, dimension (LDVT,N)
 If COMPQ = 'I', then: On exit, if INFO = 0, VT' contains the
 right singular vectors of the bidiagonal matrix. For other
 values of COMPQ, VT is not referenced.
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{dgelss}
+\label{dgelss}
 LDVT (input) INTEGER
 The leading dimension of the array VT. LDVT >= 1. If singular
 vectors are desired, then LDVT >= max( 1, N ).
+\subsection{Axiom unit tests}
+\begin{chunk}{dgelss.input}
+)set break resume
+)sys rm f dgelss.output
+)spool dgelss.output
+)set message test on
+)set message auto off
+)clear all
 Q (output) DOUBLE PRECISION array, dimension (LDQ)
 If COMPQ = 'P', then: On exit, if INFO = 0, Q and IQ contain
 the left and right singular vectors in a compact form, requir
 ing O(N log N) space instead of 2*N**2. In particular, Q con
 tains all the DOUBLE PRECISION data in LDQ >= N*(11 + 2*SMLSIZ
 + 8*INT(LOG_2(N/(SMLSIZ+1)))) words of memory, where SMLSIZ is
 returned by ILAENV and is equal to the maximum size of the sub
 problems at the bottom of the computation tree (usually about
 25). For other values of COMPQ, Q is not referenced.
+)spool
+)lisp (bye)
+\end{chunk}
 IQ (output) INTEGER array, dimension (LDIQ)
 If COMPQ = 'P', then: On exit, if INFO = 0, Q and IQ contain
 the left and right singular vectors in a compact form, requir
 ing O(N log N) space instead of 2*N**2. In particular, IQ con
 tains all INTEGER data in LDIQ >= N*(3 + 3*INT(LOG_2(N/(SML
 SIZ+1)))) words of memory, where SMLSIZ is returned by ILAENV
 and is equal to the maximum size of the subproblems at the bot
 tom of the computation tree (usually about 25). For other val
 ues of COMPQ, IQ is not referenced.
+\subsection{Axiom help page}
+\begin{chunk}{dgelss.help}
+====================================================================
+dgelss examples
+====================================================================
 WORK (workspace) DOUBLE PRECISION array, dimension (MAX(1,LWORK))
 If COMPQ = 'N' then LWORK >= (4 * N). If COMPQ = 'P' then
 LWORK >= (6 * N). If COMPQ = 'I' then LWORK >= (3 * N**2 + 4 *
 N).
+====================================================================
+Man Page Details
+====================================================================
 IWORK (workspace) INTEGER array, dimension (8*N)
+SYNOPSIS
+ Functions/Subroutines
+ subroutine dgelss (M, N, NRHS, A, LDA, B, LDB, S, RCOND, RANK, WORK,
+ LWORK, INFO)
+ DGELSS solves overdetermined or underdetermined systems for GE
+ matrices
 INFO (output) INTEGER
 = 0: successful exit.
 < 0: if INFO = i, the ith argument had an illegal value.
 > 0: The algorithm failed to compute an singular value. The
 update process of divide and conquer failed.
+Function/Subroutine Documentation
+ subroutine dgelss (integer M, integer N, integer NRHS, double precision,
+ dimension( lda, * ) A, integer LDA, double precision, dimension( ldb, *
+ ) B, integer LDB, double precision, dimension( * ) S, double precision
+ RCOND, integer RANK, double precision, dimension( * ) WORK, integer
+ LWORK, integer INFO)
+ DGELSS solves overdetermined or underdetermined systems for GE
+ matrices
 Further Details
 ===============
+Purpose:
+ DGELSS computes the minimum norm solution to a real linear least
+ squares problem:
+
+ Minimize 2norm( b  A*x ).
+
+ using the singular value decomposition (SVD) of A. A is an MbyN
+ matrix which may be rankdeficient.
+
+ Several right hand side vectors b and solution vectors x can be
+ handled in a single call; they are stored as the columns of the
+ MbyNRHS right hand side matrix B and the NbyNRHS solution matrix X.
+
+ The effective rank of A is determined by treating as zero those
+ singular values which are less than RCOND times the largest singular value.
 Based on contributions by
 Ming Gu and Huan Ren, Computer Science Division, University of
 California at Berkeley, USA
+Parameters:
+
+ M
+ M is INTEGER
+ The number of rows of the matrix A. M >= 0.
+
+ N
+ N is INTEGER
+ The number of columns of the matrix A. N >= 0.
+
+ NRHS
+ NRHS is INTEGER
+ The number of right hand sides, i.e., the number of columns
+ of the matrices B and X. NRHS >= 0.
+
+ A
+ A is DOUBLE PRECISION array, dimension (LDA,N)
+ On entry, the MbyN matrix A.
+ On exit, the first min(m,n) rows of A are overwritten with
+ its right singular vectors, stored rowwise.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+
+ B
+ B is DOUBLE PRECISION array, dimension (LDB,NRHS)
+ On entry, the MbyNRHS right hand side matrix B.
+ On exit, B is overwritten by the NbyNRHS solution
+ matrix X. If m >= n and RANK = n, the residual
+ sumofsquares for the solution in the ith column is given
+ by the sum of squares of elements n+1:m in that column.
+
+ LDB
+ LDB is INTEGER
+ The leading dimension of the array B. LDB >= max(1,max(M,N)).
+
+ S
+ S is DOUBLE PRECISION array, dimension (min(M,N))
+ The singular values of A in decreasing order.
+ The condition number of A in the 2norm = S(1)/S(min(m,n)).
+
+ RCOND
+ RCOND is DOUBLE PRECISION
+ RCOND is used to determine the effective rank of A.
+ Singular values S(i) <= RCOND*S(1) are treated as zero.
+ If RCOND < 0, machine precision is used instead.
+
+ RANK
+ RANK is INTEGER
+ The effective rank of A, i.e., the number of singular values
+ which are greater than RCOND*S(1).
+
+ WORK
+ WORK is DOUBLE PRECISION array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK. LWORK >= 1, and also:
+ LWORK >= 3*min(M,N) + max( 2*min(M,N), max(M,N), NRHS )
+ For good performance, LWORK should generally be larger.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value.
+ > 0: the algorithm for computing the SVD failed to converge;
+ if INFO = i, i offdiagonal elements of an intermediate
+ bidiagonal form did not converge to zero.
\end{chunk}
The input arguments are:
\begin{itemize}
\item uplo  simplearray character (1)
\item compq  (simplearray character (1)
\item n  fixnum
\item d  array doublefloat
\item e  array doublefloat
\item u  array doublefloat
\item ldu  fixnum
\item vt  doublefloat
\item ldvt  fixnum
\item q  array doublefloat
\item iq  array fixnum
\item work  array doublefloat
\item iwork  array fixnum
\item info  fixnum
\end{itemize}
+\subsection{fortran code}
+\label{dgelss.f}
+\index{dgelss.f}
+\begin{chunk}{dgelss.f}
+\end{chunk}
The return values are:
\begin{itemize}
\item uplo  nil
\item compq  nil
\item n  nil
\item d  nil
\item e  nil
\item u  nil
\item ldu  nil
\item vt  nil
\item ldvt  nil
\item q  nil
\item iq  nil
\item work  nil
\item iwork  nil
\item info  info
\end{itemize}
+\subsection{lisp code}
+\begin{chunk}{LAPACK dgelss}
\calls{dbdsdc}{dlasr}
\calls{dbdsdc}{dswap}
\calls{dbdsdc}{dlasda}
\calls{dbdsdc}{dlasd0}
\calls{dbdsdc}{dlamch}
\calls{dbdsdc}{dlascl}
\calls{dbdsdc}{dlanst}
\calls{dbdsdc}{dlaset}
\calls{dbdsdc}{dlasdq}
\calls{dbdsdc}{dlartg}
\calls{dbdsdc}{dcopy}
\calls{dbdsdc}{ilaenv}
\calls{dbdsdc}{xerbla}
\calls{dbdsdc}{charequal}
+\end{chunk}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{dgelsx  DEPRECATED. Use dgelsy}
+\label{dgelsx}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{dgelsy}
+\label{dgelsy}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{dgelsy.input}
+)set break resume
+)sys rm f dgelsy.output
+)spool dgelsy.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{dgelsy.help}
+====================================================================
+dgelsy examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine dgelsy (M, N, NRHS, A, LDA, B, LDB, JPVT, RCOND, RANK, WORK,
+ LWORK, INFO)
+ DGELSY solves overdetermined or underdetermined systems for GE
+ matrices
+
+Function/Subroutine Documentation
+ subroutine dgelsy (integer M, integer N, integer NRHS, double precision,
+ dimension( lda, * ) A, integer LDA, double precision, dimension( ldb, *
+ ) B, integer LDB, integer, dimension( * ) JPVT, double precision RCOND,
+ integer RANK, double precision, dimension( * ) WORK, integer LWORK,
+ integer INFO)
+ DGELSY solves overdetermined or underdetermined systems for GE
+ matrices
+
+Purpose:
+ DGELSY computes the minimumnorm solution to a real linear least
+ squares problem:
+ minimize  A * X  B 
+ using a complete orthogonal factorization of A. A is an MbyN
+ matrix which may be rankdeficient.
+
+ Several right hand side vectors b and solution vectors x can be
+ handled in a single call; they are stored as the columns of the
+ MbyNRHS right hand side matrix B and the NbyNRHS solution
+ matrix X.
+
+ The routine first computes a QR factorization with column pivoting:
+ A * P = Q * [ R11 R12 ]
+ [ 0 R22 ]
+ with R11 defined as the largest leading submatrix whose estimated
+ condition number is less than 1/RCOND. The order of R11, RANK,
+ is the effective rank of A.
+
+ Then, R22 is considered to be negligible, and R12 is annihilated
+ by orthogonal transformations from the right, arriving at the
+ complete orthogonal factorization:
+ A * P = Q * [ T11 0 ] * Z
+ [ 0 0 ]
+ The minimumnorm solution is then
+ X = P * Z**T [ inv(T11)*Q1**T*B ]
+ [ 0 ]
+ where Q1 consists of the first RANK columns of Q.
+
+ This routine is basically identical to the original xGELSX except
+ three differences:
+ o The call to the subroutine xGEQPF has been substituted by the
+ the call to the subroutine xGEQP3. This subroutine is a Blas3
+ version of the QR factorization with column pivoting.
+ o Matrix B (the right hand side) is updated with Blas3.
+ o The permutation of matrix B (the right hand side) is faster and
+ more simple.
+
+Parameters:
+
+ M
+ M is INTEGER
+ The number of rows of the matrix A. M >= 0.
+
+ N
+ N is INTEGER
+ The number of columns of the matrix A. N >= 0.
+
+ NRHS
+ NRHS is INTEGER
+ The number of right hand sides, i.e., the number of
+ columns of matrices B and X. NRHS >= 0.
+
+ A
+ A is DOUBLE PRECISION array, dimension (LDA,N)
+ On entry, the MbyN matrix A.
+ On exit, A has been overwritten by details of its
+ complete orthogonal factorization.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+
+ B
+ B is DOUBLE PRECISION array, dimension (LDB,NRHS)
+ On entry, the MbyNRHS right hand side matrix B.
+ On exit, the NbyNRHS solution matrix X.
+
+ LDB
+ LDB is INTEGER
+ The leading dimension of the array B. LDB >= max(1,M,N).
+
+ JPVT
+ JPVT is INTEGER array, dimension (N)
+ On entry, if JPVT(i) .ne. 0, the ith column of A is permuted
+ to the front of AP, otherwise column i is a free column.
+ On exit, if JPVT(i) = k, then the ith column of AP
+ was the kth column of A.
+
+ RCOND
+ RCOND is DOUBLE PRECISION
+ RCOND is used to determine the effective rank of A, which
+ is defined as the order of the largest leading triangular
+ submatrix R11 in the QR factorization with pivoting of A,
+ whose estimated condition number < 1/RCOND.
+
+ RANK
+ RANK is INTEGER
+ The effective rank of A, i.e., the order of the submatrix
+ R11. This is the same as the order of the submatrix T11
+ in the complete orthogonal factorization of A.
+
+ WORK
+ WORK is DOUBLE PRECISION array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK.
+ The unblocked strategy requires that:
+ LWORK >= MAX( MN+3*N+1, 2*MN+NRHS ),
+ where MN = min( M, N ).
+ The block algorithm requires that:
+ LWORK >= MAX( MN+2*N+NB*(N+1), 2*MN+NB*NRHS ),
+ where NB is an upper bound on the blocksize returned
+ by ILAENV for the routines DGEQP3, DTZRZF, STZRQF, DORMQR,
+ and DORMRZ.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: If INFO = i, the ith argument had an illegal value.
+
+\end{chunk}
\subsection{fortran code}
\label{dbdsdc.f}
\index{dbdsdc.f}
\begin{chunk}{dbdsdc.f}
 SUBROUTINE DBDSDC( UPLO, COMPQ, N, D, E, U, LDU, VT, LDVT, Q, IQ,
 $ WORK, IWORK, INFO )
*
*  LAPACK routine (version 3.0) 
* Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
* Courant Institute, Argonne National Lab, and Rice University
* December 1, 1999
*
* .. Scalar Arguments ..
 CHARACTER COMPQ, UPLO
 INTEGER INFO, LDU, LDVT, N
* ..
* .. Array Arguments ..
 INTEGER IQ( * ), IWORK( * )
 DOUBLE PRECISION D( * ), E( * ), Q( * ), U( LDU, * ),
 $ VT( LDVT, * ), WORK( * )
* ..
*
* =====================================================================
*
* .. Parameters ..
 DOUBLE PRECISION ZERO, ONE, TWO
 PARAMETER ( ZERO = 0.0D+0, ONE = 1.0D+0, TWO = 2.0D+0 )
* ..
* .. Local Scalars ..
 INTEGER DIFL, DIFR, GIVCOL, GIVNUM, GIVPTR, I, IC,
 $ ICOMPQ, IERR, II, IS, IU, IUPLO, IVT, J, K, KK,
 $ MLVL, NM1, NSIZE, PERM, POLES, QSTART, SMLSIZ,
 $ SMLSZP, SQRE, START, WSTART, Z
 DOUBLE PRECISION CS, EPS, ORGNRM, P, R, SN
* ..
* .. External Functions ..
 LOGICAL LSAME
 INTEGER ILAENV
 DOUBLE PRECISION DLAMCH, DLANST
 EXTERNAL LSAME, ILAENV, DLAMCH, DLANST
* ..
* .. External Subroutines ..
 EXTERNAL DCOPY, DLARTG, DLASCL, DLASD0, DLASDA, DLASDQ,
 $ DLASET, DLASR, DSWAP, XERBLA
* ..
* .. Intrinsic Functions ..
 INTRINSIC ABS, DBLE, INT, LOG, SIGN
* ..
* .. Executable Statements ..
*
* Test the input parameters.
*
 INFO = 0
*
 IUPLO = 0
 IF( LSAME( UPLO, 'U' ) )
 $ IUPLO = 1
 IF( LSAME( UPLO, 'L' ) )
 $ IUPLO = 2
 IF( LSAME( COMPQ, 'N' ) ) THEN
 ICOMPQ = 0
 ELSE IF( LSAME( COMPQ, 'P' ) ) THEN
 ICOMPQ = 1
 ELSE IF( LSAME( COMPQ, 'I' ) ) THEN
 ICOMPQ = 2
 ELSE
 ICOMPQ = 1
 END IF
 IF( IUPLO.EQ.0 ) THEN
 INFO = 1
 ELSE IF( ICOMPQ.LT.0 ) THEN
 INFO = 2
 ELSE IF( N.LT.0 ) THEN
 INFO = 3
 ELSE IF( ( LDU.LT.1 ) .OR. ( ( ICOMPQ.EQ.2 ) .AND. ( LDU.LT.
 $ N ) ) ) THEN
 INFO = 7
 ELSE IF( ( LDVT.LT.1 ) .OR. ( ( ICOMPQ.EQ.2 ) .AND. ( LDVT.LT.
 $ N ) ) ) THEN
 INFO = 9
 END IF
 IF( INFO.NE.0 ) THEN
 CALL XERBLA( 'DBDSDC', INFO )
 RETURN
 END IF
*
* Quick return if possible
*
 IF( N.EQ.0 )
 $ RETURN
 SMLSIZ = ILAENV( 9, 'DBDSDC', ' ', 0, 0, 0, 0 )
 IF( N.EQ.1 ) THEN
 IF( ICOMPQ.EQ.1 ) THEN
 Q( 1 ) = SIGN( ONE, D( 1 ) )
 Q( 1+SMLSIZ*N ) = ONE
 ELSE IF( ICOMPQ.EQ.2 ) THEN
 U( 1, 1 ) = SIGN( ONE, D( 1 ) )
 VT( 1, 1 ) = ONE
 END IF
 D( 1 ) = ABS( D( 1 ) )
 RETURN
 END IF
 NM1 = N  1
*
* If matrix lower bidiagonal, rotate to be upper bidiagonal
* by applying Givens rotations on the left
*
 WSTART = 1
 QSTART = 3
 IF( ICOMPQ.EQ.1 ) THEN
 CALL DCOPY( N, D, 1, Q( 1 ), 1 )
 CALL DCOPY( N1, E, 1, Q( N+1 ), 1 )
 END IF
 IF( IUPLO.EQ.2 ) THEN
 QSTART = 5
 WSTART = 2*N  1
 DO 10 I = 1, N  1
 CALL DLARTG( D( I ), E( I ), CS, SN, R )
 D( I ) = R
 E( I ) = SN*D( I+1 )
 D( I+1 ) = CS*D( I+1 )
 IF( ICOMPQ.EQ.1 ) THEN
 Q( I+2*N ) = CS
 Q( I+3*N ) = SN
 ELSE IF( ICOMPQ.EQ.2 ) THEN
 WORK( I ) = CS
 WORK( NM1+I ) = SN
 END IF
 10 CONTINUE
 END IF
*
* If ICOMPQ = 0, use DLASDQ to compute the singular values.
*
 IF( ICOMPQ.EQ.0 ) THEN
 CALL DLASDQ( 'U', 0, N, 0, 0, 0, D, E, VT, LDVT, U, LDU, U,
 $ LDU, WORK( WSTART ), INFO )
 GO TO 40
 END IF
*
* If N is smaller than the minimum divide size SMLSIZ, then solve
* the problem with another solver.
*
 IF( N.LE.SMLSIZ ) THEN
 IF( ICOMPQ.EQ.2 ) THEN
 CALL DLASET( 'A', N, N, ZERO, ONE, U, LDU )
 CALL DLASET( 'A', N, N, ZERO, ONE, VT, LDVT )
 CALL DLASDQ( 'U', 0, N, N, N, 0, D, E, VT, LDVT, U, LDU, U,
 $ LDU, WORK( WSTART ), INFO )
 ELSE IF( ICOMPQ.EQ.1 ) THEN
 IU = 1
 IVT = IU + N
 CALL DLASET( 'A', N, N, ZERO, ONE, Q( IU+( QSTART1 )*N ),
 $ N )
 CALL DLASET( 'A', N, N, ZERO, ONE, Q( IVT+( QSTART1 )*N ),
 $ N )
 CALL DLASDQ( 'U', 0, N, N, N, 0, D, E,
 $ Q( IVT+( QSTART1 )*N ), N,
 $ Q( IU+( QSTART1 )*N ), N,
 $ Q( IU+( QSTART1 )*N ), N, WORK( WSTART ),
 $ INFO )
 END IF
 GO TO 40
 END IF
*
 IF( ICOMPQ.EQ.2 ) THEN
 CALL DLASET( 'A', N, N, ZERO, ONE, U, LDU )
 CALL DLASET( 'A', N, N, ZERO, ONE, VT, LDVT )
 END IF
*
* Scale.
*
 ORGNRM = DLANST( 'M', N, D, E )
 IF( ORGNRM.EQ.ZERO )
 $ RETURN
 CALL DLASCL( 'G', 0, 0, ORGNRM, ONE, N, 1, D, N, IERR )
 CALL DLASCL( 'G', 0, 0, ORGNRM, ONE, NM1, 1, E, NM1, IERR )
*
 EPS = DLAMCH( 'Epsilon' )
*
 MLVL = INT( LOG( DBLE( N ) / DBLE( SMLSIZ+1 ) ) / LOG( TWO ) ) + 1
 SMLSZP = SMLSIZ + 1
*
 IF( ICOMPQ.EQ.1 ) THEN
 IU = 1
 IVT = 1 + SMLSIZ
 DIFL = IVT + SMLSZP
 DIFR = DIFL + MLVL
 Z = DIFR + MLVL*2
 IC = Z + MLVL
 IS = IC + 1
 POLES = IS + 1
 GIVNUM = POLES + 2*MLVL
*
 K = 1
 GIVPTR = 2
 PERM = 3
 GIVCOL = PERM + MLVL
 END IF
*
 DO 20 I = 1, N
 IF( ABS( D( I ) ).LT.EPS ) THEN
 D( I ) = SIGN( EPS, D( I ) )
 END IF
 20 CONTINUE
*
 START = 1
 SQRE = 0
*
 DO 30 I = 1, NM1
 IF( ( ABS( E( I ) ).LT.EPS ) .OR. ( I.EQ.NM1 ) ) THEN
*
* Subproblem found. First determine its size and then
* apply divide and conquer on it.
*
 IF( I.LT.NM1 ) THEN
*
* A subproblem with E(I) small for I < NM1.
*
 NSIZE = I  START + 1
 ELSE IF( ABS( E( I ) ).GE.EPS ) THEN
*
* A subproblem with E(NM1) not too small but I = NM1.
*
 NSIZE = N  START + 1
 ELSE
*
* A subproblem with E(NM1) small. This implies an
* 1by1 subproblem at D(N). Solve this 1by1 problem
* first.
*
 NSIZE = I  START + 1
 IF( ICOMPQ.EQ.2 ) THEN
 U( N, N ) = SIGN( ONE, D( N ) )
 VT( N, N ) = ONE
 ELSE IF( ICOMPQ.EQ.1 ) THEN
 Q( N+( QSTART1 )*N ) = SIGN( ONE, D( N ) )
 Q( N+( SMLSIZ+QSTART1 )*N ) = ONE
 END IF
 D( N ) = ABS( D( N ) )
 END IF
 IF( ICOMPQ.EQ.2 ) THEN
 CALL DLASD0( NSIZE, SQRE, D( START ), E( START ),
 $ U( START, START ), LDU, VT( START, START ),
 $ LDVT, SMLSIZ, IWORK, WORK( WSTART ), INFO )
 ELSE
 CALL DLASDA( ICOMPQ, SMLSIZ, NSIZE, SQRE, D( START ),
 $ E( START ), Q( START+( IU+QSTART2 )*N ), N,
 $ Q( START+( IVT+QSTART2 )*N ),
 $ IQ( START+K*N ), Q( START+( DIFL+QSTART2 )*
 $ N ), Q( START+( DIFR+QSTART2 )*N ),
 $ Q( START+( Z+QSTART2 )*N ),
 $ Q( START+( POLES+QSTART2 )*N ),
 $ IQ( START+GIVPTR*N ), IQ( START+GIVCOL*N ),
 $ N, IQ( START+PERM*N ),
 $ Q( START+( GIVNUM+QSTART2 )*N ),
 $ Q( START+( IC+QSTART2 )*N ),
 $ Q( START+( IS+QSTART2 )*N ),
 $ WORK( WSTART ), IWORK, INFO )
 IF( INFO.NE.0 ) THEN
 RETURN
 END IF
 END IF
 START = I + 1
 END IF
 30 CONTINUE
*
* Unscale
*
 CALL DLASCL( 'G', 0, 0, ONE, ORGNRM, N, 1, D, N, IERR )
 40 CONTINUE
*
* Use Selection Sort to minimize swaps of singular vectors
*
 DO 60 II = 2, N
 I = II  1
 KK = I
 P = D( I )
 DO 50 J = II, N
 IF( D( J ).GT.P ) THEN
 KK = J
 P = D( J )
 END IF
 50 CONTINUE
 IF( KK.NE.I ) THEN
 D( KK ) = D( I )
 D( I ) = P
 IF( ICOMPQ.EQ.1 ) THEN
 IQ( I ) = KK
 ELSE IF( ICOMPQ.EQ.2 ) THEN
 CALL DSWAP( N, U( 1, I ), 1, U( 1, KK ), 1 )
 CALL DSWAP( N, VT( I, 1 ), LDVT, VT( KK, 1 ), LDVT )
 END IF
 ELSE IF( ICOMPQ.EQ.1 ) THEN
 IQ( I ) = I
 END IF
 60 CONTINUE
*
* If ICOMPQ = 1, use IQ(N,1) as the indicator for UPLO
*
 IF( ICOMPQ.EQ.1 ) THEN
 IF( IUPLO.EQ.1 ) THEN
 IQ( N ) = 1
 ELSE
 IQ( N ) = 0
 END IF
 END IF
*
* If B is lower bidiagonal, update U by those Givens rotations
* which rotated B to be upper bidiagonal
*
 IF( ( IUPLO.EQ.2 ) .AND. ( ICOMPQ.EQ.2 ) )
 $ CALL DLASR( 'L', 'V', 'B', N, N, WORK( 1 ), WORK( N ), U, LDU )
*
 RETURN
*
* End of DBDSDC
*
 END

+\label{dgelsy.f}
+\index{dgelsy.f}
+\begin{chunk}{dgelsy.f}
\end{chunk}
\subsection{lisp code}
\begin{chunk}{LAPACK dbdsdc}
(let* ((zero 0.0) (one 1.0) (two 2.0))
 (declare (type (doublefloat 0.0 0.0) zero)
 (type (doublefloat 1.0 1.0) one)
 (type (doublefloat 2.0 2.0) two))
 (defun dbdsdc (uplo compq n d e u ldu vt ldvt q iq work iwork info)
 (declare (type (simplearray fixnum (*)) iwork iq)
 (type (simplearray doublefloat (*)) work q vt u e d)
 (type fixnum info ldvt ldu n)
 (type character compq uplo))
 (f2cllib:withmultiarraydata
 ((uplo character uplo%data% uplo%offset%)
 (compq character compq%data% compq%offset%)
 (d doublefloat d%data% d%offset%)
 (e doublefloat e%data% e%offset%)
 (u doublefloat u%data% u%offset%)
 (vt doublefloat vt%data% vt%offset%)
 (q doublefloat q%data% q%offset%)
 (work doublefloat work%data% work%offset%)
 (iq fixnum iq%data% iq%offset%)
 (iwork fixnum iwork%data% iwork%offset%))
 (prog ((cs 0.0) (eps 0.0) (orgnrm 0.0) (p 0.0) (r 0.0) (sn 0.0) (difl 0)
 (difr 0) (givcol 0) (givnum 0) (givptr 0) (i 0) (ic 0) (icompq 0)
 (ierr 0) (ii 0) (is 0) (iu 0) (iuplo 0) (ivt 0) (j 0) (k 0) (kk 0)
 (mlvl 0) (nm1 0) (nsize 0) (perm 0) (poles 0) (qstart 0)
 (smlsiz 0) (smlszp 0) (sqre 0) (start 0) (wstart 0) (z 0))
 (declare (type (doublefloat) cs eps orgnrm p r sn)
 (type fixnum difl difr givcol givnum givptr i ic
 icompq ierr ii is iu iuplo ivt j k
 kk mlvl nm1 nsize perm poles qstart
 smlsiz smlszp sqre start wstart z))
 (setf info 0)
 (setf iuplo 0)
 (if (charequal uplo #\U) (setf iuplo 1))
 (if (charequal uplo #\L) (setf iuplo 2))
 (cond
 ((charequal compq #\N) (setf icompq 0))
 ((charequal compq #\P) (setf icompq 1))
 ((charequal compq #\I) (setf icompq 2))
 (t (setf icompq 1)))
 (cond
 ((= iuplo 0) (setf info 1))
 ((< icompq 0) (setf info 2))
 ((< n 0) (setf info 3))
 ((or (< ldu 1) (and (= icompq 2) (< ldu n))) (setf info 7))
 ((or (< ldvt 1) (and (= icompq 2) (< ldvt n))) (setf info 9)))
 (cond
 ((/= info 0)
 (error
 " ** On entry to ~a parameter number ~a had an illegal value~%"
 "DBDSDC" (f2cllib:intsub info))
 (go end_label)))
 (if (= n 0) (go end_label))
 (setf smlsiz (ilaenv 9 "DBDSDC" " " 0 0 0 0))
 (cond
 ((= n 1)
 (cond
 ((= icompq 1)
 (setf
 (f2cllib:fref q%data% (1) ((1 *)) q%offset%)
 (f2cllib:sign one
 (f2cllib:fref d%data% (1) ((1 *)) d%offset%)))
 (setf
 (f2cllib:fref q%data%
 ((f2cllib:intadd 1
 (f2cllib:intmul smlsiz n))) ((1 *)) q%offset%)
 one))
 ((= icompq 2)
 (setf
 (f2cllib:fref u%data% (1 1) ((1 ldu) (1 *)) u%offset%)
 (f2cllib:sign one (f2cllib:fref d%data% (1) ((1 *)) d%offset%)))
 (setf
 (f2cllib:fref vt%data% (1 1) ((1 ldvt) (1 *)) vt%offset%)
 one)))
 (setf (f2cllib:fref d%data% (1) ((1 *)) d%offset%)
 (abs (f2cllib:fref d%data% (1) ((1 *)) d%offset%)))
 (go end_label)))
 (setf nm1 (f2cllib:intsub n 1))
 (setf wstart 1)
 (setf qstart 3)
 (cond
 ((= icompq 1)
 (dcopy n d 1 (f2cllib:arrayslice q doublefloat (1) ((1 *))) 1)
 (dcopy (f2cllib:intsub n 1) e 1
 (f2cllib:arrayslice q doublefloat ((+ n 1)) ((1 *))) 1)))
 (cond
 ((= iuplo 2)
 (setf qstart 5)
 (setf wstart (f2cllib:intsub (f2cllib:intmul 2 n) 1))
 (f2cllib:fdo (i 1 (f2cllib:intadd i 1))
 ((> i (f2cllib:intadd n (f2cllib:intsub 1))) nil)
 (tagbody
 (multiplevaluebind (var0 var1 var2 var3 var4)
 (dlartg (f2cllib:fref d%data% (i) ((1 *)) d%offset%)
 (f2cllib:fref e%data% (i) ((1 *)) e%offset%) cs sn r)
 (declare (ignore var0 var1))
 (setf cs var2)
 (setf sn var3)
 (setf r var4))
 (setf (f2cllib:fref d%data% (i) ((1 *)) d%offset%) r)
 (setf
 (f2cllib:fref e%data% (i) ((1 *)) e%offset%)
 (* sn (f2cllib:fref
 d%data% ((f2cllib:intadd i 1)) ((1 *)) d%offset%)))
 (setf
 (f2cllib:fref d%data%
 ((f2cllib:intadd i 1)) ((1 *)) d%offset%)
 (* cs (f2cllib:fref
 d%data% ((f2cllib:intadd i 1)) ((1 *)) d%offset%)))
 (cond
 ((= icompq 1)
 (setf
 (f2cllib:fref q%data%
 ((f2cllib:intadd i (f2cllib:intmul 2 n)))
 ((1 *)) q%offset%)
 cs)
 (setf
 (f2cllib:fref q%data%
 ((f2cllib:intadd i (f2cllib:intmul 3 n)))
 ((1 *)) q%offset%)
 sn))
 ((= icompq 2)
 (setf (f2cllib:fref work%data% (i) ((1 *)) work%offset%) cs)
 (setf
 (f2cllib:fref work%data%
 ((f2cllib:intadd nm1 i)) ((1 *)) work%offset%)
 ( sn))))))))
 (cond
 ((= icompq 0)
 (multiplevaluebind
 (var0 var1 var2 var3 var4 var5 var6 var7 var8 var9
 var10 var11 var12 var13 var14 var15)
 (dlasdq "U" 0 n 0 0 0 d e vt ldvt u ldu u ldu
 (f2cllib:arrayslice work doublefloat (wstart) ((1 *))) info)
 (declare (ignore var0 var1 var2 var3 var4 var5 var6 var7
 var8 var9 var10 var11 var12 var13 var14))
 (setf info var15))
 (go label40)))
 (cond
 ((<= n smlsiz)
 (cond
 ((= icompq 2)
 (dlaset "A" n n zero one u ldu)
 (dlaset "A" n n zero one vt ldvt)
 (multiplevaluebind
 (var0 var1 var2 var3 var4 var5 var6 var7 var8
 var9 var10 var11 var12 var13 var14 var15)
 (dlasdq "U" 0 n n n 0 d e vt ldvt u ldu u ldu
 (f2cllib:arrayslice work doublefloat (wstart) ((1 *)))
 info)
 (declare (ignore var0 var1 var2 var3 var4 var5 var6
 var7 var8 var9 var10 var11 var12 var13 var14))
 (setf info var15)))
 ((= icompq 1)
 (setf iu 1)
 (setf ivt (f2cllib:intadd iu n))
 (dlaset "A" n n zero one
 (f2cllib:arrayslice q doublefloat
 ((+ iu
 (f2cllib:intmul
 (f2cllib:intadd qstart (f2cllib:intsub 1)) n)))
 ((1 *)))
 n)
 (dlaset "A" n n zero one
 (f2cllib:arrayslice q doublefloat
 ((+ ivt
 (f2cllib:intmul
 (f2cllib:intadd qstart (f2cllib:intsub 1)) n)))
 ((1 *)))
 n)
 (multiplevaluebind
 (var0 var1 var2 var3 var4 var5 var6 var7 var8
 var9 var10 var11 var12 var13 var14 var15)
 (dlasdq "U" 0 n n n 0 d e
 (f2cllib:arrayslice q doublefloat
 ((+ ivt
 (f2cllib:intmul
 (f2cllib:intadd qstart (f2cllib:intsub 1))
 n)))
 ((1 *)))
 n
 (f2cllib:arrayslice q doublefloat
 ((+ iu
 (f2cllib:intmul
 (f2cllib:intadd qstart (f2cllib:intsub 1))
 n)))
 ((1 *)))
 n
 (f2cllib:arrayslice q doublefloat
 ((+ iu
 (f2cllib:intmul
 (f2cllib:intadd qstart (f2cllib:intsub 1))
 n)))
 ((1 *)))
 n
 (f2cllib:arrayslice work doublefloat (wstart) ((1 *)))
 info)
 (declare (ignore var0 var1 var2 var3 var4 var5 var6
 var7 var8 var9 var10 var11 var12 var13 var14))
 (setf info var15))))
 (go label40)))
 (cond
 ((= icompq 2)
 (dlaset "A" n n zero one u ldu)
 (dlaset "A" n n zero one vt ldvt)))
 (setf orgnrm (dlanst "M" n d e))
 (if (= orgnrm zero) (go end_label))
 (multiplevaluebind
 (var0 var1 var2 var3 var4 var5 var6 var7 var8 var9)
 (dlascl "G" 0 0 orgnrm one n 1 d n ierr)
 (declare (ignore var0 var1 var2 var3 var4 var5 var6 var7
 var8))
 (setf ierr var9))
 (multiplevaluebind
 (var0 var1 var2 var3 var4 var5 var6 var7 var8 var9)
 (dlascl "G" 0 0 orgnrm one nm1 1 e nm1 ierr)
 (declare (ignore var0 var1 var2 var3 var4 var5 var6 var7
 var8))
 (setf ierr var9))
 (setf eps (dlamch "Epsilon"))
 (setf mlvl
 (f2cllib:intadd
 (f2cllib:int
 (/
 (f2cllib:flog
 (/ (coerce (realpart n) 'doublefloat)
 (coerce (realpart (f2cllib:intadd smlsiz 1)) 'doublefloat)))
 (f2cllib:flog two)))
 1))
 (setf smlszp (f2cllib:intadd smlsiz 1))
 (cond
 ((= icompq 1)
 (setf iu 1)
 (setf ivt (f2cllib:intadd 1 smlsiz))
 (setf difl (f2cllib:intadd ivt smlszp))
 (setf difr (f2cllib:intadd difl mlvl))
 (setf z (f2cllib:intadd difr (f2cllib:intmul mlvl 2)))
 (setf ic (f2cllib:intadd z mlvl))
 (setf is (f2cllib:intadd ic 1))
 (setf poles (f2cllib:intadd is 1))
 (setf givnum (f2cllib:intadd poles (f2cllib:intmul 2 mlvl)))
 (setf k 1)
 (setf givptr 2)
 (setf perm 3)
 (setf givcol (f2cllib:intadd perm mlvl))))
 (f2cllib:fdo (i 1 (f2cllib:intadd i 1))
 ((> i n) nil)
 (tagbody
 (cond
 ((< (abs (f2cllib:fref d (i) ((1 *)))) eps)
 (setf
 (f2cllib:fref d%data% (i) ((1 *)) d%offset%)
 (f2cllib:sign eps
 (f2cllib:fref d%data% (i) ((1 *)) d%offset%)))))))
 (setf start 1)
 (setf sqre 0)
 (f2cllib:fdo (i 1 (f2cllib:intadd i 1))
 ((> i nm1) nil)
 (tagbody
 (cond
 ((or (< (abs (f2cllib:fref e (i) ((1 *)))) eps) (= i nm1))
 (cond
 ((< i nm1)
 (setf nsize (f2cllib:intadd (f2cllib:intsub i start) 1)))
 ((>= (abs (f2cllib:fref e (i) ((1 *)))) eps)
 (setf nsize (f2cllib:intadd (f2cllib:intsub n start) 1)))
 (t
 (setf nsize (f2cllib:intadd (f2cllib:intsub i start) 1))
 (cond
 ((= icompq 2)
 (setf
 (f2cllib:fref u%data% (n n) ((1 ldu) (1 *)) u%offset%)
 (f2cllib:sign one
 (f2cllib:fref d%data% (n) ((1 *)) d%offset%)))
 (setf
 (f2cllib:fref vt%data% (n n) ((1 ldvt) (1 *)) vt%offset%)
 one))
 ((= icompq 1)
 (setf
 (f2cllib:fref q%data%
 ((f2cllib:intadd n
 (f2cllib:intmul (f2cllib:intsub qstart 1) n)))
 ((1 *)) q%offset%)
 (f2cllib:sign one
 (f2cllib:fref d%data% (n) ((1 *)) d%offset%)))
 (setf
 (f2cllib:fref q%data%
 ((f2cllib:intadd n
 (f2cllib:intmul
 (f2cllib:intsub
 (f2cllib:intadd smlsiz qstart) 1) n)))
 ((1 *)) q%offset%)
 one)))
 (setf
 (f2cllib:fref d%data% (n) ((1 *)) d%offset%)
 (abs (f2cllib:fref d%data% (n) ((1 *)) d%offset%)))))
 (cond
 ((= icompq 2)
 (multiplevaluebind
 (var0 var1 var2 var3 var4 var5 var6 var7 var8
 var9 var10 var11)
 (dlasd0 nsize sqre
 (f2cllib:arrayslice d doublefloat (start) ((1 *)))
 (f2cllib:arrayslice e doublefloat (start) ((1 *)))
 (f2cllib:arrayslice u doublefloat
 (start start) ((1 ldu) (1 *)))
 ldu
 (f2cllib:arrayslice vt doublefloat
 (start start) ((1 ldvt) (1 *)))
 ldvt
 smlsiz
 iwork
 (f2cllib:arrayslice work doublefloat (wstart) ((1 *))) info)
 (declare (ignore var0 var1 var2 var3 var4 var5 var6
 var7 var8 var9 var10))
 (setf info var11)))
 (t
 (multiplevaluebind
 (var0 var1 var2 var3 var4 var5 var6 var7 var8
 var9 var10 var11 var12 var13 var14 var15 var16
 var17 var18 var19 var20 var21 var22 var23)
 (dlasda icompq smlsiz nsize sqre
 (f2cllib:arrayslice d doublefloat (start) ((1 *)))
 (f2cllib:arrayslice e doublefloat (start) ((1 *)))
 (f2cllib:arrayslice q doublefloat
 ((+ start (f2cllib:intmul (f2cllib:intadd iu qstart
 (f2cllib:intsub 2)) n))) ((1 *)))
 n
 (f2cllib:arrayslice q doublefloat
 ((+ start (f2cllib:intmul (f2cllib:intadd ivt qstart
 (f2cllib:intsub 2)) n))) ((1 *)))
 (f2cllib:arrayslice iq fixnum
 ((+ start (f2cllib:intmul k n))) ((1 *)))
 (f2cllib:arrayslice q doublefloat
 ((+ start (f2cllib:intmul (f2cllib:intadd difl qstart
 (f2cllib:intsub 2)) n))) ((1 *)))
 (f2cllib:arrayslice q doublefloat
 ((+ start (f2cllib:intmul (f2cllib:intadd difr qstart
 (f2cllib:intsub 2)) n))) ((1 *)))
 (f2cllib:arrayslice q doublefloat
 ((+ start (f2cllib:intmul (f2cllib:intadd z qstart
 (f2cllib:intsub 2)) n))) ((1 *)))
 (f2cllib:arrayslice q doublefloat
 ((+ start (f2cllib:intmul (f2cllib:intadd poles qstart
 (f2cllib:intsub 2)) n))) ((1 *)))
 (f2cllib:arrayslice iq fixnum
 ((+ start (f2cllib:intmul givptr n))) ((1 *)))
 (f2cllib:arrayslice iq fixnum
 ((+ start (f2cllib:intmul givcol n))) ((1 *)))
 n
 (f2cllib:arrayslice iq fixnum
 ((+ start (f2cllib:intmul perm n))) ((1 *)))
 (f2cllib:arrayslice q doublefloat
 ((+ start (f2cllib:intmul (f2cllib:intadd givnum qstart
 (f2cllib:intsub 2)) n))) ((1 *)))
 (f2cllib:arrayslice q doublefloat
 ((+ start (f2cllib:intmul (f2cllib:intadd ic qstart
 (f2cllib:intsub 2)) n))) ((1 *)))
 (f2cllib:arrayslice q doublefloat
 ((+ start (f2cllib:intmul (f2cllib:intadd is qstart
 (f2cllib:intsub 2)) n))) ((1 *)))
 (f2cllib:arrayslice work doublefloat (wstart) ((1 *)))
 iwork
 info)
 (declare (ignore var0 var1 var2 var3 var4 var5 var6
 var7 var8 var9 var10 var11 var12
 var13 var14 var15 var16 var17 var18
 var19 var20 var21 var22))
 (setf info var23))
 (cond
 ((/= info 0) (go end_label)))))
 (setf start (f2cllib:intadd i 1))))))
 (multiplevaluebind
 (var0 var1 var2 var3 var4 var5 var6 var7 var8 var9)
 (dlascl "G" 0 0 one orgnrm n 1 d n ierr)
 (declare (ignore var0 var1 var2 var3 var4 var5 var6 var7 var8))
 (setf ierr var9))
 label40
 (f2cllib:fdo (ii 2 (f2cllib:intadd ii 1))
 ((> ii n) nil)
 (tagbody
 (setf i (f2cllib:intsub ii 1))
 (setf kk i)
 (setf p (f2cllib:fref d%data% (i) ((1 *)) d%offset%))
 (f2cllib:fdo (j ii (f2cllib:intadd j 1))
 ((> j n) nil)
 (tagbody
 (cond
 ((> (f2cllib:fref d (j) ((1 *))) p)
 (setf kk j)
 (setf p (f2cllib:fref d%data% (j) ((1 *)) d%offset%))))))
 (cond
 ((/= kk i)
 (setf (f2cllib:fref d%data% (kk) ((1 *)) d%offset%)
 (f2cllib:fref d%data% (i) ((1 *)) d%offset%))
 (setf (f2cllib:fref d%data% (i) ((1 *)) d%offset%) p)
 (cond
 ((= icompq 1)
 (setf (f2cllib:fref iq%data% (i) ((1 *)) iq%offset%) kk))
 ((= icompq 2)
 (dswap n
 (f2cllib:arrayslice u doublefloat (1 i) ((1 ldu) (1 *)))
 1
 (f2cllib:arrayslice u doublefloat (1 kk) ((1 ldu) (1 *)))
 1)
 (dswap n
 (f2cllib:arrayslice vt doublefloat (i 1) ((1 ldvt) (1 *)))
 ldvt
 (f2cllib:arrayslice vt doublefloat (kk 1) ((1 ldvt) (1 *)))
 ldvt))))
 ((= icompq 1)
 (setf (f2cllib:fref iq%data% (i) ((1 *)) iq%offset%) i)))))
 (cond
 ((= icompq 1)
 (cond
 ((= iuplo 1)
 (setf (f2cllib:fref iq%data% (n) ((1 *)) iq%offset%) 1))
 (t
 (setf (f2cllib:fref iq%data% (n) ((1 *)) iq%offset%) 0)))))
 (if (and (= iuplo 2) (= icompq 2))
 (dlasr "L" "V" "B" n n
 (f2cllib:arrayslice work doublefloat (1) ((1 *)))
 (f2cllib:arrayslice work doublefloat (n) ((1 *))) u ldu))
 end_label
 (return
 (values nil nil nil nil nil nil nil nil nil nil nil nil nil info))))))
+\begin{chunk}{LAPACK dgelsy}
\end{chunk}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{dbdsqr}
%\pagehead{dbdsqr}{dbdsqr}
%\pagepic{ps/v104algebraicfunction.ps}{AF}{1.00}
+\section{dgesv}
+\label{dgesv}
\subsection{Axiom unit tests}
\begin{chunk}{dbdsqr.input}
+\begin{chunk}{dgesv.input}
)set break resume
)sys rm f dbdsqr.output
)spool dbdsqr.output
+)sys rm f dgesv.output
+)spool dgesv.output
)set message test on
)set message auto off
)clear all
@@ 85103,161 +85488,123785 @@ The return values are:
\end{chunk}
\subsection{Axiom help page}
\begin{chunk}{dbdsqr.help}
+\begin{chunk}{dgesv.help}
====================================================================
dbdsqr examples
+dgesv examples
====================================================================
====================================================================
Man Page Details
====================================================================
NAME
 DBDSQR  the singular values and, optionally, the right and/or left
 singular vectors from the singular value decomposition (SVD) of a real
 NbyN (upper or lower) bidiagonal matrix B using the implicit zero
 shift QR algorithm
+SYNOPSIS
+ Functions/Subroutines
+ subroutine dgesv (N, NRHS, A, LDA, IPIV, B, LDB, INFO)
+ DGESV computes the solution to system of linear equations A * X =
+ B for GE matrices
+
+Function/Subroutine Documentation
+ subroutine dgesv (integer N, integer NRHS, double precision, dimension(
+ lda, * ) A, integer LDA, integer, dimension( * ) IPIV, double
+ precision, dimension( ldb, * ) B, integer LDB, integer INFO)
+ DGESV computes the solution to system of linear equations A * X = B
+ for GE matrices
+
+Purpose:
+ DGESV computes the solution to a real system of linear equations
+ A * X = B,
+ where A is an NbyN matrix and X and B are NbyNRHS matrices.
+
+ The LU decomposition with partial pivoting and row interchanges is
+ used to factor A as
+ A = P * L * U,
+ where P is a permutation matrix, L is unit lower triangular, and U is
+ upper triangular. The factored form of A is then used to solve the
+ system of equations A * X = B.
+
+Parameters:
+
+ N
+ N is INTEGER
+ The number of linear equations, i.e., the order of the matrix A. N >= 0.
+
+ NRHS
+ NRHS is INTEGER
+ The number of right hand sides, i.e., the number of columns
+ of the matrix B. NRHS >= 0.
+
+ A
+ A is DOUBLE PRECISION array, dimension (LDA,N)
+ On entry, the NbyN coefficient matrix A.
+ On exit, the factors L and U from the factorization
+ A = P*L*U; the unit diagonal elements of L are not stored.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,N).
+
+ IPIV
+ IPIV is INTEGER array, dimension (N)
+ The pivot indices that define the permutation matrix P;
+ row i of the matrix was interchanged with row IPIV(i).
+
+ B
+ B is DOUBLE PRECISION array, dimension (LDB,NRHS)
+ On entry, the NbyNRHS matrix of right hand side matrix B.
+ On exit, if INFO = 0, the NbyNRHS solution matrix X.
+
+ LDB
+ LDB is INTEGER
+ The leading dimension of the array B. LDB >= max(1,N).
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value
+ > 0: if INFO = i, U(i,i) is exactly zero. The factorization
+ has been completed, but the factor U is exactly
+ singular, so the solution could not be computed.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{dgesv.f}
+\index{dgesv.f}
+\begin{chunk}{dgesv.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK dgesv}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{dgesvx}
+\label{dgesvx}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{dgesvx.input}
+)set break resume
+)sys rm f dgesvx.output
+)spool dgesvx.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{dgesvx.help}
+====================================================================
+dgesvx examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
SYNOPSIS
 SUBROUTINE DBDSQR( UPLO, N, NCVT, NRU, NCC, D, E, VT, LDVT, U, LDU, C,
 LDC, WORK, INFO )
+ Functions/Subroutines
+ subroutine dgesvx (FACT, TRANS, N, NRHS, A, LDA, AF, LDAF, IPIV, EQUED,
+ R, C, B, LDB, X, LDX, RCOND, FERR, BERR, WORK, IWORK, INFO)
+ DGESVX computes the solution to system of linear equations A * X =
+ B for GE matrices
 CHARACTER UPLO
+Function/Subroutine Documentation
+ subroutine dgesvx (character FACT, character TRANS, integer N, integer
+ NRHS, double precision, dimension( lda, * ) A, integer LDA, double
+ precision, dimension( ldaf, * ) AF, integer LDAF, integer, dimension( *
+ ) IPIV, character EQUED, double precision, dimension( * ) R, double
+ precision, dimension( * ) C, double precision, dimension( ldb, * ) B,
+ integer LDB, double precision, dimension( ldx, * ) X, integer LDX,
+ double precision RCOND, double precision, dimension( * ) FERR, double
+ precision, dimension( * ) BERR, double precision, dimension( * ) WORK,
+ integer, dimension( * ) IWORK, integer INFO)
+ DGESVX computes the solution to system of linear equations A * X = B
+ for GE matrices
 INTEGER INFO, LDC, LDU, LDVT, N, NCC, NCVT, NRU
+Purpose:
+ DGESVX uses the LU factorization to compute the solution to a real
+ system of linear equations
+ A * X = B,
+ where A is an NbyN matrix and X and B are NbyNRHS matrices.
+
+ Error bounds on the solution and a condition estimate are also
+ provided.
 DOUBLE PRECISION C( LDC, * ), D( * ), E( * ), U( LDU, * ),
 VT( LDVT, * ), WORK( * )
+Description:
+ The following steps are performed:
+
+ 1. If FACT = 'E', real scaling factors are computed to equilibrate
+ the system:
+ TRANS = 'N': diag(R)*A*diag(C) *inv(diag(C))*X = diag(R)*B
+ TRANS = 'T': (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
+ TRANS = 'C': (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B
+ Whether or not the system will be equilibrated depends on the
+ scaling of the matrix A, but if equilibration is used, A is
+ overwritten by diag(R)*A*diag(C) and B by diag(R)*B (if TRANS='N')
+ or diag(C)*B (if TRANS = 'T' or 'C').
+
+ 2. If FACT = 'N' or 'E', the LU decomposition is used to factor the
+ matrix A (after equilibration if FACT = 'E') as
+ A = P * L * U,
+ where P is a permutation matrix, L is a unit lower triangular
+ matrix, and U is upper triangular.
+
+ 3. If some U(i,i)=0, so that U is exactly singular, then the routine
+ returns with INFO = i. Otherwise, the factored form of A is used
+ to estimate the condition number of the matrix A. If the
+ reciprocal of the condition number is less than machine precision,
+ INFO = N+1 is returned as a warning, but the routine still goes on
+ to solve for X and compute error bounds as described below.
+
+ 4. The system of equations is solved for X using the factored form of A.
+
+ 5. Iterative refinement is applied to improve the computed solution
+ matrix and calculate error bounds and backward error estimates for it.
+
+ 6. If equilibration was used, the matrix X is premultiplied by
+ diag(C) (if TRANS = 'N') or diag(R) (if TRANS = 'T' or 'C') so
+ that it solves the original system before equilibration.
PURPOSE
 DBDSQR computes the singular values and, optionally, the right and/or
 left singular vectors from the singular value decomposition (SVD) of a
 real NbyN (upper or lower) bidiagonal matrix B using the implicit
 zeroshift QR algorithm. The SVD of B has the form
+Parameters:
 B = Q * S * P**T
+ FACT
+ FACT is CHARACTER*1
+ Specifies whether or not the factored form of the matrix A is
+ supplied on entry, and if not, whether the matrix A should be
+ equilibrated before it is factored.
+ = 'F': On entry, AF and IPIV contain the factored form of A.
+ If EQUED is not 'N', the matrix A has been
+ equilibrated with scaling factors given by R and C.
+ A, AF, and IPIV are not modified.
+ = 'N': The matrix A will be copied to AF and factored.
+ = 'E': The matrix A will be equilibrated if necessary, then
+ copied to AF and factored.
 where S is the diagonal matrix of singular values, Q is an orthogonal
 matrix of left singular vectors, and P is an orthogonal matrix of right
 singular vectors. If left singular vectors are requested, this subrou
 tine actually returns U*Q instead of Q, and, if right singular vectors
 are requested, this subroutine returns P**T*VT instead of P**T, for
 given real input matrices U and VT. When U and VT are the orthogonal
 matrices that reduce a general matrix A to bidiagonal form: A =
 U*B*VT, as computed by DGEBRD, then
+ TRANS
+ TRANS is CHARACTER*1
+ Specifies the form of the system of equations:
+ = 'N': A * X = B (No transpose)
+ = 'T': A**T * X = B (Transpose)
+ = 'C': A**H * X = B (Transpose)
 A = (U*Q) * S * (P**T*VT)
+ N
+ N is INTEGER
+ The number of linear equations, i.e., the order of the matrix A. N >= 0.
 is the SVD of A. Optionally, the subroutine may also compute Q**T*C
 for a given real input matrix C.
+ NRHS
+ NRHS is INTEGER
+ The number of right hand sides, i.e., the number of columns
+ of the matrices B and X. NRHS >= 0.
 See "Computing Small Singular Values of Bidiagonal Matrices With Guar
 anteed High Relative Accuracy," by J. Demmel and W. Kahan, LAPACK Work
 ing Note #3 (or SIAM J. Sci. Statist. Comput. vol. 11, no. 5, pp.
 873912, Sept 1990) and
 "Accurate singular values and differential qd algorithms," by B. Par
 lett and V. Fernando, Technical Report CPAM554, Mathematics Depart
 ment, University of California at Berkeley, July 1992 for a detailed
 description of the algorithm.
+ A
+ A is DOUBLE PRECISION array, dimension (LDA,N)
+ On entry, the NbyN matrix A. If FACT = 'F' and EQUED is
+ not 'N', then A must have been equilibrated by the scaling
+ factors in R and/or C. A is not modified if FACT = 'F' or
+ 'N', or if FACT = 'E' and EQUED = 'N' on exit.
+
+ On exit, if EQUED .ne. 'N', A is scaled as follows:
+ EQUED = 'R': A := diag(R) * A
+ EQUED = 'C': A := A * diag(C)
+ EQUED = 'B': A := diag(R) * A * diag(C).
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,N).
+
+ AF
+ AF is DOUBLE PRECISION array, dimension (LDAF,N)
+ If FACT = 'F', then AF is an input argument and on entry
+ contains the factors L and U from the factorization
+ A = P*L*U as computed by DGETRF. If EQUED .ne. 'N', then
+ AF is the factored form of the equilibrated matrix A.
+
+ If FACT = 'N', then AF is an output argument and on exit
+ returns the factors L and U from the factorization A = P*L*U
+ of the original matrix A.
+
+ If FACT = 'E', then AF is an output argument and on exit
+ returns the factors L and U from the factorization A = P*L*U
+ of the equilibrated matrix A (see the description of A for
+ the form of the equilibrated matrix).
ARGUMENTS
 UPLO (input) CHARACTER*1
 = 'U': B is upper bidiagonal;
 = 'L': B is lower bidiagonal.
+ LDAF
+
+ LDAF is INTEGER
+ The leading dimension of the array AF. LDAF >= max(1,N).
+
+ IPIV
+ IPIV is INTEGER array, dimension (N)
+ If FACT = 'F', then IPIV is an input argument and on entry
+ contains the pivot indices from the factorization A = P*L*U
+ as computed by DGETRF; row i of the matrix was interchanged
+ with row IPIV(i).
+
+ If FACT = 'N', then IPIV is an output argument and on exit
+ contains the pivot indices from the factorization A = P*L*U
+ of the original matrix A.
+
+ If FACT = 'E', then IPIV is an output argument and on exit
+ contains the pivot indices from the factorization A = P*L*U
+ of the equilibrated matrix A.
+
+ EQUED
+ EQUED is CHARACTER*1
+ Specifies the form of equilibration that was done.
+ = 'N': No equilibration (always true if FACT = 'N').
+ = 'R': Row equilibration, i.e., A has been premultiplied by diag(R).
+ = 'C': Column equilibration, i.e., A has been postmultiplied by diag(C).
+ = 'B': Both row and column equilibration, i.e., A has been
+ replaced by diag(R) * A * diag(C).
+ EQUED is an input argument if FACT = 'F'; otherwise, it is an
+ output argument.
+
+ R
+ R is DOUBLE PRECISION array, dimension (N)
+ The row scale factors for A. If EQUED = 'R' or 'B', A is
+ multiplied on the left by diag(R); if EQUED = 'N' or 'C', R
+ is not accessed. R is an input argument if FACT = 'F';
+ otherwise, R is an output argument. If FACT = 'F' and
+ EQUED = 'R' or 'B', each element of R must be positive.
 N (input) INTEGER
 The order of the matrix B. N >= 0.
+ C
+ C is DOUBLE PRECISION array, dimension (N)
+ The column scale factors for A. If EQUED = 'C' or 'B', A is
+ multiplied on the right by diag(C); if EQUED = 'N' or 'R', C
+ is not accessed. C is an input argument if FACT = 'F';
+ otherwise, C is an output argument. If FACT = 'F' and
+ EQUED = 'C' or 'B', each element of C must be positive.
 NCVT (input) INTEGER
 The number of columns of the matrix VT. NCVT >= 0.
+ B
+ B is DOUBLE PRECISION array, dimension (LDB,NRHS)
+ On entry, the NbyNRHS right hand side matrix B.
+ On exit,
+ if EQUED = 'N', B is not modified;
+ if TRANS = 'N' and EQUED = 'R' or 'B', B is overwritten by diag(R)*B;
+ if TRANS = 'T' or 'C' and EQUED = 'C' or 'B', B is
+ overwritten by diag(C)*B.
 NRU (input) INTEGER
 The number of rows of the matrix U. NRU >= 0.
+ LDB
+ LDB is INTEGER
+ The leading dimension of the array B. LDB >= max(1,N).
 NCC (input) INTEGER
 The number of columns of the matrix C. NCC >= 0.
+ X
+ X is DOUBLE PRECISION array, dimension (LDX,NRHS)
+ If INFO = 0 or INFO = N+1, the NbyNRHS solution matrix X
+ to the original system of equations. Note that A and B are
+ modified on exit if EQUED .ne. 'N', and the solution to the
+ equilibrated system is inv(diag(C))*X if TRANS = 'N' and
+ EQUED = 'C' or 'B', or inv(diag(R))*X if TRANS = 'T' or 'C'
+ and EQUED = 'R' or 'B'.
+
+ LDX
+ LDX is INTEGER
+ The leading dimension of the array X. LDX >= max(1,N).
+
+ RCOND
+ RCOND is DOUBLE PRECISION
+ The estimate of the reciprocal condition number of the matrix
+ A after equilibration (if done). If RCOND is less than the
+ machine precision (in particular, if RCOND = 0), the matrix
+ is singular to working precision. This condition is
+ indicated by a return code of INFO > 0.
+
+ FERR
+ FERR is DOUBLE PRECISION array, dimension (NRHS)
+ The estimated forward error bound for each solution vector
+ X(j) (the jth column of the solution matrix X).
+ If XTRUE is the true solution corresponding to X(j), FERR(j)
+ is an estimated upper bound for the magnitude of the largest
+ element in (X(j)  XTRUE) divided by the magnitude of the
+ largest element in X(j). The estimate is as reliable as
+ the estimate for RCOND, and is almost always a slight
+ overestimate of the true error.
+
+ BERR
+ BERR is DOUBLE PRECISION array, dimension (NRHS)
+ The componentwise relative backward error of each solution
+ vector X(j) (i.e., the smallest relative change in
+ any element of A or B that makes X(j) an exact solution).
+
+ WORK
+ WORK is DOUBLE PRECISION array, dimension (4*N)
+ On exit, WORK(1) contains the reciprocal pivot growth
+ factor norm(A)/norm(U). The "max absolute element" norm is
+ used. If WORK(1) is much less than 1, then the stability
+ of the LU factorization of the (equilibrated) matrix A
+ could be poor. This also means that the solution X, condition
+ estimator RCOND, and forward error bound FERR could be
+ unreliable. If factorization fails with 0 0: if INFO = i, and i is
+ <= N: U(i,i) is exactly zero. The factorization has
+ been completed, but the factor U is exactly
+ singular, so the solution and error bounds
+ could not be computed. RCOND = 0 is returned.
+ = N+1: U is nonsingular, but RCOND is less than machine
+ precision, meaning that the matrix is singular
+ to working precision. Nevertheless, the
+ solution and error bounds are computed because
+ there are a number of situations where the
+ computed solution can be more accurate than the
+ value of RCOND would suggest.
 D (input/output) DOUBLE PRECISION array, dimension (N)
 On entry, the n diagonal elements of the bidiagonal matrix B.
 On exit, if INFO=0, the singular values of B in decreasing
 order.
+\end{chunk}
 E (input/output) DOUBLE PRECISION array, dimension (N1)
 On entry, the N1 offdiagonal elements of the bidiagonal matrix
 B. On exit, if INFO = 0, E is destroyed; if INFO > 0, D and E
 will contain the diagonal and superdiagonal elements of a bidi
 agonal matrix orthogonally equivalent to the one given as
 input.
+\subsection{fortran code}
+\label{dgesvx.f}
+\index{dgesvx.f}
+\begin{chunk}{dgesvx.f}
+\end{chunk}
 VT (input/output) DOUBLE PRECISION array, dimension (LDVT, NCVT)
 On entry, an NbyNCVT matrix VT. On exit, VT is overwritten
 by P**T * VT. Not referenced if NCVT = 0.
+\subsection{lisp code}
+\begin{chunk}{LAPACK dgesvx}
 LDVT (input) INTEGER
 The leading dimension of the array VT. LDVT >= max(1,N) if
 NCVT > 0; LDVT >= 1 if NCVT = 0.
+\end{chunk}
 U (input/output) DOUBLE PRECISION array, dimension (LDU, N)
 On entry, an NRUbyN matrix U. On exit, U is overwritten by U
 * Q. Not referenced if NRU = 0.
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{dgesvxx}
+\label{dgesvxx}
 LDU (input) INTEGER
 The leading dimension of the array U. LDU >= max(1,NRU).
+\subsection{Axiom unit tests}
+\begin{chunk}{dgesvxx.input}
+)set break resume
+)sys rm f dgesvxx.output
+)spool dgesvxx.output
+)set message test on
+)set message auto off
+)clear all
 C (input/output) DOUBLE PRECISION array, dimension (LDC, NCC)
 On entry, an NbyNCC matrix C. On exit, C is overwritten by
 Q**T * C. Not referenced if NCC = 0.
+)spool
+)lisp (bye)
+\end{chunk}
 LDC (input) INTEGER
 The leading dimension of the array C. LDC >= max(1,N) if NCC >
 0; LDC >=1 if NCC = 0.
+\subsection{Axiom help page}
+\begin{chunk}{dgesvxx.help}
+====================================================================
+dgesvxx examples
+====================================================================
 WORK (workspace) DOUBLE PRECISION array, dimension (2*N)
 if NCVT = NRU = NCC = 0, (max(1, 4*N)) otherwise
+====================================================================
+Man Page Details
+====================================================================
 INFO (output) INTEGER
 = 0: successful exit
 < 0: If INFO = i, the ith argument had an illegal value
 > 0: the algorithm did not converge; D and E contain the ele
 ments of a bidiagonal matrix which is orthogonally similar to
 the input matrix B; if INFO = i, i elements of E have not con
 verged to zero.
+SYNOPSIS
+ Functions/Subroutines
+ subroutine dgesvxx (FACT, TRANS, N, NRHS, A, LDA, AF, LDAF, IPIV,
+ EQUED, R, C, B, LDB, X, LDX, RCOND, RPVGRW, BERR, N_ERR_BNDS,
+ ERR_BNDS_NORM, ERR_BNDS_COMP, NPARAMS, PARAMS, WORK, IWORK, INFO)
+ DGESVXX computes the solution to system of linear equations A * X
+ = B for GE matrices
PARAMETERS
 TOLMUL DOUBLE PRECISION, default = max(10,min(100,EPS**(1/8)))
 TOLMUL controls the convergence criterion of the QR loop. If
 it is positive, TOLMUL*EPS is the desired relative precision in
 the computed singular values. If it is negative, abs(TOL
 MUL*EPS*sigma_max) is the desired absolute accuracy in the com
 puted singular values (corresponds to relative accuracy
 abs(TOLMUL*EPS) in the largest singular value. abs(TOLMUL)
 should be between 1 and 1/EPS, and preferably between 10 (for
 fast convergence) and .1/EPS (for there to be some accuracy in
 the results). Default is to lose at either one eighth or 2 of
 the available decimal digits in each computed singular value
 (whichever is smaller).
+Function/Subroutine Documentation
+ subroutine dgesvxx (character FACT, character TRANS, integer N, integer
+ NRHS, double precision, dimension( lda, * ) A, integer LDA, double
+ precision, dimension( ldaf, * ) AF, integer LDAF, integer, dimension( *
+ ) IPIV, character EQUED, double precision, dimension( * ) R, double
+ precision, dimension( * ) C, double precision, dimension( ldb, * ) B,
+ integer LDB, double precision, dimension( ldx , * ) X, integer LDX,
+ double precision RCOND, double precision RPVGRW, double precision,
+ dimension( * ) BERR, integer N_ERR_BNDS, double precision, dimension(
+ nrhs, * ) ERR_BNDS_NORM, double precision, dimension( nrhs, * )
+ ERR_BNDS_COMP, integer NPARAMS, double precision, dimension( * )
+ PARAMS, double precision, dimension( * ) WORK, integer, dimension( * )
+ IWORK, integer INFO)
+ DGESVXX computes the solution to system of linear equations A * X = B
+ for GE matrices
 MAXITR INTEGER, default = 6
 MAXITR controls the maximum number of passes of the algorithm
 through its inner loop. The algorithms stops (and so fails to
 converge) if the number of passes through the inner loop
 exceeds MAXITR*N**2.
+Purpose:
+ DGESVXX uses the LU factorization to compute the solution to a
+ double precision system of linear equations A * X = B, where A is an
+ NbyN matrix and X and B are NbyNRHS matrices.
+
+ If requested, both normwise and maximum componentwise error bounds
+ are returned. DGESVXX will return a solution with a tiny
+ guaranteed error (O(eps) where eps is the working machine
+ precision) unless the matrix is very illconditioned, in which
+ case a warning is returned. Relevant condition numbers also are
+ calculated and returned.
+
+ DGESVXX accepts userprovided factorizations and equilibration
+ factors; see the definitions of the FACT and EQUED options.
+ Solving with refinement and using a factorization from a previous
+ DGESVXX call will also produce a solution with either O(eps)
+ errors or warnings, but we cannot make that claim for general
+ userprovided factorizations and equilibration factors if they
+ differ from what DGESVXX would itself produce.
+
+Description:
+ The following steps are performed:
+
+ 1. If FACT = 'E', double precision scaling factors are computed to
+ equilibrate the system:
+ TRANS = 'N': diag(R)*A*diag(C) *inv(diag(C))*X = diag(R)*B
+ TRANS = 'T': (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
+ TRANS = 'C': (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B
+
+ Whether or not the system will be equilibrated depends on the
+ scaling of the matrix A, but if equilibration is used, A is
+ overwritten by diag(R)*A*diag(C) and B by diag(R)*B (if TRANS='N')
+ or diag(C)*B (if TRANS = 'T' or 'C').
+
+ 2. If FACT = 'N' or 'E', the LU decomposition is used to factor
+ the matrix A (after equilibration if FACT = 'E') as
+ A = P * L * U,
+ where P is a permutation matrix, L is a unit lower triangular
+ matrix, and U is upper triangular.
+
+ 3. If some U(i,i)=0, so that U is exactly singular, then the
+ routine returns with INFO = i. Otherwise, the factored form of A
+ is used to estimate the condition number of the matrix A (see
+ argument RCOND). If the reciprocal of the condition number is less
+ than machine precision, the routine still goes on to solve for X
+ and compute error bounds as described below.
+
+ 4. The system of equations is solved for X using the factored form of A.
+
+ 5. By default (unless PARAMS(LA_LINRX_ITREF_I) is set to zero),
+ the routine will use iterative refinement to try to get a small
+ error and error bounds. Refinement calculates the residual to at
+ least twice the working precision.
+
+ 6. If equilibration was used, the matrix X is premultiplied by
+ diag(C) (if TRANS = 'N') or diag(R) (if TRANS = 'T' or 'C') so
+ that it solves the original system before equilibration.
+
+ Some optional parameters are bundled in the PARAMS array. These
+ settings determine how refinement is performed, but often the
+ defaults are acceptable. If the defaults are acceptable, users
+ can pass NPARAMS = 0 which prevents the source code from accessing
+ the PARAMS argument.
+
+Parameters:
+
+ FACT
+ FACT is CHARACTER*1
+ Specifies whether or not the factored form of the matrix A is
+ supplied on entry, and if not, whether the matrix A should be
+ equilibrated before it is factored.
+ = 'F': On entry, AF and IPIV contain the factored form of A.
+ If EQUED is not 'N', the matrix A has been
+ equilibrated with scaling factors given by R and C.
+ A, AF, and IPIV are not modified.
+ = 'N': The matrix A will be copied to AF and factored.
+ = 'E': The matrix A will be equilibrated if necessary, then
+ copied to AF and factored.
+
+ TRANS
+ TRANS is CHARACTER*1
+ Specifies the form of the system of equations:
+ = 'N': A * X = B (No transpose)
+ = 'T': A**T * X = B (Transpose)
+ = 'C': A**H * X = B (Conjugate Transpose = Transpose)
+
+ N
+ N is INTEGER
+ The number of linear equations, i.e., the order of the matrix A. N >= 0.
+
+ NRHS
+ NRHS is INTEGER
+ The number of right hand sides, i.e., the number of columns
+ of the matrices B and X. NRHS >= 0.
+
+ A
+ A is DOUBLE PRECISION array, dimension (LDA,N)
+ On entry, the NbyN matrix A. If FACT = 'F' and EQUED is
+ not 'N', then A must have been equilibrated by the scaling
+ factors in R and/or C. A is not modified if FACT = 'F' or
+ 'N', or if FACT = 'E' and EQUED = 'N' on exit.
+
+ On exit, if EQUED .ne. 'N', A is scaled as follows:
+ EQUED = 'R': A := diag(R) * A
+ EQUED = 'C': A := A * diag(C)
+ EQUED = 'B': A := diag(R) * A * diag(C).
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,N).
+
+ AF
+ AF is DOUBLE PRECISION array, dimension (LDAF,N)
+ If FACT = 'F', then AF is an input argument and on entry
+ contains the factors L and U from the factorization
+ A = P*L*U as computed by DGETRF. If EQUED .ne. 'N', then
+ AF is the factored form of the equilibrated matrix A.
+
+ If FACT = 'N', then AF is an output argument and on exit
+ returns the factors L and U from the factorization A = P*L*U
+ of the original matrix A.
+
+ If FACT = 'E', then AF is an output argument and on exit
+ returns the factors L and U from the factorization A = P*L*U
+ of the equilibrated matrix A (see the description of A for
+ the form of the equilibrated matrix).
+
+ LDAF
+ LDAF is INTEGER
+ The leading dimension of the array AF. LDAF >= max(1,N).
+
+ IPIV
+ IPIV is INTEGER array, dimension (N)
+ If FACT = 'F', then IPIV is an input argument and on entry
+ contains the pivot indices from the factorization A = P*L*U
+ as computed by DGETRF; row i of the matrix was interchanged
+ with row IPIV(i).
+
+ If FACT = 'N', then IPIV is an output argument and on exit
+ contains the pivot indices from the factorization A = P*L*U
+ of the original matrix A.
+
+ If FACT = 'E', then IPIV is an output argument and on exit
+ contains the pivot indices from the factorization A = P*L*U
+ of the equilibrated matrix A.
+
+ EQUED
+ EQUED is CHARACTER*1
+ Specifies the form of equilibration that was done.
+ = 'N': No equilibration (always true if FACT = 'N').
+ = 'R': Row equilibration, i.e., A has been premultiplied by diag(R).
+ = 'C': Column equilibration, i.e., A has been postmultiplied by diag(C).
+ = 'B': Both row and column equilibration, i.e., A has been
+ replaced by diag(R) * A * diag(C).
+ EQUED is an input argument if FACT = 'F'; otherwise, it is an
+ output argument.
+
+ R
+ R is DOUBLE PRECISION array, dimension (N)
+ The row scale factors for A. If EQUED = 'R' or 'B', A is
+ multiplied on the left by diag(R); if EQUED = 'N' or 'C', R
+ is not accessed. R is an input argument if FACT = 'F';
+ otherwise, R is an output argument. If FACT = 'F' and
+ EQUED = 'R' or 'B', each element of R must be positive.
+ If R is output, each element of R is a power of the radix.
+ If R is input, each element of R should be a power of the radix
+ to ensure a reliable solution and error estimates. Scaling by
+ powers of the radix does not cause rounding errors unless the
+ result underflows or overflows. Rounding errors during scaling
+ lead to refining with a matrix that is not equivalent to the
+ input matrix, producing error estimates that may not be reliable.
+
+ C
+ C is DOUBLE PRECISION array, dimension (N)
+ The column scale factors for A. If EQUED = 'C' or 'B', A is
+ multiplied on the right by diag(C); if EQUED = 'N' or 'R', C
+ is not accessed. C is an input argument if FACT = 'F';
+ otherwise, C is an output argument. If FACT = 'F' and
+ EQUED = 'C' or 'B', each element of C must be positive.
+ If C is output, each element of C is a power of the radix.
+ If C is input, each element of C should be a power of the radix
+ to ensure a reliable solution and error estimates. Scaling by
+ powers of the radix does not cause rounding errors unless the
+ result underflows or overflows. Rounding errors during scaling
+ lead to refining with a matrix that is not equivalent to the
+ input matrix, producing error estimates that may not be reliable.
+
+ B
+ B is DOUBLE PRECISION array, dimension (LDB,NRHS)
+ On entry, the NbyNRHS right hand side matrix B.
+ On exit,
+ if EQUED = 'N', B is not modified;
+ if TRANS = 'N' and EQUED = 'R' or 'B', B is overwritten by diag(R)*B;
+ if TRANS = 'T' or 'C' and EQUED = 'C' or 'B', B is overwritten by diag(C)*B.
+
+ LDB
+ LDB is INTEGER
+ The leading dimension of the array B. LDB >= max(1,N).
+
+ X
+ X is DOUBLE PRECISION array, dimension (LDX,NRHS)
+ If INFO = 0, the NbyNRHS solution matrix X to the original
+ system of equations. Note that A and B are modified on exit
+ if EQUED .ne. 'N', and the solution to the equilibrated system is
+ inv(diag(C))*X if TRANS = 'N' and EQUED = 'C' or 'B', or
+ inv(diag(R))*X if TRANS = 'T' or 'C' and EQUED = 'R' or 'B'.
+
+ LDX
+ LDX is INTEGER
+ The leading dimension of the array X. LDX >= max(1,N).
+
+ RCOND
+ RCOND is DOUBLE PRECISION
+ Reciprocal scaled condition number. This is an estimate of the
+ reciprocal Skeel condition number of the matrix A after
+ equilibration (if done). If this is less than the machine
+ precision (in particular, if it is zero), the matrix is singular
+ to working precision. Note that the error may still be small even
+ if this number is very small and the matrix appears illconditioned.
+
+ RPVGRW
+ RPVGRW is DOUBLE PRECISION
+ Reciprocal pivot growth. On exit, this contains the reciprocal
+ pivot growth factor norm(A)/norm(U). The "max absolute element"
+ norm is used. If this is much less than 1, then the stability of
+ the LU factorization of the (equilibrated) matrix A could be poor.
+ This also means that the solution X, estimated condition numbers,
+ and error bounds could be unreliable. If factorization fails with
+ 0 0 and <= N: U(INFO,INFO) is exactly zero. The factorization
+ has been completed, but the factor U is exactly singular, so
+ the solution and error bounds could not be computed. RCOND = 0
+ is returned.
+ = N+J: The solution corresponding to the Jth righthand side is
+ not guaranteed. The solutions corresponding to other right
+ hand sides K with K > J may not be guaranteed as well, but
+ only the first such righthand side is reported. If a small
+ componentwise error is not requested (PARAMS(3) = 0.0) then
+ the Jth righthand side is the first with a normwise error
+ bound that is not guaranteed (the smallest J such
+ that ERR_BNDS_NORM(J,1) = 0.0). By default (PARAMS(3) = 1.0)
+ the Jth righthand side is the first with either a normwise or
+ componentwise error bound that is not guaranteed (the smallest
+ J such that either ERR_BNDS_NORM(J,1) = 0.0 or
+ ERR_BNDS_COMP(J,1) = 0.0). See the definition of
+ ERR_BNDS_NORM(:,1) and ERR_BNDS_COMP(:,1). To get information
+ about all of the righthand sides check ERR_BNDS_NORM or
+ ERR_BNDS_COMP.
\end{chunk}
\subsection{fortran code}
\label{dbdsqr.f}
\index{dbdsqr.f}
\begin{chunk}{dbdsqr.f}
 SUBROUTINE DBDSQR( UPLO, N, NCVT, NRU, NCC, D, E, VT, LDVT, U,
 $ LDU, C, LDC, WORK, INFO )
*
*  LAPACK routine (version 3.0) 
* Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
* Courant Institute, Argonne National Lab, and Rice University
* October 31, 1999
*
+\label{dgesvxx.f}
+\index{dgesvxx.f}
+\begin{chunk}{dgesvxx.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK dgesvxx}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{dsgesv}
+\label{dsgesv}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{dsgesv.input}
+)set break resume
+)sys rm f dsgesv.output
+)spool dsgesv.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{dsgesv.help}
+====================================================================
+dsgesv examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine dsgesv (N, NRHS, A, LDA, IPIV, B, LDB, X, LDX, WORK, SWORK,
+ ITER, INFO)
+ DSGESV computes the solution to system of linear equations A * X =
+ B for GE matrices (mixed precision with iterative refinement)
+
+Function/Subroutine Documentation
+ subroutine dsgesv (integer N, integer NRHS, double precision, dimension(
+ lda, * ) A, integer LDA, integer, dimension( * ) IPIV, double
+ precision, dimension( ldb, * ) B, integer LDB, double precision,
+ dimension( ldx, * ) X, integer LDX, double precision, dimension( n, * )
+ WORK, real, dimension( * ) SWORK, integer ITER, integer INFO)
+ DSGESV computes the solution to system of linear equations A * X = B
+ for GE matrices (mixed precision with iterative refinement)
+
+ Purpose:
+ DSGESV computes the solution to a real system of linear equations
+ A * X = B,
+ where A is an NbyN matrix and X and B are NbyNRHS matrices.
+
+ DSGESV first attempts to factorize the matrix in SINGLE PRECISION
+ and use this factorization within an iterative refinement procedure
+ to produce a solution with DOUBLE PRECISION normwise backward error
+ quality (see below). If the approach fails the method switches to a
+ DOUBLE PRECISION factorization and solve.
+
+ The iterative refinement is not going to be a winning strategy if
+ the ratio SINGLE PRECISION performance over DOUBLE PRECISION
+ performance is too small. A reasonable strategy should take the
+ number of righthand sides and the size of the matrix into account.
+ This might be done with a call to ILAENV in the future. Up to now, we
+ always try iterative refinement.
+
+ The iterative refinement process is stopped if
+ ITER > ITERMAX
+ or for all the RHS we have:
+ RNRM < SQRT(N)*XNRM*ANRM*EPS*BWDMAX
+ where
+ o ITER is the number of the current iteration in the iterative
+ refinement process
+ o RNRM is the infinitynorm of the residual
+ o XNRM is the infinitynorm of the solution
+ o ANRM is the infinityoperatornorm of the matrix A
+ o EPS is the machine epsilon returned by DLAMCH('Epsilon')
+ The value ITERMAX and BWDMAX are fixed to 30 and 1.0D+00 respectively.
+
+Parameters:
+
+ N
+ N is INTEGER
+ The number of linear equations, i.e., the order of the
+ matrix A. N >= 0.
+
+ NRHS
+ NRHS is INTEGER
+ The number of right hand sides, i.e., the number of columns
+ of the matrix B. NRHS >= 0.
+
+ A
+ A is DOUBLE PRECISION array,
+ dimension (LDA,N)
+ On entry, the NbyN coefficient matrix A.
+ On exit, if iterative refinement has been successfully used
+ (INFO.EQ.0 and ITER.GE.0, see description below), then A is
+ unchanged, if double precision factorization has been used
+ (INFO.EQ.0 and ITER.LT.0, see description below), then the
+ array A contains the factors L and U from the factorization
+ A = P*L*U; the unit diagonal elements of L are not stored.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,N).
+
+ IPIV
+ IPIV is INTEGER array, dimension (N)
+ The pivot indices that define the permutation matrix P;
+ row i of the matrix was interchanged with row IPIV(i).
+ Corresponds either to the single precision factorization
+ (if INFO.EQ.0 and ITER.GE.0) or the double precision
+ factorization (if INFO.EQ.0 and ITER.LT.0).
+
+ B
+ B is DOUBLE PRECISION array, dimension (LDB,NRHS)
+ The NbyNRHS right hand side matrix B.
+
+ LDB
+ LDB is INTEGER
+ The leading dimension of the array B. LDB >= max(1,N).
+
+ X
+ X is DOUBLE PRECISION array, dimension (LDX,NRHS)
+ If INFO = 0, the NbyNRHS solution matrix X.
+
+ LDX
+ LDX is INTEGER
+ The leading dimension of the array X. LDX >= max(1,N).
+
+ WORK
+ WORK is DOUBLE PRECISION array, dimension (N,NRHS)
+ This array is used to hold the residual vectors.
+
+ SWORK
+ SWORK is REAL array, dimension (N*(N+NRHS))
+ This array is used to use the single precision matrix and the
+ righthand sides or solutions in single precision.
+
+ ITER
+ ITER is INTEGER
+ < 0: iterative refinement has failed, double precision
+ factorization has been performed
+ 1 : the routine fell back to full precision for
+ implementation or machinespecific reasons
+ 2 : narrowing the precision induced an overflow,
+ the routine fell back to full precision
+ 3 : failure of SGETRF
+ 31: stop the iterative refinement after the 30th iterations
+ > 0: iterative refinement has been sucessfully used.
+ Returns the number of iterations
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value
+ > 0: if INFO = i, U(i,i) computed in DOUBLE PRECISION is
+ exactly zero. The factorization has been completed,
+ but the factor U is exactly singular, so the solution
+ could not be computed.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{dsgesv.f}
+\index{dsgesv.f}
+\begin{chunk}{dsgesv.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK dsgesv}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\chapter{LAPACK  General Matrices, Linear Solve, Real}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{sgels}
+\label{sgels}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{sgels.input}
+)set break resume
+)sys rm f sgels.output
+)spool sgels.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{sgels.help}
+====================================================================
+sgels examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine sgels (TRANS, M, N, NRHS, A, LDA, B, LDB, WORK, LWORK, INFO)
+ SGELS solves overdetermined or underdetermined systems for GE
+ matrices
+
+Function/Subroutine Documentation
+ subroutine sgels (character TRANS, integer M, integer N, integer NRHS,
+ real, dimension( lda, * ) A, integer LDA, real, dimension( ldb, * ) B,
+ integer LDB, real, dimension( * ) WORK, integer LWORK, integer INFO)
+ SGELS solves overdetermined or underdetermined systems for GE matrices
+
+Purpose:
+ SGELS solves overdetermined or underdetermined real linear systems
+ involving an MbyN matrix A, or its transpose, using a QR or LQ
+ factorization of A. It is assumed that A has full rank.
+
+ The following options are provided:
+
+ 1. If TRANS = 'N' and m >= n: find the least squares solution of
+ an overdetermined system, i.e., solve the least squares problem
+ minimize  B  A*X .
+
+ 2. If TRANS = 'N' and m < n: find the minimum norm solution of
+ an underdetermined system A * X = B.
+
+ 3. If TRANS = 'T' and m >= n: find the minimum norm solution of
+ an undetermined system A**T * X = B.
+
+ 4. If TRANS = 'T' and m < n: find the least squares solution of
+ an overdetermined system, i.e., solve the least squares problem
+ minimize  B  A**T * X .
+
+ Several right hand side vectors b and solution vectors x can be
+ handled in a single call; they are stored as the columns of the
+ MbyNRHS right hand side matrix B and the NbyNRHS solution matrix X.
+
+Parameters:
+
+ TRANS
+ TRANS is CHARACTER*1
+ = 'N': the linear system involves A;
+ = 'T': the linear system involves A**T.
+
+ M
+ M is INTEGER
+ The number of rows of the matrix A. M >= 0.
+
+ N
+ N is INTEGER
+ The number of columns of the matrix A. N >= 0.
+
+ NRHS
+ NRHS is INTEGER
+ The number of right hand sides, i.e., the number of
+ columns of the matrices B and X. NRHS >=0.
+
+ A
+ A is REAL array, dimension (LDA,N)
+ On entry, the MbyN matrix A.
+ On exit,
+ if M >= N, A is overwritten by details of its QR
+ factorization as returned by SGEQRF;
+ if M < N, A is overwritten by details of its LQ
+ factorization as returned by SGELQF.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+
+ B
+ B is REAL array, dimension (LDB,NRHS)
+ On entry, the matrix B of right hand side vectors, stored
+ columnwise; B is MbyNRHS if TRANS = 'N', or NbyNRHS
+ if TRANS = 'T'.
+ On exit, if INFO = 0, B is overwritten by the solution
+ vectors, stored columnwise:
+ if TRANS = 'N' and m >= n, rows 1 to n of B contain the least
+ squares solution vectors; the residual sum of squares for the
+ solution in each column is given by the sum of squares of
+ elements N+1 to M in that column;
+ if TRANS = 'N' and m < n, rows 1 to N of B contain the
+ minimum norm solution vectors;
+ if TRANS = 'T' and m >= n, rows 1 to M of B contain the
+ minimum norm solution vectors;
+ if TRANS = 'T' and m < n, rows 1 to M of B contain the
+ least squares solution vectors; the residual sum of squares
+ for the solution in each column is given by the sum of
+ squares of elements M+1 to N in that column.
+
+ LDB
+ LDB is INTEGER
+ The leading dimension of the array B. LDB >= MAX(1,M,N).
+
+ WORK
+ WORK is REAL array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK.
+ LWORK >= max( 1, MN + max( MN, NRHS ) ).
+ For optimal performance,
+ LWORK >= max( 1, MN + max( MN, NRHS )*NB ).
+ where MN = min(M,N) and NB is the optimum block size.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value
+ > 0: if INFO = i, the ith diagonal element of the
+ triangular factor of A is zero, so that A does not have
+ full rank; the least squares solution could not be computed.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{sgels.f}
+\index{sgels.f}
+\begin{chunk}{sgels.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK sgels}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{sgelsd}
+\label{sgelsd}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{sgelsd.input}
+)set break resume
+)sys rm f sgelsd.output
+)spool sgelsd.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{sgelsd.help}
+====================================================================
+sgelsd examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine sgelsd (M, N, NRHS, A, LDA, B, LDB, S, RCOND, RANK, WORK,
+ LWORK, IWORK, INFO)
+ SGELSD computes the minimumnorm solution to a linear least
+ squares problem for GE matrices
+
+Function/Subroutine Documentation
+ subroutine sgelsd (integer M, integer N, integer NRHS, real, dimension(
+ lda, * ) A, integer LDA, real, dimension( ldb, * ) B, integer LDB,
+ real, dimension( * ) S, real RCOND, integer RANK, real, dimension( * )
+ WORK, integer LWORK, integer, dimension( * ) IWORK, integer INFO)
+ SGELSD computes the minimumnorm solution to a linear least squares
+ problem for GE matrices
+
+Purpose:
+ SGELSD computes the minimumnorm solution to a real linear least
+ squares problem:
+ minimize 2norm( b  A*x )
+ using the singular value decomposition (SVD) of A. A is an MbyN
+ matrix which may be rankdeficient.
+
+ Several right hand side vectors b and solution vectors x can be
+ handled in a single call; they are stored as the columns of the
+ MbyNRHS right hand side matrix B and the NbyNRHS solution
+ matrix X.
+
+ The problem is solved in three steps:
+ (1) Reduce the coefficient matrix A to bidiagonal form with
+ Householder transformations, reducing the original problem
+ into a "bidiagonal least squares problem" (BLS)
+ (2) Solve the BLS using a divide and conquer approach.
+ (3) Apply back all the Householder tranformations to solve
+ the original least squares problem.
+
+ The effective rank of A is determined by treating as zero those
+ singular values which are less than RCOND times the largest singular
+ value.
+
+ The divide and conquer algorithm makes very mild assumptions about
+ floating point arithmetic. It will work on machines with a guard
+ digit in add/subtract, or on those binary machines without guard
+ digits which subtract like the Cray XMP, Cray YMP, Cray C90, or
+ Cray2. It could conceivably fail on hexadecimal or decimal machines
+ without guard digits, but we know of none.
+
+Parameters:
+
+ M
+ M is INTEGER
+ The number of rows of A. M >= 0.
+
+ N
+ N is INTEGER
+ The number of columns of A. N >= 0.
+
+ NRHS
+ NRHS is INTEGER
+ The number of right hand sides, i.e., the number of columns
+ of the matrices B and X. NRHS >= 0.
+
+ A
+ A is REAL array, dimension (LDA,N)
+ On entry, the MbyN matrix A.
+ On exit, A has been destroyed.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+
+ B
+ B is REAL array, dimension (LDB,NRHS)
+ On entry, the MbyNRHS right hand side matrix B.
+ On exit, B is overwritten by the NbyNRHS solution
+ matrix X. If m >= n and RANK = n, the residual
+ sumofsquares for the solution in the ith column is given
+ by the sum of squares of elements n+1:m in that column.
+
+ LDB
+ LDB is INTEGER
+ The leading dimension of the array B. LDB >= max(1,max(M,N)).
+
+ S
+ S is REAL array, dimension (min(M,N))
+ The singular values of A in decreasing order.
+ The condition number of A in the 2norm = S(1)/S(min(m,n)).
+
+ RCOND
+ RCOND is REAL
+ RCOND is used to determine the effective rank of A.
+ Singular values S(i) <= RCOND*S(1) are treated as zero.
+ If RCOND < 0, machine precision is used instead.
+
+ RANK
+ RANK is INTEGER
+ The effective rank of A, i.e., the number of singular values
+ which are greater than RCOND*S(1).
+
+ WORK
+ WORK is REAL array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK. LWORK must be at least 1.
+ The exact minimum amount of workspace needed depends on M,
+ N and NRHS. As long as LWORK is at least
+ 12*N + 2*N*SMLSIZ + 8*N*NLVL + N*NRHS + (SMLSIZ+1)**2,
+ if M is greater than or equal to N or
+ 12*M + 2*M*SMLSIZ + 8*M*NLVL + M*NRHS + (SMLSIZ+1)**2,
+ if M is less than N, the code will execute correctly.
+ SMLSIZ is returned by ILAENV and is equal to the maximum
+ size of the subproblems at the bottom of the computation
+ tree (usually about 25), and
+ NLVL = MAX( 0, INT( LOG_2( MIN( M,N )/(SMLSIZ+1) ) ) + 1 )
+ For good performance, LWORK should generally be larger.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the array WORK and the
+ minimum size of the array IWORK, and returns these values as
+ the first entries of the WORK and IWORK arrays, and no error
+ message related to LWORK is issued by XERBLA.
+
+ IWORK
+ IWORK is INTEGER array, dimension (MAX(1,LIWORK))
+ LIWORK >= max(1, 3*MINMN*NLVL + 11*MINMN),
+ where MINMN = MIN( M,N ).
+ On exit, if INFO = 0, IWORK(1) returns the minimum LIWORK.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value.
+ > 0: the algorithm for computing the SVD failed to converge;
+ if INFO = i, i offdiagonal elements of an intermediate
+ bidiagonal form did not converge to zero.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{sgelsd.f}
+\index{sgelsd.f}
+\begin{chunk}{sgelsd.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK sgelsd}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{sgelss}
+\label{sgelss}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{sgelss.input}
+)set break resume
+)sys rm f sgelss.output
+)spool sgelss.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{sgelss.help}
+====================================================================
+sgelss examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine sgelss (M, N, NRHS, A, LDA, B, LDB, S, RCOND, RANK, WORK,
+ LWORK, INFO)
+ SGELSS solves overdetermined or underdetermined systems for GE
+ matrices
+
+Function/Subroutine Documentation
+ subroutine sgelss (integer M, integer N, integer NRHS, real, dimension(
+ lda, * ) A, integer LDA, real, dimension( ldb, * ) B, integer LDB,
+ real, dimension( * ) S, real RCOND, integer RANK, real, dimension( * )
+ WORK, integer LWORK, integer INFO)
+ SGELSS solves overdetermined or underdetermined systems for GE
+ matrices
+
+Purpose:
+ SGELSS computes the minimum norm solution to a real linear least
+ squares problem:
+
+ Minimize 2norm( b  A*x ).
+
+ using the singular value decomposition (SVD) of A. A is an MbyN
+ matrix which may be rankdeficient.
+
+ Several right hand side vectors b and solution vectors x can be
+ handled in a single call; they are stored as the columns of the
+ MbyNRHS right hand side matrix B and the NbyNRHS solution matrix X.
+
+ The effective rank of A is determined by treating as zero those
+ singular values which are less than RCOND times the largest singular
+ value.
+
+Parameters:
+
+ M
+ M is INTEGER
+ The number of rows of the matrix A. M >= 0.
+
+ N
+ N is INTEGER
+ The number of columns of the matrix A. N >= 0.
+
+ NRHS
+ NRHS is INTEGER
+ The number of right hand sides, i.e., the number of columns
+ of the matrices B and X. NRHS >= 0.
+
+ A
+ A is REAL array, dimension (LDA,N)
+ On entry, the MbyN matrix A.
+ On exit, the first min(m,n) rows of A are overwritten with
+ its right singular vectors, stored rowwise.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+
+ B
+ B is REAL array, dimension (LDB,NRHS)
+ On entry, the MbyNRHS right hand side matrix B.
+ On exit, B is overwritten by the NbyNRHS solution
+ matrix X. If m >= n and RANK = n, the residual
+ sumofsquares for the solution in the ith column is given
+ by the sum of squares of elements n+1:m in that column.
+
+ LDB
+ LDB is INTEGER
+ The leading dimension of the array B. LDB >= max(1,max(M,N)).
+
+ S
+ S is REAL array, dimension (min(M,N))
+ The singular values of A in decreasing order.
+ The condition number of A in the 2norm = S(1)/S(min(m,n)).
+
+ RCOND
+ RCOND is REAL
+ RCOND is used to determine the effective rank of A.
+ Singular values S(i) <= RCOND*S(1) are treated as zero.
+ If RCOND < 0, machine precision is used instead.
+
+ RANK
+ RANK is INTEGER
+ The effective rank of A, i.e., the number of singular values
+ which are greater than RCOND*S(1).
+
+ WORK
+ WORK is REAL array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK. LWORK >= 1, and also:
+ LWORK >= 3*min(M,N) + max( 2*min(M,N), max(M,N), NRHS )
+ For good performance, LWORK should generally be larger.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value.
+ > 0: the algorithm for computing the SVD failed to converge;
+ if INFO = i, i offdiagonal elements of an intermediate
+ bidiagonal form did not converge to zero.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{sgelss.f}
+\index{sgelss.f}
+\begin{chunk}{sgelss.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK sgelss}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{sgelsx  DEPRECATED use sgelsy}
+\label{sgelsx}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{sgelsy}
+\label{sgelsy}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{sgelsy.input}
+)set break resume
+)sys rm f sgelsy.output
+)spool sgelsy.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{sgelsy.help}
+====================================================================
+sgelsy examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine sgelsy (M, N, NRHS, A, LDA, B, LDB, JPVT, RCOND, RANK, WORK,
+ LWORK, INFO)
+ SGELSY solves overdetermined or underdetermined systems for GE
+ matrices
+
+Function/Subroutine Documentation
+ subroutine sgelsy (integer M, integer N, integer NRHS, real, dimension(
+ lda, * ) A, integer LDA, real, dimension( ldb, * ) B, integer LDB,
+ integer, dimension( * ) JPVT, real RCOND, integer RANK, real,
+ dimension( * ) WORK, integer LWORK, integer INFO)
+ SGELSY solves overdetermined or underdetermined systems for GE
+ matrices
+
+Purpose:
+ SGELSY computes the minimumnorm solution to a real linear least
+ squares problem:
+ minimize  A * X  B 
+ using a complete orthogonal factorization of A. A is an MbyN
+ matrix which may be rankdeficient.
+
+ Several right hand side vectors b and solution vectors x can be
+ handled in a single call; they are stored as the columns of the
+ MbyNRHS right hand side matrix B and the NbyNRHS solution
+ matrix X.
+
+ The routine first computes a QR factorization with column pivoting:
+ A * P = Q * [ R11 R12 ]
+ [ 0 R22 ]
+ with R11 defined as the largest leading submatrix whose estimated
+ condition number is less than 1/RCOND. The order of R11, RANK,
+ is the effective rank of A.
+
+ Then, R22 is considered to be negligible, and R12 is annihilated
+ by orthogonal transformations from the right, arriving at the
+ complete orthogonal factorization:
+ A * P = Q * [ T11 0 ] * Z
+ [ 0 0 ]
+ The minimumnorm solution is then
+ X = P * Z**T [ inv(T11)*Q1**T*B ]
+ [ 0 ]
+ where Q1 consists of the first RANK columns of Q.
+
+ This routine is basically identical to the original xGELSX except
+ three differences:
+ o The call to the subroutine xGEQPF has been substituted by the
+ the call to the subroutine xGEQP3. This subroutine is a Blas3
+ version of the QR factorization with column pivoting.
+ o Matrix B (the right hand side) is updated with Blas3.
+ o The permutation of matrix B (the right hand side) is faster and
+ more simple.
+
+Parameters:
+
+ M
+ M is INTEGER
+ The number of rows of the matrix A. M >= 0.
+
+ N
+ N is INTEGER
+ The number of columns of the matrix A. N >= 0.
+
+ NRHS
+ NRHS is INTEGER
+ The number of right hand sides, i.e., the number of
+ columns of matrices B and X. NRHS >= 0.
+
+ A
+ A is REAL array, dimension (LDA,N)
+ On entry, the MbyN matrix A.
+ On exit, A has been overwritten by details of its
+ complete orthogonal factorization.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+
+ B
+ B is REAL array, dimension (LDB,NRHS)
+ On entry, the MbyNRHS right hand side matrix B.
+ On exit, the NbyNRHS solution matrix X.
+
+ LDB
+ LDB is INTEGER
+ The leading dimension of the array B. LDB >= max(1,M,N).
+
+ JPVT
+ JPVT is INTEGER array, dimension (N)
+ On entry, if JPVT(i) .ne. 0, the ith column of A is permuted
+ to the front of AP, otherwise column i is a free column.
+ On exit, if JPVT(i) = k, then the ith column of AP
+ was the kth column of A.
+
+ RCOND
+ RCOND is REAL
+ RCOND is used to determine the effective rank of A, which
+ is defined as the order of the largest leading triangular
+ submatrix R11 in the QR factorization with pivoting of A,
+ whose estimated condition number < 1/RCOND.
+
+ RANK
+ RANK is INTEGER
+ The effective rank of A, i.e., the order of the submatrix
+ R11. This is the same as the order of the submatrix T11
+ in the complete orthogonal factorization of A.
+
+ WORK
+ WORK is REAL array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK.
+ The unblocked strategy requires that:
+ LWORK >= MAX( MN+3*N+1, 2*MN+NRHS ),
+ where MN = min( M, N ).
+ The block algorithm requires that:
+ LWORK >= MAX( MN+2*N+NB*(N+1), 2*MN+NB*NRHS ),
+ where NB is an upper bound on the blocksize returned
+ by ILAENV for the routines SGEQP3, STZRZF, STZRQF, SORMQR,
+ and SORMRZ.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: If INFO = i, the ith argument had an illegal value.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{sgelsy.f}
+\index{sgelsy.f}
+\begin{chunk}{sgelsy.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK sgelsy}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{sgesv}
+\label{sgesv}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{sgesv.input}
+)set break resume
+)sys rm f sgesv.output
+)spool sgesv.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{sgesv.help}
+====================================================================
+sgesv examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine sgesv (N, NRHS, A, LDA, IPIV, B, LDB, INFO)
+ SGESV computes the solution to system of linear equations A * X =
+ B for GE matrices (simple driver)
+
+Function/Subroutine Documentation
+ subroutine sgesv (integer N, integer NRHS, real, dimension( lda, * ) A,
+ integer LDA, integer, dimension( * ) IPIV, real, dimension( ldb, * ) B,
+ integer LDB, integer INFO)
+ SGESV computes the solution to system of linear equations A * X = B
+ for GE matrices (simple driver)
+
+Purpose:
+ SGESV computes the solution to a real system of linear equations
+ A * X = B,
+ where A is an NbyN matrix and X and B are NbyNRHS matrices.
+
+ The LU decomposition with partial pivoting and row interchanges is
+ used to factor A as
+ A = P * L * U,
+ where P is a permutation matrix, L is unit lower triangular, and U is
+ upper triangular. The factored form of A is then used to solve the
+ system of equations A * X = B.
+
+Parameters:
+
+ N
+ N is INTEGER
+ The number of linear equations, i.e., the order of the
+ matrix A. N >= 0.
+
+ NRHS
+ NRHS is INTEGER
+ The number of right hand sides, i.e., the number of columns
+ of the matrix B. NRHS >= 0.
+
+ A
+ A is REAL array, dimension (LDA,N)
+ On entry, the NbyN coefficient matrix A.
+ On exit, the factors L and U from the factorization
+ A = P*L*U; the unit diagonal elements of L are not stored.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,N).
+
+ IPIV
+ IPIV is INTEGER array, dimension (N)
+ The pivot indices that define the permutation matrix P;
+ row i of the matrix was interchanged with row IPIV(i).
+
+ B
+ B is REAL array, dimension (LDB,NRHS)
+ On entry, the NbyNRHS matrix of right hand side matrix B.
+ On exit, if INFO = 0, the NbyNRHS solution matrix X.
+
+ LDB
+ LDB is INTEGER
+ The leading dimension of the array B. LDB >= max(1,N).
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value
+ > 0: if INFO = i, U(i,i) is exactly zero. The factorization
+ has been completed, but the factor U is exactly
+ singular, so the solution could not be computed.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{sgesv.f}
+\index{sgesv.f}
+\begin{chunk}{sgesv.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK sgesv}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{sgesvx}
+\label{sgesvx}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{sgesvx.input}
+)set break resume
+)sys rm f sgesvx.output
+)spool sgesvx.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{sgesvx.help}
+====================================================================
+sgesvx examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine sgesvx (FACT, TRANS, N, NRHS, A, LDA, AF, LDAF, IPIV, EQUED,
+ R, C, B, LDB, X, LDX, RCOND, FERR, BERR, WORK, IWORK, INFO)
+ SGESVX computes the solution to system of linear equations A * X =
+ B for GE matrices
+
+Function/Subroutine Documentation
+ subroutine sgesvx (character FACT, character TRANS, integer N, integer
+ NRHS, real, dimension( lda, * ) A, integer LDA, real, dimension( ldaf,
+ * ) AF, integer LDAF, integer, dimension( * ) IPIV, character EQUED,
+ real, dimension( * ) R, real, dimension( * ) C, real, dimension( ldb, *
+ ) B, integer LDB, real, dimension( ldx, * ) X, integer LDX, real RCOND,
+ real, dimension( * ) FERR, real, dimension( * ) BERR, real, dimension(
+ * ) WORK, integer, dimension( * ) IWORK, integer INFO)
+ SGESVX computes the solution to system of linear equations A * X = B
+ for GE matrices
+
+Purpose:
+ SGESVX uses the LU factorization to compute the solution to a real
+ system of linear equations
+ A * X = B,
+ where A is an NbyN matrix and X and B are NbyNRHS matrices.
+
+ Error bounds on the solution and a condition estimate are also provided.
+
+Description:
+ The following steps are performed:
+
+ 1. If FACT = 'E', real scaling factors are computed to equilibrate
+ the system:
+ TRANS = 'N': diag(R)*A*diag(C) *inv(diag(C))*X = diag(R)*B
+ TRANS = 'T': (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
+ TRANS = 'C': (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B
+ Whether or not the system will be equilibrated depends on the
+ scaling of the matrix A, but if equilibration is used, A is
+ overwritten by diag(R)*A*diag(C) and B by diag(R)*B (if TRANS='N')
+ or diag(C)*B (if TRANS = 'T' or 'C').
+
+ 2. If FACT = 'N' or 'E', the LU decomposition is used to factor the
+ matrix A (after equilibration if FACT = 'E') as
+ A = P * L * U,
+ where P is a permutation matrix, L is a unit lower triangular
+ matrix, and U is upper triangular.
+
+ 3. If some U(i,i)=0, so that U is exactly singular, then the routine
+ returns with INFO = i. Otherwise, the factored form of A is used
+ to estimate the condition number of the matrix A. If the
+ reciprocal of the condition number is less than machine precision,
+ INFO = N+1 is returned as a warning, but the routine still goes on
+ to solve for X and compute error bounds as described below.
+
+ 4. The system of equations is solved for X using the factored form of A.
+
+ 5. Iterative refinement is applied to improve the computed solution
+ matrix and calculate error bounds and backward error estimates for it.
+
+ 6. If equilibration was used, the matrix X is premultiplied by
+ diag(C) (if TRANS = 'N') or diag(R) (if TRANS = 'T' or 'C') so
+ that it solves the original system before equilibration.
+
+Parameters:
+
+ FACT
+ FACT is CHARACTER*1
+ Specifies whether or not the factored form of the matrix A is
+ supplied on entry, and if not, whether the matrix A should be
+ equilibrated before it is factored.
+ = 'F': On entry, AF and IPIV contain the factored form of A.
+ If EQUED is not 'N', the matrix A has been
+ equilibrated with scaling factors given by R and C.
+ A, AF, and IPIV are not modified.
+ = 'N': The matrix A will be copied to AF and factored.
+ = 'E': The matrix A will be equilibrated if necessary, then
+ copied to AF and factored.
+
+ TRANS
+ TRANS is CHARACTER*1
+ Specifies the form of the system of equations:
+ = 'N': A * X = B (No transpose)
+ = 'T': A**T * X = B (Transpose)
+ = 'C': A**H * X = B (Transpose)
+
+ N
+ N is INTEGER
+ The number of linear equations, i.e., the order of the
+ matrix A. N >= 0.
+
+ NRHS
+ NRHS is INTEGER
+ The number of right hand sides, i.e., the number of columns
+ of the matrices B and X. NRHS >= 0.
+
+ A
+ A is REAL array, dimension (LDA,N)
+ On entry, the NbyN matrix A. If FACT = 'F' and EQUED is
+ not 'N', then A must have been equilibrated by the scaling
+ factors in R and/or C. A is not modified if FACT = 'F' or
+ 'N', or if FACT = 'E' and EQUED = 'N' on exit.
+
+ On exit, if EQUED .ne. 'N', A is scaled as follows:
+ EQUED = 'R': A := diag(R) * A
+ EQUED = 'C': A := A * diag(C)
+ EQUED = 'B': A := diag(R) * A * diag(C).
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,N).
+
+ AF
+ AF is REAL array, dimension (LDAF,N)
+ If FACT = 'F', then AF is an input argument and on entry
+ contains the factors L and U from the factorization
+ A = P*L*U as computed by SGETRF. If EQUED .ne. 'N', then
+ AF is the factored form of the equilibrated matrix A.
+
+ If FACT = 'N', then AF is an output argument and on exit
+ returns the factors L and U from the factorization A = P*L*U
+ of the original matrix A.
+
+ If FACT = 'E', then AF is an output argument and on exit
+ returns the factors L and U from the factorization A = P*L*U
+ of the equilibrated matrix A (see the description of A for
+ the form of the equilibrated matrix).
+
+ LDAF
+ LDAF is INTEGER
+ The leading dimension of the array AF. LDAF >= max(1,N).
+
+ IPIV
+ IPIV is INTEGER array, dimension (N)
+ If FACT = 'F', then IPIV is an input argument and on entry
+ contains the pivot indices from the factorization A = P*L*U
+ as computed by SGETRF; row i of the matrix was interchanged
+ with row IPIV(i).
+
+ If FACT = 'N', then IPIV is an output argument and on exit
+ contains the pivot indices from the factorization A = P*L*U
+ of the original matrix A.
+
+ If FACT = 'E', then IPIV is an output argument and on exit
+ contains the pivot indices from the factorization A = P*L*U
+ of the equilibrated matrix A.
+
+ EQUED
+ EQUED is CHARACTER*1
+ Specifies the form of equilibration that was done.
+ = 'N': No equilibration (always true if FACT = 'N').
+ = 'R': Row equilibration, i.e., A has been premultiplied by diag(R).
+ = 'C': Column equilibration, i.e., A has been postmultiplied by diag(C).
+ = 'B': Both row and column equilibration, i.e., A has been
+ replaced by diag(R) * A * diag(C).
+ EQUED is an input argument if FACT = 'F'; otherwise, it is an
+ output argument.
+
+ R
+ R is REAL array, dimension (N)
+ The row scale factors for A. If EQUED = 'R' or 'B', A is
+ multiplied on the left by diag(R); if EQUED = 'N' or 'C', R
+ is not accessed. R is an input argument if FACT = 'F';
+ otherwise, R is an output argument. If FACT = 'F' and
+ EQUED = 'R' or 'B', each element of R must be positive.
+
+ C
+ C is REAL array, dimension (N)
+ The column scale factors for A. If EQUED = 'C' or 'B', A is
+ multiplied on the right by diag(C); if EQUED = 'N' or 'R', C
+ is not accessed. C is an input argument if FACT = 'F';
+ otherwise, C is an output argument. If FACT = 'F' and
+ EQUED = 'C' or 'B', each element of C must be positive.
+
+ B
+ B is REAL array, dimension (LDB,NRHS)
+ On entry, the NbyNRHS right hand side matrix B.
+ On exit,
+ if EQUED = 'N', B is not modified;
+ if TRANS = 'N' and EQUED = 'R' or 'B', B is overwritten by
+ diag(R)*B;
+ if TRANS = 'T' or 'C' and EQUED = 'C' or 'B', B is
+ overwritten by diag(C)*B.
+
+ LDB
+ LDB is INTEGER
+ The leading dimension of the array B. LDB >= max(1,N).
+
+ X
+ X is REAL array, dimension (LDX,NRHS)
+ If INFO = 0 or INFO = N+1, the NbyNRHS solution matrix X
+ to the original system of equations. Note that A and B are
+ modified on exit if EQUED .ne. 'N', and the solution to the
+ equilibrated system is inv(diag(C))*X if TRANS = 'N' and
+ EQUED = 'C' or 'B', or inv(diag(R))*X if TRANS = 'T' or 'C'
+ and EQUED = 'R' or 'B'.
+
+ LDX
+ LDX is INTEGER
+ The leading dimension of the array X. LDX >= max(1,N).
+
+ RCOND
+ RCOND is REAL
+ The estimate of the reciprocal condition number of the matrix
+ A after equilibration (if done). If RCOND is less than the
+ machine precision (in particular, if RCOND = 0), the matrix
+ is singular to working precision. This condition is
+ indicated by a return code of INFO > 0.
+
+ FERR
+ FERR is REAL array, dimension (NRHS)
+ The estimated forward error bound for each solution vector
+ X(j) (the jth column of the solution matrix X).
+ If XTRUE is the true solution corresponding to X(j), FERR(j)
+ is an estimated upper bound for the magnitude of the largest
+ element in (X(j)  XTRUE) divided by the magnitude of the
+ largest element in X(j). The estimate is as reliable as
+ the estimate for RCOND, and is almost always a slight
+ overestimate of the true error.
+
+ BERR
+ BERR is REAL array, dimension (NRHS)
+ The componentwise relative backward error of each solution
+ vector X(j) (i.e., the smallest relative change in
+ any element of A or B that makes X(j) an exact solution).
+
+ WORK
+ WORK is REAL array, dimension (4*N)
+ On exit, WORK(1) contains the reciprocal pivot growth
+ factor norm(A)/norm(U). The "max absolute element" norm is
+ used. If WORK(1) is much less than 1, then the stability
+ of the LU factorization of the (equilibrated) matrix A
+ could be poor. This also means that the solution X, condition
+ estimator RCOND, and forward error bound FERR could be
+ unreliable. If factorization fails with 0 0: if INFO = i, and i is
+ <= N: U(i,i) is exactly zero. The factorization has
+ been completed, but the factor U is exactly
+ singular, so the solution and error bounds
+ could not be computed. RCOND = 0 is returned.
+ = N+1: U is nonsingular, but RCOND is less than machine
+ precision, meaning that the matrix is singular
+ to working precision. Nevertheless, the
+ solution and error bounds are computed because
+ there are a number of situations where the
+ computed solution can be more accurate than the
+ value of RCOND would suggest.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{sgesvx.f}
+\index{sgesvx.f}
+\begin{chunk}{sgesvx.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK sgesvx}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{sgesvxx}
+\label{sgesvxx}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{sgesvxx.input}
+)set break resume
+)sys rm f sgesvxx.output
+)spool sgesvxx.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{sgesvxx.help}
+====================================================================
+sgesvxx examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine sgesvxx (FACT, TRANS, N, NRHS, A, LDA, AF, LDAF, IPIV,
+ EQUED, R, C, B, LDB, X, LDX, RCOND, RPVGRW, BERR, N_ERR_BNDS,
+ ERR_BNDS_NORM, ERR_BNDS_COMP, NPARAMS, PARAMS, WORK, IWORK, INFO)
+ SGESVXX computes the solution to system of linear equations A * X
+ = B for GE matrices
+
+Function/Subroutine Documentation
+ subroutine sgesvxx (character FACT, character TRANS, integer N, integer
+ NRHS, real, dimension( lda, * ) A, integer LDA, real, dimension( ldaf,
+ * ) AF, integer LDAF, integer, dimension( * ) IPIV, character EQUED,
+ real, dimension( * ) R, real, dimension( * ) C, real, dimension( ldb, *
+ ) B, integer LDB, real, dimension( ldx , * ) X, integer LDX, real
+ RCOND, real RPVGRW, real, dimension( * ) BERR, integer N_ERR_BNDS,
+ real, dimension( nrhs, * ) ERR_BNDS_NORM, real, dimension( nrhs, * )
+ ERR_BNDS_COMP, integer NPARAMS, real, dimension( * ) PARAMS, real,
+ dimension( * ) WORK, integer, dimension( * ) IWORK, integer INFO)
+ SGESVXX computes the solution to system of linear equations A * X = B
+ for GE matrices
+
+Purpose:
+ SGESVXX uses the LU factorization to compute the solution to a
+ real system of linear equations A * X = B, where A is an
+ NbyN matrix and X and B are NbyNRHS matrices.
+
+ If requested, both normwise and maximum componentwise error bounds
+ are returned. SGESVXX will return a solution with a tiny
+ guaranteed error (O(eps) where eps is the working machine
+ precision) unless the matrix is very illconditioned, in which
+ case a warning is returned. Relevant condition numbers also are
+ calculated and returned.
+
+ SGESVXX accepts userprovided factorizations and equilibration
+ factors; see the definitions of the FACT and EQUED options.
+ Solving with refinement and using a factorization from a previous
+ SGESVXX call will also produce a solution with either O(eps)
+ errors or warnings, but we cannot make that claim for general
+ userprovided factorizations and equilibration factors if they
+ differ from what SGESVXX would itself produce.
+
+Description:
+ The following steps are performed:
+
+ 1. If FACT = 'E', real scaling factors are computed to equilibrate
+ the system:
+
+ TRANS = 'N': diag(R)*A*diag(C) *inv(diag(C))*X = diag(R)*B
+ TRANS = 'T': (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
+ TRANS = 'C': (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B
+
+ Whether or not the system will be equilibrated depends on the
+ scaling of the matrix A, but if equilibration is used, A is
+ overwritten by diag(R)*A*diag(C) and B by diag(R)*B (if TRANS='N')
+ or diag(C)*B (if TRANS = 'T' or 'C').
+
+ 2. If FACT = 'N' or 'E', the LU decomposition is used to factor
+ the matrix A (after equilibration if FACT = 'E') as
+
+ A = P * L * U,
+
+ where P is a permutation matrix, L is a unit lower triangular
+ matrix, and U is upper triangular.
+
+ 3. If some U(i,i)=0, so that U is exactly singular, then the
+ routine returns with INFO = i. Otherwise, the factored form of A
+ is used to estimate the condition number of the matrix A (see
+ argument RCOND). If the reciprocal of the condition number is less
+ than machine precision, the routine still goes on to solve for X
+ and compute error bounds as described below.
+
+ 4. The system of equations is solved for X using the factored form of A.
+
+ 5. By default (unless PARAMS(LA_LINRX_ITREF_I) is set to zero),
+ the routine will use iterative refinement to try to get a small
+ error and error bounds. Refinement calculates the residual to at
+ least twice the working precision.
+
+ 6. If equilibration was used, the matrix X is premultiplied by
+ diag(C) (if TRANS = 'N') or diag(R) (if TRANS = 'T' or 'C') so
+ that it solves the original system before equilibration.
+
+ Some optional parameters are bundled in the PARAMS array. These
+ settings determine how refinement is performed, but often the
+ defaults are acceptable. If the defaults are acceptable, users
+ can pass NPARAMS = 0 which prevents the source code from accessing
+ the PARAMS argument.
+
+Parameters:
+
+ FACT
+ FACT is CHARACTER*1
+ Specifies whether or not the factored form of the matrix A is
+ supplied on entry, and if not, whether the matrix A should be
+ equilibrated before it is factored.
+ = 'F': On entry, AF and IPIV contain the factored form of A.
+ If EQUED is not 'N', the matrix A has been
+ equilibrated with scaling factors given by R and C.
+ A, AF, and IPIV are not modified.
+ = 'N': The matrix A will be copied to AF and factored.
+ = 'E': The matrix A will be equilibrated if necessary, then
+ copied to AF and factored.
+
+ TRANS
+ TRANS is CHARACTER*1
+ Specifies the form of the system of equations:
+ = 'N': A * X = B (No transpose)
+ = 'T': A**T * X = B (Transpose)
+ = 'C': A**H * X = B (Conjugate Transpose = Transpose)
+
+ N
+ N is INTEGER
+ The number of linear equations, i.e., the order of the matrix A. N >= 0.
+
+ NRHS
+ NRHS is INTEGER
+ The number of right hand sides, i.e., the number of columns
+ of the matrices B and X. NRHS >= 0.
+
+ A
+ A is REAL array, dimension (LDA,N)
+ On entry, the NbyN matrix A. If FACT = 'F' and EQUED is
+ not 'N', then A must have been equilibrated by the scaling
+ factors in R and/or C. A is not modified if FACT = 'F' or
+ 'N', or if FACT = 'E' and EQUED = 'N' on exit.
+
+ On exit, if EQUED .ne. 'N', A is scaled as follows:
+ EQUED = 'R': A := diag(R) * A
+ EQUED = 'C': A := A * diag(C)
+ EQUED = 'B': A := diag(R) * A * diag(C).
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,N).
+
+ AF
+ AF is REAL array, dimension (LDAF,N)
+ If FACT = 'F', then AF is an input argument and on entry
+ contains the factors L and U from the factorization
+ A = P*L*U as computed by SGETRF. If EQUED .ne. 'N', then
+ AF is the factored form of the equilibrated matrix A.
+
+ If FACT = 'N', then AF is an output argument and on exit
+ returns the factors L and U from the factorization A = P*L*U
+ of the original matrix A.
+
+ If FACT = 'E', then AF is an output argument and on exit
+ returns the factors L and U from the factorization A = P*L*U
+ of the equilibrated matrix A (see the description of A for
+ the form of the equilibrated matrix).
+
+ LDAF
+ LDAF is INTEGER
+ The leading dimension of the array AF. LDAF >= max(1,N).
+
+ IPIV
+ IPIV is INTEGER array, dimension (N)
+ If FACT = 'F', then IPIV is an input argument and on entry
+ contains the pivot indices from the factorization A = P*L*U
+ as computed by SGETRF; row i of the matrix was interchanged
+ with row IPIV(i).
+
+ If FACT = 'N', then IPIV is an output argument and on exit
+ contains the pivot indices from the factorization A = P*L*U
+ of the original matrix A.
+
+ If FACT = 'E', then IPIV is an output argument and on exit
+ contains the pivot indices from the factorization A = P*L*U
+ of the equilibrated matrix A.
+
+ EQUED
+ EQUED is CHARACTER*1
+ Specifies the form of equilibration that was done.
+ = 'N': No equilibration (always true if FACT = 'N').
+ = 'R': Row equilibration, i.e., A has been premultiplied by diag(R).
+ = 'C': Column equilibration, i.e., A has been postmultiplied by diag(C).
+ = 'B': Both row and column equilibration, i.e., A has been
+ replaced by diag(R) * A * diag(C).
+ EQUED is an input argument if FACT = 'F'; otherwise, it is an
+ output argument.
+
+ R
+ R is REAL array, dimension (N)
+ The row scale factors for A. If EQUED = 'R' or 'B', A is
+ multiplied on the left by diag(R); if EQUED = 'N' or 'C', R
+ is not accessed. R is an input argument if FACT = 'F';
+ otherwise, R is an output argument. If FACT = 'F' and
+ EQUED = 'R' or 'B', each element of R must be positive.
+ If R is output, each element of R is a power of the radix.
+ If R is input, each element of R should be a power of the radix
+ to ensure a reliable solution and error estimates. Scaling by
+ powers of the radix does not cause rounding errors unless the
+ result underflows or overflows. Rounding errors during scaling
+ lead to refining with a matrix that is not equivalent to the
+ input matrix, producing error estimates that may not be reliable.
+
+ C
+ C is REAL array, dimension (N)
+ The column scale factors for A. If EQUED = 'C' or 'B', A is
+ multiplied on the right by diag(C); if EQUED = 'N' or 'R', C
+ is not accessed. C is an input argument if FACT = 'F';
+ otherwise, C is an output argument. If FACT = 'F' and
+ EQUED = 'C' or 'B', each element of C must be positive.
+ If C is output, each element of C is a power of the radix.
+ If C is input, each element of C should be a power of the radix
+ to ensure a reliable solution and error estimates. Scaling by
+ powers of the radix does not cause rounding errors unless the
+ result underflows or overflows. Rounding errors during scaling
+ lead to refining with a matrix that is not equivalent to the
+ input matrix, producing error estimates that may not be reliable.
+
+ B
+ B is REAL array, dimension (LDB,NRHS)
+ On entry, the NbyNRHS right hand side matrix B.
+ On exit,
+ if EQUED = 'N', B is not modified;
+ if TRANS = 'N' and EQUED = 'R' or 'B', B is overwritten by diag(R)*B;
+ if TRANS = 'T' or 'C' and EQUED = 'C' or 'B', B is overwritten by diag(C)*B.
+
+ LDB
+ LDB is INTEGER
+ The leading dimension of the array B. LDB >= max(1,N).
+
+ X
+ X is REAL array, dimension (LDX,NRHS)
+ If INFO = 0, the NbyNRHS solution matrix X to the original
+ system of equations. Note that A and B are modified on exit
+ if EQUED .ne. 'N', and the solution to the equilibrated system is
+ inv(diag(C))*X if TRANS = 'N' and EQUED = 'C' or 'B', or
+ inv(diag(R))*X if TRANS = 'T' or 'C' and EQUED = 'R' or 'B'.
+
+ LDX
+ LDX is INTEGER
+ The leading dimension of the array X. LDX >= max(1,N).
+
+ RCOND
+ RCOND is REAL
+ Reciprocal scaled condition number. This is an estimate of the
+ reciprocal Skeel condition number of the matrix A after
+ equilibration (if done). If this is less than the machine
+ precision (in particular, if it is zero), the matrix is singular
+ to working precision. Note that the error may still be small even
+ if this number is very small and the matrix appears illconditioned.
+
+ RPVGRW
+ RPVGRW is REAL
+ Reciprocal pivot growth. On exit, this contains the reciprocal
+ pivot growth factor norm(A)/norm(U). The "max absolute element"
+ norm is used. If this is much less than 1, then the stability of
+ the LU factorization of the (equilibrated) matrix A could be poor.
+ This also means that the solution X, estimated condition numbers,
+ and error bounds could be unreliable. If factorization fails with
+ 0 0 and <= N: U(INFO,INFO) is exactly zero. The factorization
+ has been completed, but the factor U is exactly singular, so
+ the solution and error bounds could not be computed. RCOND = 0
+ is returned.
+ = N+J: The solution corresponding to the Jth righthand side is
+ not guaranteed. The solutions corresponding to other right
+ hand sides K with K > J may not be guaranteed as well, but
+ only the first such righthand side is reported. If a small
+ componentwise error is not requested (PARAMS(3) = 0.0) then
+ the Jth righthand side is the first with a normwise error
+ bound that is not guaranteed (the smallest J such
+ that ERR_BNDS_NORM(J,1) = 0.0). By default (PARAMS(3) = 1.0)
+ the Jth righthand side is the first with either a normwise or
+ componentwise error bound that is not guaranteed (the smallest
+ J such that either ERR_BNDS_NORM(J,1) = 0.0 or
+ ERR_BNDS_COMP(J,1) = 0.0). See the definition of
+ ERR_BNDS_NORM(:,1) and ERR_BNDS_COMP(:,1). To get information
+ about all of the righthand sides check ERR_BNDS_NORM or
+ ERR_BNDS_COMP.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{sgesvxx.f}
+\index{sgesvxx.f}
+\begin{chunk}{sgesvxx.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK sgesvxx}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\chapter{LAPACK  General Matrices, Linear Solve, Complex}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{cgels}
+\label{cgels}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{cgels.input}
+)set break resume
+)sys rm f cgels.output
+)spool cgels.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{cgels.help}
+====================================================================
+cgels examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine cgels (TRANS, M, N, NRHS, A, LDA, B, LDB, WORK, LWORK, INFO)
+ CGELS solves overdetermined or underdetermined systems for GE
+ matrices
+
+Function/Subroutine Documentation
+ subroutine cgels (character TRANS, integer M, integer N, integer NRHS,
+ complex, dimension( lda, * ) A, integer LDA, complex, dimension( ldb, *
+ ) B, integer LDB, complex, dimension( * ) WORK, integer LWORK, integer
+ INFO)
+ CGELS solves overdetermined or underdetermined systems for GE matrices
+
+Purpose:
+ CGELS solves overdetermined or underdetermined complex linear systems
+ involving an MbyN matrix A, or its conjugatetranspose, using a QR
+ or LQ factorization of A. It is assumed that A has full rank.
+
+ The following options are provided:
+
+ 1. If TRANS = 'N' and m >= n: find the least squares solution of
+ an overdetermined system, i.e., solve the least squares problem
+ minimize  B  A*X .
+
+ 2. If TRANS = 'N' and m < n: find the minimum norm solution of
+ an underdetermined system A * X = B.
+
+ 3. If TRANS = 'C' and m >= n: find the minimum norm solution of
+ an undetermined system A**H * X = B.
+
+ 4. If TRANS = 'C' and m < n: find the least squares solution of
+ an overdetermined system, i.e., solve the least squares problem
+ minimize  B  A**H * X .
+
+ Several right hand side vectors b and solution vectors x can be
+ handled in a single call; they are stored as the columns of the
+ MbyNRHS right hand side matrix B and the NbyNRHS solution matrix X.
+
+Parameters:
+
+ TRANS
+ TRANS is CHARACTER*1
+ = 'N': the linear system involves A;
+ = 'C': the linear system involves A**H.
+
+ M
+ M is INTEGER
+ The number of rows of the matrix A. M >= 0.
+
+ N
+ N is INTEGER
+ The number of columns of the matrix A. N >= 0.
+
+ NRHS
+ NRHS is INTEGER
+ The number of right hand sides, i.e., the number of
+ columns of the matrices B and X. NRHS >= 0.
+
+ A
+ A is COMPLEX array, dimension (LDA,N)
+ On entry, the MbyN matrix A.
+ if M >= N, A is overwritten by details of its QR
+ factorization as returned by CGEQRF;
+ if M < N, A is overwritten by details of its LQ
+ factorization as returned by CGELQF.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+
+ B
+ B is COMPLEX array, dimension (LDB,NRHS)
+ On entry, the matrix B of right hand side vectors, stored
+ columnwise; B is MbyNRHS if TRANS = 'N', or NbyNRHS
+ if TRANS = 'C'.
+ On exit, if INFO = 0, B is overwritten by the solution
+ vectors, stored columnwise:
+ if TRANS = 'N' and m >= n, rows 1 to n of B contain the least
+ squares solution vectors; the residual sum of squares for the
+ solution in each column is given by the sum of squares of the
+ modulus of elements N+1 to M in that column;
+ if TRANS = 'N' and m < n, rows 1 to N of B contain the
+ minimum norm solution vectors;
+ if TRANS = 'C' and m >= n, rows 1 to M of B contain the
+ minimum norm solution vectors;
+ if TRANS = 'C' and m < n, rows 1 to M of B contain the
+ least squares solution vectors; the residual sum of squares
+ for the solution in each column is given by the sum of
+ squares of the modulus of elements M+1 to N in that column.
+
+ LDB
+ LDB is INTEGER
+ The leading dimension of the array B. LDB >= MAX(1,M,N).
+
+ WORK
+ WORK is COMPLEX array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK.
+ LWORK >= max( 1, MN + max( MN, NRHS ) ).
+ For optimal performance,
+ LWORK >= max( 1, MN + max( MN, NRHS )*NB ).
+ where MN = min(M,N) and NB is the optimum block size.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value
+ > 0: if INFO = i, the ith diagonal element of the
+ triangular factor of A is zero, so that A does not have
+ full rank; the least squares solution could not be computed.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{cgels.f}
+\index{cgels.f}
+\begin{chunk}{cgels.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK cgels}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{cgelsd}
+\label{cgelsd}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{cgelsd.input}
+)set break resume
+)sys rm f cgelsd.output
+)spool cgelsd.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{cgelsd.help}
+====================================================================
+cgelsd examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine cgelsd (M, N, NRHS, A, LDA, B, LDB, S, RCOND, RANK, WORK,
+ LWORK, RWORK, IWORK, INFO)
+ CGELSD computes the minimumnorm solution to a linear least
+ squares problem for GE matrices
+
+Function/Subroutine Documentation
+ subroutine cgelsd (integer M, integer N, integer NRHS, complex, dimension(
+ lda, * ) A, integer LDA, complex, dimension( ldb, * ) B, integer LDB,
+ real, dimension( * ) S, real RCOND, integer RANK, complex, dimension( *
+ ) WORK, integer LWORK, real, dimension( * ) RWORK, integer, dimension(
+ * ) IWORK, integer INFO)
+ CGELSD computes the minimumnorm solution to a linear least squares
+ problem for GE matrices
+
+Purpose:
+
+ CGELSD computes the minimumnorm solution to a real linear least
+ squares problem:
+ minimize 2norm( b  A*x )
+ using the singular value decomposition (SVD) of A. A is an MbyN
+ matrix which may be rankdeficient.
+
+ Several right hand side vectors b and solution vectors x can be
+ handled in a single call; they are stored as the columns of the
+ MbyNRHS right hand side matrix B and the NbyNRHS solution matrix X.
+
+ The problem is solved in three steps:
+ (1) Reduce the coefficient matrix A to bidiagonal form with
+ Householder tranformations, reducing the original problem
+ into a "bidiagonal least squares problem" (BLS)
+ (2) Solve the BLS using a divide and conquer approach.
+ (3) Apply back all the Householder tranformations to solve
+ the original least squares problem.
+
+ The effective rank of A is determined by treating as zero those
+ singular values which are less than RCOND times the largest singular
+ value.
+
+ The divide and conquer algorithm makes very mild assumptions about
+ floating point arithmetic. It will work on machines with a guard
+ digit in add/subtract, or on those binary machines without guard
+ digits which subtract like the Cray XMP, Cray YMP, Cray C90, or
+ Cray2. It could conceivably fail on hexadecimal or decimal machines
+ without guard digits, but we know of none.
+
+Parameters:
+
+ M
+ M is INTEGER
+ The number of rows of the matrix A. M >= 0.
+
+ N
+ N is INTEGER
+ The number of columns of the matrix A. N >= 0.
+
+ NRHS
+ NRHS is INTEGER
+ The number of right hand sides, i.e., the number of columns
+ of the matrices B and X. NRHS >= 0.
+
+ A
+ A is COMPLEX array, dimension (LDA,N)
+ On entry, the MbyN matrix A.
+ On exit, A has been destroyed.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+
+ B
+ B is COMPLEX array, dimension (LDB,NRHS)
+ On entry, the MbyNRHS right hand side matrix B.
+ On exit, B is overwritten by the NbyNRHS solution matrix X.
+ If m >= n and RANK = n, the residual sumofsquares for
+ the solution in the ith column is given by the sum of
+ squares of the modulus of elements n+1:m in that column.
+
+ LDB
+ LDB is INTEGER
+ The leading dimension of the array B. LDB >= max(1,M,N).
+
+ S
+ S is REAL array, dimension (min(M,N))
+ The singular values of A in decreasing order.
+ The condition number of A in the 2norm = S(1)/S(min(m,n)).
+
+ RCOND
+ RCOND is REAL
+ RCOND is used to determine the effective rank of A.
+ Singular values S(i) <= RCOND*S(1) are treated as zero.
+ If RCOND < 0, machine precision is used instead.
+
+ RANK
+ RANK is INTEGER
+ The effective rank of A, i.e., the number of singular values
+ which are greater than RCOND*S(1).
+
+ WORK
+ WORK is COMPLEX array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK. LWORK must be at least 1.
+ The exact minimum amount of workspace needed depends on M,
+ N and NRHS. As long as LWORK is at least
+ 2 * N + N * NRHS
+ if M is greater than or equal to N or
+ 2 * M + M * NRHS
+ if M is less than N, the code will execute correctly.
+ For good performance, LWORK should generally be larger.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the array WORK and the
+ minimum sizes of the arrays RWORK and IWORK, and returns
+ these values as the first entries of the WORK, RWORK and
+ IWORK arrays, and no error message related to LWORK is issued
+ by XERBLA.
+
+ RWORK
+ RWORK is REAL array, dimension (MAX(1,LRWORK))
+ LRWORK >=
+ 10*N + 2*N*SMLSIZ + 8*N*NLVL + 3*SMLSIZ*NRHS +
+ MAX( (SMLSIZ+1)**2, N*(1+NRHS) + 2*NRHS )
+ if M is greater than or equal to N or
+ 10*M + 2*M*SMLSIZ + 8*M*NLVL + 3*SMLSIZ*NRHS +
+ MAX( (SMLSIZ+1)**2, N*(1+NRHS) + 2*NRHS )
+ if M is less than N, the code will execute correctly.
+ SMLSIZ is returned by ILAENV and is equal to the maximum
+ size of the subproblems at the bottom of the computation
+ tree (usually about 25), and
+ NLVL = MAX( 0, INT( LOG_2( MIN( M,N )/(SMLSIZ+1) ) ) + 1 )
+ On exit, if INFO = 0, RWORK(1) returns the minimum LRWORK.
+
+ IWORK
+ IWORK is INTEGER array, dimension (MAX(1,LIWORK))
+ LIWORK >= max(1, 3*MINMN*NLVL + 11*MINMN),
+ where MINMN = MIN( M,N ).
+ On exit, if INFO = 0, IWORK(1) returns the minimum LIWORK.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value.
+ > 0: the algorithm for computing the SVD failed to converge;
+ if INFO = i, i offdiagonal elements of an intermediate
+ bidiagonal form did not converge to zero.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{cgelsd.f}
+\index{cgelsd.f}
+\begin{chunk}{cgelsd.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK cgelsd}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{cgelss}
+\label{cgelss}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{cgelss.input}
+)set break resume
+)sys rm f cgelss.output
+)spool cgelss.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{cgelss.help}
+====================================================================
+cgelss examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine cgelss (M, N, NRHS, A, LDA, B, LDB, S, RCOND, RANK, WORK,
+ LWORK, RWORK, INFO)
+ CGELSS solves overdetermined or underdetermined systems for GE
+ matrices
+
+Function/Subroutine Documentation
+ subroutine cgelss (integer M, integer N, integer NRHS, complex, dimension(
+ lda, * ) A, integer LDA, complex, dimension( ldb, * ) B, integer LDB,
+ real, dimension( * ) S, real RCOND, integer RANK, complex, dimension( *
+ ) WORK, integer LWORK, real, dimension( * ) RWORK, integer INFO)
+ CGELSS solves overdetermined or underdetermined systems for GE
+ matrices
+
+Purpose:
+
+ CGELSS computes the minimum norm solution to a complex linear
+ least squares problem:
+
+ Minimize 2norm( b  A*x ).
+
+ using the singular value decomposition (SVD) of A. A is an MbyN
+ matrix which may be rankdeficient.
+
+ Several right hand side vectors b and solution vectors x can be
+ handled in a single call; they are stored as the columns of the
+ MbyNRHS right hand side matrix B and the NbyNRHS solution matrix X.
+
+ The effective rank of A is determined by treating as zero those
+ singular values which are less than RCOND times the largest singular value.
+
+Parameters:
+
+ M
+ M is INTEGER
+ The number of rows of the matrix A. M >= 0.
+
+ N
+ N is INTEGER
+ The number of columns of the matrix A. N >= 0.
+
+ NRHS
+ NRHS is INTEGER
+ The number of right hand sides, i.e., the number of columns
+ of the matrices B and X. NRHS >= 0.
+
+ A
+ A is COMPLEX array, dimension (LDA,N)
+ On entry, the MbyN matrix A.
+ On exit, the first min(m,n) rows of A are overwritten with
+ its right singular vectors, stored rowwise.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+
+ B
+ B is COMPLEX array, dimension (LDB,NRHS)
+ On entry, the MbyNRHS right hand side matrix B.
+ On exit, B is overwritten by the NbyNRHS solution matrix X.
+ If m >= n and RANK = n, the residual sumofsquares for
+ the solution in the ith column is given by the sum of
+ squares of the modulus of elements n+1:m in that column.
+
+ LDB
+ LDB is INTEGER
+ The leading dimension of the array B. LDB >= max(1,M,N).
+
+ S
+ S is REAL array, dimension (min(M,N))
+ The singular values of A in decreasing order.
+ The condition number of A in the 2norm = S(1)/S(min(m,n)).
+
+ RCOND
+ RCOND is REAL
+ RCOND is used to determine the effective rank of A.
+ Singular values S(i) <= RCOND*S(1) are treated as zero.
+ If RCOND < 0, machine precision is used instead.
+
+ RANK
+ RANK is INTEGER
+ The effective rank of A, i.e., the number of singular values
+ which are greater than RCOND*S(1).
+
+ WORK
+ WORK is COMPLEX array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK. LWORK >= 1, and also:
+ LWORK >= 2*min(M,N) + max(M,N,NRHS)
+ For good performance, LWORK should generally be larger.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ RWORK
+ RWORK is REAL array, dimension (5*min(M,N))
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value.
+ > 0: the algorithm for computing the SVD failed to converge;
+ if INFO = i, i offdiagonal elements of an intermediate
+ bidiagonal form did not converge to zero.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{cgelss.f}
+\index{cgelss.f}
+\begin{chunk}{cgelss.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK cgelss}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{cgelsx  DEPRECATED use cgelsy}
+\label{cgelsx}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{cgelsy}
+\label{cgelsy}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{cgelsy.input}
+)set break resume
+)sys rm f cgelsy.output
+)spool cgelsy.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{cgelsy.help}
+====================================================================
+cgelsy examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine cgelsy (M, N, NRHS, A, LDA, B, LDB, JPVT, RCOND, RANK, WORK,
+ LWORK, RWORK, INFO)
+ CGELSY solves overdetermined or underdetermined systems for GE
+ matrices
+
+Function/Subroutine Documentation
+ subroutine cgelsy (integer M, integer N, integer NRHS, complex, dimension(
+ lda, * ) A, integer LDA, complex, dimension( ldb, * ) B, integer LDB,
+ integer, dimension( * ) JPVT, real RCOND, integer RANK, complex,
+ dimension( * ) WORK, integer LWORK, real, dimension( * ) RWORK, integer
+ INFO)
+ CGELSY solves overdetermined or underdetermined systems for GE
+ matrices
+
+Purpose:
+
+ CGELSY computes the minimumnorm solution to a complex linear least
+ squares problem:
+ minimize  A * X  B 
+ using a complete orthogonal factorization of A. A is an MbyN
+ matrix which may be rankdeficient.
+
+ Several right hand side vectors b and solution vectors x can be
+ handled in a single call; they are stored as the columns of the
+ MbyNRHS right hand side matrix B and the NbyNRHS solution matrix X.
+
+ The routine first computes a QR factorization with column pivoting:
+ A * P = Q * [ R11 R12 ]
+ [ 0 R22 ]
+ with R11 defined as the largest leading submatrix whose estimated
+ condition number is less than 1/RCOND. The order of R11, RANK,
+ is the effective rank of A.
+
+ Then, R22 is considered to be negligible, and R12 is annihilated
+ by unitary transformations from the right, arriving at the
+ complete orthogonal factorization:
+ A * P = Q * [ T11 0 ] * Z
+ [ 0 0 ]
+ The minimumnorm solution is then
+ X = P * Z**H [ inv(T11)*Q1**H*B ]
+ [ 0 ]
+ where Q1 consists of the first RANK columns of Q.
+
+ This routine is basically identical to the original xGELSX except
+ three differences:
+ o The permutation of matrix B (the right hand side) is faster and
+ more simple.
+ o The call to the subroutine xGEQPF has been substituted by the
+ the call to the subroutine xGEQP3. This subroutine is a Blas3
+ version of the QR factorization with column pivoting.
+ o Matrix B (the right hand side) is updated with Blas3.
+
+Parameters:
+
+ M
+ M is INTEGER
+ The number of rows of the matrix A. M >= 0.
+
+ N
+ N is INTEGER
+ The number of columns of the matrix A. N >= 0.
+
+ NRHS
+ NRHS is INTEGER
+ The number of right hand sides, i.e., the number of
+ columns of matrices B and X. NRHS >= 0.
+
+ A
+ A is COMPLEX array, dimension (LDA,N)
+ On entry, the MbyN matrix A.
+ On exit, A has been overwritten by details of its
+ complete orthogonal factorization.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+
+ B
+ B is COMPLEX array, dimension (LDB,NRHS)
+ On entry, the MbyNRHS right hand side matrix B.
+ On exit, the NbyNRHS solution matrix X.
+
+ LDB
+ LDB is INTEGER
+ The leading dimension of the array B. LDB >= max(1,M,N).
+
+ JPVT
+ JPVT is INTEGER array, dimension (N)
+ On entry, if JPVT(i) .ne. 0, the ith column of A is permuted
+ to the front of AP, otherwise column i is a free column.
+ On exit, if JPVT(i) = k, then the ith column of A*P
+ was the kth column of A.
+
+ RCOND
+ RCOND is REAL
+ RCOND is used to determine the effective rank of A, which
+ is defined as the order of the largest leading triangular
+ submatrix R11 in the QR factorization with pivoting of A,
+ whose estimated condition number < 1/RCOND.
+
+ RANK
+ RANK is INTEGER
+ The effective rank of A, i.e., the order of the submatrix
+ R11. This is the same as the order of the submatrix T11
+ in the complete orthogonal factorization of A.
+
+ WORK
+ WORK is COMPLEX array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK.
+ The unblocked strategy requires that:
+ LWORK >= MN + MAX( 2*MN, N+1, MN+NRHS )
+ where MN = min(M,N).
+ The block algorithm requires that:
+ LWORK >= MN + MAX( 2*MN, NB*(N+1), MN+MN*NB, MN+NB*NRHS )
+ where NB is an upper bound on the blocksize returned
+ by ILAENV for the routines CGEQP3, CTZRZF, CTZRQF, CUNMQR,
+ and CUNMRZ.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ RWORK
+ RWORK is REAL array, dimension (2*N)
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{cgelsy.f}
+\index{cgelsy.f}
+\begin{chunk}{cgelsy.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK cgelsy}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{cgesv}
+\label{cgesv}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{cgesv.input}
+)set break resume
+)sys rm f cgesv.output
+)spool cgesv.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{cgesv.help}
+====================================================================
+cgesv examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine cgesv (N, NRHS, A, LDA, IPIV, B, LDB, INFO)
+ CGESV computes the solution to system of linear equations A * X =
+ B for GE matrices (simple driver)
+
+Function/Subroutine Documentation
+ subroutine cgesv (integer N, integer NRHS, complex, dimension( lda, * ) A,
+ integer LDA, integer, dimension( * ) IPIV, complex, dimension( ldb, * )
+ B, integer LDB, integer INFO)
+ CGESV computes the solution to system of linear equations A * X = B
+ for GE matrices (simple driver)
+
+Purpose:
+
+ CGESV computes the solution to a complex system of linear equations
+ A * X = B,
+ where A is an NbyN matrix and X and B are NbyNRHS matrices.
+
+ The LU decomposition with partial pivoting and row interchanges is
+ used to factor A as
+ A = P * L * U,
+ where P is a permutation matrix, L is unit lower triangular, and U is
+ upper triangular. The factored form of A is then used to solve the
+ system of equations A * X = B.
+
+Parameters:
+
+ N
+ N is INTEGER
+ The number of linear equations, i.e., the order of the matrix A. N >= 0.
+
+ NRHS
+ NRHS is INTEGER
+ The number of right hand sides, i.e., the number of columns
+ of the matrix B. NRHS >= 0.
+
+ A
+ A is COMPLEX array, dimension (LDA,N)
+ On entry, the NbyN coefficient matrix A.
+ On exit, the factors L and U from the factorization
+ A = P*L*U; the unit diagonal elements of L are not stored.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,N).
+
+ IPIV
+ IPIV is INTEGER array, dimension (N)
+ The pivot indices that define the permutation matrix P;
+ row i of the matrix was interchanged with row IPIV(i).
+
+ B
+ B is COMPLEX array, dimension (LDB,NRHS)
+ On entry, the NbyNRHS matrix of right hand side matrix B.
+ On exit, if INFO = 0, the NbyNRHS solution matrix X.
+
+ LDB
+ LDB is INTEGER
+ The leading dimension of the array B. LDB >= max(1,N).
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value
+ > 0: if INFO = i, U(i,i) is exactly zero. The factorization
+ has been completed, but the factor U is exactly
+ singular, so the solution could not be computed.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{cgesv.f}
+\index{cgesv.f}
+\begin{chunk}{cgesv.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK cgesv}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{cgesvx}
+\label{cgesvx}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{cgesvx.input}
+)set break resume
+)sys rm f cgesvx.output
+)spool cgesvx.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{cgesvx.help}
+====================================================================
+cgesvx examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine cgesvx (FACT, TRANS, N, NRHS, A, LDA, AF, LDAF, IPIV, EQUED,
+ R, C, B, LDB, X, LDX, RCOND, FERR, BERR, WORK, RWORK, INFO)
+ CGESVX computes the solution to system of linear equations A * X =
+ B for GE matrices
+
+Function/Subroutine Documentation
+ subroutine cgesvx (character FACT, character TRANS, integer N, integer
+ NRHS, complex, dimension( lda, * ) A, integer LDA, complex, dimension(
+ ldaf, * ) AF, integer LDAF, integer, dimension( * ) IPIV, character
+ EQUED, real, dimension( * ) R, real, dimension( * ) C, complex,
+ dimension( ldb, * ) B, integer LDB, complex, dimension( ldx, * ) X,
+ integer LDX, real RCOND, real, dimension( * ) FERR, real, dimension( *
+ ) BERR, complex, dimension( * ) WORK, real, dimension( * ) RWORK,
+ integer INFO)
+ CGESVX computes the solution to system of linear equations A * X = B
+ for GE matrices
+
+Purpose:
+
+ CGESVX uses the LU factorization to compute the solution to a complex
+ system of linear equations
+ A * X = B,
+ where A is an NbyN matrix and X and B are NbyNRHS matrices.
+
+ Error bounds on the solution and a condition estimate are also provided.
+
+Description:
+ The following steps are performed:
+
+ 1. If FACT = 'E', real scaling factors are computed to equilibrate
+ the system:
+ TRANS = 'N': diag(R)*A*diag(C) *inv(diag(C))*X = diag(R)*B
+ TRANS = 'T': (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
+ TRANS = 'C': (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B
+ Whether or not the system will be equilibrated depends on the
+ scaling of the matrix A, but if equilibration is used, A is
+ overwritten by diag(R)*A*diag(C) and B by diag(R)*B (if TRANS='N')
+ or diag(C)*B (if TRANS = 'T' or 'C').
+
+ 2. If FACT = 'N' or 'E', the LU decomposition is used to factor the
+ matrix A (after equilibration if FACT = 'E') as
+ A = P * L * U,
+ where P is a permutation matrix, L is a unit lower triangular
+ matrix, and U is upper triangular.
+
+ 3. If some U(i,i)=0, so that U is exactly singular, then the routine
+ returns with INFO = i. Otherwise, the factored form of A is used
+ to estimate the condition number of the matrix A. If the
+ reciprocal of the condition number is less than machine precision,
+ INFO = N+1 is returned as a warning, but the routine still goes on
+ to solve for X and compute error bounds as described below.
+
+ 4. The system of equations is solved for X using the factored form of A.
+
+ 5. Iterative refinement is applied to improve the computed solution
+ matrix and calculate error bounds and backward error estimates
+ for it.
+
+ 6. If equilibration was used, the matrix X is premultiplied by
+ diag(C) (if TRANS = 'N') or diag(R) (if TRANS = 'T' or 'C') so
+ that it solves the original system before equilibration.
+
+Parameters:
+
+ FACT
+ FACT is CHARACTER*1
+ Specifies whether or not the factored form of the matrix A is
+ supplied on entry, and if not, whether the matrix A should be
+ equilibrated before it is factored.
+ = 'F': On entry, AF and IPIV contain the factored form of A.
+ If EQUED is not 'N', the matrix A has been
+ equilibrated with scaling factors given by R and C.
+ A, AF, and IPIV are not modified.
+ = 'N': The matrix A will be copied to AF and factored.
+ = 'E': The matrix A will be equilibrated if necessary, then
+ copied to AF and factored.
+
+ TRANS
+ TRANS is CHARACTER*1
+ Specifies the form of the system of equations:
+ = 'N': A * X = B (No transpose)
+ = 'T': A**T * X = B (Transpose)
+ = 'C': A**H * X = B (Conjugate transpose)
+
+ N
+ N is INTEGER
+ The number of linear equations, i.e., the order of the
+ matrix A. N >= 0.
+
+ NRHS
+ NRHS is INTEGER
+ The number of right hand sides, i.e., the number of columns
+ of the matrices B and X. NRHS >= 0.
+
+ A
+ A is COMPLEX array, dimension (LDA,N)
+ On entry, the NbyN matrix A. If FACT = 'F' and EQUED is
+ not 'N', then A must have been equilibrated by the scaling
+ factors in R and/or C. A is not modified if FACT = 'F' or
+ 'N', or if FACT = 'E' and EQUED = 'N' on exit.
+
+ On exit, if EQUED .ne. 'N', A is scaled as follows:
+ EQUED = 'R': A := diag(R) * A
+ EQUED = 'C': A := A * diag(C)
+ EQUED = 'B': A := diag(R) * A * diag(C).
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,N).
+
+ AF
+ AF is COMPLEX array, dimension (LDAF,N)
+ If FACT = 'F', then AF is an input argument and on entry
+ contains the factors L and U from the factorization
+ A = P*L*U as computed by CGETRF. If EQUED .ne. 'N', then
+ AF is the factored form of the equilibrated matrix A.
+
+ If FACT = 'N', then AF is an output argument and on exit
+ returns the factors L and U from the factorization A = P*L*U
+ of the original matrix A.
+
+ If FACT = 'E', then AF is an output argument and on exit
+ returns the factors L and U from the factorization A = P*L*U
+ of the equilibrated matrix A (see the description of A for
+ the form of the equilibrated matrix).
+
+ LDAF
+ LDAF is INTEGER
+ The leading dimension of the array AF. LDAF >= max(1,N).
+
+ IPIV
+ IPIV is INTEGER array, dimension (N)
+ If FACT = 'F', then IPIV is an input argument and on entry
+ contains the pivot indices from the factorization A = P*L*U
+ as computed by CGETRF; row i of the matrix was interchanged
+ with row IPIV(i).
+
+ If FACT = 'N', then IPIV is an output argument and on exit
+ contains the pivot indices from the factorization A = P*L*U
+ of the original matrix A.
+
+ If FACT = 'E', then IPIV is an output argument and on exit
+ contains the pivot indices from the factorization A = P*L*U
+ of the equilibrated matrix A.
+
+ EQUED
+ EQUED is CHARACTER*1
+ Specifies the form of equilibration that was done.
+ = 'N': No equilibration (always true if FACT = 'N').
+ = 'R': Row equilibration, i.e., A has been premultiplied by diag(R).
+ = 'C': Column equilibration, i.e., A has been postmultiplied by diag(C).
+ = 'B': Both row and column equilibration, i.e., A has been
+ replaced by diag(R) * A * diag(C).
+ EQUED is an input argument if FACT = 'F'; otherwise, it is an
+ output argument.
+
+ R
+ R is REAL array, dimension (N)
+ The row scale factors for A. If EQUED = 'R' or 'B', A is
+ multiplied on the left by diag(R); if EQUED = 'N' or 'C', R
+ is not accessed. R is an input argument if FACT = 'F';
+ otherwise, R is an output argument. If FACT = 'F' and
+ EQUED = 'R' or 'B', each element of R must be positive.
+
+ C
+ C is REAL array, dimension (N)
+ The column scale factors for A. If EQUED = 'C' or 'B', A is
+ multiplied on the right by diag(C); if EQUED = 'N' or 'R', C
+ is not accessed. C is an input argument if FACT = 'F';
+ otherwise, C is an output argument. If FACT = 'F' and
+ EQUED = 'C' or 'B', each element of C must be positive.
+
+ B
+ B is COMPLEX array, dimension (LDB,NRHS)
+ On entry, the NbyNRHS right hand side matrix B.
+ On exit,
+ if EQUED = 'N', B is not modified;
+ if TRANS = 'N' and EQUED = 'R' or 'B', B is overwritten by
+ diag(R)*B;
+ if TRANS = 'T' or 'C' and EQUED = 'C' or 'B', B is
+ overwritten by diag(C)*B.
+
+ LDB
+ LDB is INTEGER
+ The leading dimension of the array B. LDB >= max(1,N).
+
+ X
+ X is COMPLEX array, dimension (LDX,NRHS)
+ If INFO = 0 or INFO = N+1, the NbyNRHS solution matrix X
+ to the original system of equations. Note that A and B are
+ modified on exit if EQUED .ne. 'N', and the solution to the
+ equilibrated system is inv(diag(C))*X if TRANS = 'N' and
+ EQUED = 'C' or 'B', or inv(diag(R))*X if TRANS = 'T' or 'C'
+ and EQUED = 'R' or 'B'.
+
+ LDX
+ LDX is INTEGER
+ The leading dimension of the array X. LDX >= max(1,N).
+
+ RCOND
+ RCOND is REAL
+ The estimate of the reciprocal condition number of the matrix
+ A after equilibration (if done). If RCOND is less than the
+ machine precision (in particular, if RCOND = 0), the matrix
+ is singular to working precision. This condition is
+ indicated by a return code of INFO > 0.
+
+ FERR
+ FERR is REAL array, dimension (NRHS)
+ The estimated forward error bound for each solution vector
+ X(j) (the jth column of the solution matrix X).
+ If XTRUE is the true solution corresponding to X(j), FERR(j)
+ is an estimated upper bound for the magnitude of the largest
+ element in (X(j)  XTRUE) divided by the magnitude of the
+ largest element in X(j). The estimate is as reliable as
+ the estimate for RCOND, and is almost always a slight
+ overestimate of the true error.
+
+ BERR
+ BERR is REAL array, dimension (NRHS)
+ The componentwise relative backward error of each solution
+ vector X(j) (i.e., the smallest relative change in
+ any element of A or B that makes X(j) an exact solution).
+
+ WORK
+ WORK is COMPLEX array, dimension (2*N)
+
+ RWORK
+ RWORK is REAL array, dimension (2*N)
+ On exit, RWORK(1) contains the reciprocal pivot growth
+ factor norm(A)/norm(U). The "max absolute element" norm is
+ used. If RWORK(1) is much less than 1, then the stability
+ of the LU factorization of the (equilibrated) matrix A
+ could be poor. This also means that the solution X, condition
+ estimator RCOND, and forward error bound FERR could be
+ unreliable. If factorization fails with 0 0: if INFO = i, and i is
+ <= N: U(i,i) is exactly zero. The factorization has
+ been completed, but the factor U is exactly
+ singular, so the solution and error bounds
+ could not be computed. RCOND = 0 is returned.
+ = N+1: U is nonsingular, but RCOND is less than machine
+ precision, meaning that the matrix is singular
+ to working precision. Nevertheless, the
+ solution and error bounds are computed because
+ there are a number of situations where the
+ computed solution can be more accurate than the
+ value of RCOND would suggest.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{cgesvx.f}
+\index{cgesvx.f}
+\begin{chunk}{cgesvx.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK cgesvx}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{cgesvxx}
+\label{cgesvxx}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{cgesvxx.input}
+)set break resume
+)sys rm f cgesvxx.output
+)spool cgesvxx.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page \cite{Demm05}}
+\begin{chunk}{cgesvxx.help}
+====================================================================
+cgesvxx examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine cgesvxx (FACT, TRANS, N, NRHS, A, LDA, AF, LDAF, IPIV,
+ EQUED, R, C, B, LDB, X, LDX, RCOND, RPVGRW, BERR, N_ERR_BNDS,
+ ERR_BNDS_NORM, ERR_BNDS_COMP, NPARAMS, PARAMS, WORK, RWORK, INFO)
+ CGESVXX computes the solution to system of linear equations A * X
+ = B for GE matrices
+
+Function/Subroutine Documentation
+ subroutine cgesvxx (character FACT, character TRANS, integer N, integer
+ NRHS, complex, dimension( lda, * ) A, integer LDA, complex, dimension(
+ ldaf, * ) AF, integer LDAF, integer, dimension( * ) IPIV, character
+ EQUED, real, dimension( * ) R, real, dimension( * ) C, complex,
+ dimension( ldb, * ) B, integer LDB, complex, dimension( ldx , * ) X,
+ integer LDX, real RCOND, real RPVGRW, real, dimension( * ) BERR,
+ integer N_ERR_BNDS, real, dimension( nrhs, * ) ERR_BNDS_NORM, real,
+ dimension( nrhs, * ) ERR_BNDS_COMP, integer NPARAMS, real, dimension( *
+ ) PARAMS, complex, dimension( * ) WORK, real, dimension( * ) RWORK,
+ integer INFO)
+ CGESVXX computes the solution to system of linear equations A * X = B
+ for GE matrices
+
+Purpose:
+ CGESVXX uses the LU factorization to compute the solution to a
+ complex system of linear equations A * X = B, where A is an
+ NbyN matrix and X and B are NbyNRHS matrices.
+
+ If requested, both normwise and maximum componentwise error bounds
+ are returned. CGESVXX will return a solution with a tiny
+ guaranteed error (O(eps) where eps is the working machine
+ precision) unless the matrix is very illconditioned, in which
+ case a warning is returned. Relevant condition numbers also are
+ calculated and returned.
+
+ CGESVXX accepts userprovided factorizations and equilibration
+ factors; see the definitions of the FACT and EQUED options.
+ Solving with refinement and using a factorization from a previous
+ CGESVXX call will also produce a solution with either O(eps)
+ errors or warnings, but we cannot make that claim for general
+ userprovided factorizations and equilibration factors if they
+ differ from what CGESVXX would itself produce.
+
+Description:
+ The following steps are performed:
+
+ 1. If FACT = 'E', real scaling factors are computed to equilibrate
+ the system:
+
+ TRANS = 'N': diag(R)*A*diag(C) *inv(diag(C))*X = diag(R)*B
+ TRANS = 'T': (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
+ TRANS = 'C': (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B
+
+ Whether or not the system will be equilibrated depends on the
+ scaling of the matrix A, but if equilibration is used, A is
+ overwritten by diag(R)*A*diag(C) and B by diag(R)*B (if TRANS='N')
+ or diag(C)*B (if TRANS = 'T' or 'C').
+
+ 2. If FACT = 'N' or 'E', the LU decomposition is used to factor
+ the matrix A (after equilibration if FACT = 'E') as
+ A = P * L * U,
+ where P is a permutation matrix, L is a unit lower triangular
+ matrix, and U is upper triangular.
+
+ 3. If some U(i,i)=0, so that U is exactly singular, then the
+ routine returns with INFO = i. Otherwise, the factored form of A
+ is used to estimate the condition number of the matrix A (see
+ argument RCOND). If the reciprocal of the condition number is less
+ than machine precision, the routine still goes on to solve for X
+ and compute error bounds as described below.
+
+ 4. The system of equations is solved for X using the factored form of A.
+
+ 5. By default (unless PARAMS(LA_LINRX_ITREF_I) is set to zero),
+ the routine will use iterative refinement to try to get a small
+ error and error bounds. Refinement calculates the residual to at
+ least twice the working precision.
+
+ 6. If equilibration was used, the matrix X is premultiplied by
+ diag(C) (if TRANS = 'N') or diag(R) (if TRANS = 'T' or 'C') so
+ that it solves the original system before equilibration.
+
+ Some optional parameters are bundled in the PARAMS array. These
+ settings determine how refinement is performed, but often the
+ defaults are acceptable. If the defaults are acceptable, users
+ can pass NPARAMS = 0 which prevents the source code from accessing
+ the PARAMS argument.
+
+Parameters:
+
+ FACT
+ FACT is CHARACTER*1
+ Specifies whether or not the factored form of the matrix A is
+ supplied on entry, and if not, whether the matrix A should be
+ equilibrated before it is factored.
+ = 'F': On entry, AF and IPIV contain the factored form of A.
+ If EQUED is not 'N', the matrix A has been
+ equilibrated with scaling factors given by R and C.
+ A, AF, and IPIV are not modified.
+ = 'N': The matrix A will be copied to AF and factored.
+ = 'E': The matrix A will be equilibrated if necessary, then
+ copied to AF and factored.
+
+TRANS
+ TRANS is CHARACTER*1
+ Specifies the form of the system of equations:
+ = 'N': A * X = B (No transpose)
+ = 'T': A**T * X = B (Transpose)
+ = 'C': A**H * X = B (Conjugate Transpose)
+
+ N
+ N is INTEGER
+ The number of linear equations, i.e., the order of the matrix A. N >= 0.
+
+ NRHS
+ NRHS is INTEGER
+ The number of right hand sides, i.e., the number of columns
+ of the matrices B and X. NRHS >= 0.
+
+ A
+ A is COMPLEX array, dimension (LDA,N)
+ On entry, the NbyN matrix A. If FACT = 'F' and EQUED is
+ not 'N', then A must have been equilibrated by the scaling
+ factors in R and/or C. A is not modified if FACT = 'F' or
+ 'N', or if FACT = 'E' and EQUED = 'N' on exit.
+
+ On exit, if EQUED .ne. 'N', A is scaled as follows:
+ EQUED = 'R': A := diag(R) * A
+ EQUED = 'C': A := A * diag(C)
+ EQUED = 'B': A := diag(R) * A * diag(C).
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,N).
+
+ AF
+ AF is COMPLEX array, dimension (LDAF,N)
+ If FACT = 'F', then AF is an input argument and on entry
+ contains the factors L and U from the factorization
+ A = P*L*U as computed by CGETRF. If EQUED .ne. 'N', then
+ AF is the factored form of the equilibrated matrix A.
+
+ If FACT = 'N', then AF is an output argument and on exit
+ returns the factors L and U from the factorization A = P*L*U
+ of the original matrix A.
+
+ If FACT = 'E', then AF is an output argument and on exit
+ returns the factors L and U from the factorization A = P*L*U
+ of the equilibrated matrix A (see the description of A for
+ the form of the equilibrated matrix).
+
+ LDAF
+ LDAF is INTEGER
+ The leading dimension of the array AF. LDAF >= max(1,N).
+
+ IPIV
+ IPIV is INTEGER array, dimension (N)
+ If FACT = 'F', then IPIV is an input argument and on entry
+ contains the pivot indices from the factorization A = P*L*U
+ as computed by CGETRF; row i of the matrix was interchanged
+ with row IPIV(i).
+
+ If FACT = 'N', then IPIV is an output argument and on exit
+ contains the pivot indices from the factorization A = P*L*U
+ of the original matrix A.
+
+ If FACT = 'E', then IPIV is an output argument and on exit
+ contains the pivot indices from the factorization A = P*L*U
+ of the equilibrated matrix A.
+
+ EQUED
+ EQUED is CHARACTER*1
+ Specifies the form of equilibration that was done.
+ = 'N': No equilibration (always true if FACT = 'N').
+ = 'R': Row equilibration, i.e., A has been premultiplied by diag(R).
+ = 'C': Column equilibration, i.e., A has been postmultiplied by diag(C).
+ = 'B': Both row and column equilibration, i.e., A has been
+ replaced by diag(R) * A * diag(C).
+ EQUED is an input argument if FACT = 'F'; otherwise, it is an
+ output argument.
+
+ R
+ R is REAL array, dimension (N)
+ The row scale factors for A. If EQUED = 'R' or 'B', A is
+ multiplied on the left by diag(R); if EQUED = 'N' or 'C', R
+ is not accessed. R is an input argument if FACT = 'F';
+ otherwise, R is an output argument. If FACT = 'F' and
+ EQUED = 'R' or 'B', each element of R must be positive.
+ If R is output, each element of R is a power of the radix.
+ If R is input, each element of R should be a power of the radix
+ to ensure a reliable solution and error estimates. Scaling by
+ powers of the radix does not cause rounding errors unless the
+ result underflows or overflows. Rounding errors during scaling
+ lead to refining with a matrix that is not equivalent to the
+ input matrix, producing error estimates that may not be reliable.
+
+ C
+ C is REAL array, dimension (N)
+ The column scale factors for A. If EQUED = 'C' or 'B', A is
+ multiplied on the right by diag(C); if EQUED = 'N' or 'R', C
+ is not accessed. C is an input argument if FACT = 'F';
+ otherwise, C is an output argument. If FACT = 'F' and
+ EQUED = 'C' or 'B', each element of C must be positive.
+ If C is output, each element of C is a power of the radix.
+ If C is input, each element of C should be a power of the radix
+ to ensure a reliable solution and error estimates. Scaling by
+ powers of the radix does not cause rounding errors unless the
+ result underflows or overflows. Rounding errors during scaling
+ lead to refining with a matrix that is not equivalent to the
+ input matrix, producing error estimates that may not be reliable.
+
+ B
+ B is COMPLEX array, dimension (LDB,NRHS)
+ On entry, the NbyNRHS right hand side matrix B.
+ On exit,
+ if EQUED = 'N', B is not modified;
+ if TRANS = 'N' and EQUED = 'R' or 'B', B is overwritten by diag(R)*B;
+ if TRANS = 'T' or 'C' and EQUED = 'C' or 'B', B is
+ overwritten by diag(C)*B.
+
+ LDB
+ LDB is INTEGER
+ The leading dimension of the array B. LDB >= max(1,N).
+
+ X
+ X is COMPLEX array, dimension (LDX,NRHS)
+ If INFO = 0, the NbyNRHS solution matrix X to the original
+ system of equations. Note that A and B are modified on exit
+ if EQUED .ne. 'N', and the solution to the equilibrated system is
+ inv(diag(C))*X if TRANS = 'N' and EQUED = 'C' or 'B', or
+ inv(diag(R))*X if TRANS = 'T' or 'C' and EQUED = 'R' or 'B'.
+
+ LDX
+ LDX is INTEGER
+ The leading dimension of the array X. LDX >= max(1,N).
+
+ RCOND
+ RCOND is REAL
+ Reciprocal scaled condition number. This is an estimate of the
+ reciprocal Skeel condition number of the matrix A after
+ equilibration (if done). If this is less than the machine
+ precision (in particular, if it is zero), the matrix is singular
+ to working precision. Note that the error may still be small even
+ if this number is very small and the matrix appears illconditioned.
+
+ RPVGRW
+ RPVGRW is REAL
+ Reciprocal pivot growth. On exit, this contains the reciprocal
+ pivot growth factor norm(A)/norm(U). The "max absolute element"
+ norm is used. If this is much less than 1, then the stability of
+ the LU factorization of the (equilibrated) matrix A could be poor.
+ This also means that the solution X, estimated condition numbers,
+ and error bounds could be unreliable. If factorization fails with
+ 0 0 and <= N: U(INFO,INFO) is exactly zero. The factorization
+ has been completed, but the factor U is exactly singular, so
+ the solution and error bounds could not be computed. RCOND = 0
+ is returned.
+ = N+J: The solution corresponding to the Jth righthand side is
+ not guaranteed. The solutions corresponding to other right
+ hand sides K with K > J may not be guaranteed as well, but
+ only the first such righthand side is reported. If a small
+ componentwise error is not requested (PARAMS(3) = 0.0) then
+ the Jth righthand side is the first with a normwise error
+ bound that is not guaranteed (the smallest J such
+ that ERR_BNDS_NORM(J,1) = 0.0). By default (PARAMS(3) = 1.0)
+ the Jth righthand side is the first with either a normwise or
+ componentwise error bound that is not guaranteed (the smallest
+ J such that either ERR_BNDS_NORM(J,1) = 0.0 or
+ ERR_BNDS_COMP(J,1) = 0.0). See the definition of
+ ERR_BNDS_NORM(:,1) and ERR_BNDS_COMP(:,1). To get information
+ about all of the righthand sides check ERR_BNDS_NORM or ERR_BNDS_COMP.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{cgesvxx.f}
+\index{cgesvxx.f}
+\begin{chunk}{cgesvxx.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK cgesvxx}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\chapter{LAPACK  General Matrices, Linear Solve, Complex16}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{zcgesv}
+\label{zcgesv}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{zcgesv.input}
+)set break resume
+)sys rm f zcgesv.output
+)spool zcgesv.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{zcgesv.help}
+====================================================================
+zcgesv examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine zcgesv (N, NRHS, A, LDA, IPIV, B, LDB, X, LDX, WORK, SWORK,
+ RWORK, ITER, INFO)
+ ZCGESV computes the solution to system of linear equations A * X =
+ B for GE matrices (mixed precision with iterative refinement)
+
+Function/Subroutine Documentation
+ subroutine zcgesv (integer N, integer NRHS, complex*16, dimension( lda, * )
+ A, integer LDA, integer, dimension( * ) IPIV, complex*16, dimension(
+ ldb, * ) B, integer LDB, complex*16, dimension( ldx, * ) X, integer
+ LDX, complex*16, dimension( n, * ) WORK, complex, dimension( * ) SWORK,
+ double precision, dimension( * ) RWORK, integer ITER, integer INFO)
+ ZCGESV computes the solution to system of linear equations A * X = B
+ for GE matrices (mixed precision with iterative refinement)
+
+Purpose:
+ ZCGESV computes the solution to a complex system of linear equations
+ A * X = B,
+ where A is an NbyN matrix and X and B are NbyNRHS matrices.
+
+ ZCGESV first attempts to factorize the matrix in COMPLEX and use this
+ factorization within an iterative refinement procedure to produce a
+ solution with COMPLEX*16 normwise backward error quality (see below).
+ If the approach fails the method switches to a COMPLEX*16
+ factorization and solve.
+
+ The iterative refinement is not going to be a winning strategy if
+ the ratio COMPLEX performance over COMPLEX*16 performance is too
+ small. A reasonable strategy should take the number of righthand
+ sides and the size of the matrix into account. This might be done
+ with a call to ILAENV in the future. Up to now, we always try
+ iterative refinement.
+
+ The iterative refinement process is stopped if
+ ITER > ITERMAX
+ or for all the RHS we have:
+ RNRM < SQRT(N)*XNRM*ANRM*EPS*BWDMAX
+ where
+ o ITER is the number of the current iteration in the iterative
+ refinement process
+ o RNRM is the infinitynorm of the residual
+ o XNRM is the infinitynorm of the solution
+ o ANRM is the infinityoperatornorm of the matrix A
+ o EPS is the machine epsilon returned by DLAMCH('Epsilon')
+ The value ITERMAX and BWDMAX are fixed to 30 and 1.0D+00 respectively.
+
+Parameters:
+
+ N
+ N is INTEGER
+ The number of linear equations, i.e., the order of the matrix A. N >= 0.
+
+ NRHS
+ NRHS is INTEGER
+ The number of right hand sides, i.e., the number of columns
+ of the matrix B. NRHS >= 0.
+
+ A
+ A is COMPLEX*16 array,
+ dimension (LDA,N)
+ On entry, the NbyN coefficient matrix A.
+ On exit, if iterative refinement has been successfully used
+ (INFO.EQ.0 and ITER.GE.0, see description below), then A is
+ unchanged, if double precision factorization has been used
+ (INFO.EQ.0 and ITER.LT.0, see description below), then the
+ array A contains the factors L and U from the factorization
+ A = P*L*U; the unit diagonal elements of L are not stored.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,N).
+
+ IPIV
+ IPIV is INTEGER array, dimension (N)
+ The pivot indices that define the permutation matrix P;
+ row i of the matrix was interchanged with row IPIV(i).
+ Corresponds either to the single precision factorization
+ (if INFO.EQ.0 and ITER.GE.0) or the double precision
+ factorization (if INFO.EQ.0 and ITER.LT.0).
+
+ B
+ B is COMPLEX*16 array, dimension (LDB,NRHS)
+ The NbyNRHS right hand side matrix B.
+
+ LDB
+ LDB is INTEGER
+ The leading dimension of the array B. LDB >= max(1,N).
+
+ X
+ X is COMPLEX*16 array, dimension (LDX,NRHS)
+ If INFO = 0, the NbyNRHS solution matrix X.
+
+ LDX
+ LDX is INTEGER
+ The leading dimension of the array X. LDX >= max(1,N).
+
+ WORK
+ WORK is COMPLEX*16 array, dimension (N*NRHS)
+ This array is used to hold the residual vectors.
+
+ SWORK
+ SWORK is COMPLEX array, dimension (N*(N+NRHS))
+ This array is used to use the single precision matrix and the
+ righthand sides or solutions in single precision.
+
+ RWORK
+ RWORK is DOUBLE PRECISION array, dimension (N)
+
+ ITER
+ ITER is INTEGER
+ < 0: iterative refinement has failed, COMPLEX*16
+ factorization has been performed
+ 1 : the routine fell back to full precision for
+ implementation or machinespecific reasons
+ 2 : narrowing the precision induced an overflow,
+ the routine fell back to full precision
+ 3 : failure of CGETRF
+ 31: stop the iterative refinement after the 30th
+ iterations
+ > 0: iterative refinement has been sucessfully used.
+ Returns the number of iterations
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value
+ > 0: if INFO = i, U(i,i) computed in COMPLEX*16 is exactly
+ zero. The factorization has been completed, but the
+ factor U is exactly singular, so the solution
+ could not be computed.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{zcgesv.f}
+\index{zcgesv.f}
+\begin{chunk}{zcgesv.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK zcgesv}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{zgels}
+\label{zgels}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{zgels.input}
+)set break resume
+)sys rm f zgels.output
+)spool zgels.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{zgels.help}
+====================================================================
+zgels examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine zgels (TRANS, M, N, NRHS, A, LDA, B, LDB, WORK, LWORK, INFO)
+ ZGELS solves overdetermined or underdetermined systems for GE
+ matrices
+
+Function/Subroutine Documentation
+ subroutine zgels (character TRANS, integer M, integer N, integer NRHS,
+ complex*16, dimension( lda, * ) A, integer LDA, complex*16, dimension(
+ ldb, * ) B, integer LDB, complex*16, dimension( * ) WORK, integer
+ LWORK, integer INFO)
+ ZGELS solves overdetermined or underdetermined systems for GE matrices
+
+Purpose:
+ 1. If TRANS = 'N' and m >= n: find the least squares solution of
+ an overdetermined system, i.e., solve the least squares problem
+ minimize  B  A*X .
+
+ 2. If TRANS = 'N' and m < n: find the minimum norm solution of
+ an underdetermined system A * X = B.
+
+ 3. If TRANS = 'C' and m >= n: find the minimum norm solution of
+ an undetermined system A**H * X = B.
+
+ 4. If TRANS = 'C' and m < n: find the least squares solution of
+ an overdetermined system, i.e., solve the least squares problem
+ minimize  B  A**H * X .
+
+ Several right hand side vectors b and solution vectors x can be
+ handled in a single call; they are stored as the columns of the
+ MbyNRHS right hand side matrix B and the NbyNRHS solution matrix X.
+
+Parameters:
+
+ TRANS
+ TRANS is CHARACTER*1
+ = 'N': the linear system involves A;
+ = 'C': the linear system involves A**H.
+
+ M
+ M is INTEGER
+ The number of rows of the matrix A. M >= 0.
+
+ N
+ N is INTEGER
+ The number of columns of the matrix A. N >= 0.
+
+ NRHS
+ NRHS is INTEGER
+ The number of right hand sides, i.e., the number of
+ columns of the matrices B and X. NRHS >= 0.
+
+ A
+ A is COMPLEX*16 array, dimension (LDA,N)
+ On entry, the MbyN matrix A.
+ if M >= N, A is overwritten by details of its QR
+ factorization as returned by ZGEQRF;
+ if M < N, A is overwritten by details of its LQ
+ factorization as returned by ZGELQF.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+
+ B
+ B is COMPLEX*16 array, dimension (LDB,NRHS)
+ On entry, the matrix B of right hand side vectors, stored
+ columnwise; B is MbyNRHS if TRANS = 'N', or NbyNRHS
+ if TRANS = 'C'.
+ On exit, if INFO = 0, B is overwritten by the solution
+ vectors, stored columnwise:
+ if TRANS = 'N' and m >= n, rows 1 to n of B contain the least
+ squares solution vectors; the residual sum of squares for the
+ solution in each column is given by the sum of squares of the
+ modulus of elements N+1 to M in that column;
+ if TRANS = 'N' and m < n, rows 1 to N of B contain the
+ minimum norm solution vectors;
+ if TRANS = 'C' and m >= n, rows 1 to M of B contain the
+ minimum norm solution vectors;
+ if TRANS = 'C' and m < n, rows 1 to M of B contain the
+ least squares solution vectors; the residual sum of squares
+ for the solution in each column is given by the sum of
+ squares of the modulus of elements M+1 to N in that column.
+
+ LDB
+ LDB is INTEGER
+ The leading dimension of the array B. LDB >= MAX(1,M,N).
+
+ WORK
+ WORK is COMPLEX*16 array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK.
+ LWORK >= max( 1, MN + max( MN, NRHS ) ).
+ For optimal performance,
+ LWORK >= max( 1, MN + max( MN, NRHS )*NB ).
+ where MN = min(M,N) and NB is the optimum block size.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value
+ > 0: if INFO = i, the ith diagonal element of the
+ triangular factor of A is zero, so that A does not have
+ full rank; the least squares solution could not be computed.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{zgels.f}
+\index{zgels.f}
+\begin{chunk}{zgels.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK zgels}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{zgelsd}
+\label{zgelsd}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{zgelsd.input}
+)set break resume
+)sys rm f zgelsd.output
+)spool zgelsd.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{zgelsd.help}
+====================================================================
+zgelsd examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine zgelsd (M, N, NRHS, A, LDA, B, LDB, S, RCOND, RANK, WORK,
+ LWORK, RWORK, IWORK, INFO)
+ ZGELSD computes the minimumnorm solution to a linear least
+ squares problem for GE matrices
+
+Function/Subroutine Documentation
+ subroutine zgelsd (integer M, integer N, integer NRHS, complex*16,
+ dimension( lda, * ) A, integer LDA, complex*16, dimension( ldb, * ) B,
+ integer LDB, double precision, dimension( * ) S, double precision
+ RCOND, integer RANK, complex*16, dimension( * ) WORK, integer LWORK,
+ double precision, dimension( * ) RWORK, integer, dimension( * ) IWORK,
+ integer INFO)
+ ZGELSD computes the minimumnorm solution to a linear least squares
+ problem for GE matrices
+
+Purpose:
+ ZGELSD computes the minimumnorm solution to a real linear least
+ squares problem:
+ minimize 2norm( b  A*x )
+ using the singular value decomposition (SVD) of A. A is an MbyN
+ matrix which may be rankdeficient.
+
+ Several right hand side vectors b and solution vectors x can be
+ handled in a single call; they are stored as the columns of the
+ MbyNRHS right hand side matrix B and the NbyNRHS solution matrix X.
+
+ The problem is solved in three steps:
+ (1) Reduce the coefficient matrix A to bidiagonal form with
+ Householder tranformations, reducing the original problem
+ into a "bidiagonal least squares problem" (BLS)
+ (2) Solve the BLS using a divide and conquer approach.
+ (3) Apply back all the Householder tranformations to solve
+ the original least squares problem.
+
+ The effective rank of A is determined by treating as zero those
+ singular values which are less than RCOND times the largest singular
+ value.
+
+ The divide and conquer algorithm makes very mild assumptions about
+ floating point arithmetic. It will work on machines with a guard
+ digit in add/subtract, or on those binary machines without guard
+ digits which subtract like the Cray XMP, Cray YMP, Cray C90, or
+ Cray2. It could conceivably fail on hexadecimal or decimal machines
+ without guard digits, but we know of none.
+
+Parameters:
+
+ M
+ M is INTEGER
+ The number of rows of the matrix A. M >= 0.
+
+ N
+ N is INTEGER
+ The number of columns of the matrix A. N >= 0.
+
+ NRHS
+ NRHS is INTEGER
+ The number of right hand sides, i.e., the number of columns
+ of the matrices B and X. NRHS >= 0.
+
+ A
+ A is COMPLEX*16 array, dimension (LDA,N)
+ On entry, the MbyN matrix A.
+ On exit, A has been destroyed.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+
+ B
+ B is COMPLEX*16 array, dimension (LDB,NRHS)
+ On entry, the MbyNRHS right hand side matrix B.
+ On exit, B is overwritten by the NbyNRHS solution matrix X.
+ If m >= n and RANK = n, the residual sumofsquares for
+ the solution in the ith column is given by the sum of
+ squares of the modulus of elements n+1:m in that column.
+
+ LDB
+ LDB is INTEGER
+ The leading dimension of the array B. LDB >= max(1,M,N).
+
+ S
+ S is DOUBLE PRECISION array, dimension (min(M,N))
+ The singular values of A in decreasing order.
+ The condition number of A in the 2norm = S(1)/S(min(m,n)).
+
+ RCOND
+ RCOND is DOUBLE PRECISION
+ RCOND is used to determine the effective rank of A.
+ Singular values S(i) <= RCOND*S(1) are treated as zero.
+ If RCOND < 0, machine precision is used instead.
+
+ RANK
+ RANK is INTEGER
+ The effective rank of A, i.e., the number of singular values
+ which are greater than RCOND*S(1).
+
+ WORK
+ WORK is COMPLEX*16 array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK. LWORK must be at least 1.
+ The exact minimum amount of workspace needed depends on M,
+ N and NRHS. As long as LWORK is at least
+ 2*N + N*NRHS
+ if M is greater than or equal to N or
+ 2*M + M*NRHS
+ if M is less than N, the code will execute correctly.
+ For good performance, LWORK should generally be larger.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the array WORK and the
+ minimum sizes of the arrays RWORK and IWORK, and returns
+ these values as the first entries of the WORK, RWORK and
+ IWORK arrays, and no error message related to LWORK is issued by XERBLA.
+
+ RWORK
+ RWORK is DOUBLE PRECISION array, dimension (MAX(1,LRWORK))
+ LRWORK >=
+ 10*N + 2*N*SMLSIZ + 8*N*NLVL + 3*SMLSIZ*NRHS +
+ MAX( (SMLSIZ+1)**2, N*(1+NRHS) + 2*NRHS )
+ if M is greater than or equal to N or
+ 10*M + 2*M*SMLSIZ + 8*M*NLVL + 3*SMLSIZ*NRHS +
+ MAX( (SMLSIZ+1)**2, N*(1+NRHS) + 2*NRHS )
+ if M is less than N, the code will execute correctly.
+ SMLSIZ is returned by ILAENV and is equal to the maximum
+ size of the subproblems at the bottom of the computation
+ tree (usually about 25), and
+ NLVL = MAX( 0, INT( LOG_2( MIN( M,N )/(SMLSIZ+1) ) ) + 1 )
+ On exit, if INFO = 0, RWORK(1) returns the minimum LRWORK.
+
+ IWORK
+ IWORK is INTEGER array, dimension (MAX(1,LIWORK))
+ LIWORK >= max(1, 3*MINMN*NLVL + 11*MINMN),
+ where MINMN = MIN( M,N ).
+ On exit, if INFO = 0, IWORK(1) returns the minimum LIWORK.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value.
+ > 0: the algorithm for computing the SVD failed to converge;
+ if INFO = i, i offdiagonal elements of an intermediate
+ bidiagonal form did not converge to zero.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{zgelsd.f}
+\index{zgelsd.f}
+\begin{chunk}{zgelsd.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK zgelsd}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{zgelss}
+\label{zgelss}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{zgelss.input}
+)set break resume
+)sys rm f zgelss.output
+)spool zgelss.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{zgelss.help}
+====================================================================
+zgelss examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine zgelss (M, N, NRHS, A, LDA, B, LDB, S, RCOND, RANK, WORK,
+ LWORK, RWORK, INFO)
+ ZGELSS solves overdetermined or underdetermined systems for GE
+ matrices
+
+Function/Subroutine Documentation
+ subroutine zgelss (integer M, integer N, integer NRHS, complex*16,
+ dimension( lda, * ) A, integer LDA, complex*16, dimension( ldb, * ) B,
+ integer LDB, double precision, dimension( * ) S, double precision
+ RCOND, integer RANK, complex*16, dimension( * ) WORK, integer LWORK,
+ double precision, dimension( * ) RWORK, integer INFO)
+ ZGELSS solves overdetermined or underdetermined systems for GE
+ matrices
+
+Purpose:
+ ZGELSS computes the minimum norm solution to a complex linear
+ least squares problem:
+
+ Minimize 2norm( b  A*x ).
+
+ using the singular value decomposition (SVD) of A. A is an MbyN
+ matrix which may be rankdeficient.
+
+ Several right hand side vectors b and solution vectors x can be
+ handled in a single call; they are stored as the columns of the
+ MbyNRHS right hand side matrix B and the NbyNRHS solution matrix X.
+
+ The effective rank of A is determined by treating as zero those
+ singular values which are less than RCOND times the largest singular value.
+
+Parameters:
+
+ M
+ M is INTEGER
+ The number of rows of the matrix A. M >= 0.
+
+ N
+ N is INTEGER
+ The number of columns of the matrix A. N >= 0.
+
+ NRHS
+ NRHS is INTEGER
+ The number of right hand sides, i.e., the number of columns
+ of the matrices B and X. NRHS >= 0.
+
+ A
+ A is COMPLEX*16 array, dimension (LDA,N)
+ On entry, the MbyN matrix A.
+ On exit, the first min(m,n) rows of A are overwritten with
+ its right singular vectors, stored rowwise.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+
+ B
+ B is COMPLEX*16 array, dimension (LDB,NRHS)
+ On entry, the MbyNRHS right hand side matrix B.
+ On exit, B is overwritten by the NbyNRHS solution matrix X.
+ If m >= n and RANK = n, the residual sumofsquares for
+ the solution in the ith column is given by the sum of
+ squares of the modulus of elements n+1:m in that column.
+
+ LDB
+ LDB is INTEGER
+ The leading dimension of the array B. LDB >= max(1,M,N).
+
+ S
+ S is DOUBLE PRECISION array, dimension (min(M,N))
+ The singular values of A in decreasing order.
+ The condition number of A in the 2norm = S(1)/S(min(m,n)).
+
+ RCOND
+ RCOND is DOUBLE PRECISION
+ RCOND is used to determine the effective rank of A.
+ Singular values S(i) <= RCOND*S(1) are treated as zero.
+ If RCOND < 0, machine precision is used instead.
+
+ RANK
+ RANK is INTEGER
+ The effective rank of A, i.e., the number of singular values
+ which are greater than RCOND*S(1).
+
+ WORK
+ WORK is COMPLEX*16 array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK. LWORK >= 1, and also:
+ LWORK >= 2*min(M,N) + max(M,N,NRHS)
+ For good performance, LWORK should generally be larger.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ RWORK
+ RWORK is DOUBLE PRECISION array, dimension (5*min(M,N))
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value.
+ > 0: the algorithm for computing the SVD failed to converge;
+ if INFO = i, i offdiagonal elements of an intermediate
+ bidiagonal form did not converge to zero.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{zgelss.f}
+\index{zgelss.f}
+\begin{chunk}{zgelss.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK zgelss}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{zgelsx  DEPRECATED use zgelsy}
+\label{zgelsx}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{zgelsy}
+\label{zgelsy}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{zgelsy.input}
+)set break resume
+)sys rm f zgelsy.output
+)spool zgelsy.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{zgelsy.help}
+====================================================================
+zgelsy examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine zgelsy (M, N, NRHS, A, LDA, B, LDB, JPVT, RCOND, RANK, WORK,
+ LWORK, RWORK, INFO)
+ ZGELSY solves overdetermined or underdetermined systems for GE
+ matrices
+
+Function/Subroutine Documentation
+ subroutine zgelsy (integer M, integer N, integer NRHS, complex*16,
+ dimension( lda, * ) A, integer LDA, complex*16, dimension( ldb, * ) B,
+ integer LDB, integer, dimension( * ) JPVT, double precision RCOND,
+ integer RANK, complex*16, dimension( * ) WORK, integer LWORK, double
+ precision, dimension( * ) RWORK, integer INFO)
+ ZGELSY solves overdetermined or underdetermined systems for GE
+ matrices
+
+Purpose:
+ ZGELSY computes the minimumnorm solution to a complex linear least
+ squares problem:
+ minimize  A * X  B 
+ using a complete orthogonal factorization of A. A is an MbyN
+ matrix which may be rankdeficient.
+
+ Several right hand side vectors b and solution vectors x can be
+ handled in a single call; they are stored as the columns of the
+ MbyNRHS right hand side matrix B and the NbyNRHS solution matrix X.
+
+ The routine first computes a QR factorization with column pivoting:
+ A * P = Q * [ R11 R12 ]
+ [ 0 R22 ]
+ with R11 defined as the largest leading submatrix whose estimated
+ condition number is less than 1/RCOND. The order of R11, RANK,
+ is the effective rank of A.
+
+ Then, R22 is considered to be negligible, and R12 is annihilated
+ by unitary transformations from the right, arriving at the
+ complete orthogonal factorization:
+ A * P = Q * [ T11 0 ] * Z
+ [ 0 0 ]
+ The minimumnorm solution is then
+ X = P * Z**H [ inv(T11)*Q1**H*B ]
+ [ 0 ]
+ where Q1 consists of the first RANK columns of Q.
+
+ This routine is basically identical to the original xGELSX except
+ three differences:
+ o The permutation of matrix B (the right hand side) is faster and
+ more simple.
+ o The call to the subroutine xGEQPF has been substituted by the
+ the call to the subroutine xGEQP3. This subroutine is a Blas3
+ version of the QR factorization with column pivoting.
+ o Matrix B (the right hand side) is updated with Blas3.
+
+Parameters:
+
+ M
+ M is INTEGER
+ The number of rows of the matrix A. M >= 0.
+
+ N
+ N is INTEGER
+ The number of columns of the matrix A. N >= 0.
+
+ NRHS
+ NRHS is INTEGER
+ The number of right hand sides, i.e., the number of
+ columns of matrices B and X. NRHS >= 0.
+
+ A
+ A is COMPLEX*16 array, dimension (LDA,N)
+ On entry, the MbyN matrix A.
+ On exit, A has been overwritten by details of its
+ complete orthogonal factorization.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+
+ B
+ B is COMPLEX*16 array, dimension (LDB,NRHS)
+ On entry, the MbyNRHS right hand side matrix B.
+ On exit, the NbyNRHS solution matrix X.
+
+ LDB
+ LDB is INTEGER
+ The leading dimension of the array B. LDB >= max(1,M,N).
+
+ JPVT
+ JPVT is INTEGER array, dimension (N)
+ On entry, if JPVT(i) .ne. 0, the ith column of A is permuted
+ to the front of AP, otherwise column i is a free column.
+ On exit, if JPVT(i) = k, then the ith column of A*P
+ was the kth column of A.
+
+ RCOND
+ RCOND is DOUBLE PRECISION
+ RCOND is used to determine the effective rank of A, which
+ is defined as the order of the largest leading triangular
+ submatrix R11 in the QR factorization with pivoting of A,
+ whose estimated condition number < 1/RCOND.
+
+ RANK
+ RANK is INTEGER
+ The effective rank of A, i.e., the order of the submatrix
+ R11. This is the same as the order of the submatrix T11
+ in the complete orthogonal factorization of A.
+
+ WORK
+ WORK is COMPLEX*16 array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK.
+ The unblocked strategy requires that:
+ LWORK >= MN + MAX( 2*MN, N+1, MN+NRHS )
+ where MN = min(M,N).
+ The block algorithm requires that:
+ LWORK >= MN + MAX( 2*MN, NB*(N+1), MN+MN*NB, MN+NB*NRHS )
+ where NB is an upper bound on the blocksize returned
+ by ILAENV for the routines ZGEQP3, ZTZRZF, CTZRQF, ZUNMQR,
+ and ZUNMRZ.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ RWORK
+ RWORK is DOUBLE PRECISION array, dimension (2*N)
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{zgelsy.f}
+\index{zgelsy.f}
+\begin{chunk}{zgelsy.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK zgelsy}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{zgesv}
+\label{zgesv}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{zgesv.input}
+)set break resume
+)sys rm f zgesv.output
+)spool zgesv.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{zgesv.help}
+====================================================================
+zgesv examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine zgesv (N, NRHS, A, LDA, IPIV, B, LDB, INFO)
+ ZGESV computes the solution to system of linear equations A * X =
+ B for GE matrices (simple driver)
+
+Function/Subroutine Documentation
+ subroutine zgesv (integer N, integer NRHS, complex*16, dimension( lda, * )
+ A, integer LDA, integer, dimension( * ) IPIV, complex*16, dimension(
+ ldb, * ) B, integer LDB, integer INFO)
+ ZGESV computes the solution to system of linear equations A * X = B
+ for GE matrices (simple driver)
+
+Purpose:
+ ZGESV computes the solution to a complex system of linear equations
+ A * X = B,
+ where A is an NbyN matrix and X and B are NbyNRHS matrices.
+
+ The LU decomposition with partial pivoting and row interchanges is
+ used to factor A as
+ A = P * L * U,
+ where P is a permutation matrix, L is unit lower triangular, and U is
+ upper triangular. The factored form of A is then used to solve the
+ system of equations A * X = B.
+
+Parameters:
+
+ N
+ N is INTEGER
+ The number of linear equations, i.e., the order of the matrix A. N >= 0.
+
+ NRHS
+ NRHS is INTEGER
+ The number of right hand sides, i.e., the number of columns
+ of the matrix B. NRHS >= 0.
+
+ A
+ A is COMPLEX*16 array, dimension (LDA,N)
+ On entry, the NbyN coefficient matrix A.
+ On exit, the factors L and U from the factorization
+ A = P*L*U; the unit diagonal elements of L are not stored.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,N).
+
+ IPIV
+ IPIV is INTEGER array, dimension (N)
+ The pivot indices that define the permutation matrix P;
+ row i of the matrix was interchanged with row IPIV(i).
+
+ B
+ B is COMPLEX*16 array, dimension (LDB,NRHS)
+ On entry, the NbyNRHS matrix of right hand side matrix B.
+ On exit, if INFO = 0, the NbyNRHS solution matrix X.
+
+ LDB
+ LDB is INTEGER
+ The leading dimension of the array B. LDB >= max(1,N).
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value
+ > 0: if INFO = i, U(i,i) is exactly zero. The factorization
+ has been completed, but the factor U is exactly
+ singular, so the solution could not be computed.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{zgesv.f}
+\index{zgesv.f}
+\begin{chunk}{zgesv.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK zgesv}
+
+\end{chunk}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{zgesvx}
+\label{zgesvx}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{zgesvx.input}
+)set break resume
+)sys rm f zgesvx.output
+)spool zgesvx.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{zgesvx.help}
+====================================================================
+zgesvx examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine zgesvx (FACT, TRANS, N, NRHS, A, LDA, AF, LDAF, IPIV, EQUED,
+ R, C, B, LDB, X, LDX, RCOND, FERR, BERR, WORK, RWORK, INFO)
+ ZGESVX computes the solution to system of linear equations A * X =
+ B for GE matrices
+
+Function/Subroutine Documentation
+ subroutine zgesvx (character FACT, character TRANS, integer N, integer
+ NRHS, complex*16, dimension( lda, * ) A, integer LDA, complex*16,
+ dimension( ldaf, * ) AF, integer LDAF, integer, dimension( * ) IPIV,
+ character EQUED, double precision, dimension( * ) R, double precision,
+ dimension( * ) C, complex*16, dimension( ldb, * ) B, integer LDB,
+ complex*16, dimension( ldx, * ) X, integer LDX, double precision RCOND,
+ double precision, dimension( * ) FERR, double precision, dimension( * )
+ BERR, complex*16, dimension( * ) WORK, double precision, dimension( * )
+ RWORK, integer INFO)
+ ZGESVX computes the solution to system of linear equations A * X = B
+ for GE matrices
+
+Purpose:
+ ZGESVX uses the LU factorization to compute the solution to a complex
+ system of linear equations
+ A * X = B,
+ where A is an NbyN matrix and X and B are NbyNRHS matrices.
+
+ Error bounds on the solution and a condition estimate are also provided.
+
+Description:
+ The following steps are performed:
+
+ 1. If FACT = 'E', real scaling factors are computed to equilibrate
+ the system:
+ TRANS = 'N': diag(R)*A*diag(C) *inv(diag(C))*X = diag(R)*B
+ TRANS = 'T': (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
+ TRANS = 'C': (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B
+ Whether or not the system will be equilibrated depends on the
+ scaling of the matrix A, but if equilibration is used, A is
+ overwritten by diag(R)*A*diag(C) and B by diag(R)*B (if TRANS='N')
+ or diag(C)*B (if TRANS = 'T' or 'C').
+
+ 2. If FACT = 'N' or 'E', the LU decomposition is used to factor the
+ matrix A (after equilibration if FACT = 'E') as
+ A = P * L * U,
+ where P is a permutation matrix, L is a unit lower triangular
+ matrix, and U is upper triangular.
+
+ 3. If some U(i,i)=0, so that U is exactly singular, then the routine
+ returns with INFO = i. Otherwise, the factored form of A is used
+ to estimate the condition number of the matrix A. If the
+ reciprocal of the condition number is less than machine precision,
+ INFO = N+1 is returned as a warning, but the routine still goes on
+ to solve for X and compute error bounds as described below.
+
+ 4. The system of equations is solved for X using the factored form of A.
+
+ 5. Iterative refinement is applied to improve the computed solution
+ matrix and calculate error bounds and backward error estimates for it.
+
+ 6. If equilibration was used, the matrix X is premultiplied by
+ diag(C) (if TRANS = 'N') or diag(R) (if TRANS = 'T' or 'C') so
+ that it solves the original system before equilibration.
+
+Parameters:
+
+ FACT
+ FACT is CHARACTER*1
+ Specifies whether or not the factored form of the matrix A is
+ supplied on entry, and if not, whether the matrix A should be
+ equilibrated before it is factored.
+ = 'F': On entry, AF and IPIV contain the factored form of A.
+ If EQUED is not 'N', the matrix A has been
+ equilibrated with scaling factors given by R and C.
+ A, AF, and IPIV are not modified.
+ = 'N': The matrix A will be copied to AF and factored.
+ = 'E': The matrix A will be equilibrated if necessary, then
+ copied to AF and factored.
+
+ TRANS
+ TRANS is CHARACTER*1
+ Specifies the form of the system of equations:
+ = 'N': A * X = B (No transpose)
+ = 'T': A**T * X = B (Transpose)
+ = 'C': A**H * X = B (Conjugate transpose)
+
+ N
+ N is INTEGER
+ The number of linear equations, i.e., the order of the matrix A. N >= 0.
+
+ NRHS
+ NRHS is INTEGER
+ The number of right hand sides, i.e., the number of columns
+ of the matrices B and X. NRHS >= 0.
+
+ A
+ A is COMPLEX*16 array, dimension (LDA,N)
+ On entry, the NbyN matrix A. If FACT = 'F' and EQUED is
+ not 'N', then A must have been equilibrated by the scaling
+ factors in R and/or C. A is not modified if FACT = 'F' or
+ 'N', or if FACT = 'E' and EQUED = 'N' on exit.
+
+ On exit, if EQUED .ne. 'N', A is scaled as follows:
+ EQUED = 'R': A := diag(R) * A
+ EQUED = 'C': A := A * diag(C)
+ EQUED = 'B': A := diag(R) * A * diag(C).
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,N).
+
+ AF
+ AF is COMPLEX*16 array, dimension (LDAF,N)
+ If FACT = 'F', then AF is an input argument and on entry
+ contains the factors L and U from the factorization
+ A = P*L*U as computed by ZGETRF. If EQUED .ne. 'N', then
+ AF is the factored form of the equilibrated matrix A.
+
+ If FACT = 'N', then AF is an output argument and on exit
+ returns the factors L and U from the factorization A = P*L*U
+ of the original matrix A.
+
+ If FACT = 'E', then AF is an output argument and on exit
+ returns the factors L and U from the factorization A = P*L*U
+ of the equilibrated matrix A (see the description of A for
+ the form of the equilibrated matrix).
+
+ LDAF
+ LDAF is INTEGER
+ The leading dimension of the array AF. LDAF >= max(1,N).
+
+ IPIV
+ IPIV is INTEGER array, dimension (N)
+ If FACT = 'F', then IPIV is an input argument and on entry
+ contains the pivot indices from the factorization A = P*L*U
+ as computed by ZGETRF; row i of the matrix was interchanged
+ with row IPIV(i).
+
+ If FACT = 'N', then IPIV is an output argument and on exit
+ contains the pivot indices from the factorization A = P*L*U
+ of the original matrix A.
+
+ If FACT = 'E', then IPIV is an output argument and on exit
+ contains the pivot indices from the factorization A = P*L*U
+ of the equilibrated matrix A.
+
+ EQUED
+ EQUED is CHARACTER*1
+ Specifies the form of equilibration that was done.
+ = 'N': No equilibration (always true if FACT = 'N').
+ = 'R': Row equilibration, i.e., A has been premultiplied by diag(R).
+ = 'C': Column equilibration, i.e., A has been postmultiplied by diag(C).
+ = 'B': Both row and column equilibration, i.e., A has been
+ replaced by diag(R) * A * diag(C).
+ EQUED is an input argument if FACT = 'F'; otherwise, it is an
+ output argument.
+
+ R
+ R is DOUBLE PRECISION array, dimension (N)
+ The row scale factors for A. If EQUED = 'R' or 'B', A is
+ multiplied on the left by diag(R); if EQUED = 'N' or 'C', R
+ is not accessed. R is an input argument if FACT = 'F';
+ otherwise, R is an output argument. If FACT = 'F' and
+ EQUED = 'R' or 'B', each element of R must be positive.
+
+ C
+ C is DOUBLE PRECISION array, dimension (N)
+ The column scale factors for A. If EQUED = 'C' or 'B', A is
+ multiplied on the right by diag(C); if EQUED = 'N' or 'R', C
+ is not accessed. C is an input argument if FACT = 'F';
+ otherwise, C is an output argument. If FACT = 'F' and
+ EQUED = 'C' or 'B', each element of C must be positive.
+
+ B
+ B is COMPLEX*16 array, dimension (LDB,NRHS)
+ On entry, the NbyNRHS right hand side matrix B.
+ On exit,
+ if EQUED = 'N', B is not modified;
+ if TRANS = 'N' and EQUED = 'R' or 'B', B is overwritten by
+ diag(R)*B;
+ if TRANS = 'T' or 'C' and EQUED = 'C' or 'B', B is
+ overwritten by diag(C)*B.
+
+ LDB
+ LDB is INTEGER
+ The leading dimension of the array B. LDB >= max(1,N).
+
+ X
+ X is COMPLEX*16 array, dimension (LDX,NRHS)
+ If INFO = 0 or INFO = N+1, the NbyNRHS solution matrix X
+ to the original system of equations. Note that A and B are
+ modified on exit if EQUED .ne. 'N', and the solution to the
+ equilibrated system is inv(diag(C))*X if TRANS = 'N' and
+ EQUED = 'C' or 'B', or inv(diag(R))*X if TRANS = 'T' or 'C'
+ and EQUED = 'R' or 'B'.
+
+ LDX
+ LDX is INTEGER
+ The leading dimension of the array X. LDX >= max(1,N).
+
+ RCOND
+ RCOND is DOUBLE PRECISION
+ The estimate of the reciprocal condition number of the matrix
+ A after equilibration (if done). If RCOND is less than the
+ machine precision (in particular, if RCOND = 0), the matrix
+ is singular to working precision. This condition is
+ indicated by a return code of INFO > 0.
+
+ FERR
+ FERR is DOUBLE PRECISION array, dimension (NRHS)
+ The estimated forward error bound for each solution vector
+ X(j) (the jth column of the solution matrix X).
+ If XTRUE is the true solution corresponding to X(j), FERR(j)
+ is an estimated upper bound for the magnitude of the largest
+ element in (X(j)  XTRUE) divided by the magnitude of the
+ largest element in X(j). The estimate is as reliable as
+ the estimate for RCOND, and is almost always a slight
+ overestimate of the true error.
+
+ BERR
+ BERR is DOUBLE PRECISION array, dimension (NRHS)
+ The componentwise relative backward error of each solution
+ vector X(j) (i.e., the smallest relative change in
+ any element of A or B that makes X(j) an exact solution).
+
+ WORK
+ WORK is COMPLEX*16 array, dimension (2*N)
+
+ RWORK
+ RWORK is DOUBLE PRECISION array, dimension (2*N)
+ On exit, RWORK(1) contains the reciprocal pivot growth
+ factor norm(A)/norm(U). The "max absolute element" norm is
+ used. If RWORK(1) is much less than 1, then the stability
+ of the LU factorization of the (equilibrated) matrix A
+ could be poor. This also means that the solution X, condition
+ estimator RCOND, and forward error bound FERR could be
+ unreliable. If factorization fails with 0 0: if INFO = i, and i is
+ <= N: U(i,i) is exactly zero. The factorization has
+ been completed, but the factor U is exactly
+ singular, so the solution and error bounds
+ could not be computed. RCOND = 0 is returned.
+ = N+1: U is nonsingular, but RCOND is less than machine
+ precision, meaning that the matrix is singular
+ to working precision. Nevertheless, the
+ solution and error bounds are computed because
+ there are a number of situations where the
+ computed solution can be more accurate than the
+ value of RCOND would suggest.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{zgesvx.f}
+\index{zgesvx.f}
+\begin{chunk}{zgesvx.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK zgesvx}
+
+\end{chunk}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{zgesvxx}
+\label{zgesvxx}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{zgesvxx.input}
+)set break resume
+)sys rm f zgesvxx.output
+)spool zgesvxx.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page \cite{Demm05}}
+\begin{chunk}{zgesvxx.help}
+====================================================================
+zgesvxx examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine zgesvxx (FACT, TRANS, N, NRHS, A, LDA, AF, LDAF, IPIV,
+ EQUED, R, C, B, LDB, X, LDX, RCOND, RPVGRW, BERR, N_ERR_BNDS,
+ ERR_BNDS_NORM, ERR_BNDS_COMP, NPARAMS, PARAMS, WORK, RWORK, INFO)
+ ZGESVXX computes the solution to system of linear equations A * X
+ = B for GE matrices
+
+Function/Subroutine Documentation
+ subroutine zgesvxx (character FACT, character TRANS, integer N, integer
+ NRHS, complex*16, dimension( lda, * ) A, integer LDA, complex*16,
+ dimension( ldaf, * ) AF, integer LDAF, integer, dimension( * ) IPIV,
+ character EQUED, double precision, dimension( * ) R, double precision,
+ dimension( * ) C, complex*16, dimension( ldb, * ) B, integer LDB,
+ complex*16, dimension( ldx , * ) X, integer LDX, double precision
+ RCOND, double precision RPVGRW, double precision, dimension( * ) BERR,
+ integer N_ERR_BNDS, double precision, dimension( nrhs, * )
+ ERR_BNDS_NORM, double precision, dimension( nrhs, * ) ERR_BNDS_COMP,
+ integer NPARAMS, double precision, dimension( * ) PARAMS, complex*16,
+ dimension( * ) WORK, double precision, dimension( * ) RWORK, integer
+ INFO)
+ ZGESVXX computes the solution to system of linear equations A * X = B
+ for GE matrices
+
+Purpose:
+ ZGESVXX uses the LU factorization to compute the solution to a
+ complex*16 system of linear equations A * X = B, where A is an
+ NbyN matrix and X and B are NbyNRHS matrices.
+
+ If requested, both normwise and maximum componentwise error bounds
+ are returned. ZGESVXX will return a solution with a tiny
+ guaranteed error (O(eps) where eps is the working machine
+ precision) unless the matrix is very illconditioned, in which
+ case a warning is returned. Relevant condition numbers also are
+ calculated and returned.
+
+ ZGESVXX accepts userprovided factorizations and equilibration
+ factors; see the definitions of the FACT and EQUED options.
+ Solving with refinement and using a factorization from a previous
+ ZGESVXX call will also produce a solution with either O(eps)
+ errors or warnings, but we cannot make that claim for general
+ userprovided factorizations and equilibration factors if they
+ differ from what ZGESVXX would itself produce.
+
+Description:
+ The following steps are performed:
+
+ 1. If FACT = 'E', double precision scaling factors are computed to
+ equilibrate the system:
+ TRANS = 'N': diag(R)*A*diag(C) *inv(diag(C))*X = diag(R)*B
+ TRANS = 'T': (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
+ TRANS = 'C': (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B
+
+ Whether or not the system will be equilibrated depends on the
+ scaling of the matrix A, but if equilibration is used, A is
+ overwritten by diag(R)*A*diag(C) and B by diag(R)*B (if TRANS='N')
+ or diag(C)*B (if TRANS = 'T' or 'C').
+
+ 2. If FACT = 'N' or 'E', the LU decomposition is used to factor
+ the matrix A (after equilibration if FACT = 'E') as
+ A = P * L * U,
+ where P is a permutation matrix, L is a unit lower triangular
+ matrix, and U is upper triangular.
+
+ 3. If some U(i,i)=0, so that U is exactly singular, then the
+ routine returns with INFO = i. Otherwise, the factored form of A
+ is used to estimate the condition number of the matrix A (see
+ argument RCOND). If the reciprocal of the condition number is less
+ than machine precision, the routine still goes on to solve for X
+ and compute error bounds as described below.
+
+ 4. The system of equations is solved for X using the factored form of A.
+
+ 5. By default (unless PARAMS(LA_LINRX_ITREF_I) is set to zero),
+ the routine will use iterative refinement to try to get a small
+ error and error bounds. Refinement calculates the residual to at
+ least twice the working precision.
+
+ 6. If equilibration was used, the matrix X is premultiplied by
+ diag(C) (if TRANS = 'N') or diag(R) (if TRANS = 'T' or 'C') so
+ that it solves the original system before equilibration.
+
+ Some optional parameters are bundled in the PARAMS array. These
+ settings determine how refinement is performed, but often the
+ defaults are acceptable. If the defaults are acceptable, users
+ can pass NPARAMS = 0 which prevents the source code from accessing
+ the PARAMS argument.
+
+Parameters:
+
+ FACT
+ FACT is CHARACTER*1
+ Specifies whether or not the factored form of the matrix A is
+ supplied on entry, and if not, whether the matrix A should be
+ equilibrated before it is factored.
+ = 'F': On entry, AF and IPIV contain the factored form of A.
+ If EQUED is not 'N', the matrix A has been
+ equilibrated with scaling factors given by R and C.
+ A, AF, and IPIV are not modified.
+ = 'N': The matrix A will be copied to AF and factored.
+ = 'E': The matrix A will be equilibrated if necessary, then
+ copied to AF and factored.
+
+ TRANS
+ TRANS is CHARACTER*1
+ Specifies the form of the system of equations:
+ = 'N': A * X = B (No transpose)
+ = 'T': A**T * X = B (Transpose)
+ = 'C': A**H * X = B (Conjugate Transpose)
+
+ N
+ N is INTEGER
+ The number of linear equations, i.e., the order of the
+ matrix A. N >= 0.
+
+ NRHS
+ NRHS is INTEGER
+ The number of right hand sides, i.e., the number of columns
+ of the matrices B and X. NRHS >= 0.
+
+ A
+ A is COMPLEX*16 array, dimension (LDA,N)
+ On entry, the NbyN matrix A. If FACT = 'F' and EQUED is
+ not 'N', then A must have been equilibrated by the scaling
+ factors in R and/or C. A is not modified if FACT = 'F' or
+ 'N', or if FACT = 'E' and EQUED = 'N' on exit.
+
+ On exit, if EQUED .ne. 'N', A is scaled as follows:
+ EQUED = 'R': A := diag(R) * A
+ EQUED = 'C': A := A * diag(C)
+ EQUED = 'B': A := diag(R) * A * diag(C).
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,N).
+
+ AF
+ AF is COMPLEX*16 array, dimension (LDAF,N)
+ If FACT = 'F', then AF is an input argument and on entry
+ contains the factors L and U from the factorization
+ A = P*L*U as computed by ZGETRF. If EQUED .ne. 'N', then
+ AF is the factored form of the equilibrated matrix A.
+
+ If FACT = 'N', then AF is an output argument and on exit
+ returns the factors L and U from the factorization A = P*L*U
+ of the original matrix A.
+
+ If FACT = 'E', then AF is an output argument and on exit
+ returns the factors L and U from the factorization A = P*L*U
+ of the equilibrated matrix A (see the description of A for
+ the form of the equilibrated matrix).
+
+ LDAF
+ LDAF is INTEGER
+ The leading dimension of the array AF. LDAF >= max(1,N).
+
+ IPIV
+ IPIV is INTEGER array, dimension (N)
+ If FACT = 'F', then IPIV is an input argument and on entry
+ contains the pivot indices from the factorization A = P*L*U
+ as computed by ZGETRF; row i of the matrix was interchanged
+ with row IPIV(i).
+
+ If FACT = 'N', then IPIV is an output argument and on exit
+ contains the pivot indices from the factorization A = P*L*U
+ of the original matrix A.
+
+ If FACT = 'E', then IPIV is an output argument and on exit
+ contains the pivot indices from the factorization A = P*L*U
+ of the equilibrated matrix A.
+
+ EQUED
+ EQUED is CHARACTER*1
+ Specifies the form of equilibration that was done.
+ = 'N': No equilibration (always true if FACT = 'N').
+ = 'R': Row equilibration, i.e., A has been premultiplied by diag(R).
+ = 'C': Column equilibration, i.e., A has been postmultiplied by diag(C).
+ = 'B': Both row and column equilibration, i.e., A has been
+ replaced by diag(R) * A * diag(C).
+ EQUED is an input argument if FACT = 'F'; otherwise, it is an
+ output argument.
+
+ R
+ R is DOUBLE PRECISION array, dimension (N)
+ The row scale factors for A. If EQUED = 'R' or 'B', A is
+ multiplied on the left by diag(R); if EQUED = 'N' or 'C', R
+ is not accessed. R is an input argument if FACT = 'F';
+ otherwise, R is an output argument. If FACT = 'F' and
+ EQUED = 'R' or 'B', each element of R must be positive.
+ If R is output, each element of R is a power of the radix.
+ If R is input, each element of R should be a power of the radix
+ to ensure a reliable solution and error estimates. Scaling by
+ powers of the radix does not cause rounding errors unless the
+ result underflows or overflows. Rounding errors during scaling
+ lead to refining with a matrix that is not equivalent to the
+ input matrix, producing error estimates that may not be reliable.
+
+ C
+ C is DOUBLE PRECISION array, dimension (N)
+ The column scale factors for A. If EQUED = 'C' or 'B', A is
+ multiplied on the right by diag(C); if EQUED = 'N' or 'R', C
+ is not accessed. C is an input argument if FACT = 'F';
+ otherwise, C is an output argument. If FACT = 'F' and
+ EQUED = 'C' or 'B', each element of C must be positive.
+ If C is output, each element of C is a power of the radix.
+ If C is input, each element of C should be a power of the radix
+ to ensure a reliable solution and error estimates. Scaling by
+ powers of the radix does not cause rounding errors unless the
+ result underflows or overflows. Rounding errors during scaling
+ lead to refining with a matrix that is not equivalent to the
+ input matrix, producing error estimates that may not be reliable.
+
+ B
+ B is COMPLEX*16 array, dimension (LDB,NRHS)
+ On entry, the NbyNRHS right hand side matrix B.
+ On exit,
+ if EQUED = 'N', B is not modified;
+ if TRANS = 'N' and EQUED = 'R' or 'B', B is overwritten by diag(R)*B;
+ if TRANS = 'T' or 'C' and EQUED = 'C' or 'B', B is overwritten by diag(C)*B.
+
+ LDB
+ LDB is INTEGER
+ The leading dimension of the array B. LDB >= max(1,N).
+
+ X
+ X is COMPLEX*16 array, dimension (LDX,NRHS)
+ If INFO = 0, the NbyNRHS solution matrix X to the original
+ system of equations. Note that A and B are modified on exit
+ if EQUED .ne. 'N', and the solution to the equilibrated system is
+ inv(diag(C))*X if TRANS = 'N' and EQUED = 'C' or 'B', or
+ inv(diag(R))*X if TRANS = 'T' or 'C' and EQUED = 'R' or 'B'.
+
+ LDX
+ LDX is INTEGER
+ The leading dimension of the array X. LDX >= max(1,N).
+
+ RCOND
+ RCOND is DOUBLE PRECISION
+ Reciprocal scaled condition number. This is an estimate of the
+ reciprocal Skeel condition number of the matrix A after
+ equilibration (if done). If this is less than the machine
+ precision (in particular, if it is zero), the matrix is singular
+ to working precision. Note that the error may still be small even
+ if this number is very small and the matrix appears illconditioned.
+
+ RPVGRW
+ RPVGRW is DOUBLE PRECISION
+ Reciprocal pivot growth. On exit, this contains the reciprocal
+ pivot growth factor norm(A)/norm(U). The "max absolute element"
+ norm is used. If this is much less than 1, then the stability of
+ the LU factorization of the (equilibrated) matrix A could be poor.
+ This also means that the solution X, estimated condition numbers,
+ and error bounds could be unreliable. If factorization fails with
+ 0 0 and <= N: U(INFO,INFO) is exactly zero. The factorization
+ has been completed, but the factor U is exactly singular, so
+ the solution and error bounds could not be computed. RCOND = 0
+ is returned.
+ = N+J: The solution corresponding to the Jth righthand side is
+ not guaranteed. The solutions corresponding to other right
+ hand sides K with K > J may not be guaranteed as well, but
+ only the first such righthand side is reported. If a small
+ componentwise error is not requested (PARAMS(3) = 0.0) then
+ the Jth righthand side is the first with a normwise error
+ bound that is not guaranteed (the smallest J such
+ that ERR_BNDS_NORM(J,1) = 0.0). By default (PARAMS(3) = 1.0)
+ the Jth righthand side is the first with either a normwise or
+ componentwise error bound that is not guaranteed (the smallest
+ J such that either ERR_BNDS_NORM(J,1) = 0.0 or
+ ERR_BNDS_COMP(J,1) = 0.0). See the definition of
+ ERR_BNDS_NORM(:,1) and ERR_BNDS_COMP(:,1). To get information
+ about all of the righthand sides check ERR_BNDS_NORM or
+ ERR_BNDS_COMP.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{zgesvxx.f}
+\index{zgesvxx.f}
+\begin{chunk}{zgesvxx.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK zgesvxx}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\chapter{LAPACK  General Matrices, Eigenvalue , Double}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{dgees}
+\label{dgees}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{dgees.input}
+)set break resume
+)sys rm f dgees.output
+)spool dgees.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{dgees.help}
+====================================================================
+dgees examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine dgees (JOBVS, SORT, SELECT, N, A, LDA, SDIM, WR, WI, VS,
+ LDVS, WORK, LWORK, BWORK, INFO)
+ DGEES computes the eigenvalues, the Schur form, and, optionally,
+ the matrix of Schur vectors for GE matrices
+
+Function/Subroutine Documentation
+ subroutine dgees (character JOBVS, character SORT, external SELECT, integer
+ N, double precision, dimension( lda, * ) A, integer LDA, integer SDIM,
+ double precision, dimension( * ) WR, double precision, dimension( * )
+ WI, double precision, dimension( ldvs, * ) VS, integer LDVS, double
+ precision, dimension( * ) WORK, integer LWORK, logical, dimension( * )
+ BWORK, integer INFO)
+ DGEES computes the eigenvalues, the Schur form, and, optionally, the
+ matrix of Schur vectors for GE matrices
+
+Purpose:
+ DGEES computes for an NbyN real nonsymmetric matrix A, the
+ eigenvalues, the real Schur form T, and, optionally, the matrix of
+ Schur vectors Z. This gives the Schur factorization A = Z*T*(Z**T).
+
+ Optionally, it also orders the eigenvalues on the diagonal of the
+ real Schur form so that selected eigenvalues are at the top left.
+ The leading columns of Z then form an orthonormal basis for the
+ invariant subspace corresponding to the selected eigenvalues.
+
+ A matrix is in real Schur form if it is upper quasitriangular with
+ 1by1 and 2by2 blocks. 2by2 blocks will be standardized in the form
+ [ a b ]
+ [ c a ]
+
+ where b*c < 0. The eigenvalues of such a block are a + sqrt(bc).
+
+Parameters:
+
+ JOBVS
+ JOBVS is CHARACTER*1
+ = 'N': Schur vectors are not computed;
+ = 'V': Schur vectors are computed.
+
+ SORT
+ SORT is CHARACTER*1
+ Specifies whether or not to order the eigenvalues on the
+ diagonal of the Schur form.
+ = 'N': Eigenvalues are not ordered;
+ = 'S': Eigenvalues are ordered (see SELECT).
+
+ SELECT
+ SELECT is a LOGICAL FUNCTION of two DOUBLE PRECISION arguments
+ SELECT must be declared EXTERNAL in the calling subroutine.
+ If SORT = 'S', SELECT is used to select eigenvalues to sort
+ to the top left of the Schur form.
+ If SORT = 'N', SELECT is not referenced.
+ An eigenvalue WR(j)+sqrt(1)*WI(j) is selected if
+ SELECT(WR(j),WI(j)) is true; i.e., if either one of a complex
+ conjugate pair of eigenvalues is selected, then both complex
+ eigenvalues are selected.
+ Note that a selected complex eigenvalue may no longer
+ satisfy SELECT(WR(j),WI(j)) = .TRUE. after ordering, since
+ ordering may change the value of complex eigenvalues
+ (especially if the eigenvalue is illconditioned); in this
+ case INFO is set to N+2 (see INFO below).
+
+ N
+ N is INTEGER
+ The order of the matrix A. N >= 0.
+
+ A
+ A is DOUBLE PRECISION array, dimension (LDA,N)
+ On entry, the NbyN matrix A.
+ On exit, A has been overwritten by its real Schur form T.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,N).
+
+ SDIM
+ SDIM is INTEGER
+ If SORT = 'N', SDIM = 0.
+ If SORT = 'S', SDIM = number of eigenvalues (after sorting)
+ for which SELECT is true. (Complex conjugate
+ pairs for which SELECT is true for either
+ eigenvalue count as 2.)
+
+ WR
+ WR is DOUBLE PRECISION array, dimension (N)
+
+ WI
+ WI is DOUBLE PRECISION array, dimension (N)
+ WR and WI contain the real and imaginary parts,
+ respectively, of the computed eigenvalues in the same order
+ that they appear on the diagonal of the output Schur form T.
+ Complex conjugate pairs of eigenvalues will appear
+ consecutively with the eigenvalue having the positive
+ imaginary part first.
+
+ VS
+ VS is DOUBLE PRECISION array, dimension (LDVS,N)
+ If JOBVS = 'V', VS contains the orthogonal matrix Z of Schur vectors.
+ If JOBVS = 'N', VS is not referenced.
+
+ LDVS
+ LDVS is INTEGER
+ The leading dimension of the array VS. LDVS >= 1; if
+ JOBVS = 'V', LDVS >= N.
+
+ WORK
+ WORK is DOUBLE PRECISION array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) contains the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK. LWORK >= max(1,3*N).
+ For good performance, LWORK must generally be larger.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ BWORK
+ BWORK is LOGICAL array, dimension (N)
+ Not referenced if SORT = 'N'.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value.
+ > 0: if INFO = i, and i is
+ <= N: the QR algorithm failed to compute all the
+ eigenvalues; elements 1:ILO1 and i+1:N of WR and WI
+ contain those eigenvalues which have converged; if
+ JOBVS = 'V', VS contains the matrix which reduces A
+ to its partially converged Schur form.
+ = N+1: the eigenvalues could not be reordered because some
+ eigenvalues were too close to separate (the problem
+ is very illconditioned);
+ = N+2: after reordering, roundoff changed values of some
+ complex eigenvalues so that leading eigenvalues in
+ the Schur form no longer satisfy SELECT=.TRUE. This
+ could also be caused by underflow due to scaling.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{dgees.f}
+\index{dgees.f}
+\begin{chunk}{dgees.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK dgees}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{dgeesx}
+\label{dgeesx}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{dgeesx.input}
+)set break resume
+)sys rm f dgeesx.output
+)spool dgeesx.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{dgeesx.help}
+====================================================================
+dgeesx examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine dgeesx (JOBVS, SORT, SELECT, SENSE, N, A, LDA, SDIM, WR, WI,
+ VS, LDVS, RCONDE, RCONDV, WORK, LWORK, IWORK, LIWORK, BWORK, INFO)
+ DGEESX computes the eigenvalues, the Schur form, and, optionally,
+ the matrix of Schur vectors for GE matrices
+
+Function/Subroutine Documentation
+ subroutine dgeesx (character JOBVS, character SORT, external SELECT,
+ character SENSE, integer N, double precision, dimension( lda, * ) A,
+ integer LDA, integer SDIM, double precision, dimension( * ) WR, double
+ precision, dimension( * ) WI, double precision, dimension( ldvs, * )
+ VS, integer LDVS, double precision RCONDE, double precision RCONDV,
+ double precision, dimension( * ) WORK, integer LWORK, integer,
+ dimension( * ) IWORK, integer LIWORK, logical, dimension( * ) BWORK,
+ integer INFO)
+ DGEESX computes the eigenvalues, the Schur form, and, optionally, the
+ matrix of Schur vectors for GE matrices
+
+Purpose:
+ DGEESX computes for an NbyN real nonsymmetric matrix A, the
+ eigenvalues, the real Schur form T, and, optionally, the matrix of
+ Schur vectors Z. This gives the Schur factorization A = Z*T*(Z**T).
+
+ Optionally, it also orders the eigenvalues on the diagonal of the
+ real Schur form so that selected eigenvalues are at the top left;
+ computes a reciprocal condition number for the average of the
+ selected eigenvalues (RCONDE); and computes a reciprocal condition
+ number for the right invariant subspace corresponding to the
+ selected eigenvalues (RCONDV). The leading columns of Z form an
+ orthonormal basis for this invariant subspace.
+
+ For further explanation of the reciprocal condition numbers RCONDE
+ and RCONDV, see Section 4.10 of the LAPACK Users' Guide (where
+ these quantities are called s and sep respectively).
+
+ A real matrix is in real Schur form if it is upper quasitriangular
+ with 1by1 and 2by2 blocks. 2by2 blocks will be standardized in
+ the form
+ [ a b ]
+ [ c a ]
+
+ where b*c < 0. The eigenvalues of such a block are a + sqrt(bc).
+
+Parameters:
+
+ JOBVS
+ JOBVS is CHARACTER*1
+ = 'N': Schur vectors are not computed;
+ = 'V': Schur vectors are computed.
+
+ SORT
+ SORT is CHARACTER*1
+ Specifies whether or not to order the eigenvalues on the
+ diagonal of the Schur form.
+ = 'N': Eigenvalues are not ordered;
+ = 'S': Eigenvalues are ordered (see SELECT).
+
+ SELECT
+ SELECT is procedure) LOGICAL FUNCTION of two DOUBLE PRECISION arguments
+ SELECT must be declared EXTERNAL in the calling subroutine.
+ If SORT = 'S', SELECT is used to select eigenvalues to sort
+ to the top left of the Schur form.
+ If SORT = 'N', SELECT is not referenced.
+ An eigenvalue WR(j)+sqrt(1)*WI(j) is selected if
+ SELECT(WR(j),WI(j)) is true; i.e., if either one of a
+ complex conjugate pair of eigenvalues is selected, then both
+ are. Note that a selected complex eigenvalue may no longer
+ satisfy SELECT(WR(j),WI(j)) = .TRUE. after ordering, since
+ ordering may change the value of complex eigenvalues
+ (especially if the eigenvalue is illconditioned); in this
+ case INFO may be set to N+3 (see INFO below).
+
+ SENSE
+ SENSE is CHARACTER*1
+ Determines which reciprocal condition numbers are computed.
+ = 'N': None are computed;
+ = 'E': Computed for average of selected eigenvalues only;
+ = 'V': Computed for selected right invariant subspace only;
+ = 'B': Computed for both.
+ If SENSE = 'E', 'V' or 'B', SORT must equal 'S'.
+
+ N
+ N is INTEGER
+ The order of the matrix A. N >= 0.
+
+ A
+ A is DOUBLE PRECISION array, dimension (LDA, N)
+ On entry, the NbyN matrix A.
+ On exit, A is overwritten by its real Schur form T.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,N).
+
+ SDIM
+ SDIM is INTEGER
+ If SORT = 'N', SDIM = 0.
+ If SORT = 'S', SDIM = number of eigenvalues (after sorting)
+ for which SELECT is true. (Complex conjugate
+ pairs for which SELECT is true for either
+ eigenvalue count as 2.)
+
+ WR
+ WR is DOUBLE PRECISION array, dimension (N)
+
+ WI
+ WI is DOUBLE PRECISION array, dimension (N)
+ WR and WI contain the real and imaginary parts, respectively,
+ of the computed eigenvalues, in the same order that they
+ appear on the diagonal of the output Schur form T. Complex
+ conjugate pairs of eigenvalues appear consecutively with the
+ eigenvalue having the positive imaginary part first.
+
+ VS
+ VS is DOUBLE PRECISION array, dimension (LDVS,N)
+ If JOBVS = 'V', VS contains the orthogonal matrix Z of Schur vectors.
+ If JOBVS = 'N', VS is not referenced.
+
+ LDVS
+ LDVS is INTEGER
+ The leading dimension of the array VS. LDVS >= 1, and if
+ JOBVS = 'V', LDVS >= N.
+
+ RCONDE
+ RCONDE is DOUBLE PRECISION
+ If SENSE = 'E' or 'B', RCONDE contains the reciprocal
+ condition number for the average of the selected eigenvalues.
+ Not referenced if SENSE = 'N' or 'V'.
+
+ RCONDV
+ RCONDV is DOUBLE PRECISION
+ If SENSE = 'V' or 'B', RCONDV contains the reciprocal
+ condition number for the selected right invariant subspace.
+ Not referenced if SENSE = 'N' or 'E'.
+
+ WORK
+ WORK is DOUBLE PRECISION array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK. LWORK >= max(1,3*N).
+ Also, if SENSE = 'E' or 'V' or 'B',
+ LWORK >= N+2*SDIM*(NSDIM), where SDIM is the number of
+ selected eigenvalues computed by this routine. Note that
+ N+2*SDIM*(NSDIM) <= N+N*N/2. Note also that an error is only
+ returned if LWORK < max(1,3*N), but if SENSE = 'E' or 'V' or
+ 'B' this may not be large enough.
+ For good performance, LWORK must generally be larger.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates upper bounds on the optimal sizes of the
+ arrays WORK and IWORK, returns these values as the first
+ entries of the WORK and IWORK arrays, and no error messages
+ related to LWORK or LIWORK are issued by XERBLA.
+
+ IWORK
+ IWORK is INTEGER array, dimension (MAX(1,LIWORK))
+ On exit, if INFO = 0, IWORK(1) returns the optimal LIWORK.
+
+ LIWORK
+ LIWORK is INTEGER
+ The dimension of the array IWORK.
+ LIWORK >= 1; if SENSE = 'V' or 'B', LIWORK >= SDIM*(NSDIM).
+ Note that SDIM*(NSDIM) <= N*N/4. Note also that an error is
+ only returned if LIWORK < 1, but if SENSE = 'V' or 'B' this
+ may not be large enough.
+
+ If LIWORK = 1, then a workspace query is assumed; the
+ routine only calculates upper bounds on the optimal sizes of
+ the arrays WORK and IWORK, returns these values as the first
+ entries of the WORK and IWORK arrays, and no error messages
+ related to LWORK or LIWORK are issued by XERBLA.
+
+ BWORK
+ BWORK is LOGICAL array, dimension (N)
+ Not referenced if SORT = 'N'.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value.
+ > 0: if INFO = i, and i is
+ <= N: the QR algorithm failed to compute all the
+ eigenvalues; elements 1:ILO1 and i+1:N of WR and WI
+ contain those eigenvalues which have converged; if
+ JOBVS = 'V', VS contains the transformation which
+ reduces A to its partially converged Schur form.
+ = N+1: the eigenvalues could not be reordered because some
+ eigenvalues were too close to separate (the problem
+ is very illconditioned);
+ = N+2: after reordering, roundoff changed values of some
+ complex eigenvalues so that leading eigenvalues in
+ the Schur form no longer satisfy SELECT=.TRUE. This
+ could also be caused by underflow due to scaling.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{dgeesx.f}
+\index{dgeesx.f}
+\begin{chunk}{dgeesx.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK dgeesx}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{dgeev}
+\label{dgeev}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{dgeev.input}
+)set break resume
+)sys rm f dgeev.output
+)spool dgeev.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{dgeev.help}
+====================================================================
+dgeev examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine dgeev (JOBVL, JOBVR, N, A, LDA, WR, WI, VL, LDVL, VR, LDVR,
+ WORK, LWORK, INFO)
+ DGEEV computes the eigenvalues and, optionally, the left and/or
+ right eigenvectors for GE matrices
+
+Function/Subroutine Documentation
+ subroutine dgeev (character JOBVL, character JOBVR, integer N, double
+ precision, dimension( lda, * ) A, integer LDA, double precision,
+ dimension( * ) WR, double precision, dimension( * ) WI, double
+ precision, dimension( ldvl, * ) VL, integer LDVL, double precision,
+ dimension( ldvr, * ) VR, integer LDVR, double precision, dimension( * )
+ WORK, integer LWORK, integer INFO)
+ DGEEV computes the eigenvalues and, optionally, the left and/or right
+ eigenvectors for GE matrices
+
+Purpose:
+ DGEEV computes for an NbyN real nonsymmetric matrix A, the
+ eigenvalues and, optionally, the left and/or right eigenvectors.
+
+ The right eigenvector v(j) of A satisfies
+ A * v(j) = lambda(j) * v(j)
+ where lambda(j) is its eigenvalue.
+ The left eigenvector u(j) of A satisfies
+ u(j)**H * A = lambda(j) * u(j)**H
+ where u(j)**H denotes the conjugatetranspose of u(j).
+
+ The computed eigenvectors are normalized to have Euclidean norm
+ equal to 1 and largest component real.
+
+Parameters:
+
+ JOBVL
+ JOBVL is CHARACTER*1
+ = 'N': left eigenvectors of A are not computed;
+ = 'V': left eigenvectors of A are computed.
+
+ JOBVR
+ JOBVR is CHARACTER*1
+ = 'N': right eigenvectors of A are not computed;
+ = 'V': right eigenvectors of A are computed.
+
+ N
+ N is INTEGER
+ The order of the matrix A. N >= 0.
+
+ A
+ A is DOUBLE PRECISION array, dimension (LDA,N)
+ On entry, the NbyN matrix A.
+ On exit, A has been overwritten.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,N).
+
+ WR
+ WR is DOUBLE PRECISION array, dimension (N)
+
+ WI
+ WI is DOUBLE PRECISION array, dimension (N)
+ WR and WI contain the real and imaginary parts,
+ respectively, of the computed eigenvalues. Complex
+ conjugate pairs of eigenvalues appear consecutively
+ with the eigenvalue having the positive imaginary part first.
+
+ VL
+ VL is DOUBLE PRECISION array, dimension (LDVL,N)
+ If JOBVL = 'V', the left eigenvectors u(j) are stored one
+ after another in the columns of VL, in the same order
+ as their eigenvalues.
+ If JOBVL = 'N', VL is not referenced.
+ If the jth eigenvalue is real, then u(j) = VL(:,j),
+ the jth column of VL.
+ If the jth and (j+1)st eigenvalues form a complex
+ conjugate pair, then u(j) = VL(:,j) + i*VL(:,j+1) and
+ u(j+1) = VL(:,j)  i*VL(:,j+1).
+
+ LDVL
+ LDVL is INTEGER
+ The leading dimension of the array VL. LDVL >= 1; if
+ JOBVL = 'V', LDVL >= N.
+
+ VR
+ VR is DOUBLE PRECISION array, dimension (LDVR,N)
+ If JOBVR = 'V', the right eigenvectors v(j) are stored one
+ after another in the columns of VR, in the same order
+ as their eigenvalues.
+ If JOBVR = 'N', VR is not referenced.
+ If the jth eigenvalue is real, then v(j) = VR(:,j),
+ the jth column of VR.
+ If the jth and (j+1)st eigenvalues form a complex
+ conjugate pair, then v(j) = VR(:,j) + i*VR(:,j+1) and
+ v(j+1) = VR(:,j)  i*VR(:,j+1).
+
+ LDVR
+ LDVR is INTEGER
+ The leading dimension of the array VR. LDVR >= 1; if
+ JOBVR = 'V', LDVR >= N.
+
+ WORK
+ WORK is DOUBLE PRECISION array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK. LWORK >= max(1,3*N), and
+ if JOBVL = 'V' or JOBVR = 'V', LWORK >= 4*N. For good
+ performance, LWORK must generally be larger.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value.
+ > 0: if INFO = i, the QR algorithm failed to compute all the
+ eigenvalues, and no eigenvectors have been computed;
+ elements i+1:N of WR and WI contain eigenvalues which
+ have converged.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{dgeev.f}
+\index{dgeev.f}
+\begin{chunk}{dgeev.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK dgeev}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{dgeevx}
+\label{dgeevx}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{dgeevx.input}
+)set break resume
+)sys rm f dgeevx.output
+)spool dgeevx.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{dgeevx.help}
+====================================================================
+dgeevx examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine dgeevx (BALANC, JOBVL, JOBVR, SENSE, N, A, LDA, WR, WI, VL,
+ LDVL, VR, LDVR, ILO, IHI, SCALE, ABNRM, RCONDE, RCONDV, WORK,
+ LWORK, IWORK, INFO)
+ DGEEVX computes the eigenvalues and, optionally, the left and/or
+ right eigenvectors for GE matrices
+
+Function/Subroutine Documentation
+ subroutine dgeevx (character BALANC, character JOBVL, character JOBVR,
+ character SENSE, integer N, double precision, dimension( lda, * ) A,
+ integer LDA, double precision, dimension( * ) WR, double precision,
+ dimension( * ) WI, double precision, dimension( ldvl, * ) VL, integer
+ LDVL, double precision, dimension( ldvr, * ) VR, integer LDVR, integer
+ ILO, integer IHI, double precision, dimension( * ) SCALE, double
+ precision ABNRM, double precision, dimension( * ) RCONDE, double
+ precision, dimension( * ) RCONDV, double precision, dimension( * )
+ WORK, integer LWORK, integer, dimension( * ) IWORK, integer INFO)
+ DGEEVX computes the eigenvalues and, optionally, the left and/or right
+ eigenvectors for GE matrices
+
+Purpose:
+ DGEEVX computes for an NbyN real nonsymmetric matrix A, the
+ eigenvalues and, optionally, the left and/or right eigenvectors.
+
+ Optionally also, it computes a balancing transformation to improve
+ the conditioning of the eigenvalues and eigenvectors (ILO, IHI,
+ SCALE, and ABNRM), reciprocal condition numbers for the eigenvalues
+ (RCONDE), and reciprocal condition numbers for the right
+ eigenvectors (RCONDV).
+
+ The right eigenvector v(j) of A satisfies
+ A * v(j) = lambda(j) * v(j)
+ where lambda(j) is its eigenvalue.
+ The left eigenvector u(j) of A satisfies
+ u(j)**H * A = lambda(j) * u(j)**H
+ where u(j)**H denotes the conjugatetranspose of u(j).
+
+ The computed eigenvectors are normalized to have Euclidean norm
+ equal to 1 and largest component real.
+
+ Balancing a matrix means permuting the rows and columns to make it
+ more nearly upper triangular, and applying a diagonal similarity
+ transformation D * A * D**(1), where D is a diagonal matrix, to
+ make its rows and columns closer in norm and the condition numbers
+ of its eigenvalues and eigenvectors smaller. The computed
+ reciprocal condition numbers correspond to the balanced matrix.
+ Permuting rows and columns will not change the condition numbers
+ (in exact arithmetic) but diagonal scaling will. For further
+ explanation of balancing, see section 4.10.2 of the LAPACK Users' Guide.
+
+Parameters:
+
+ BALANC
+ BALANC is CHARACTER*1
+ Indicates how the input matrix should be diagonally scaled
+ and/or permuted to improve the conditioning of its
+ eigenvalues.
+ = 'N': Do not diagonally scale or permute;
+ = 'P': Perform permutations to make the matrix more nearly
+ upper triangular. Do not diagonally scale;
+ = 'S': Diagonally scale the matrix, i.e. replace A by
+ D*A*D**(1), where D is a diagonal matrix chosen
+ to make the rows and columns of A more equal in
+ norm. Do not permute;
+ = 'B': Both diagonally scale and permute A.
+ Computed reciprocal condition numbers will be for the matrix
+ after balancing and/or permuting. Permuting does not change
+ condition numbers (in exact arithmetic), but balancing does.
+
+ JOBVL
+ JOBVL is CHARACTER*1
+ = 'N': left eigenvectors of A are not computed;
+ = 'V': left eigenvectors of A are computed.
+ If SENSE = 'E' or 'B', JOBVL must = 'V'.
+
+ JOBVR
+ JOBVR is CHARACTER*1
+ = 'N': right eigenvectors of A are not computed;
+ = 'V': right eigenvectors of A are computed.
+ If SENSE = 'E' or 'B', JOBVR must = 'V'.
+
+ SENSE
+ SENSE is CHARACTER*1
+ Determines which reciprocal condition numbers are computed.
+ = 'N': None are computed;
+ = 'E': Computed for eigenvalues only;
+ = 'V': Computed for right eigenvectors only;
+ = 'B': Computed for eigenvalues and right eigenvectors.
+
+ If SENSE = 'E' or 'B', both left and right eigenvectors
+ must also be computed (JOBVL = 'V' and JOBVR = 'V').
+
+ N
+ N is INTEGER
+ The order of the matrix A. N >= 0.
+
+ A
+ A is DOUBLE PRECISION array, dimension (LDA,N)
+ On entry, the NbyN matrix A.
+ On exit, A has been overwritten. If JOBVL = 'V' or
+ JOBVR = 'V', A contains the real Schur form of the balanced
+ version of the input matrix A.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,N).
+
+ WR
+ WR is DOUBLE PRECISION array, dimension (N)
+
+ WI
+ WI is DOUBLE PRECISION array, dimension (N)
+ WR and WI contain the real and imaginary parts,
+ respectively, of the computed eigenvalues. Complex
+ conjugate pairs of eigenvalues will appear consecutively
+ with the eigenvalue having the positive imaginary part first.
+
+ VL
+ VL is DOUBLE PRECISION array, dimension (LDVL,N)
+ If JOBVL = 'V', the left eigenvectors u(j) are stored one
+ after another in the columns of VL, in the same order
+ as their eigenvalues.
+ If JOBVL = 'N', VL is not referenced.
+ If the jth eigenvalue is real, then u(j) = VL(:,j),
+ the jth column of VL.
+ If the jth and (j+1)st eigenvalues form a complex
+ conjugate pair, then u(j) = VL(:,j) + i*VL(:,j+1) and
+ u(j+1) = VL(:,j)  i*VL(:,j+1).
+
+ LDVL
+ LDVL is INTEGER
+ The leading dimension of the array VL. LDVL >= 1; if
+ JOBVL = 'V', LDVL >= N.
+
+ VR
+ VR is DOUBLE PRECISION array, dimension (LDVR,N)
+ If JOBVR = 'V', the right eigenvectors v(j) are stored one
+ after another in the columns of VR, in the same order
+ as their eigenvalues.
+ If JOBVR = 'N', VR is not referenced.
+ If the jth eigenvalue is real, then v(j) = VR(:,j),
+ the jth column of VR.
+ If the jth and (j+1)st eigenvalues form a complex
+ conjugate pair, then v(j) = VR(:,j) + i*VR(:,j+1) and
+ v(j+1) = VR(:,j)  i*VR(:,j+1).
+
+ LDVR
+ LDVR is INTEGER
+ The leading dimension of the array VR. LDVR >= 1, and if
+ JOBVR = 'V', LDVR >= N.
+
+ ILO
+ ILO is INTEGER
+
+ IHI
+ IHI is INTEGER
+ ILO and IHI are integer values determined when A was
+ balanced. The balanced A(i,j) = 0 if I > J and
+ J = 1,...,ILO1 or I = IHI+1,...,N.
+
+ SCALE
+ SCALE is DOUBLE PRECISION array, dimension (N)
+ Details of the permutations and scaling factors applied
+ when balancing A. If P(j) is the index of the row and column
+ interchanged with row and column j, and D(j) is the scaling
+ factor applied to row and column j, then
+ SCALE(J) = P(J), for J = 1,...,ILO1
+ = D(J), for J = ILO,...,IHI
+ = P(J) for J = IHI+1,...,N.
+ The order in which the interchanges are made is N to IHI+1,
+ then 1 to ILO1.
+
+ ABNRM
+ ABNRM is DOUBLE PRECISION
+ The onenorm of the balanced matrix (the maximum
+ of the sum of absolute values of elements of any column).
+
+ RCONDE
+ RCONDE is DOUBLE PRECISION array, dimension (N)
+ RCONDE(j) is the reciprocal condition number of the jth eigenvalue.
+
+ RCONDV
+ RCONDV is DOUBLE PRECISION array, dimension (N)
+ RCONDV(j) is the reciprocal condition number of the jth
+ right eigenvector.
+
+ WORK
+ WORK is DOUBLE PRECISION array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK. If SENSE = 'N' or 'E',
+ LWORK >= max(1,2*N), and if JOBVL = 'V' or JOBVR = 'V',
+ LWORK >= 3*N. If SENSE = 'V' or 'B', LWORK >= N*(N+6).
+ For good performance, LWORK must generally be larger.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ IWORK
+ IWORK is INTEGER array, dimension (2*N2)
+ If SENSE = 'N' or 'E', not referenced.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value.
+ > 0: if INFO = i, the QR algorithm failed to compute all the
+ eigenvalues, and no eigenvectors or condition numbers
+ have been computed; elements 1:ILO1 and i+1:N of WR
+ and WI contain eigenvalues which have converged.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{dgeevx.f}
+\index{dgeevx.f}
+\begin{chunk}{dgeevx.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK dgeevx}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{dgegs  DEPRECATED use dgges}
+\label{dgegs}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{dgegv  DEPRECATED use dggev}
+\label{dgegv}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{dgges}
+\label{dgges}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{dgges.input}
+)set break resume
+)sys rm f dgges.output
+)spool dgges.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{dgges.help}
+====================================================================
+dgges examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine dgges (JOBVSL, JOBVSR, SORT, SELCTG, N, A, LDA, B, LDB,
+ SDIM, ALPHAR, ALPHAI, BETA, VSL, LDVSL, VSR, LDVSR, WORK, LWORK,
+ BWORK, INFO)
+ DGGES computes the eigenvalues, the Schur form, and, optionally,
+ the matrix of Schur vectors for GE matrices
+
+Function/Subroutine Documentation
+ subroutine dgges (character JOBVSL, character JOBVSR, character SORT,
+ external SELCTG, integer N, double precision, dimension( lda, * ) A,
+ integer LDA, double precision, dimension( ldb, * ) B, integer LDB,
+ integer SDIM, double precision, dimension( * ) ALPHAR, double
+ precision, dimension( * ) ALPHAI, double precision, dimension( * )
+ BETA, double precision, dimension( ldvsl, * ) VSL, integer LDVSL,
+ double precision, dimension( ldvsr, * ) VSR, integer LDVSR, double
+ precision, dimension( * ) WORK, integer LWORK, logical, dimension( * )
+ BWORK, integer INFO)
+ DGGES computes the eigenvalues, the Schur form, and, optionally, the
+ matrix of Schur vectors for GE matrices
+
+Purpose:
+ DGGES computes for a pair of NbyN real nonsymmetric matrices (A,B),
+ the generalized eigenvalues, the generalized real Schur form (S,T),
+ optionally, the left and/or right matrices of Schur vectors (VSL and
+ VSR). This gives the generalized Schur factorization
+
+ (A,B) = ( (VSL)*S*(VSR)**T, (VSL)*T*(VSR)**T )
+
+ Optionally, it also orders the eigenvalues so that a selected cluster
+ of eigenvalues appears in the leading diagonal blocks of the upper
+ quasitriangular matrix S and the upper triangular matrix T.The
+ leading columns of VSL and VSR then form an orthonormal basis for the
+ corresponding left and right eigenspaces (deflating subspaces).
+
+ (If only the generalized eigenvalues are needed, use the driver
+ DGGEV instead, which is faster.)
+
+ A generalized eigenvalue for a pair of matrices (A,B) is a scalar w
+ or a ratio alpha/beta = w, such that A  w*B is singular. It is
+ usually represented as the pair (alpha,beta), as there is a
+ reasonable interpretation for beta=0 or both being zero.
+
+ A pair of matrices (S,T) is in generalized real Schur form if T is
+ upper triangular with nonnegative diagonal and S is block upper
+ triangular with 1by1 and 2by2 blocks. 1by1 blocks correspond
+ to real generalized eigenvalues, while 2by2 blocks of S will be
+ "standardized" by making the corresponding elements of T have the form:
+ [ a 0 ]
+ [ 0 b ]
+ and the pair of corresponding 2by2 blocks in S and T will have a
+ complex conjugate pair of generalized eigenvalues.
+
+Parameters:
+
+ JOBVSL
+ JOBVSL is CHARACTER*1
+ = 'N': do not compute the left Schur vectors;
+ = 'V': compute the left Schur vectors.
+
+ JOBVSR
+ JOBVSR is CHARACTER*1
+ = 'N': do not compute the right Schur vectors;
+ = 'V': compute the right Schur vectors.
+
+ SORT
+ SORT is CHARACTER*1
+ Specifies whether or not to order the eigenvalues on the
+ diagonal of the generalized Schur form.
+ = 'N': Eigenvalues are not ordered;
+ = 'S': Eigenvalues are ordered (see SELCTG);
+
+ SELCTG
+ SELCTG is a LOGICAL FUNCTION of three DOUBLE PRECISION arguments
+ SELCTG must be declared EXTERNAL in the calling subroutine.
+ If SORT = 'N', SELCTG is not referenced.
+ If SORT = 'S', SELCTG is used to select eigenvalues to sort
+ to the top left of the Schur form.
+ An eigenvalue (ALPHAR(j)+ALPHAI(j))/BETA(j) is selected if
+ SELCTG(ALPHAR(j),ALPHAI(j),BETA(j)) is true; i.e. if either
+ one of a complex conjugate pair of eigenvalues is selected,
+ then both complex eigenvalues are selected.
+
+ Note that in the illconditioned case, a selected complex
+ eigenvalue may no longer satisfy SELCTG(ALPHAR(j),ALPHAI(j),
+ BETA(j)) = .TRUE. after ordering. INFO is to be set to N+2
+ in this case.
+
+ N
+ N is INTEGER
+ The order of the matrices A, B, VSL, and VSR. N >= 0.
+
+ A
+ A is DOUBLE PRECISION array, dimension (LDA, N)
+ On entry, the first of the pair of matrices.
+ On exit, A has been overwritten by its generalized Schur form S.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of A. LDA >= max(1,N).
+
+ B
+ B is DOUBLE PRECISION array, dimension (LDB, N)
+ On entry, the second of the pair of matrices.
+ On exit, B has been overwritten by its generalized Schur form T.
+
+ LDB
+ LDB is INTEGER
+ The leading dimension of B. LDB >= max(1,N).
+
+ SDIM
+ SDIM is INTEGER
+ If SORT = 'N', SDIM = 0.
+ If SORT = 'S', SDIM = number of eigenvalues (after sorting)
+ for which SELCTG is true. (Complex conjugate pairs for which
+ SELCTG is true for either eigenvalue count as 2.)
+
+ ALPHAR
+ ALPHAR is DOUBLE PRECISION array, dimension (N)
+
+ ALPHAI
+ ALPHAI is DOUBLE PRECISION array, dimension (N)
+
+ BETA
+ BETA is DOUBLE PRECISION array, dimension (N)
+ On exit, (ALPHAR(j) + ALPHAI(j)*i)/BETA(j), j=1,...,N, will
+ be the generalized eigenvalues. ALPHAR(j) + ALPHAI(j)*i,
+ and BETA(j),j=1,...,N are the diagonals of the complex Schur
+ form (S,T) that would result if the 2by2 diagonal blocks of
+ the real Schur form of (A,B) were further reduced to
+ triangular form using 2by2 complex unitary transformations.
+ If ALPHAI(j) is zero, then the jth eigenvalue is real; if
+ positive, then the jth and (j+1)st eigenvalues are a
+ complex conjugate pair, with ALPHAI(j+1) negative.
+
+ Note: the quotients ALPHAR(j)/BETA(j) and ALPHAI(j)/BETA(j)
+ may easily over or underflow, and BETA(j) may even be zero.
+ Thus, the user should avoid naively computing the ratio.
+ However, ALPHAR and ALPHAI will be always less than and
+ usually comparable with norm(A) in magnitude, and BETA always
+ less than and usually comparable with norm(B).
+
+ VSL
+ VSL is DOUBLE PRECISION array, dimension (LDVSL,N)
+ If JOBVSL = 'V', VSL will contain the left Schur vectors.
+ Not referenced if JOBVSL = 'N'.
+
+ LDVSL
+ LDVSL is INTEGER
+ The leading dimension of the matrix VSL. LDVSL >=1, and
+ if JOBVSL = 'V', LDVSL >= N.
+
+ VSR
+ VSR is DOUBLE PRECISION array, dimension (LDVSR,N)
+ If JOBVSR = 'V', VSR will contain the right Schur vectors.
+ Not referenced if JOBVSR = 'N'.
+
+ LDVSR
+ LDVSR is INTEGER
+ The leading dimension of the matrix VSR. LDVSR >= 1, and
+ if JOBVSR = 'V', LDVSR >= N.
+
+ WORK
+ WORK is DOUBLE PRECISION array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK.
+ If N = 0, LWORK >= 1, else LWORK >= 8*N+16.
+ For good performance , LWORK must generally be larger.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ BWORK
+ BWORK is LOGICAL array, dimension (N)
+ Not referenced if SORT = 'N'.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value.
+ = 1,...,N:
+ The QZ iteration failed. (A,B) are not in Schur
+ form, but ALPHAR(j), ALPHAI(j), and BETA(j) should
+ be correct for j=INFO+1,...,N.
+ > N:
+ =N+1: other than QZ iteration failed in DHGEQZ.
+ =N+2: after reordering, roundoff changed values of
+ some complex eigenvalues so that leading
+ eigenvalues in the Generalized Schur form no
+ longer satisfy SELCTG=.TRUE. This could also
+ be caused due to scaling.
+ =N+3: reordering failed in DTGSEN.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{dgges.f}
+\index{dgges.f}
+\begin{chunk}{dgges.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK dgges}
+
+\end{chunk}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{dgges3}
+\label{dgges3}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{dgges3.input}
+)set break resume
+)sys rm f dgges3.output
+)spool dgges3.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{dgges3.help}
+====================================================================
+dgges3 examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine dgges3 (JOBVSL, JOBVSR, SORT, SELCTG, N, A, LDA, B, LDB,
+ SDIM, ALPHAR, ALPHAI, BETA, VSL, LDVSL, VSR, LDVSR, WORK, LWORK,
+ BWORK, INFO)
+ DGGES3 computes the eigenvalues, the Schur form, and, optionally,
+ the matrix of Schur vectors for GE matrices (blocked algorithm)
+
+Function/Subroutine Documentation
+ subroutine dgges3 (character JOBVSL, character JOBVSR, character SORT,
+ external SELCTG, integer N, double precision, dimension( lda, * ) A,
+ integer LDA, double precision, dimension( ldb, * ) B, integer LDB,
+ integer SDIM, double precision, dimension( * ) ALPHAR, double
+ precision, dimension( * ) ALPHAI, double precision, dimension( * )
+ BETA, double precision, dimension( ldvsl, * ) VSL, integer LDVSL,
+ double precision, dimension( ldvsr, * ) VSR, integer LDVSR, double
+ precision, dimension( * ) WORK, integer LWORK, logical, dimension( * )
+ BWORK, integer INFO)
+ DGGES3 computes the eigenvalues, the Schur form, and, optionally, the
+ matrix of Schur vectors for GE matrices (blocked algorithm)
+
+Purpose:
+ DGGES3 computes for a pair of NbyN real nonsymmetric matrices (A,B),
+ the generalized eigenvalues, the generalized real Schur form (S,T),
+ optionally, the left and/or right matrices of Schur vectors (VSL and
+ VSR). This gives the generalized Schur factorization
+
+ (A,B) = ( (VSL)*S*(VSR)**T, (VSL)*T*(VSR)**T )
+
+ Optionally, it also orders the eigenvalues so that a selected cluster
+ of eigenvalues appears in the leading diagonal blocks of the upper
+ quasitriangular matrix S and the upper triangular matrix T.The
+ leading columns of VSL and VSR then form an orthonormal basis for the
+ corresponding left and right eigenspaces (deflating subspaces).
+
+ (If only the generalized eigenvalues are needed, use the driver
+ DGGEV instead, which is faster.)
+
+ A generalized eigenvalue for a pair of matrices (A,B) is a scalar w
+ or a ratio alpha/beta = w, such that A  w*B is singular. It is
+ usually represented as the pair (alpha,beta), as there is a
+ reasonable interpretation for beta=0 or both being zero.
+
+ A pair of matrices (S,T) is in generalized real Schur form if T is
+ upper triangular with nonnegative diagonal and S is block upper
+ triangular with 1by1 and 2by2 blocks. 1by1 blocks correspond
+ to real generalized eigenvalues, while 2by2 blocks of S will be
+ "standardized" by making the corresponding elements of T have the form:
+ [ a 0 ]
+ [ 0 b ]
+ and the pair of corresponding 2by2 blocks in S and T will have a
+ complex conjugate pair of generalized eigenvalues.
+
+Parameters:
+
+ JOBVSL
+ JOBVSL is CHARACTER*1
+ = 'N': do not compute the left Schur vectors;
+ = 'V': compute the left Schur vectors.
+
+ JOBVSR
+ JOBVSR is CHARACTER*1
+ = 'N': do not compute the right Schur vectors;
+ = 'V': compute the right Schur vectors.
+
+ SORT
+ SORT is CHARACTER*1
+ Specifies whether or not to order the eigenvalues on the
+ diagonal of the generalized Schur form.
+ = 'N': Eigenvalues are not ordered;
+ = 'S': Eigenvalues are ordered (see SELCTG);
+
+ SELCTG
+ SELCTG is a LOGICAL FUNCTION of three DOUBLE PRECISION arguments
+ SELCTG must be declared EXTERNAL in the calling subroutine.
+ If SORT = 'N', SELCTG is not referenced.
+ If SORT = 'S', SELCTG is used to select eigenvalues to sort
+ to the top left of the Schur form.
+ An eigenvalue (ALPHAR(j)+ALPHAI(j))/BETA(j) is selected if
+ SELCTG(ALPHAR(j),ALPHAI(j),BETA(j)) is true; i.e. if either
+ one of a complex conjugate pair of eigenvalues is selected,
+ then both complex eigenvalues are selected.
+
+ Note that in the illconditioned case, a selected complex
+ eigenvalue may no longer satisfy SELCTG(ALPHAR(j),ALPHAI(j),
+ BETA(j)) = .TRUE. after ordering. INFO is to be set to N+2
+ in this case.
+
+ N
+ N is INTEGER
+ The order of the matrices A, B, VSL, and VSR. N >= 0.
+
+ A
+ A is DOUBLE PRECISION array, dimension (LDA, N)
+ On entry, the first of the pair of matrices.
+ On exit, A has been overwritten by its generalized Schur form S.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of A. LDA >= max(1,N).
+
+ B
+ B is DOUBLE PRECISION array, dimension (LDB, N)
+ On entry, the second of the pair of matrices.
+ On exit, B has been overwritten by its generalized Schur form T.
+
+ LDB
+ LDB is INTEGER
+ The leading dimension of B. LDB >= max(1,N).
+
+ SDIM
+ SDIM is INTEGER
+ If SORT = 'N', SDIM = 0.
+ If SORT = 'S', SDIM = number of eigenvalues (after sorting)
+ for which SELCTG is true. (Complex conjugate pairs for which
+ SELCTG is true for either eigenvalue count as 2.)
+
+ ALPHAR
+ ALPHAR is DOUBLE PRECISION array, dimension (N)
+
+ ALPHAI
+ ALPHAI is DOUBLE PRECISION array, dimension (N)
+
+ BETA
+ BETA is DOUBLE PRECISION array, dimension (N)
+ On exit, (ALPHAR(j) + ALPHAI(j)*i)/BETA(j), j=1,...,N, will
+ be the generalized eigenvalues. ALPHAR(j) + ALPHAI(j)*i,
+ and BETA(j),j=1,...,N are the diagonals of the complex Schur
+ form (S,T) that would result if the 2by2 diagonal blocks of
+ the real Schur form of (A,B) were further reduced to
+ triangular form using 2by2 complex unitary transformations.
+ If ALPHAI(j) is zero, then the jth eigenvalue is real; if
+ positive, then the jth and (j+1)st eigenvalues are a
+ complex conjugate pair, with ALPHAI(j+1) negative.
+
+ Note: the quotients ALPHAR(j)/BETA(j) and ALPHAI(j)/BETA(j)
+ may easily over or underflow, and BETA(j) may even be zero.
+ Thus, the user should avoid naively computing the ratio.
+ However, ALPHAR and ALPHAI will be always less than and
+ usually comparable with norm(A) in magnitude, and BETA always
+ less than and usually comparable with norm(B).
+
+ VSL
+ VSL is DOUBLE PRECISION array, dimension (LDVSL,N)
+ If JOBVSL = 'V', VSL will contain the left Schur vectors.
+ Not referenced if JOBVSL = 'N'.
+
+ LDVSL
+ LDVSL is INTEGER
+ The leading dimension of the matrix VSL. LDVSL >=1, and
+ if JOBVSL = 'V', LDVSL >= N.
+
+ VSR
+ VSR is DOUBLE PRECISION array, dimension (LDVSR,N)
+ If JOBVSR = 'V', VSR will contain the right Schur vectors.
+ Not referenced if JOBVSR = 'N'.
+
+ LDVSR
+ LDVSR is INTEGER
+ The leading dimension of the matrix VSR. LDVSR >= 1, and
+ if JOBVSR = 'V', LDVSR >= N.
+
+ WORK
+ WORK is DOUBLE PRECISION array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ BWORK
+ BWORK is LOGICAL array, dimension (N)
+ Not referenced if SORT = 'N'.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value.
+ = 1,...,N:
+ The QZ iteration failed. (A,B) are not in Schur
+ form, but ALPHAR(j), ALPHAI(j), and BETA(j) should
+ be correct for j=INFO+1,...,N.
+ > N: =N+1: other than QZ iteration failed in DHGEQZ.
+ =N+2: after reordering, roundoff changed values of
+ some complex eigenvalues so that leading
+ eigenvalues in the Generalized Schur form no
+ longer satisfy SELCTG=.TRUE. This could also
+ be caused due to scaling.
+ =N+3: reordering failed in DTGSEN.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{dgges3.f}
+\index{dgges3.f}
+\begin{chunk}{dgges3.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK dgges3}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{dggesx}
+\label{dggesx}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{dggesx.input}
+)set break resume
+)sys rm f dggesx.output
+)spool dggesx.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{dggesx.help}
+====================================================================
+dggesx examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine dggesx (JOBVSL, JOBVSR, SORT, SELCTG, SENSE, N, A, LDA, B,
+ LDB, SDIM, ALPHAR, ALPHAI, BETA, VSL, LDVSL, VSR, LDVSR, RCONDE,
+ RCONDV, WORK, LWORK, IWORK, LIWORK, BWORK, INFO)
+ DGGESX computes the eigenvalues, the Schur form, and, optionally,
+ the matrix of Schur vectors for GE matrices
+
+Function/Subroutine Documentation
+ subroutine dggesx (character JOBVSL, character JOBVSR, character SORT,
+ external SELCTG, character SENSE, integer N, double precision,
+ dimension( lda, * ) A, integer LDA, double precision, dimension( ldb, *
+ ) B, integer LDB, integer SDIM, double precision, dimension( * )
+ ALPHAR, double precision, dimension( * ) ALPHAI, double precision,
+ dimension( * ) BETA, double precision, dimension( ldvsl, * ) VSL,
+ integer LDVSL, double precision, dimension( ldvsr, * ) VSR, integer
+ LDVSR, double precision, dimension( 2 ) RCONDE, double precision,
+ dimension( 2 ) RCONDV, double precision, dimension( * ) WORK, integer
+ LWORK, integer, dimension( * ) IWORK, integer LIWORK, logical,
+ dimension( * ) BWORK, integer INFO)
+ DGGESX computes the eigenvalues, the Schur form, and, optionally, the
+ matrix of Schur vectors for GE matrices
+
+Purpose:
+ DGGESX computes for a pair of NbyN real nonsymmetric matrices
+ (A,B), the generalized eigenvalues, the real Schur form (S,T), and,
+ optionally, the left and/or right matrices of Schur vectors (VSL and
+ VSR). This gives the generalized Schur factorization
+
+ (A,B) = ( (VSL) S (VSR)**T, (VSL) T (VSR)**T )
+
+ Optionally, it also orders the eigenvalues so that a selected cluster
+ of eigenvalues appears in the leading diagonal blocks of the upper
+ quasitriangular matrix S and the upper triangular matrix T; computes
+ a reciprocal condition number for the average of the selected
+ eigenvalues (RCONDE); and computes a reciprocal condition number for
+ the right and left deflating subspaces corresponding to the selected
+ eigenvalues (RCONDV). The leading columns of VSL and VSR then form
+ an orthonormal basis for the corresponding left and right eigenspaces
+ (deflating subspaces).
+
+ A generalized eigenvalue for a pair of matrices (A,B) is a scalar w
+ or a ratio alpha/beta = w, such that A  w*B is singular. It is
+ usually represented as the pair (alpha,beta), as there is a
+ reasonable interpretation for beta=0 or for both being zero.
+
+ A pair of matrices (S,T) is in generalized real Schur form if T is
+ upper triangular with nonnegative diagonal and S is block upper
+ triangular with 1by1 and 2by2 blocks. 1by1 blocks correspond
+ to real generalized eigenvalues, while 2by2 blocks of S will be
+ "standardized" by making the corresponding elements of T have the form:
+ [ a 0 ]
+ [ 0 b ]
+ and the pair of corresponding 2by2 blocks in S and T will have a
+ complex conjugate pair of generalized eigenvalues.
+
+Parameters:
+
+ JOBVSL
+ JOBVSL is CHARACTER*1
+ = 'N': do not compute the left Schur vectors;
+ = 'V': compute the left Schur vectors.
+
+ JOBVSR
+ JOBVSR is CHARACTER*1
+ = 'N': do not compute the right Schur vectors;
+ = 'V': compute the right Schur vectors.
+
+ SORT
+ SORT is CHARACTER*1
+ Specifies whether or not to order the eigenvalues on the
+ diagonal of the generalized Schur form.
+ = 'N': Eigenvalues are not ordered;
+ = 'S': Eigenvalues are ordered (see SELCTG).
+
+ SELCTG
+ SELCTG is procedure) LOGICAL FUNCTION of three DOUBLE PRECISION arguments
+ SELCTG must be declared EXTERNAL in the calling subroutine.
+ If SORT = 'N', SELCTG is not referenced.
+ If SORT = 'S', SELCTG is used to select eigenvalues to sort
+ to the top left of the Schur form.
+ An eigenvalue (ALPHAR(j)+ALPHAI(j))/BETA(j) is selected if
+ SELCTG(ALPHAR(j),ALPHAI(j),BETA(j)) is true; i.e. if either
+ one of a complex conjugate pair of eigenvalues is selected,
+ then both complex eigenvalues are selected.
+ Note that a selected complex eigenvalue may no longer satisfy
+ SELCTG(ALPHAR(j),ALPHAI(j),BETA(j)) = .TRUE. after ordering,
+ since ordering may change the value of complex eigenvalues
+ (especially if the eigenvalue is illconditioned), in this
+ case INFO is set to N+3.
+
+ SENSE
+ SENSE is CHARACTER*1
+ Determines which reciprocal condition numbers are computed.
+ = 'N' : None are computed;
+ = 'E' : Computed for average of selected eigenvalues only;
+ = 'V' : Computed for selected deflating subspaces only;
+ = 'B' : Computed for both.
+ If SENSE = 'E', 'V', or 'B', SORT must equal 'S'.
+
+ N
+ N is INTEGER
+ The order of the matrices A, B, VSL, and VSR. N >= 0.
+
+ A
+ A is DOUBLE PRECISION array, dimension (LDA, N)
+ On entry, the first of the pair of matrices.
+ On exit, A has been overwritten by its generalized Schur form S.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of A. LDA >= max(1,N).
+
+ B
+ B is DOUBLE PRECISION array, dimension (LDB, N)
+ On entry, the second of the pair of matrices.
+ On exit, B has been overwritten by its generalized Schur form T.
+
+ LDB
+ LDB is INTEGER
+ The leading dimension of B. LDB >= max(1,N).
+
+ SDIM
+ SDIM is INTEGER
+ If SORT = 'N', SDIM = 0.
+ If SORT = 'S', SDIM = number of eigenvalues (after sorting)
+ for which SELCTG is true. (Complex conjugate pairs for which
+ SELCTG is true for either eigenvalue count as 2.)
+
+ ALPHAR
+ ALPHAR is DOUBLE PRECISION array, dimension (N)
+
+ ALPHAI
+ ALPHAI is DOUBLE PRECISION array, dimension (N)
+
+ BETA
+ BETA is DOUBLE PRECISION array, dimension (N)
+ On exit, (ALPHAR(j) + ALPHAI(j)*i)/BETA(j), j=1,...,N, will
+ be the generalized eigenvalues. ALPHAR(j) + ALPHAI(j)*i
+ and BETA(j),j=1,...,N are the diagonals of the complex Schur
+ form (S,T) that would result if the 2by2 diagonal blocks of
+ the real Schur form of (A,B) were further reduced to
+ triangular form using 2by2 complex unitary transformations.
+ If ALPHAI(j) is zero, then the jth eigenvalue is real; if
+ positive, then the jth and (j+1)st eigenvalues are a
+ complex conjugate pair, with ALPHAI(j+1) negative.
+
+ Note: the quotients ALPHAR(j)/BETA(j) and ALPHAI(j)/BETA(j)
+ may easily over or underflow, and BETA(j) may even be zero.
+ Thus, the user should avoid naively computing the ratio.
+ However, ALPHAR and ALPHAI will be always less than and
+ usually comparable with norm(A) in magnitude, and BETA always
+ less than and usually comparable with norm(B).
+
+ VSL
+ VSL is DOUBLE PRECISION array, dimension (LDVSL,N)
+ If JOBVSL = 'V', VSL will contain the left Schur vectors.
+ Not referenced if JOBVSL = 'N'.
+
+ LDVSL
+ LDVSL is INTEGER
+ The leading dimension of the matrix VSL. LDVSL >=1, and
+ if JOBVSL = 'V', LDVSL >= N.
+
+ VSR
+ VSR is DOUBLE PRECISION array, dimension (LDVSR,N)
+ If JOBVSR = 'V', VSR will contain the right Schur vectors.
+ Not referenced if JOBVSR = 'N'.
+
+ LDVSR
+ LDVSR is INTEGER
+ The leading dimension of the matrix VSR. LDVSR >= 1, and
+ if JOBVSR = 'V', LDVSR >= N.
+
+ RCONDE
+ RCONDE is DOUBLE PRECISION array, dimension ( 2 )
+ If SENSE = 'E' or 'B', RCONDE(1) and RCONDE(2) contain the
+ reciprocal condition numbers for the average of the selected eigenvalues.
+ Not referenced if SENSE = 'N' or 'V'.
+
+ RCONDV
+ RCONDV is DOUBLE PRECISION array, dimension ( 2 )
+ If SENSE = 'V' or 'B', RCONDV(1) and RCONDV(2) contain the
+ reciprocal condition numbers for the selected deflating subspaces.
+ Not referenced if SENSE = 'N' or 'E'.
+
+ WORK
+ WORK is DOUBLE PRECISION array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK.
+ If N = 0, LWORK >= 1, else if SENSE = 'E', 'V', or 'B',
+ LWORK >= max( 8*N, 6*N+16, 2*SDIM*(NSDIM) ), else
+ LWORK >= max( 8*N, 6*N+16 ).
+ Note that 2*SDIM*(NSDIM) <= N*N/2.
+ Note also that an error is only returned if
+ LWORK < max( 8*N, 6*N+16), but if SENSE = 'E' or 'V' or 'B'
+ this may not be large enough.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the bound on the optimal size of the WORK
+ array and the minimum size of the IWORK array, returns these
+ values as the first entries of the WORK and IWORK arrays, and
+ no error message related to LWORK or LIWORK is issued by XERBLA.
+
+ IWORK
+ IWORK is INTEGER array, dimension (MAX(1,LIWORK))
+ On exit, if INFO = 0, IWORK(1) returns the minimum LIWORK.
+
+ LIWORK
+ LIWORK is INTEGER
+ The dimension of the array IWORK.
+ If SENSE = 'N' or N = 0, LIWORK >= 1, otherwise
+ LIWORK >= N+6.
+
+ If LIWORK = 1, then a workspace query is assumed; the
+ routine only calculates the bound on the optimal size of the
+ WORK array and the minimum size of the IWORK array, returns
+ these values as the first entries of the WORK and IWORK
+ arrays, and no error message related to LWORK or LIWORK is issued by XERBLA.
+
+ BWORK
+ BWORK is LOGICAL array, dimension (N)
+ Not referenced if SORT = 'N'.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value.
+ = 1,...,N:
+ The QZ iteration failed. (A,B) are not in Schur
+ form, but ALPHAR(j), ALPHAI(j), and BETA(j) should
+ be correct for j=INFO+1,...,N.
+ > N: =N+1: other than QZ iteration failed in DHGEQZ
+ =N+2: after reordering, roundoff changed values of
+ some complex eigenvalues so that leading
+ eigenvalues in the Generalized Schur form no
+ longer satisfy SELCTG=.TRUE. This could also
+ be caused due to scaling.
+ =N+3: reordering failed in DTGSEN.
+
+Further Details:
+
+ An approximate (asymptotic) bound on the average absolute error of
+ the selected eigenvalues is
+
+ EPS * norm((A, B)) / RCONDE( 1 ).
+
+ An approximate (asymptotic) bound on the maximum angular error in
+ the computed deflating subspaces is
+
+ EPS * norm((A, B)) / RCONDV( 2 ).
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{dggesx.f}
+\index{dggesx.f}
+\begin{chunk}{dggesx.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK dggesx}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{dggev}
+\label{dggev}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{dggev.input}
+)set break resume
+)sys rm f dggev.output
+)spool dggev.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{dggev.help}
+====================================================================
+dggev examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine dggev (JOBVL, JOBVR, N, A, LDA, B, LDB, ALPHAR, ALPHAI,
+ BETA, VL, LDVL, VR, LDVR, WORK, LWORK, INFO)
+ DGGEV computes the eigenvalues and, optionally, the left and/or
+ right eigenvectors for GE matrices
+
+Function/Subroutine Documentation
+ subroutine dggev (character JOBVL, character JOBVR, integer N, double
+ precision, dimension( lda, * ) A, integer LDA, double precision,
+ dimension( ldb, * ) B, integer LDB, double precision, dimension( * )
+ ALPHAR, double precision, dimension( * ) ALPHAI, double precision,
+ dimension( * ) BETA, double precision, dimension( ldvl, * ) VL, integer
+ LDVL, double precision, dimension( ldvr, * ) VR, integer LDVR, double
+ precision, dimension( * ) WORK, integer LWORK, integer INFO)
+ DGGEV computes the eigenvalues and, optionally, the left and/or right
+ eigenvectors for GE matrices
+
+Purpose:
+ DGGEV computes for a pair of NbyN real nonsymmetric matrices (A,B)
+ the generalized eigenvalues, and optionally, the left and/or right
+ generalized eigenvectors.
+
+ A generalized eigenvalue for a pair of matrices (A,B) is a scalar
+ lambda or a ratio alpha/beta = lambda, such that A  lambda*B is
+ singular. It is usually represented as the pair (alpha,beta), as
+ there is a reasonable interpretation for beta=0, and even for both
+ being zero.
+
+ The right eigenvector v(j) corresponding to the eigenvalue lambda(j)
+ of (A,B) satisfies
+
+ A * v(j) = lambda(j) * B * v(j).
+
+ The left eigenvector u(j) corresponding to the eigenvalue lambda(j)
+ of (A,B) satisfies
+
+ u(j)**H * A = lambda(j) * u(j)**H * B .
+
+ where u(j)**H is the conjugatetranspose of u(j).
+
+Parameters:
+
+ JOBVL
+ JOBVL is CHARACTER*1
+ = 'N': do not compute the left generalized eigenvectors;
+ = 'V': compute the left generalized eigenvectors.
+
+ JOBVR
+ JOBVR is CHARACTER*1
+ = 'N': do not compute the right generalized eigenvectors;
+ = 'V': compute the right generalized eigenvectors.
+
+ N
+ N is INTEGER
+ The order of the matrices A, B, VL, and VR. N >= 0.
+
+ A
+ A is DOUBLE PRECISION array, dimension (LDA, N)
+ On entry, the matrix A in the pair (A,B).
+ On exit, A has been overwritten.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of A. LDA >= max(1,N).
+
+ B
+ B is DOUBLE PRECISION array, dimension (LDB, N)
+ On entry, the matrix B in the pair (A,B).
+ On exit, B has been overwritten.
+
+ LDB
+ LDB is INTEGER
+ The leading dimension of B. LDB >= max(1,N).
+
+ ALPHAR
+ ALPHAR is DOUBLE PRECISION array, dimension (N)
+
+ ALPHAI
+ ALPHAI is DOUBLE PRECISION array, dimension (N)
+
+ BETA
+ BETA is DOUBLE PRECISION array, dimension (N)
+ On exit, (ALPHAR(j) + ALPHAI(j)*i)/BETA(j), j=1,...,N, will
+ be the generalized eigenvalues. If ALPHAI(j) is zero, then
+ the jth eigenvalue is real; if positive, then the jth and
+ (j+1)st eigenvalues are a complex conjugate pair, with
+ ALPHAI(j+1) negative.
+
+ Note: the quotients ALPHAR(j)/BETA(j) and ALPHAI(j)/BETA(j)
+ may easily over or underflow, and BETA(j) may even be zero.
+ Thus, the user should avoid naively computing the ratio
+ alpha/beta. However, ALPHAR and ALPHAI will be always less
+ than and usually comparable with norm(A) in magnitude, and
+ BETA always less than and usually comparable with norm(B).
+
+ VL
+ VL is DOUBLE PRECISION array, dimension (LDVL,N)
+ If JOBVL = 'V', the left eigenvectors u(j) are stored one
+ after another in the columns of VL, in the same order as
+ their eigenvalues. If the jth eigenvalue is real, then
+ u(j) = VL(:,j), the jth column of VL. If the jth and
+ (j+1)th eigenvalues form a complex conjugate pair, then
+ u(j) = VL(:,j)+i*VL(:,j+1) and u(j+1) = VL(:,j)i*VL(:,j+1).
+ Each eigenvector is scaled so the largest component has
+ abs(real part)+abs(imag. part)=1.
+ Not referenced if JOBVL = 'N'.
+
+ LDVL
+ LDVL is INTEGER
+ The leading dimension of the matrix VL. LDVL >= 1, and
+ if JOBVL = 'V', LDVL >= N.
+
+ VR
+ VR is DOUBLE PRECISION array, dimension (LDVR,N)
+ If JOBVR = 'V', the right eigenvectors v(j) are stored one
+ after another in the columns of VR, in the same order as
+ their eigenvalues. If the jth eigenvalue is real, then
+ v(j) = VR(:,j), the jth column of VR. If the jth and
+ (j+1)th eigenvalues form a complex conjugate pair, then
+ v(j) = VR(:,j)+i*VR(:,j+1) and v(j+1) = VR(:,j)i*VR(:,j+1).
+ Each eigenvector is scaled so the largest component has
+ abs(real part)+abs(imag. part)=1.
+ Not referenced if JOBVR = 'N'.
+
+ LDVR
+ LDVR is INTEGER
+ The leading dimension of the matrix VR. LDVR >= 1, and
+ if JOBVR = 'V', LDVR >= N.
+
+ WORK
+ WORK is DOUBLE PRECISION array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK. LWORK >= max(1,8*N).
+ For good performance, LWORK must generally be larger.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value.
+ = 1,...,N:
+ The QZ iteration failed. No eigenvectors have been
+ calculated, but ALPHAR(j), ALPHAI(j), and BETA(j)
+ should be correct for j=INFO+1,...,N.
+ > N: =N+1: other than QZ iteration failed in DHGEQZ.
+ =N+2: error return from DTGEVC.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{dggev.f}
+\index{dggev.f}
+\begin{chunk}{dggev.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK dggev}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{dggev3}
+\label{dggev3}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{dggev3.input}
+)set break resume
+)sys rm f dggev3.output
+)spool dggev3.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{dggev3.help}
+====================================================================
+dggev3 examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine dggev3 (JOBVL, JOBVR, N, A, LDA, B, LDB, ALPHAR, ALPHAI,
+ BETA, VL, LDVL, VR, LDVR, WORK, LWORK, INFO)
+ DGGEV3 computes the eigenvalues and, optionally, the left and/or
+ right eigenvectors for GE matrices (blocked algorithm)
+
+Function/Subroutine Documentation
+ subroutine dggev3 (character JOBVL, character JOBVR, integer N, double
+ precision, dimension( lda, * ) A, integer LDA, double precision,
+ dimension( ldb, * ) B, integer LDB, double precision, dimension( * )
+ ALPHAR, double precision, dimension( * ) ALPHAI, double precision,
+ dimension( * ) BETA, double precision, dimension( ldvl, * ) VL, integer
+ LDVL, double precision, dimension( ldvr, * ) VR, integer LDVR, double
+ precision, dimension( * ) WORK, integer LWORK, integer INFO)
+ DGGEV3 computes the eigenvalues and, optionally, the left and/or right
+ eigenvectors for GE matrices (blocked algorithm)
+
+Purpose:
+ DGGEV3 computes for a pair of NbyN real nonsymmetric matrices (A,B)
+ the generalized eigenvalues, and optionally, the left and/or right
+ generalized eigenvectors.
+
+ A generalized eigenvalue for a pair of matrices (A,B) is a scalar
+ lambda or a ratio alpha/beta = lambda, such that A  lambda*B is
+ singular. It is usually represented as the pair (alpha,beta), as
+ there is a reasonable interpretation for beta=0, and even for both
+ being zero.
+
+ The right eigenvector v(j) corresponding to the eigenvalue lambda(j)
+ of (A,B) satisfies
+
+ A * v(j) = lambda(j) * B * v(j).
+
+ The left eigenvector u(j) corresponding to the eigenvalue lambda(j)
+ of (A,B) satisfies
+
+ u(j)**H * A = lambda(j) * u(j)**H * B .
+
+ where u(j)**H is the conjugatetranspose of u(j).
+
+Parameters:
+
+ JOBVL
+ JOBVL is CHARACTER*1
+ = 'N': do not compute the left generalized eigenvectors;
+ = 'V': compute the left generalized eigenvectors.
+
+ JOBVR
+ JOBVR is CHARACTER*1
+ = 'N': do not compute the right generalized eigenvectors;
+ = 'V': compute the right generalized eigenvectors.
+
+ N
+ N is INTEGER
+ The order of the matrices A, B, VL, and VR. N >= 0.
+
+ A
+ A is DOUBLE PRECISION array, dimension (LDA, N)
+ On entry, the matrix A in the pair (A,B).
+ On exit, A has been overwritten.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of A. LDA >= max(1,N).
+
+ B
+ B is DOUBLE PRECISION array, dimension (LDB, N)
+ On entry, the matrix B in the pair (A,B).
+ On exit, B has been overwritten.
+
+ LDB
+ LDB is INTEGER
+ The leading dimension of B. LDB >= max(1,N).
+
+ ALPHAR
+ ALPHAR is DOUBLE PRECISION array, dimension (N)
+
+ ALPHAI
+ ALPHAI is DOUBLE PRECISION array, dimension (N)
+
+ BETA
+ BETA is DOUBLE PRECISION array, dimension (N)
+ On exit, (ALPHAR(j) + ALPHAI(j)*i)/BETA(j), j=1,...,N, will
+ be the generalized eigenvalues. If ALPHAI(j) is zero, then
+ the jth eigenvalue is real; if positive, then the jth and
+ (j+1)st eigenvalues are a complex conjugate pair, with
+ ALPHAI(j+1) negative.
+
+ Note: the quotients ALPHAR(j)/BETA(j) and ALPHAI(j)/BETA(j)
+ may easily over or underflow, and BETA(j) may even be zero.
+ Thus, the user should avoid naively computing the ratio
+ alpha/beta. However, ALPHAR and ALPHAI will be always less
+ than and usually comparable with norm(A) in magnitude, and
+ BETA always less than and usually comparable with norm(B).
+
+ VL
+ VL is DOUBLE PRECISION array, dimension (LDVL,N)
+ If JOBVL = 'V', the left eigenvectors u(j) are stored one
+ after another in the columns of VL, in the same order as
+ their eigenvalues. If the jth eigenvalue is real, then
+ u(j) = VL(:,j), the jth column of VL. If the jth and
+ (j+1)th eigenvalues form a complex conjugate pair, then
+ u(j) = VL(:,j)+i*VL(:,j+1) and u(j+1) = VL(:,j)i*VL(:,j+1).
+ Each eigenvector is scaled so the largest component has
+ abs(real part)+abs(imag. part)=1.
+ Not referenced if JOBVL = 'N'.
+
+ LDVL
+ LDVL is INTEGER
+ The leading dimension of the matrix VL. LDVL >= 1, and
+ if JOBVL = 'V', LDVL >= N.
+
+ VR
+ VR is DOUBLE PRECISION array, dimension (LDVR,N)
+ If JOBVR = 'V', the right eigenvectors v(j) are stored one
+ after another in the columns of VR, in the same order as
+ their eigenvalues. If the jth eigenvalue is real, then
+ v(j) = VR(:,j), the jth column of VR. If the jth and
+ (j+1)th eigenvalues form a complex conjugate pair, then
+ v(j) = VR(:,j)+i*VR(:,j+1) and v(j+1) = VR(:,j)i*VR(:,j+1).
+ Each eigenvector is scaled so the largest component has
+ abs(real part)+abs(imag. part)=1.
+ Not referenced if JOBVR = 'N'.
+
+ LDVR
+ LDVR is INTEGER
+ The leading dimension of the matrix VR. LDVR >= 1, and
+ if JOBVR = 'V', LDVR >= N.
+
+ WORK
+ WORK is DOUBLE PRECISION array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value.
+ = 1,...,N:
+ The QZ iteration failed. No eigenvectors have been
+ calculated, but ALPHAR(j), ALPHAI(j), and BETA(j)
+ should be correct for j=INFO+1,...,N.
+ > N: =N+1: other than QZ iteration failed in DHGEQZ.
+ =N+2: error return from DTGEVC.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{dggev3.f}
+\index{dggev3.f}
+\begin{chunk}{dggev3.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK dggev3}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{dggevx}
+\label{dggevx}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{dggevx.input}
+)set break resume
+)sys rm f dggevx.output
+)spool dggevx.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{dggevx.help}
+====================================================================
+dggevx examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine dggevx (BALANC, JOBVL, JOBVR, SENSE, N, A, LDA, B, LDB,
+ ALPHAR, ALPHAI, BETA, VL, LDVL, VR, LDVR, ILO, IHI, LSCALE, RSCALE,
+ ABNRM, BBNRM, RCONDE, RCONDV, WORK, LWORK, IWORK, BWORK, INFO)
+ DGGEVX computes the eigenvalues and, optionally, the left and/or
+ right eigenvectors for GE matrices
+
+Function/Subroutine Documentation
+ subroutine dggevx (character BALANC, character JOBVL, character JOBVR,
+ character SENSE, integer N, double precision, dimension( lda, * ) A,
+ integer LDA, double precision, dimension( ldb, * ) B, integer LDB,
+ double precision, dimension( * ) ALPHAR, double precision, dimension( *
+ ) ALPHAI, double precision, dimension( * ) BETA, double precision,
+ dimension( ldvl, * ) VL, integer LDVL, double precision, dimension(
+ ldvr, * ) VR, integer LDVR, integer ILO, integer IHI, double precision,
+ dimension( * ) LSCALE, double precision, dimension( * ) RSCALE, double
+ precision ABNRM, double precision BBNRM, double precision, dimension( *
+ ) RCONDE, double precision, dimension( * ) RCONDV, double precision,
+ dimension( * ) WORK, integer LWORK, integer, dimension( * ) IWORK,
+ logical, dimension( * ) BWORK, integer INFO)
+ DGGEVX computes the eigenvalues and, optionally, the left and/or right
+ eigenvectors for GE matrices
+
+Purpose:
+ DGGEVX computes for a pair of NbyN real nonsymmetric matrices (A,B)
+ the generalized eigenvalues, and optionally, the left and/or right
+ generalized eigenvectors.
+
+ Optionally also, it computes a balancing transformation to improve
+ the conditioning of the eigenvalues and eigenvectors (ILO, IHI,
+ LSCALE, RSCALE, ABNRM, and BBNRM), reciprocal condition numbers for
+ the eigenvalues (RCONDE), and reciprocal condition numbers for the
+ right eigenvectors (RCONDV).
+
+ A generalized eigenvalue for a pair of matrices (A,B) is a scalar
+ lambda or a ratio alpha/beta = lambda, such that A  lambda*B is
+ singular. It is usually represented as the pair (alpha,beta), as
+ there is a reasonable interpretation for beta=0, and even for both
+ being zero.
+
+ The right eigenvector v(j) corresponding to the eigenvalue lambda(j)
+ of (A,B) satisfies
+
+ A * v(j) = lambda(j) * B * v(j) .
+
+ The left eigenvector u(j) corresponding to the eigenvalue lambda(j)
+ of (A,B) satisfies
+
+ u(j)**H * A = lambda(j) * u(j)**H * B.
+
+ where u(j)**H is the conjugatetranspose of u(j).
+
+Parameters:
+
+ BALANC
+ BALANC is CHARACTER*1
+ Specifies the balance option to be performed.
+ = 'N': do not diagonally scale or permute;
+ = 'P': permute only;
+ = 'S': scale only;
+ = 'B': both permute and scale.
+ Computed reciprocal condition numbers will be for the
+ matrices after permuting and/or balancing. Permuting does
+ not change condition numbers (in exact arithmetic), but balancing does.
+
+ JOBVL
+ JOBVL is CHARACTER*1
+ = 'N': do not compute the left generalized eigenvectors;
+ = 'V': compute the left generalized eigenvectors.
+
+ JOBVR
+ JOBVR is CHARACTER*1
+ = 'N': do not compute the right generalized eigenvectors;
+ = 'V': compute the right generalized eigenvectors.
+
+ SENSE
+ SENSE is CHARACTER*1
+ Determines which reciprocal condition numbers are computed.
+ = 'N': none are computed;
+ = 'E': computed for eigenvalues only;
+ = 'V': computed for eigenvectors only;
+ = 'B': computed for eigenvalues and eigenvectors.
+
+ N
+ N is INTEGER
+ The order of the matrices A, B, VL, and VR. N >= 0.
+
+ A
+ A is DOUBLE PRECISION array, dimension (LDA, N)
+ On entry, the matrix A in the pair (A,B).
+ On exit, A has been overwritten. If JOBVL='V' or JOBVR='V'
+ or both, then A contains the first part of the real Schur
+ form of the "balanced" versions of the input A and B.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of A. LDA >= max(1,N).
+
+ B
+ B is DOUBLE PRECISION array, dimension (LDB, N)
+ On entry, the matrix B in the pair (A,B).
+ On exit, B has been overwritten. If JOBVL='V' or JOBVR='V'
+ or both, then B contains the second part of the real Schur
+ form of the "balanced" versions of the input A and B.
+
+ LDB
+ LDB is INTEGER
+ The leading dimension of B. LDB >= max(1,N).
+
+ ALPHAR
+ ALPHAR is DOUBLE PRECISION array, dimension (N)
+
+ ALPHAI
+ ALPHAI is DOUBLE PRECISION array, dimension (N)
+
+ BETA
+ BETA is DOUBLE PRECISION array, dimension (N)
+ On exit, (ALPHAR(j) + ALPHAI(j)*i)/BETA(j), j=1,...,N, will
+ be the generalized eigenvalues. If ALPHAI(j) is zero, then
+ the jth eigenvalue is real; if positive, then the jth and
+ (j+1)st eigenvalues are a complex conjugate pair, with
+ ALPHAI(j+1) negative.
+
+ Note: the quotients ALPHAR(j)/BETA(j) and ALPHAI(j)/BETA(j)
+ may easily over or underflow, and BETA(j) may even be zero.
+ Thus, the user should avoid naively computing the ratio
+ ALPHA/BETA. However, ALPHAR and ALPHAI will be always less
+ than and usually comparable with norm(A) in magnitude, and
+ BETA always less than and usually comparable with norm(B).
+
+ VL
+ VL is DOUBLE PRECISION array, dimension (LDVL,N)
+ If JOBVL = 'V', the left eigenvectors u(j) are stored one
+ after another in the columns of VL, in the same order as
+ their eigenvalues. If the jth eigenvalue is real, then
+ u(j) = VL(:,j), the jth column of VL. If the jth and
+ (j+1)th eigenvalues form a complex conjugate pair, then
+ u(j) = VL(:,j)+i*VL(:,j+1) and u(j+1) = VL(:,j)i*VL(:,j+1).
+ Each eigenvector will be scaled so the largest component have
+ abs(real part) + abs(imag. part) = 1.
+ Not referenced if JOBVL = 'N'.
+
+ LDVL
+ LDVL is INTEGER
+ The leading dimension of the matrix VL. LDVL >= 1, and
+ if JOBVL = 'V', LDVL >= N.
+
+ VR
+ VR is DOUBLE PRECISION array, dimension (LDVR,N)
+ If JOBVR = 'V', the right eigenvectors v(j) are stored one
+ after another in the columns of VR, in the same order as
+ their eigenvalues. If the jth eigenvalue is real, then
+ v(j) = VR(:,j), the jth column of VR. If the jth and
+ (j+1)th eigenvalues form a complex conjugate pair, then
+ v(j) = VR(:,j)+i*VR(:,j+1) and v(j+1) = VR(:,j)i*VR(:,j+1).
+ Each eigenvector will be scaled so the largest component have
+ abs(real part) + abs(imag. part) = 1.
+ Not referenced if JOBVR = 'N'.
+
+ LDVR
+ LDVR is INTEGER
+ The leading dimension of the matrix VR. LDVR >= 1, and
+ if JOBVR = 'V', LDVR >= N.
+
+ ILO
+ ILO is INTEGER
+
+ IHI
+ IHI is INTEGER
+ ILO and IHI are integer values such that on exit
+ A(i,j) = 0 and B(i,j) = 0 if i > j and
+ j = 1,...,ILO1 or i = IHI+1,...,N.
+ If BALANC = 'N' or 'S', ILO = 1 and IHI = N.
+
+ LSCALE
+ LSCALE is DOUBLE PRECISION array, dimension (N)
+ Details of the permutations and scaling factors applied
+ to the left side of A and B. If PL(j) is the index of the
+ row interchanged with row j, and DL(j) is the scaling
+ factor applied to row j, then
+ LSCALE(j) = PL(j) for j = 1,...,ILO1
+ = DL(j) for j = ILO,...,IHI
+ = PL(j) for j = IHI+1,...,N.
+ The order in which the interchanges are made is N to IHI+1,
+ then 1 to ILO1.
+
+ RSCALE
+ RSCALE is DOUBLE PRECISION array, dimension (N)
+ Details of the permutations and scaling factors applied
+ to the right side of A and B. If PR(j) is the index of the
+ column interchanged with column j, and DR(j) is the scaling
+ factor applied to column j, then
+ RSCALE(j) = PR(j) for j = 1,...,ILO1
+ = DR(j) for j = ILO,...,IHI
+ = PR(j) for j = IHI+1,...,N
+ The order in which the interchanges are made is N to IHI+1,
+ then 1 to ILO1.
+
+ ABNRM
+ ABNRM is DOUBLE PRECISION
+ The onenorm of the balanced matrix A.
+
+ BBNRM
+ BBNRM is DOUBLE PRECISION
+ The onenorm of the balanced matrix B.
+
+ RCONDE
+ RCONDE is DOUBLE PRECISION array, dimension (N)
+ If SENSE = 'E' or 'B', the reciprocal condition numbers of
+ the eigenvalues, stored in consecutive elements of the array.
+ For a complex conjugate pair of eigenvalues two consecutive
+ elements of RCONDE are set to the same value. Thus RCONDE(j),
+ RCONDV(j), and the jth columns of VL and VR all correspond
+ to the jth eigenpair.
+ If SENSE = 'N or 'V', RCONDE is not referenced.
+
+ RCONDV
+ RCONDV is DOUBLE PRECISION array, dimension (N)
+ If SENSE = 'V' or 'B', the estimated reciprocal condition
+ numbers of the eigenvectors, stored in consecutive elements
+ of the array. For a complex eigenvector two consecutive
+ elements of RCONDV are set to the same value. If the
+ eigenvalues cannot be reordered to compute RCONDV(j),
+ RCONDV(j) is set to 0; this can only occur when the true
+ value would be very small anyway.
+ If SENSE = 'N' or 'E', RCONDV is not referenced.
+
+ WORK
+ WORK is DOUBLE PRECISION array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK. LWORK >= max(1,2*N).
+ If BALANC = 'S' or 'B', or JOBVL = 'V', or JOBVR = 'V',
+ LWORK >= max(1,6*N).
+ If SENSE = 'E' or 'B', LWORK >= max(1,10*N).
+ If SENSE = 'V' or 'B', LWORK >= 2*N*N+8*N+16.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ IWORK
+ IWORK is INTEGER array, dimension (N+6)
+ If SENSE = 'E', IWORK is not referenced.
+
+ BWORK
+ BWORK is LOGICAL array, dimension (N)
+ If SENSE = 'N', BWORK is not referenced.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value.
+ = 1,...,N:
+ The QZ iteration failed. No eigenvectors have been
+ calculated, but ALPHAR(j), ALPHAI(j), and BETA(j)
+ should be correct for j=INFO+1,...,N.
+ > N: =N+1: other than QZ iteration failed in DHGEQZ.
+ =N+2: error return from DTGEVC.
+
+Further Details:
+ Balancing a matrix pair (A,B) includes, first, permuting rows and
+ columns to isolate eigenvalues, second, applying diagonal similarity
+ transformation to the rows and columns to make the rows and columns
+ as close in norm as possible. The computed reciprocal condition
+ numbers correspond to the balanced matrix. Permuting rows and columns
+ will not change the condition numbers (in exact arithmetic) but
+ diagonal scaling will. For further explanation of balancing, see
+ section 4.11.1.2 of LAPACK Users' Guide.
+
+ An approximate error bound on the chordal distance between the ith
+ computed generalized eigenvalue w and the corresponding exact
+ eigenvalue lambda is
+
+ chord(w, lambda) <= EPS * norm(ABNRM, BBNRM) / RCONDE(I)
+
+ An approximate error bound for the angle between the ith computed
+ eigenvector VL(i) or VR(i) is given by
+
+ EPS * norm(ABNRM, BBNRM) / DIF(i).
+
+ For further explanation of the reciprocal condition numbers RCONDE
+ and RCONDV, see section 4.11 of LAPACK User's Guide.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{dggevx.f}
+\index{dggevx.f}
+\begin{chunk}{dggevx.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK dggevx}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\chapter{LAPACK  General Matrices, Eigenvalue , Real}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{sgees}
+\label{sgees}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{sgees.input}
+)set break resume
+)sys rm f sgees.output
+)spool sgees.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{sgees.help}
+====================================================================
+sgees examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine sgees (JOBVS, SORT, SELECT, N, A, LDA, SDIM, WR, WI, VS,
+ LDVS, WORK, LWORK, BWORK, INFO)
+ SGEES computes the eigenvalues, the Schur form, and, optionally,
+ the matrix of Schur vectors for GE matrices
+
+Function/Subroutine Documentation
+ subroutine sgees (character JOBVS, character SORT, external SELECT, integer
+ N, real, dimension( lda, * ) A, integer LDA, integer SDIM, real,
+ dimension( * ) WR, real, dimension( * ) WI, real, dimension( ldvs, * )
+ VS, integer LDVS, real, dimension( * ) WORK, integer LWORK, logical,
+ dimension( * ) BWORK, integer INFO)
+ SGEES computes the eigenvalues, the Schur form, and, optionally, the
+ matrix of Schur vectors for GE matrices
+
+Purpose:
+ SGEES computes for an NbyN real nonsymmetric matrix A, the
+ eigenvalues, the real Schur form T, and, optionally, the matrix of
+ Schur vectors Z. This gives the Schur factorization A = Z*T*(Z**T).
+
+ Optionally, it also orders the eigenvalues on the diagonal of the
+ real Schur form so that selected eigenvalues are at the top left.
+ The leading columns of Z then form an orthonormal basis for the
+ invariant subspace corresponding to the selected eigenvalues.
+
+ A matrix is in real Schur form if it is upper quasitriangular with
+ 1by1 and 2by2 blocks. 2by2 blocks will be standardized in the form
+ [ a b ]
+ [ c a ]
+ where b*c < 0. The eigenvalues of such a block are a + sqrt(bc).
+
+Parameters:
+
+ JOBVS
+ JOBVS is CHARACTER*1
+ = 'N': Schur vectors are not computed;
+ = 'V': Schur vectors are computed.
+
+ SORT
+ SORT is CHARACTER*1
+ Specifies whether or not to order the eigenvalues on the
+ diagonal of the Schur form.
+ = 'N': Eigenvalues are not ordered;
+ = 'S': Eigenvalues are ordered (see SELECT).
+
+ SELECT
+ SELECT is LOGICAL FUNCTION of two REAL arguments
+ SELECT must be declared EXTERNAL in the calling subroutine.
+ If SORT = 'S', SELECT is used to select eigenvalues to sort
+ to the top left of the Schur form.
+ If SORT = 'N', SELECT is not referenced.
+ An eigenvalue WR(j)+sqrt(1)*WI(j) is selected if
+ SELECT(WR(j),WI(j)) is true; i.e., if either one of a complex
+ conjugate pair of eigenvalues is selected, then both complex
+ eigenvalues are selected.
+ Note that a selected complex eigenvalue may no longer
+ satisfy SELECT(WR(j),WI(j)) = .TRUE. after ordering, since
+ ordering may change the value of complex eigenvalues
+ (especially if the eigenvalue is illconditioned); in this
+ case INFO is set to N+2 (see INFO below).
+
+ N
+ N is INTEGER
+ The order of the matrix A. N >= 0.
+
+ A
+ A is REAL array, dimension (LDA,N)
+ On entry, the NbyN matrix A.
+ On exit, A has been overwritten by its real Schur form T.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,N).
+
+ SDIM
+ SDIM is INTEGER
+ If SORT = 'N', SDIM = 0.
+ If SORT = 'S', SDIM = number of eigenvalues (after sorting)
+ for which SELECT is true. (Complex conjugate
+ pairs for which SELECT is true for either
+ eigenvalue count as 2.)
+
+ WR
+ WR is REAL array, dimension (N)
+
+ WI
+ WI is REAL array, dimension (N)
+ WR and WI contain the real and imaginary parts,
+ respectively, of the computed eigenvalues in the same order
+ that they appear on the diagonal of the output Schur form T.
+ Complex conjugate pairs of eigenvalues will appear
+ consecutively with the eigenvalue having the positive
+ imaginary part first.
+
+ VS
+ VS is REAL array, dimension (LDVS,N)
+ If JOBVS = 'V', VS contains the orthogonal matrix Z of Schur vectors.
+ If JOBVS = 'N', VS is not referenced.
+
+ LDVS
+ LDVS is INTEGER
+ The leading dimension of the array VS. LDVS >= 1; if
+ JOBVS = 'V', LDVS >= N.
+
+ WORK
+ WORK is REAL array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) contains the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK. LWORK >= max(1,3*N).
+ For good performance, LWORK must generally be larger.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ BWORK
+ BWORK is LOGICAL array, dimension (N)
+ Not referenced if SORT = 'N'.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value.
+ > 0: if INFO = i, and i is
+ <= N: the QR algorithm failed to compute all the
+ eigenvalues; elements 1:ILO1 and i+1:N of WR and WI
+ contain those eigenvalues which have converged; if
+ JOBVS = 'V', VS contains the matrix which reduces A
+ to its partially converged Schur form.
+ = N+1: the eigenvalues could not be reordered because some
+ eigenvalues were too close to separate (the problem
+ is very illconditioned);
+ = N+2: after reordering, roundoff changed values of some
+ complex eigenvalues so that leading eigenvalues in
+ the Schur form no longer satisfy SELECT=.TRUE. This
+ could also be caused by underflow due to scaling.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{sgees.f}
+\index{sgees.f}
+\begin{chunk}{sgees.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK sgees}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{sgeesx}
+\label{sgeesx}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{sgeesx.input}
+)set break resume
+)sys rm f sgeesx.output
+)spool sgeesx.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{sgeesx.help}
+====================================================================
+sgeesx examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine sgeesx (JOBVS, SORT, SELECT, SENSE, N, A, LDA, SDIM, WR, WI,
+ VS, LDVS, RCONDE, RCONDV, WORK, LWORK, IWORK, LIWORK, BWORK, INFO)
+ SGEESX computes the eigenvalues, the Schur form, and, optionally,
+ the matrix of Schur vectors for GE matrices
+
+Function/Subroutine Documentation
+ subroutine sgeesx (character JOBVS, character SORT, external SELECT,
+ character SENSE, integer N, real, dimension( lda, * ) A, integer LDA,
+ integer SDIM, real, dimension( * ) WR, real, dimension( * ) WI, real,
+ dimension( ldvs, * ) VS, integer LDVS, real RCONDE, real RCONDV, real,
+ dimension( * ) WORK, integer LWORK, integer, dimension( * ) IWORK,
+ integer LIWORK, logical, dimension( * ) BWORK, integer INFO)
+ SGEESX computes the eigenvalues, the Schur form, and, optionally, the
+ matrix of Schur vectors for GE matrices
+
+Purpose:
+ SGEESX computes for an NbyN real nonsymmetric matrix A, the
+ eigenvalues, the real Schur form T, and, optionally, the matrix of
+ Schur vectors Z. This gives the Schur factorization A = Z*T*(Z**T).
+
+ Optionally, it also orders the eigenvalues on the diagonal of the
+ real Schur form so that selected eigenvalues are at the top left;
+ computes a reciprocal condition number for the average of the
+ selected eigenvalues (RCONDE); and computes a reciprocal condition
+ number for the right invariant subspace corresponding to the
+ selected eigenvalues (RCONDV). The leading columns of Z form an
+ orthonormal basis for this invariant subspace.
+
+ For further explanation of the reciprocal condition numbers RCONDE
+ and RCONDV, see Section 4.10 of the LAPACK Users' Guide (where
+ these quantities are called s and sep respectively).
+
+ A real matrix is in real Schur form if it is upper quasitriangular
+ with 1by1 and 2by2 blocks. 2by2 blocks will be standardized in
+ the form
+ [ a b ]
+ [ c a ]
+ where b*c < 0. The eigenvalues of such a block are a + sqrt(bc).
+
+Parameters:
+
+ JOBVS
+ JOBVS is CHARACTER*1
+ = 'N': Schur vectors are not computed;
+ = 'V': Schur vectors are computed.
+
+ SORT
+ SORT is CHARACTER*1
+ Specifies whether or not to order the eigenvalues on the
+ diagonal of the Schur form.
+ = 'N': Eigenvalues are not ordered;
+ = 'S': Eigenvalues are ordered (see SELECT).
+
+ SELECT
+ SELECT is procedure) LOGICAL FUNCTION of two REAL arguments
+ SELECT must be declared EXTERNAL in the calling subroutine.
+ If SORT = 'S', SELECT is used to select eigenvalues to sort
+ to the top left of the Schur form.
+ If SORT = 'N', SELECT is not referenced.
+ An eigenvalue WR(j)+sqrt(1)*WI(j) is selected if
+ SELECT(WR(j),WI(j)) is true; i.e., if either one of a
+ complex conjugate pair of eigenvalues is selected, then both
+ are. Note that a selected complex eigenvalue may no longer
+ satisfy SELECT(WR(j),WI(j)) = .TRUE. after ordering, since
+ ordering may change the value of complex eigenvalues
+ (especially if the eigenvalue is illconditioned); in this
+ case INFO may be set to N+3 (see INFO below).
+
+ SENSE
+ SENSE is CHARACTER*1
+ Determines which reciprocal condition numbers are computed.
+ = 'N': None are computed;
+ = 'E': Computed for average of selected eigenvalues only;
+ = 'V': Computed for selected right invariant subspace only;
+ = 'B': Computed for both.
+ If SENSE = 'E', 'V' or 'B', SORT must equal 'S'.
+
+ N
+ N is INTEGER
+ The order of the matrix A. N >= 0.
+
+ A
+ A is REAL array, dimension (LDA, N)
+ On entry, the NbyN matrix A.
+ On exit, A is overwritten by its real Schur form T.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,N).
+
+ SDIM
+ SDIM is INTEGER
+ If SORT = 'N', SDIM = 0.
+ If SORT = 'S', SDIM = number of eigenvalues (after sorting)
+ for which SELECT is true. (Complex conjugate
+ pairs for which SELECT is true for either
+ eigenvalue count as 2.)
+
+ WR
+ WR is REAL array, dimension (N)
+
+ WI
+ WI is REAL array, dimension (N)
+ WR and WI contain the real and imaginary parts, respectively,
+ of the computed eigenvalues, in the same order that they
+ appear on the diagonal of the output Schur form T. Complex
+ conjugate pairs of eigenvalues appear consecutively with the
+ eigenvalue having the positive imaginary part first.
+
+ VS
+ VS is REAL array, dimension (LDVS,N)
+ If JOBVS = 'V', VS contains the orthogonal matrix Z of Schur vectors.
+ If JOBVS = 'N', VS is not referenced.
+
+ LDVS
+ LDVS is INTEGER
+ The leading dimension of the array VS. LDVS >= 1, and if
+ JOBVS = 'V', LDVS >= N.
+
+ RCONDE
+ RCONDE is REAL
+ If SENSE = 'E' or 'B', RCONDE contains the reciprocal
+ condition number for the average of the selected eigenvalues.
+ Not referenced if SENSE = 'N' or 'V'.
+
+ RCONDV
+ RCONDV is REAL
+ If SENSE = 'V' or 'B', RCONDV contains the reciprocal
+ condition number for the selected right invariant subspace.
+ Not referenced if SENSE = 'N' or 'E'.
+
+ WORK
+ WORK is REAL array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK. LWORK >= max(1,3*N).
+ Also, if SENSE = 'E' or 'V' or 'B',
+ LWORK >= N+2*SDIM*(NSDIM), where SDIM is the number of
+ selected eigenvalues computed by this routine. Note that
+ N+2*SDIM*(NSDIM) <= N+N*N/2. Note also that an error is only
+ returned if LWORK < max(1,3*N), but if SENSE = 'E' or 'V' or
+ 'B' this may not be large enough.
+ For good performance, LWORK must generally be larger.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates upper bounds on the optimal sizes of the
+ arrays WORK and IWORK, returns these values as the first
+ entries of the WORK and IWORK arrays, and no error messages
+ related to LWORK or LIWORK are issued by XERBLA.
+
+ IWORK
+ IWORK is INTEGER array, dimension (MAX(1,LIWORK))
+ On exit, if INFO = 0, IWORK(1) returns the optimal LIWORK.
+
+ LIWORK
+ LIWORK is INTEGER
+ The dimension of the array IWORK.
+ LIWORK >= 1; if SENSE = 'V' or 'B', LIWORK >= SDIM*(NSDIM).
+ Note that SDIM*(NSDIM) <= N*N/4. Note also that an error is
+ only returned if LIWORK < 1, but if SENSE = 'V' or 'B' this
+ may not be large enough.
+
+ If LIWORK = 1, then a workspace query is assumed; the
+ routine only calculates upper bounds on the optimal sizes of
+ the arrays WORK and IWORK, returns these values as the first
+ entries of the WORK and IWORK arrays, and no error messages
+ related to LWORK or LIWORK are issued by XERBLA.
+
+ BWORK
+ BWORK is LOGICAL array, dimension (N)
+ Not referenced if SORT = 'N'.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value.
+ > 0: if INFO = i, and i is
+ <= N: the QR algorithm failed to compute all the
+ eigenvalues; elements 1:ILO1 and i+1:N of WR and WI
+ contain those eigenvalues which have converged; if
+ JOBVS = 'V', VS contains the transformation which
+ reduces A to its partially converged Schur form.
+ = N+1: the eigenvalues could not be reordered because some
+ eigenvalues were too close to separate (the problem
+ is very illconditioned);
+ = N+2: after reordering, roundoff changed values of some
+ complex eigenvalues so that leading eigenvalues in
+ the Schur form no longer satisfy SELECT=.TRUE. This
+ could also be caused by underflow due to scaling.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{sgeesx.f}
+\index{sgeesx.f}
+\begin{chunk}{sgeesx.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK sgeesx}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{sgeev}
+\label{sgeev}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{sgeev.input}
+)set break resume
+)sys rm f sgeev.output
+)spool sgeev.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{sgeev.help}
+====================================================================
+sgeev examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine sgeev (JOBVL, JOBVR, N, A, LDA, WR, WI, VL, LDVL, VR, LDVR,
+ WORK, LWORK, INFO)
+ SGEEV computes the eigenvalues and, optionally, the left and/or
+ right eigenvectors for GE matrices
+
+Function/Subroutine Documentation
+ subroutine sgeev (character JOBVL, character JOBVR, integer N, real,
+ dimension( lda, * ) A, integer LDA, real, dimension( * ) WR, real,
+ dimension( * ) WI, real, dimension( ldvl, * ) VL, integer LDVL, real,
+ dimension( ldvr, * ) VR, integer LDVR, real, dimension( * ) WORK,
+ integer LWORK, integer INFO)
+ SGEEV computes the eigenvalues and, optionally, the left and/or right
+ eigenvectors for GE matrices
+
+Purpose:
+ SGEEV computes for an NbyN real nonsymmetric matrix A, the
+ eigenvalues and, optionally, the left and/or right eigenvectors.
+
+ The right eigenvector v(j) of A satisfies
+ A * v(j) = lambda(j) * v(j)
+ where lambda(j) is its eigenvalue.
+ The left eigenvector u(j) of A satisfies
+ u(j)**H * A = lambda(j) * u(j)**H
+ where u(j)**H denotes the conjugatetranspose of u(j).
+
+ The computed eigenvectors are normalized to have Euclidean norm
+ equal to 1 and largest component real.
+
+Parameters:
+
+ JOBVL
+ JOBVL is CHARACTER*1
+ = 'N': left eigenvectors of A are not computed;
+ = 'V': left eigenvectors of A are computed.
+
+ JOBVR
+ JOBVR is CHARACTER*1
+ = 'N': right eigenvectors of A are not computed;
+ = 'V': right eigenvectors of A are computed.
+
+ N
+ N is INTEGER
+ The order of the matrix A. N >= 0.
+
+ A
+ A is REAL array, dimension (LDA,N)
+ On entry, the NbyN matrix A.
+ On exit, A has been overwritten.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,N).
+
+ WR
+ WR is REAL array, dimension (N)
+
+ WI
+ WI is REAL array, dimension (N)
+ WR and WI contain the real and imaginary parts,
+ respectively, of the computed eigenvalues. Complex
+ conjugate pairs of eigenvalues appear consecutively
+ with the eigenvalue having the positive imaginary part first.
+
+ VL
+ VL is REAL array, dimension (LDVL,N)
+ If JOBVL = 'V', the left eigenvectors u(j) are stored one
+ after another in the columns of VL, in the same order
+ as their eigenvalues.
+ If JOBVL = 'N', VL is not referenced.
+ If the jth eigenvalue is real, then u(j) = VL(:,j),
+ the jth column of VL.
+ If the jth and (j+1)st eigenvalues form a complex
+ conjugate pair, then u(j) = VL(:,j) + i*VL(:,j+1) and
+ u(j+1) = VL(:,j)  i*VL(:,j+1).
+
+ LDVL
+ LDVL is INTEGER
+ The leading dimension of the array VL. LDVL >= 1; if
+ JOBVL = 'V', LDVL >= N.
+
+ VR
+ VR is REAL array, dimension (LDVR,N)
+ If JOBVR = 'V', the right eigenvectors v(j) are stored one
+ after another in the columns of VR, in the same order
+ as their eigenvalues.
+ If JOBVR = 'N', VR is not referenced.
+ If the jth eigenvalue is real, then v(j) = VR(:,j),
+ the jth column of VR.
+ If the jth and (j+1)st eigenvalues form a complex
+ conjugate pair, then v(j) = VR(:,j) + i*VR(:,j+1) and
+ v(j+1) = VR(:,j)  i*VR(:,j+1).
+
+ LDVR
+ LDVR is INTEGER
+ The leading dimension of the array VR. LDVR >= 1; if
+ JOBVR = 'V', LDVR >= N.
+
+ WORK
+ WORK is REAL array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK. LWORK >= max(1,3*N), and
+ if JOBVL = 'V' or JOBVR = 'V', LWORK >= 4*N. For good
+ performance, LWORK must generally be larger.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value.
+ > 0: if INFO = i, the QR algorithm failed to compute all the
+ eigenvalues, and no eigenvectors have been computed;
+ elements i+1:N of WR and WI contain eigenvalues which
+ have converged.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{sgeev.f}
+\index{sgeev.f}
+\begin{chunk}{sgeev.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK sgeev}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{sgeevx}
+\label{sgeevx}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{sgeevx.input}
+)set break resume
+)sys rm f sgeevx.output
+)spool sgeevx.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{sgeevx.help}
+====================================================================
+sgeevx examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine sgeevx (BALANC, JOBVL, JOBVR, SENSE, N, A, LDA, WR, WI, VL,
+ LDVL, VR, LDVR, ILO, IHI, SCALE, ABNRM, RCONDE, RCONDV, WORK,
+ LWORK, IWORK, INFO)
+ SGEEVX computes the eigenvalues and, optionally, the left and/or
+ right eigenvectors for GE matrices
+
+Function/Subroutine Documentation
+ subroutine sgeevx (character BALANC, character JOBVL, character JOBVR,
+ character SENSE, integer N, real, dimension( lda, * ) A, integer LDA,
+ real, dimension( * ) WR, real, dimension( * ) WI, real, dimension(
+ ldvl, * ) VL, integer LDVL, real, dimension( ldvr, * ) VR, integer
+ LDVR, integer ILO, integer IHI, real, dimension( * ) SCALE, real ABNRM,
+ real, dimension( * ) RCONDE, real, dimension( * ) RCONDV, real,
+ dimension( * ) WORK, integer LWORK, integer, dimension( * ) IWORK,
+ integer INFO)
+ SGEEVX computes the eigenvalues and, optionally, the left and/or right
+ eigenvectors for GE matrices
+
+Purpose:
+ SGEEVX computes for an NbyN real nonsymmetric matrix A, the
+ eigenvalues and, optionally, the left and/or right eigenvectors.
+
+ Optionally also, it computes a balancing transformation to improve
+ the conditioning of the eigenvalues and eigenvectors (ILO, IHI,
+ SCALE, and ABNRM), reciprocal condition numbers for the eigenvalues
+ (RCONDE), and reciprocal condition numbers for the right
+ eigenvectors (RCONDV).
+
+ The right eigenvector v(j) of A satisfies
+ A * v(j) = lambda(j) * v(j)
+ where lambda(j) is its eigenvalue.
+ The left eigenvector u(j) of A satisfies
+ u(j)**H * A = lambda(j) * u(j)**H
+ where u(j)**H denotes the conjugatetranspose of u(j).
+
+ The computed eigenvectors are normalized to have Euclidean norm
+ equal to 1 and largest component real.
+
+ Balancing a matrix means permuting the rows and columns to make it
+ more nearly upper triangular, and applying a diagonal similarity
+ transformation D * A * D**(1), where D is a diagonal matrix, to
+ make its rows and columns closer in norm and the condition numbers
+ of its eigenvalues and eigenvectors smaller. The computed
+ reciprocal condition numbers correspond to the balanced matrix.
+ Permuting rows and columns will not change the condition numbers
+ (in exact arithmetic) but diagonal scaling will. For further
+ explanation of balancing, see section 4.10.2 of the LAPACK Users' Guide.
+
+Parameters:
+
+ BALANC
+ BALANC is CHARACTER*1
+ Indicates how the input matrix should be diagonally scaled
+ and/or permuted to improve the conditioning of its
+ eigenvalues.
+ = 'N': Do not diagonally scale or permute;
+ = 'P': Perform permutations to make the matrix more nearly
+ upper triangular. Do not diagonally scale;
+ = 'S': Diagonally scale the matrix, i.e. replace A by
+ D*A*D**(1), where D is a diagonal matrix chosen
+ to make the rows and columns of A more equal in
+ norm. Do not permute;
+ = 'B': Both diagonally scale and permute A.
+
+ Computed reciprocal condition numbers will be for the matrix
+ after balancing and/or permuting. Permuting does not change
+ condition numbers (in exact arithmetic), but balancing does.
+
+ JOBVL
+ JOBVL is CHARACTER*1
+ = 'N': left eigenvectors of A are not computed;
+ = 'V': left eigenvectors of A are computed.
+ If SENSE = 'E' or 'B', JOBVL must = 'V'.
+
+ JOBVR
+ JOBVR is CHARACTER*1
+ = 'N': right eigenvectors of A are not computed;
+ = 'V': right eigenvectors of A are computed.
+ If SENSE = 'E' or 'B', JOBVR must = 'V'.
+
+ SENSE
+ SENSE is CHARACTER*1
+ Determines which reciprocal condition numbers are computed.
+ = 'N': None are computed;
+ = 'E': Computed for eigenvalues only;
+ = 'V': Computed for right eigenvectors only;
+ = 'B': Computed for eigenvalues and right eigenvectors.
+
+ If SENSE = 'E' or 'B', both left and right eigenvectors
+ must also be computed (JOBVL = 'V' and JOBVR = 'V').
+
+ N
+ N is INTEGER
+ The order of the matrix A. N >= 0.
+
+ A
+ A is REAL array, dimension (LDA,N)
+ On entry, the NbyN matrix A.
+ On exit, A has been overwritten. If JOBVL = 'V' or
+ JOBVR = 'V', A contains the real Schur form of the balanced
+ version of the input matrix A.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,N).
+
+ WR
+ WR is REAL array, dimension (N)
+
+ WI
+ WI is REAL array, dimension (N)
+ WR and WI contain the real and imaginary parts,
+ respectively, of the computed eigenvalues. Complex
+ conjugate pairs of eigenvalues will appear consecutively
+ with the eigenvalue having the positive imaginary part first.
+
+ VL
+ VL is REAL array, dimension (LDVL,N)
+ If JOBVL = 'V', the left eigenvectors u(j) are stored one
+ after another in the columns of VL, in the same order
+ as their eigenvalues.
+ If JOBVL = 'N', VL is not referenced.
+ If the jth eigenvalue is real, then u(j) = VL(:,j),
+ the jth column of VL.
+ If the jth and (j+1)st eigenvalues form a complex
+ conjugate pair, then u(j) = VL(:,j) + i*VL(:,j+1) and
+ u(j+1) = VL(:,j)  i*VL(:,j+1).
+
+ LDVL
+ LDVL is INTEGER
+ The leading dimension of the array VL. LDVL >= 1; if
+ JOBVL = 'V', LDVL >= N.
+
+ VR
+ VR is REAL array, dimension (LDVR,N)
+ If JOBVR = 'V', the right eigenvectors v(j) are stored one
+ after another in the columns of VR, in the same order
+ as their eigenvalues.
+ If JOBVR = 'N', VR is not referenced.
+ If the jth eigenvalue is real, then v(j) = VR(:,j),
+ the jth column of VR.
+ If the jth and (j+1)st eigenvalues form a complex
+ conjugate pair, then v(j) = VR(:,j) + i*VR(:,j+1) and
+ v(j+1) = VR(:,j)  i*VR(:,j+1).
+
+ LDVR
+ LDVR is INTEGER
+ The leading dimension of the array VR. LDVR >= 1, and if
+ JOBVR = 'V', LDVR >= N.
+
+ ILO
+ ILO is INTEGER
+
+ IHI
+ IHI is INTEGER
+ ILO and IHI are integer values determined when A was
+ balanced. The balanced A(i,j) = 0 if I > J and
+ J = 1,...,ILO1 or I = IHI+1,...,N.
+
+ SCALE
+ SCALE is REAL array, dimension (N)
+ Details of the permutations and scaling factors applied
+ when balancing A. If P(j) is the index of the row and column
+ interchanged with row and column j, and D(j) is the scaling
+ factor applied to row and column j, then
+ SCALE(J) = P(J), for J = 1,...,ILO1
+ = D(J), for J = ILO,...,IHI
+ = P(J) for J = IHI+1,...,N.
+ The order in which the interchanges are made is N to IHI+1,
+ then 1 to ILO1.
+
+ ABNRM
+ ABNRM is REAL
+ The onenorm of the balanced matrix (the maximum
+ of the sum of absolute values of elements of any column).
+
+ RCONDE
+ RCONDE is REAL array, dimension (N)
+ RCONDE(j) is the reciprocal condition number of the jth eigenvalue.
+
+ RCONDV
+ RCONDV is REAL array, dimension (N)
+ RCONDV(j) is the reciprocal condition number of the jth
+ right eigenvector.
+
+ WORK
+ WORK is REAL array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK. If SENSE = 'N' or 'E',
+ LWORK >= max(1,2*N), and if JOBVL = 'V' or JOBVR = 'V',
+ LWORK >= 3*N. If SENSE = 'V' or 'B', LWORK >= N*(N+6).
+ For good performance, LWORK must generally be larger.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ IWORK
+ IWORK is INTEGER array, dimension (2*N2)
+ If SENSE = 'N' or 'E', not referenced.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value.
+ > 0: if INFO = i, the QR algorithm failed to compute all the
+ eigenvalues, and no eigenvectors or condition numbers
+ have been computed; elements 1:ILO1 and i+1:N of WR
+ and WI contain eigenvalues which have converged.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{sgeevx.f}
+\index{sgeevx.f}
+\begin{chunk}{sgeevx.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK sgeevx}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{sgegs  DEPRECATED use sgges}
+\label{sgegs}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{sgegv  DEPRECATED use sggev}
+\label{sgegv}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{sgges}
+\label{sgges}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{sgges.input}
+)set break resume
+)sys rm f sgges.output
+)spool sgges.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{sgges.help}
+====================================================================
+sgges examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine sgges (JOBVSL, JOBVSR, SORT, SELCTG, N, A, LDA, B, LDB,
+ SDIM, ALPHAR, ALPHAI, BETA, VSL, LDVSL, VSR, LDVSR, WORK, LWORK,
+ BWORK, INFO)
+ SGGES computes the eigenvalues, the Schur form, and, optionally,
+ the matrix of Schur vectors for GE matrices
+
+Function/Subroutine Documentation
+ subroutine sgges (character JOBVSL, character JOBVSR, character SORT,
+ external SELCTG, integer N, real, dimension( lda, * ) A, integer LDA,
+ real, dimension( ldb, * ) B, integer LDB, integer SDIM, real,
+ dimension( * ) ALPHAR, real, dimension( * ) ALPHAI, real, dimension( *
+ ) BETA, real, dimension( ldvsl, * ) VSL, integer LDVSL, real,
+ dimension( ldvsr, * ) VSR, integer LDVSR, real, dimension( * ) WORK,
+ integer LWORK, logical, dimension( * ) BWORK, integer INFO)
+ SGGES computes the eigenvalues, the Schur form, and, optionally, the
+ matrix of Schur vectors for GE matrices
+
+Purpose:
+ SGGES computes for a pair of NbyN real nonsymmetric matrices (A,B),
+ the generalized eigenvalues, the generalized real Schur form (S,T),
+ optionally, the left and/or right matrices of Schur vectors (VSL and
+ VSR). This gives the generalized Schur factorization
+
+ (A,B) = ( (VSL)*S*(VSR)**T, (VSL)*T*(VSR)**T )
+
+ Optionally, it also orders the eigenvalues so that a selected cluster
+ of eigenvalues appears in the leading diagonal blocks of the upper
+ quasitriangular matrix S and the upper triangular matrix T.The
+ leading columns of VSL and VSR then form an orthonormal basis for the
+ corresponding left and right eigenspaces (deflating subspaces).
+
+ (If only the generalized eigenvalues are needed, use the driver
+ SGGEV instead, which is faster.)
+
+ A generalized eigenvalue for a pair of matrices (A,B) is a scalar w
+ or a ratio alpha/beta = w, such that A  w*B is singular. It is
+ usually represented as the pair (alpha,beta), as there is a
+ reasonable interpretation for beta=0 or both being zero.
+
+ A pair of matrices (S,T) is in generalized real Schur form if T is
+ upper triangular with nonnegative diagonal and S is block upper
+ triangular with 1by1 and 2by2 blocks. 1by1 blocks correspond
+ to real generalized eigenvalues, while 2by2 blocks of S will be
+ "standardized" by making the corresponding elements of T have the form:
+ [ a 0 ]
+ [ 0 b ]
+
+ and the pair of corresponding 2by2 blocks in S and T will have a
+ complex conjugate pair of generalized eigenvalues.
+
+Parameters:
+
+ JOBVSL
+ JOBVSL is CHARACTER*1
+ = 'N': do not compute the left Schur vectors;
+ = 'V': compute the left Schur vectors.
+
+ JOBVSR
+ JOBVSR is CHARACTER*1
+ = 'N': do not compute the right Schur vectors;
+ = 'V': compute the right Schur vectors.
+
+ SORT
+ SORT is CHARACTER*1
+ Specifies whether or not to order the eigenvalues on the
+ diagonal of the generalized Schur form.
+ = 'N': Eigenvalues are not ordered;
+ = 'S': Eigenvalues are ordered (see SELCTG);
+
+ SELCTG
+ SELCTG is a LOGICAL FUNCTION of three REAL arguments
+ SELCTG must be declared EXTERNAL in the calling subroutine.
+ If SORT = 'N', SELCTG is not referenced.
+ If SORT = 'S', SELCTG is used to select eigenvalues to sort
+ to the top left of the Schur form.
+ An eigenvalue (ALPHAR(j)+ALPHAI(j))/BETA(j) is selected if
+ SELCTG(ALPHAR(j),ALPHAI(j),BETA(j)) is true; i.e. if either
+ one of a complex conjugate pair of eigenvalues is selected,
+ then both complex eigenvalues are selected.
+
+ Note that in the illconditioned case, a selected complex
+ eigenvalue may no longer satisfy SELCTG(ALPHAR(j),ALPHAI(j),
+ BETA(j)) = .TRUE. after ordering. INFO is to be set to N+2
+ in this case.
+
+ N
+ N is INTEGER
+ The order of the matrices A, B, VSL, and VSR. N >= 0.
+
+ A
+ A is REAL array, dimension (LDA, N)
+ On entry, the first of the pair of matrices.
+ On exit, A has been overwritten by its generalized Schur form S.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of A. LDA >= max(1,N).
+
+ B
+ B is REAL array, dimension (LDB, N)
+ On entry, the second of the pair of matrices.
+ On exit, B has been overwritten by its generalized Schur form T.
+
+ LDB
+ LDB is INTEGER
+ The leading dimension of B. LDB >= max(1,N).
+
+ SDIM
+ SDIM is INTEGER
+ If SORT = 'N', SDIM = 0.
+ If SORT = 'S', SDIM = number of eigenvalues (after sorting)
+ for which SELCTG is true. (Complex conjugate pairs for which
+ SELCTG is true for either eigenvalue count as 2.)
+
+ ALPHAR
+ ALPHAR is REAL array, dimension (N)
+
+ ALPHAI
+ ALPHAI is REAL array, dimension (N)
+
+ BETA
+ BETA is REAL array, dimension (N)
+ On exit, (ALPHAR(j) + ALPHAI(j)*i)/BETA(j), j=1,...,N, will
+ be the generalized eigenvalues. ALPHAR(j) + ALPHAI(j)*i,
+ and BETA(j),j=1,...,N are the diagonals of the complex Schur
+ form (S,T) that would result if the 2by2 diagonal blocks of
+ the real Schur form of (A,B) were further reduced to
+ triangular form using 2by2 complex unitary transformations.
+ If ALPHAI(j) is zero, then the jth eigenvalue is real; if
+ positive, then the jth and (j+1)st eigenvalues are a
+ complex conjugate pair, with ALPHAI(j+1) negative.
+
+ Note: the quotients ALPHAR(j)/BETA(j) and ALPHAI(j)/BETA(j)
+ may easily over or underflow, and BETA(j) may even be zero.
+ Thus, the user should avoid naively computing the ratio.
+ However, ALPHAR and ALPHAI will be always less than and
+ usually comparable with norm(A) in magnitude, and BETA always
+ less than and usually comparable with norm(B).
+
+ VSL
+ VSL is REAL array, dimension (LDVSL,N)
+ If JOBVSL = 'V', VSL will contain the left Schur vectors.
+ Not referenced if JOBVSL = 'N'.
+
+ LDVSL
+ LDVSL is INTEGER
+ The leading dimension of the matrix VSL. LDVSL >=1, and
+ if JOBVSL = 'V', LDVSL >= N.
+
+ VSR
+ VSR is REAL array, dimension (LDVSR,N)
+ If JOBVSR = 'V', VSR will contain the right Schur vectors.
+ Not referenced if JOBVSR = 'N'.
+
+ LDVSR
+ LDVSR is INTEGER
+ The leading dimension of the matrix VSR. LDVSR >= 1, and
+ if JOBVSR = 'V', LDVSR >= N.
+
+ WORK
+ WORK is REAL array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK.
+ If N = 0, LWORK >= 1, else LWORK >= max(8*N,6*N+16).
+ For good performance , LWORK must generally be larger.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ BWORK
+ BWORK is LOGICAL array, dimension (N)
+ Not referenced if SORT = 'N'.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value.
+ = 1,...,N:
+ The QZ iteration failed. (A,B) are not in Schur
+ form, but ALPHAR(j), ALPHAI(j), and BETA(j) should
+ be correct for j=INFO+1,...,N.
+ > N: =N+1: other than QZ iteration failed in SHGEQZ.
+ =N+2: after reordering, roundoff changed values of
+ some complex eigenvalues so that leading
+ eigenvalues in the Generalized Schur form no
+ longer satisfy SELCTG=.TRUE. This could also
+ be caused due to scaling.
+ =N+3: reordering failed in STGSEN.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{sgges.f}
+\index{sgges.f}
+\begin{chunk}{sgges.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK sgges}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{sgges3}
+\label{sgges3}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{sgges3.input}
+)set break resume
+)sys rm f sgges3.output
+)spool sgges3.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{sgges3.help}
+====================================================================
+sgges3 examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine sgges3 (JOBVSL, JOBVSR, SORT, SELCTG, N, A, LDA, B, LDB,
+ SDIM, ALPHAR, ALPHAI, BETA, VSL, LDVSL, VSR, LDVSR, WORK, LWORK,
+ BWORK, INFO)
+ SGGES3 computes the eigenvalues, the Schur form, and, optionally,
+ the matrix of Schur vectors for GE matrices (blocked algorithm)
+
+Function/Subroutine Documentation
+ subroutine sgges3 (character JOBVSL, character JOBVSR, character SORT,
+ external SELCTG, integer N, real, dimension( lda, * ) A, integer LDA,
+ real, dimension( ldb, * ) B, integer LDB, integer SDIM, real,
+ dimension( * ) ALPHAR, real, dimension( * ) ALPHAI, real, dimension( *
+ ) BETA, real, dimension( ldvsl, * ) VSL, integer LDVSL, real,
+ dimension( ldvsr, * ) VSR, integer LDVSR, real, dimension( * ) WORK,
+ integer LWORK, logical, dimension( * ) BWORK, integer INFO)
+ SGGES3 computes the eigenvalues, the Schur form, and, optionally, the
+ matrix of Schur vectors for GE matrices (blocked algorithm)
+
+Purpose:
+ SGGES3 computes for a pair of NbyN real nonsymmetric matrices (A,B),
+ the generalized eigenvalues, the generalized real Schur form (S,T),
+ optionally, the left and/or right matrices of Schur vectors (VSL and
+ VSR). This gives the generalized Schur factorization
+
+ (A,B) = ( (VSL)*S*(VSR)**T, (VSL)*T*(VSR)**T )
+
+ Optionally, it also orders the eigenvalues so that a selected cluster
+ of eigenvalues appears in the leading diagonal blocks of the upper
+ quasitriangular matrix S and the upper triangular matrix T.The
+ leading columns of VSL and VSR then form an orthonormal basis for the
+ corresponding left and right eigenspaces (deflating subspaces).
+
+ (If only the generalized eigenvalues are needed, use the driver
+ SGGEV instead, which is faster.)
+
+ A generalized eigenvalue for a pair of matrices (A,B) is a scalar w
+ or a ratio alpha/beta = w, such that A  w*B is singular. It is
+ usually represented as the pair (alpha,beta), as there is a
+ reasonable interpretation for beta=0 or both being zero.
+
+ A pair of matrices (S,T) is in generalized real Schur form if T is
+ upper triangular with nonnegative diagonal and S is block upper
+ triangular with 1by1 and 2by2 blocks. 1by1 blocks correspond
+ to real generalized eigenvalues, while 2by2 blocks of S will be
+ "standardized" by making the corresponding elements of T have the form:
+ [ a 0 ]
+ [ 0 b ]
+
+ and the pair of corresponding 2by2 blocks in S and T will have a
+ complex conjugate pair of generalized eigenvalues.
+
+Parameters:
+
+ JOBVSL
+ JOBVSL is CHARACTER*1
+ = 'N': do not compute the left Schur vectors;
+ = 'V': compute the left Schur vectors.
+
+ JOBVSR
+ JOBVSR is CHARACTER*1
+ = 'N': do not compute the right Schur vectors;
+ = 'V': compute the right Schur vectors.
+
+ SORT
+ SORT is CHARACTER*1
+ Specifies whether or not to order the eigenvalues on the
+ diagonal of the generalized Schur form.
+ = 'N': Eigenvalues are not ordered;
+ = 'S': Eigenvalues are ordered (see SELCTG);
+
+ SELCTG
+ SELCTG is a LOGICAL FUNCTION of three REAL arguments
+ SELCTG must be declared EXTERNAL in the calling subroutine.
+ If SORT = 'N', SELCTG is not referenced.
+ If SORT = 'S', SELCTG is used to select eigenvalues to sort
+ to the top left of the Schur form.
+ An eigenvalue (ALPHAR(j)+ALPHAI(j))/BETA(j) is selected if
+ SELCTG(ALPHAR(j),ALPHAI(j),BETA(j)) is true; i.e. if either
+ one of a complex conjugate pair of eigenvalues is selected,
+ then both complex eigenvalues are selected.
+
+ Note that in the illconditioned case, a selected complex
+ eigenvalue may no longer satisfy SELCTG(ALPHAR(j),ALPHAI(j),
+ BETA(j)) = .TRUE. after ordering. INFO is to be set to N+2
+ in this case.
+
+ N
+ N is INTEGER
+ The order of the matrices A, B, VSL, and VSR. N >= 0.
+
+ A
+ A is REAL array, dimension (LDA, N)
+ On entry, the first of the pair of matrices.
+ On exit, A has been overwritten by its generalized Schur form S.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of A. LDA >= max(1,N).
+
+ B
+ B is REAL array, dimension (LDB, N)
+ On entry, the second of the pair of matrices.
+ On exit, B has been overwritten by its generalized Schur form T.
+
+ LDB
+ LDB is INTEGER
+ The leading dimension of B. LDB >= max(1,N).
+
+ SDIM
+ SDIM is INTEGER
+ If SORT = 'N', SDIM = 0.
+ If SORT = 'S', SDIM = number of eigenvalues (after sorting)
+ for which SELCTG is true. (Complex conjugate pairs for which
+ SELCTG is true for either eigenvalue count as 2.)
+
+ ALPHAR
+ ALPHAR is REAL array, dimension (N)
+
+ ALPHAI
+ ALPHAI is REAL array, dimension (N)
+
+ BETA
+ BETA is REAL array, dimension (N)
+ On exit, (ALPHAR(j) + ALPHAI(j)*i)/BETA(j), j=1,...,N, will
+ be the generalized eigenvalues. ALPHAR(j) + ALPHAI(j)*i,
+ and BETA(j),j=1,...,N are the diagonals of the complex Schur
+ form (S,T) that would result if the 2by2 diagonal blocks of
+ the real Schur form of (A,B) were further reduced to
+ triangular form using 2by2 complex unitary transformations.
+ If ALPHAI(j) is zero, then the jth eigenvalue is real; if
+ positive, then the jth and (j+1)st eigenvalues are a
+ complex conjugate pair, with ALPHAI(j+1) negative.
+
+ Note: the quotients ALPHAR(j)/BETA(j) and ALPHAI(j)/BETA(j)
+ may easily over or underflow, and BETA(j) may even be zero.
+ Thus, the user should avoid naively computing the ratio.
+ However, ALPHAR and ALPHAI will be always less than and
+ usually comparable with norm(A) in magnitude, and BETA always
+ less than and usually comparable with norm(B).
+
+ VSL
+ VSL is REAL array, dimension (LDVSL,N)
+ If JOBVSL = 'V', VSL will contain the left Schur vectors.
+ Not referenced if JOBVSL = 'N'.
+
+ LDVSL
+ LDVSL is INTEGER
+ The leading dimension of the matrix VSL. LDVSL >=1, and
+ if JOBVSL = 'V', LDVSL >= N.
+
+ VSR
+ VSR is REAL array, dimension (LDVSR,N)
+ If JOBVSR = 'V', VSR will contain the right Schur vectors.
+ Not referenced if JOBVSR = 'N'.
+
+ LDVSR
+ LDVSR is INTEGER
+ The leading dimension of the matrix VSR. LDVSR >= 1, and
+ if JOBVSR = 'V', LDVSR >= N.
+
+ WORK
+ WORK is REAL array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ BWORK
+ BWORK is LOGICAL array, dimension (N)
+ Not referenced if SORT = 'N'.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value.
+ = 1,...,N:
+ The QZ iteration failed. (A,B) are not in Schur
+ form, but ALPHAR(j), ALPHAI(j), and BETA(j) should
+ be correct for j=INFO+1,...,N.
+ > N: =N+1: other than QZ iteration failed in SHGEQZ.
+ =N+2: after reordering, roundoff changed values of
+ some complex eigenvalues so that leading
+ eigenvalues in the Generalized Schur form no
+ longer satisfy SELCTG=.TRUE. This could also
+ be caused due to scaling.
+ =N+3: reordering failed in STGSEN.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{sgges3.f}
+\index{sgges3.f}
+\begin{chunk}{sgges3.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK sgges3}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{sggesx}
+\label{sggesx}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{sggesx.input}
+)set break resume
+)sys rm f sggesx.output
+)spool sggesx.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{sggesx.help}
+====================================================================
+sggesx examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine sggesx (JOBVSL, JOBVSR, SORT, SELCTG, SENSE, N, A, LDA, B,
+ LDB, SDIM, ALPHAR, ALPHAI, BETA, VSL, LDVSL, VSR, LDVSR, RCONDE,
+ RCONDV, WORK, LWORK, IWORK, LIWORK, BWORK, INFO)
+ SGGESX computes the eigenvalues, the Schur form, and, optionally,
+ the matrix of Schur vectors for GE matrices
+
+Function/Subroutine Documentation
+ subroutine sggesx (character JOBVSL, character JOBVSR, character SORT,
+ external SELCTG, character SENSE, integer N, real, dimension( lda, * )
+ A, integer LDA, real, dimension( ldb, * ) B, integer LDB, integer SDIM,
+ real, dimension( * ) ALPHAR, real, dimension( * ) ALPHAI, real,
+ dimension( * ) BETA, real, dimension( ldvsl, * ) VSL, integer LDVSL,
+ real, dimension( ldvsr, * ) VSR, integer LDVSR, real, dimension( 2 )
+ RCONDE, real, dimension( 2 ) RCONDV, real, dimension( * ) WORK, integer
+ LWORK, integer, dimension( * ) IWORK, integer LIWORK, logical,
+ dimension( * ) BWORK, integer INFO)
+ SGGESX computes the eigenvalues, the Schur form, and, optionally, the
+ matrix of Schur vectors for GE matrices
+
+Purpose:
+ SGGESX computes for a pair of NbyN real nonsymmetric matrices
+ (A,B), the generalized eigenvalues, the real Schur form (S,T), and,
+ optionally, the left and/or right matrices of Schur vectors (VSL and
+ VSR). This gives the generalized Schur factorization
+
+ (A,B) = ( (VSL) S (VSR)**T, (VSL) T (VSR)**T )
+
+ Optionally, it also orders the eigenvalues so that a selected cluster
+ of eigenvalues appears in the leading diagonal blocks of the upper
+ quasitriangular matrix S and the upper triangular matrix T; computes
+ a reciprocal condition number for the average of the selected
+ eigenvalues (RCONDE); and computes a reciprocal condition number for
+ the right and left deflating subspaces corresponding to the selected
+ eigenvalues (RCONDV). The leading columns of VSL and VSR then form
+ an orthonormal basis for the corresponding left and right eigenspaces
+ (deflating subspaces).
+
+ A generalized eigenvalue for a pair of matrices (A,B) is a scalar w
+ or a ratio alpha/beta = w, such that A  w*B is singular. It is
+ usually represented as the pair (alpha,beta), as there is a
+ reasonable interpretation for beta=0 or for both being zero.
+
+ A pair of matrices (S,T) is in generalized real Schur form if T is
+ upper triangular with nonnegative diagonal and S is block upper
+ triangular with 1by1 and 2by2 blocks. 1by1 blocks correspond
+ to real generalized eigenvalues, while 2by2 blocks of S will be
+ "standardized" by making the corresponding elements of T have the form:
+ [ a 0 ]
+ [ 0 b ]
+
+ and the pair of corresponding 2by2 blocks in S and T will have a
+ complex conjugate pair of generalized eigenvalues.
+
+Parameters:
+
+ JOBVSL
+ JOBVSL is CHARACTER*1
+ = 'N': do not compute the left Schur vectors;
+ = 'V': compute the left Schur vectors.
+
+ JOBVSR
+ JOBVSR is CHARACTER*1
+ = 'N': do not compute the right Schur vectors;
+ = 'V': compute the right Schur vectors.
+
+ SORT
+ SORT is CHARACTER*1
+ Specifies whether or not to order the eigenvalues on the
+ diagonal of the generalized Schur form.
+ = 'N': Eigenvalues are not ordered;
+ = 'S': Eigenvalues are ordered (see SELCTG).
+
+ SELCTG
+ SELCTG is procedure) LOGICAL FUNCTION of three REAL arguments
+ SELCTG must be declared EXTERNAL in the calling subroutine.
+ If SORT = 'N', SELCTG is not referenced.
+ If SORT = 'S', SELCTG is used to select eigenvalues to sort
+ to the top left of the Schur form.
+ An eigenvalue (ALPHAR(j)+ALPHAI(j))/BETA(j) is selected if
+ SELCTG(ALPHAR(j),ALPHAI(j),BETA(j)) is true; i.e. if either
+ one of a complex conjugate pair of eigenvalues is selected,
+ then both complex eigenvalues are selected.
+ Note that a selected complex eigenvalue may no longer satisfy
+ SELCTG(ALPHAR(j),ALPHAI(j),BETA(j)) = .TRUE. after ordering,
+ since ordering may change the value of complex eigenvalues
+ (especially if the eigenvalue is illconditioned), in this
+ case INFO is set to N+3.
+
+ SENSE
+ SENSE is CHARACTER*1
+ Determines which reciprocal condition numbers are computed.
+ = 'N' : None are computed;
+ = 'E' : Computed for average of selected eigenvalues only;
+ = 'V' : Computed for selected deflating subspaces only;
+ = 'B' : Computed for both.
+ If SENSE = 'E', 'V', or 'B', SORT must equal 'S'.
+
+ N
+ N is INTEGER
+ The order of the matrices A, B, VSL, and VSR. N >= 0.
+
+ A
+ A is REAL array, dimension (LDA, N)
+ On entry, the first of the pair of matrices.
+ On exit, A has been overwritten by its generalized Schur form S.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of A. LDA >= max(1,N).
+
+ B
+ B is REAL array, dimension (LDB, N)
+ On entry, the second of the pair of matrices.
+ On exit, B has been overwritten by its generalized Schur form T.
+
+ LDB
+ LDB is INTEGER
+ The leading dimension of B. LDB >= max(1,N).
+
+ SDIM
+ SDIM is INTEGER
+ If SORT = 'N', SDIM = 0.
+ If SORT = 'S', SDIM = number of eigenvalues (after sorting)
+ for which SELCTG is true. (Complex conjugate pairs for which
+ SELCTG is true for either eigenvalue count as 2.)
+
+ ALPHAR
+ ALPHAR is REAL array, dimension (N)
+
+ ALPHAI
+ ALPHAI is REAL array, dimension (N)
+
+ BETA
+ BETA is REAL array, dimension (N)
+ On exit, (ALPHAR(j) + ALPHAI(j)*i)/BETA(j), j=1,...,N, will
+ be the generalized eigenvalues. ALPHAR(j) + ALPHAI(j)*i
+ and BETA(j),j=1,...,N are the diagonals of the complex Schur
+ form (S,T) that would result if the 2by2 diagonal blocks of
+ the real Schur form of (A,B) were further reduced to
+ triangular form using 2by2 complex unitary transformations.
+ If ALPHAI(j) is zero, then the jth eigenvalue is real; if
+ positive, then the jth and (j+1)st eigenvalues are a
+ complex conjugate pair, with ALPHAI(j+1) negative.
+
+ Note: the quotients ALPHAR(j)/BETA(j) and ALPHAI(j)/BETA(j)
+ may easily over or underflow, and BETA(j) may even be zero.
+ Thus, the user should avoid naively computing the ratio.
+ However, ALPHAR and ALPHAI will be always less than and
+ usually comparable with norm(A) in magnitude, and BETA always
+ less than and usually comparable with norm(B).
+
+ VSL
+ VSL is REAL array, dimension (LDVSL,N)
+ If JOBVSL = 'V', VSL will contain the left Schur vectors.
+ Not referenced if JOBVSL = 'N'.
+
+ LDVSL
+ LDVSL is INTEGER
+ The leading dimension of the matrix VSL. LDVSL >=1, and
+ if JOBVSL = 'V', LDVSL >= N.
+
+ VSR
+ VSR is REAL array, dimension (LDVSR,N)
+ If JOBVSR = 'V', VSR will contain the right Schur vectors.
+ Not referenced if JOBVSR = 'N'.
+
+ LDVSR
+ LDVSR is INTEGER
+ The leading dimension of the matrix VSR. LDVSR >= 1, and
+ if JOBVSR = 'V', LDVSR >= N.
+
+ RCONDE
+ RCONDE is REAL array, dimension ( 2 )
+ If SENSE = 'E' or 'B', RCONDE(1) and RCONDE(2) contain the
+ reciprocal condition numbers for the average of the selected
+ eigenvalues.
+ Not referenced if SENSE = 'N' or 'V'.
+
+ RCONDV
+ RCONDV is REAL array, dimension ( 2 )
+ If SENSE = 'V' or 'B', RCONDV(1) and RCONDV(2) contain the
+ reciprocal condition numbers for the selected deflating subspaces.
+ Not referenced if SENSE = 'N' or 'E'.
+
+ WORK
+ WORK is REAL array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK.
+ If N = 0, LWORK >= 1, else if SENSE = 'E', 'V', or 'B',
+ LWORK >= max( 8*N, 6*N+16, 2*SDIM*(NSDIM) ), else
+ LWORK >= max( 8*N, 6*N+16 ).
+ Note that 2*SDIM*(NSDIM) <= N*N/2.
+ Note also that an error is only returned if
+ LWORK < max( 8*N, 6*N+16), but if SENSE = 'E' or 'V' or 'B'
+ this may not be large enough.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the bound on the optimal size of the WORK
+ array and the minimum size of the IWORK array, returns these
+ values as the first entries of the WORK and IWORK arrays, and
+ no error message related to LWORK or LIWORK is issued by XERBLA.
+
+ IWORK
+ IWORK is INTEGER array, dimension (MAX(1,LIWORK))
+ On exit, if INFO = 0, IWORK(1) returns the minimum LIWORK.
+
+ LIWORK
+ LIWORK is INTEGER
+ The dimension of the array IWORK.
+ If SENSE = 'N' or N = 0, LIWORK >= 1, otherwise
+ LIWORK >= N+6.
+
+ If LIWORK = 1, then a workspace query is assumed; the
+ routine only calculates the bound on the optimal size of the
+ WORK array and the minimum size of the IWORK array, returns
+ these values as the first entries of the WORK and IWORK
+ arrays, and no error message related to LWORK or LIWORK is
+ issued by XERBLA.
+
+ BWORK
+ BWORK is LOGICAL array, dimension (N)
+ Not referenced if SORT = 'N'.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value.
+ = 1,...,N:
+ The QZ iteration failed. (A,B) are not in Schur
+ form, but ALPHAR(j), ALPHAI(j), and BETA(j) should
+ be correct for j=INFO+1,...,N.
+ > N: =N+1: other than QZ iteration failed in SHGEQZ
+ =N+2: after reordering, roundoff changed values of
+ some complex eigenvalues so that leading
+ eigenvalues in the Generalized Schur form no
+ longer satisfy SELCTG=.TRUE. This could also
+ be caused due to scaling.
+ =N+3: reordering failed in STGSEN.
+
+Further Details:
+ An approximate (asymptotic) bound on the average absolute error of
+ the selected eigenvalues is
+
+ EPS * norm((A, B)) / RCONDE( 1 ).
+
+ An approximate (asymptotic) bound on the maximum angular error in
+ the computed deflating subspaces is
+
+ EPS * norm((A, B)) / RCONDV( 2 ).
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{sggesx.f}
+\index{sggesx.f}
+\begin{chunk}{sggesx.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK sggesx}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{sggev}
+\label{sggev}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{sggev.input}
+)set break resume
+)sys rm f sggev.output
+)spool sggev.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{sggev.help}
+====================================================================
+sggev examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine sggev (JOBVL, JOBVR, N, A, LDA, B, LDB, ALPHAR, ALPHAI,
+ BETA, VL, LDVL, VR, LDVR, WORK, LWORK, INFO)
+ SGGEV computes the eigenvalues and, optionally, the left and/or
+ right eigenvectors for GE matrices
+
+Function/Subroutine Documentation
+ subroutine sggev (character JOBVL, character JOBVR, integer N, real,
+ dimension( lda, * ) A, integer LDA, real, dimension( ldb, * ) B,
+ integer LDB, real, dimension( * ) ALPHAR, real, dimension( * ) ALPHAI,
+ real, dimension( * ) BETA, real, dimension( ldvl, * ) VL, integer LDVL,
+ real, dimension( ldvr, * ) VR, integer LDVR, real, dimension( * ) WORK,
+ integer LWORK, integer INFO)
+ SGGEV computes the eigenvalues and, optionally, the left and/or right
+ eigenvectors for GE matrices
+
+Purpose:
+ SGGEV computes for a pair of NbyN real nonsymmetric matrices (A,B)
+ the generalized eigenvalues, and optionally, the left and/or right
+ generalized eigenvectors.
+
+ A generalized eigenvalue for a pair of matrices (A,B) is a scalar
+ lambda or a ratio alpha/beta = lambda, such that A  lambda*B is
+ singular. It is usually represented as the pair (alpha,beta), as
+ there is a reasonable interpretation for beta=0, and even for both
+ being zero.
+
+ The right eigenvector v(j) corresponding to the eigenvalue lambda(j)
+ of (A,B) satisfies
+
+ A * v(j) = lambda(j) * B * v(j).
+
+ The left eigenvector u(j) corresponding to the eigenvalue lambda(j)
+ of (A,B) satisfies
+
+ u(j)**H * A = lambda(j) * u(j)**H * B .
+
+ where u(j)**H is the conjugatetranspose of u(j).
+
+Parameters:
+
+ JOBVL
+ JOBVL is CHARACTER*1
+ = 'N': do not compute the left generalized eigenvectors;
+ = 'V': compute the left generalized eigenvectors.
+
+ JOBVR
+ JOBVR is CHARACTER*1
+ = 'N': do not compute the right generalized eigenvectors;
+ = 'V': compute the right generalized eigenvectors.
+
+ N
+ N is INTEGER
+ The order of the matrices A, B, VL, and VR. N >= 0.
+
+ A
+ A is REAL array, dimension (LDA, N)
+ On entry, the matrix A in the pair (A,B).
+ On exit, A has been overwritten.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of A. LDA >= max(1,N).
+
+ B
+ B is REAL array, dimension (LDB, N)
+ On entry, the matrix B in the pair (A,B).
+ On exit, B has been overwritten.
+
+ LDB
+ LDB is INTEGER
+ The leading dimension of B. LDB >= max(1,N).
+
+ ALPHAR
+ ALPHAR is REAL array, dimension (N)
+
+ ALPHAI
+ ALPHAI is REAL array, dimension (N)
+
+ BETA
+ BETA is REAL array, dimension (N)
+ On exit, (ALPHAR(j) + ALPHAI(j)*i)/BETA(j), j=1,...,N, will
+ be the generalized eigenvalues. If ALPHAI(j) is zero, then
+ the jth eigenvalue is real; if positive, then the jth and
+ (j+1)st eigenvalues are a complex conjugate pair, with
+ ALPHAI(j+1) negative.
+
+ Note: the quotients ALPHAR(j)/BETA(j) and ALPHAI(j)/BETA(j)
+ may easily over or underflow, and BETA(j) may even be zero.
+ Thus, the user should avoid naively computing the ratio
+ alpha/beta. However, ALPHAR and ALPHAI will be always less
+ than and usually comparable with norm(A) in magnitude, and
+ BETA always less than and usually comparable with norm(B).
+
+ VL
+ VL is REAL array, dimension (LDVL,N)
+ If JOBVL = 'V', the left eigenvectors u(j) are stored one
+ after another in the columns of VL, in the same order as
+ their eigenvalues. If the jth eigenvalue is real, then
+ u(j) = VL(:,j), the jth column of VL. If the jth and
+ (j+1)th eigenvalues form a complex conjugate pair, then
+ u(j) = VL(:,j)+i*VL(:,j+1) and u(j+1) = VL(:,j)i*VL(:,j+1).
+ Each eigenvector is scaled so the largest component has
+ abs(real part)+abs(imag. part)=1.
+ Not referenced if JOBVL = 'N'.
+
+ LDVL
+ LDVL is INTEGER
+ The leading dimension of the matrix VL. LDVL >= 1, and
+ if JOBVL = 'V', LDVL >= N.
+
+ VR
+ VR is REAL array, dimension (LDVR,N)
+ If JOBVR = 'V', the right eigenvectors v(j) are stored one
+ after another in the columns of VR, in the same order as
+ their eigenvalues. If the jth eigenvalue is real, then
+ v(j) = VR(:,j), the jth column of VR. If the jth and
+ (j+1)th eigenvalues form a complex conjugate pair, then
+ v(j) = VR(:,j)+i*VR(:,j+1) and v(j+1) = VR(:,j)i*VR(:,j+1).
+ Each eigenvector is scaled so the largest component has
+ abs(real part)+abs(imag. part)=1.
+ Not referenced if JOBVR = 'N'.
+
+ LDVR
+ LDVR is INTEGER
+ The leading dimension of the matrix VR. LDVR >= 1, and
+ if JOBVR = 'V', LDVR >= N.
+
+ WORK
+ WORK is REAL array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK. LWORK >= max(1,8*N).
+ For good performance, LWORK must generally be larger.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value.
+ = 1,...,N:
+ The QZ iteration failed. No eigenvectors have been
+ calculated, but ALPHAR(j), ALPHAI(j), and BETA(j)
+ should be correct for j=INFO+1,...,N.
+ > N: =N+1: other than QZ iteration failed in SHGEQZ.
+ =N+2: error return from STGEVC.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{sggev.f}
+\index{sggev.f}
+\begin{chunk}{sggev.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK sggev}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{sggev3}
+\label{sggev3}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{sggev3.input}
+)set break resume
+)sys rm f sggev3.output
+)spool sggev3.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{sggev3.help}
+====================================================================
+sggev3 examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine sggev3 (JOBVL, JOBVR, N, A, LDA, B, LDB, ALPHAR, ALPHAI,
+ BETA, VL, LDVL, VR, LDVR, WORK, LWORK, INFO)
+ SGGEV3 computes the eigenvalues and, optionally, the left and/or
+ right eigenvectors for GE matrices (blocked algorithm)
+
+Function/Subroutine Documentation
+ subroutine sggev3 (character JOBVL, character JOBVR, integer N, real,
+ dimension( lda, * ) A, integer LDA, real, dimension( ldb, * ) B,
+ integer LDB, real, dimension( * ) ALPHAR, real, dimension( * ) ALPHAI,
+ real, dimension( * ) BETA, real, dimension( ldvl, * ) VL, integer LDVL,
+ real, dimension( ldvr, * ) VR, integer LDVR, real, dimension( * ) WORK,
+ integer LWORK, integer INFO)
+ SGGEV3 computes the eigenvalues and, optionally, the left and/or right
+ eigenvectors for GE matrices (blocked algorithm)
+
+Purpose:
+ SGGEV3 computes for a pair of NbyN real nonsymmetric matrices (A,B)
+ the generalized eigenvalues, and optionally, the left and/or right
+ generalized eigenvectors.
+
+ A generalized eigenvalue for a pair of matrices (A,B) is a scalar
+ lambda or a ratio alpha/beta = lambda, such that A  lambda*B is
+ singular. It is usually represented as the pair (alpha,beta), as
+ there is a reasonable interpretation for beta=0, and even for both
+ being zero.
+
+ The right eigenvector v(j) corresponding to the eigenvalue lambda(j)
+ of (A,B) satisfies
+
+ A * v(j) = lambda(j) * B * v(j).
+
+ The left eigenvector u(j) corresponding to the eigenvalue lambda(j)
+ of (A,B) satisfies
+
+ u(j)**H * A = lambda(j) * u(j)**H * B .
+
+ where u(j)**H is the conjugatetranspose of u(j).
+
+Parameters:
+
+ JOBVL
+ JOBVL is CHARACTER*1
+ = 'N': do not compute the left generalized eigenvectors;
+ = 'V': compute the left generalized eigenvectors.
+
+ JOBVR
+ JOBVR is CHARACTER*1
+ = 'N': do not compute the right generalized eigenvectors;
+ = 'V': compute the right generalized eigenvectors.
+
+ N
+ N is INTEGER
+ The order of the matrices A, B, VL, and VR. N >= 0.
+
+ A
+ A is REAL array, dimension (LDA, N)
+ On entry, the matrix A in the pair (A,B).
+ On exit, A has been overwritten.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of A. LDA >= max(1,N).
+
+ B
+ B is REAL array, dimension (LDB, N)
+ On entry, the matrix B in the pair (A,B).
+ On exit, B has been overwritten.
+
+ LDB
+ LDB is INTEGER
+ The leading dimension of B. LDB >= max(1,N).
+
+ ALPHAR
+ ALPHAR is REAL array, dimension (N)
+
+ ALPHAI
+ ALPHAI is REAL array, dimension (N)
+
+ BETA
+ BETA is REAL array, dimension (N)
+ On exit, (ALPHAR(j) + ALPHAI(j)*i)/BETA(j), j=1,...,N, will
+ be the generalized eigenvalues. If ALPHAI(j) is zero, then
+ the jth eigenvalue is real; if positive, then the jth and
+ (j+1)st eigenvalues are a complex conjugate pair, with
+ ALPHAI(j+1) negative.
+
+ Note: the quotients ALPHAR(j)/BETA(j) and ALPHAI(j)/BETA(j)
+ may easily over or underflow, and BETA(j) may even be zero.
+ Thus, the user should avoid naively computing the ratio
+ alpha/beta. However, ALPHAR and ALPHAI will be always less
+ than and usually comparable with norm(A) in magnitude, and
+ BETA always less than and usually comparable with norm(B).
+
+ VL
+ VL is REAL array, dimension (LDVL,N)
+ If JOBVL = 'V', the left eigenvectors u(j) are stored one
+ after another in the columns of VL, in the same order as
+ their eigenvalues. If the jth eigenvalue is real, then
+ u(j) = VL(:,j), the jth column of VL. If the jth and
+ (j+1)th eigenvalues form a complex conjugate pair, then
+ u(j) = VL(:,j)+i*VL(:,j+1) and u(j+1) = VL(:,j)i*VL(:,j+1).
+ Each eigenvector is scaled so the largest component has
+ abs(real part)+abs(imag. part)=1.
+ Not referenced if JOBVL = 'N'.
+
+ LDVL
+ LDVL is INTEGER
+ The leading dimension of the matrix VL. LDVL >= 1, and
+ if JOBVL = 'V', LDVL >= N.
+
+ VR
+ VR is REAL array, dimension (LDVR,N)
+ If JOBVR = 'V', the right eigenvectors v(j) are stored one
+ after another in the columns of VR, in the same order as
+ their eigenvalues. If the jth eigenvalue is real, then
+ v(j) = VR(:,j), the jth column of VR. If the jth and
+ (j+1)th eigenvalues form a complex conjugate pair, then
+ v(j) = VR(:,j)+i*VR(:,j+1) and v(j+1) = VR(:,j)i*VR(:,j+1).
+ Each eigenvector is scaled so the largest component has
+ abs(real part)+abs(imag. part)=1.
+ Not referenced if JOBVR = 'N'.
+
+ LDVR
+ LDVR is INTEGER
+ The leading dimension of the matrix VR. LDVR >= 1, and
+ if JOBVR = 'V', LDVR >= N.
+
+ WORK
+ WORK is REAL array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value.
+ = 1,...,N:
+ The QZ iteration failed. No eigenvectors have been
+ calculated, but ALPHAR(j), ALPHAI(j), and BETA(j)
+ should be correct for j=INFO+1,...,N.
+ > N: =N+1: other than QZ iteration failed in SHGEQZ.
+ =N+2: error return from STGEVC.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{sggev3.f}
+\index{sggev3.f}
+\begin{chunk}{sggev3.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK sggev3}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{sggevx}
+\label{sggevx}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{sggevx.input}
+)set break resume
+)sys rm f sggevx.output
+)spool sggevx.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{sggevx.help}
+====================================================================
+sggevx examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine sggevx (BALANC, JOBVL, JOBVR, SENSE, N, A, LDA, B, LDB,
+ ALPHAR, ALPHAI, BETA, VL, LDVL, VR, LDVR, ILO, IHI, LSCALE, RSCALE,
+ ABNRM, BBNRM, RCONDE, RCONDV, WORK, LWORK, IWORK, BWORK, INFO)
+ SGGEVX computes the eigenvalues and, optionally, the left and/or
+ right eigenvectors for GE matrices
+
+Function/Subroutine Documentation
+ subroutine sggevx (character BALANC, character JOBVL, character JOBVR,
+ character SENSE, integer N, real, dimension( lda, * ) A, integer LDA,
+ real, dimension( ldb, * ) B, integer LDB, real, dimension( * ) ALPHAR,
+ real, dimension( * ) ALPHAI, real, dimension( * ) BETA, real,
+ dimension( ldvl, * ) VL, integer LDVL, real, dimension( ldvr, * ) VR,
+ integer LDVR, integer ILO, integer IHI, real, dimension( * ) LSCALE,
+ real, dimension( * ) RSCALE, real ABNRM, real BBNRM, real, dimension( *
+ ) RCONDE, real, dimension( * ) RCONDV, real, dimension( * ) WORK,
+ integer LWORK, integer, dimension( * ) IWORK, logical, dimension( * )
+ BWORK, integer INFO)
+ SGGEVX computes the eigenvalues and, optionally, the left and/or right
+ eigenvectors for GE matrices
+
+Purpose:
+ SGGEVX computes for a pair of NbyN real nonsymmetric matrices (A,B)
+ the generalized eigenvalues, and optionally, the left and/or right
+ generalized eigenvectors.
+
+ Optionally also, it computes a balancing transformation to improve
+ the conditioning of the eigenvalues and eigenvectors (ILO, IHI,
+ LSCALE, RSCALE, ABNRM, and BBNRM), reciprocal condition numbers for
+ the eigenvalues (RCONDE), and reciprocal condition numbers for the
+ right eigenvectors (RCONDV).
+
+ A generalized eigenvalue for a pair of matrices (A,B) is a scalar
+ lambda or a ratio alpha/beta = lambda, such that A  lambda*B is
+ singular. It is usually represented as the pair (alpha,beta), as
+ there is a reasonable interpretation for beta=0, and even for both
+ being zero.
+
+ The right eigenvector v(j) corresponding to the eigenvalue lambda(j)
+ of (A,B) satisfies
+
+ A * v(j) = lambda(j) * B * v(j) .
+
+ The left eigenvector u(j) corresponding to the eigenvalue lambda(j)
+ of (A,B) satisfies
+
+ u(j)**H * A = lambda(j) * u(j)**H * B.
+
+ where u(j)**H is the conjugatetranspose of u(j).
+
+Parameters:
+
+ BALANC
+ BALANC is CHARACTER*1
+ Specifies the balance option to be performed.
+ = 'N': do not diagonally scale or permute;
+ = 'P': permute only;
+ = 'S': scale only;
+ = 'B': both permute and scale.
+ Computed reciprocal condition numbers will be for the
+ matrices after permuting and/or balancing. Permuting does
+ not change condition numbers (in exact arithmetic), but
+ balancing does.
+
+ JOBVL
+ JOBVL is CHARACTER*1
+ = 'N': do not compute the left generalized eigenvectors;
+ = 'V': compute the left generalized eigenvectors.
+
+ JOBVR
+ JOBVR is CHARACTER*1
+ = 'N': do not compute the right generalized eigenvectors;
+ = 'V': compute the right generalized eigenvectors.
+
+ SENSE
+ SENSE is CHARACTER*1
+ Determines which reciprocal condition numbers are computed.
+ = 'N': none are computed;
+ = 'E': computed for eigenvalues only;
+ = 'V': computed for eigenvectors only;
+ = 'B': computed for eigenvalues and eigenvectors.
+
+ N
+ N is INTEGER
+ The order of the matrices A, B, VL, and VR. N >= 0.
+
+ A
+ A is REAL array, dimension (LDA, N)
+ On entry, the matrix A in the pair (A,B).
+ On exit, A has been overwritten. If JOBVL='V' or JOBVR='V'
+ or both, then A contains the first part of the real Schur
+ form of the "balanced" versions of the input A and B.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of A. LDA >= max(1,N).
+
+ B
+ B is REAL array, dimension (LDB, N)
+ On entry, the matrix B in the pair (A,B).
+ On exit, B has been overwritten. If JOBVL='V' or JOBVR='V'
+ or both, then B contains the second part of the real Schur
+ form of the "balanced" versions of the input A and B.
+
+ LDB
+ LDB is INTEGER
+ The leading dimension of B. LDB >= max(1,N).
+
+ ALPHAR
+ ALPHAR is REAL array, dimension (N)
+
+ ALPHAI
+ ALPHAI is REAL array, dimension (N)
+
+ BETA
+ BETA is REAL array, dimension (N)
+ On exit, (ALPHAR(j) + ALPHAI(j)*i)/BETA(j), j=1,...,N, will
+ be the generalized eigenvalues. If ALPHAI(j) is zero, then
+ the jth eigenvalue is real; if positive, then the jth and
+ (j+1)st eigenvalues are a complex conjugate pair, with
+ ALPHAI(j+1) negative.
+
+ Note: the quotients ALPHAR(j)/BETA(j) and ALPHAI(j)/BETA(j)
+ may easily over or underflow, and BETA(j) may even be zero.
+ Thus, the user should avoid naively computing the ratio
+ ALPHA/BETA. However, ALPHAR and ALPHAI will be always less
+ than and usually comparable with norm(A) in magnitude, and
+ BETA always less than and usually comparable with norm(B).
+
+ VL
+ VL is REAL array, dimension (LDVL,N)
+ If JOBVL = 'V', the left eigenvectors u(j) are stored one
+ after another in the columns of VL, in the same order as
+ their eigenvalues. If the jth eigenvalue is real, then
+ u(j) = VL(:,j), the jth column of VL. If the jth and
+ (j+1)th eigenvalues form a complex conjugate pair, then
+ u(j) = VL(:,j)+i*VL(:,j+1) and u(j+1) = VL(:,j)i*VL(:,j+1).
+ Each eigenvector will be scaled so the largest component have
+ abs(real part) + abs(imag. part) = 1.
+ Not referenced if JOBVL = 'N'.
+
+ LDVL
+ LDVL is INTEGER
+ The leading dimension of the matrix VL. LDVL >= 1, and
+ if JOBVL = 'V', LDVL >= N.
+
+ VR
+ VR is REAL array, dimension (LDVR,N)
+ If JOBVR = 'V', the right eigenvectors v(j) are stored one
+ after another in the columns of VR, in the same order as
+ their eigenvalues. If the jth eigenvalue is real, then
+ v(j) = VR(:,j), the jth column of VR. If the jth and
+ (j+1)th eigenvalues form a complex conjugate pair, then
+ v(j) = VR(:,j)+i*VR(:,j+1) and v(j+1) = VR(:,j)i*VR(:,j+1).
+ Each eigenvector will be scaled so the largest component have
+ abs(real part) + abs(imag. part) = 1.
+ Not referenced if JOBVR = 'N'.
+
+ LDVR
+ LDVR is INTEGER
+ The leading dimension of the matrix VR. LDVR >= 1, and
+ if JOBVR = 'V', LDVR >= N.
+
+ ILO
+ ILO is INTEGER
+
+ IHI
+ IHI is INTEGER
+ ILO and IHI are integer values such that on exit
+ A(i,j) = 0 and B(i,j) = 0 if i > j and
+ j = 1,...,ILO1 or i = IHI+1,...,N.
+ If BALANC = 'N' or 'S', ILO = 1 and IHI = N.
+
+ LSCALE
+ LSCALE is REAL array, dimension (N)
+ Details of the permutations and scaling factors applied
+ to the left side of A and B. If PL(j) is the index of the
+ row interchanged with row j, and DL(j) is the scaling
+ factor applied to row j, then
+ LSCALE(j) = PL(j) for j = 1,...,ILO1
+ = DL(j) for j = ILO,...,IHI
+ = PL(j) for j = IHI+1,...,N.
+ The order in which the interchanges are made is N to IHI+1,
+ then 1 to ILO1.
+
+ RSCALE
+ RSCALE is REAL array, dimension (N)
+ Details of the permutations and scaling factors applied
+ to the right side of A and B. If PR(j) is the index of the
+ column interchanged with column j, and DR(j) is the scaling
+ factor applied to column j, then
+ RSCALE(j) = PR(j) for j = 1,...,ILO1
+ = DR(j) for j = ILO,...,IHI
+ = PR(j) for j = IHI+1,...,N
+ The order in which the interchanges are made is N to IHI+1,
+ then 1 to ILO1.
+
+ ABNRM
+ ABNRM is REAL
+ The onenorm of the balanced matrix A.
+
+ BBNRM
+ BBNRM is REAL
+ The onenorm of the balanced matrix B.
+
+ RCONDE
+ RCONDE is REAL array, dimension (N)
+ If SENSE = 'E' or 'B', the reciprocal condition numbers of
+ the eigenvalues, stored in consecutive elements of the array.
+ For a complex conjugate pair of eigenvalues two consecutive
+ elements of RCONDE are set to the same value. Thus RCONDE(j),
+ RCONDV(j), and the jth columns of VL and VR all correspond
+ to the jth eigenpair.
+ If SENSE = 'N' or 'V', RCONDE is not referenced.
+
+ RCONDV
+ RCONDV is REAL array, dimension (N)
+ If SENSE = 'V' or 'B', the estimated reciprocal condition
+ numbers of the eigenvectors, stored in consecutive elements
+ of the array. For a complex eigenvector two consecutive
+ elements of RCONDV are set to the same value. If the
+ eigenvalues cannot be reordered to compute RCONDV(j),
+ RCONDV(j) is set to 0; this can only occur when the true
+ value would be very small anyway.
+ If SENSE = 'N' or 'E', RCONDV is not referenced.
+
+ WORK
+ WORK is REAL array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK. LWORK >= max(1,2*N).
+ If BALANC = 'S' or 'B', or JOBVL = 'V', or JOBVR = 'V',
+ LWORK >= max(1,6*N).
+ If SENSE = 'E', LWORK >= max(1,10*N).
+ If SENSE = 'V' or 'B', LWORK >= 2*N*N+8*N+16.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ IWORK
+ IWORK is INTEGER array, dimension (N+6)
+ If SENSE = 'E', IWORK is not referenced.
+
+ BWORK
+ BWORK is LOGICAL array, dimension (N)
+ If SENSE = 'N', BWORK is not referenced.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value.
+ = 1,...,N:
+ The QZ iteration failed. No eigenvectors have been
+ calculated, but ALPHAR(j), ALPHAI(j), and BETA(j)
+ should be correct for j=INFO+1,...,N.
+ > N: =N+1: other than QZ iteration failed in SHGEQZ.
+ =N+2: error return from STGEVC.
+
+Further Details:
+ Balancing a matrix pair (A,B) includes, first, permuting rows and
+ columns to isolate eigenvalues, second, applying diagonal similarity
+ transformation to the rows and columns to make the rows and columns
+ as close in norm as possible. The computed reciprocal condition
+ numbers correspond to the balanced matrix. Permuting rows and columns
+ will not change the condition numbers (in exact arithmetic) but
+ diagonal scaling will. For further explanation of balancing, see
+ section 4.11.1.2 of LAPACK Users' Guide.
+
+ An approximate error bound on the chordal distance between the ith
+ computed generalized eigenvalue w and the corresponding exact
+ eigenvalue lambda is
+
+ chord(w, lambda) <= EPS * norm(ABNRM, BBNRM) / RCONDE(I)
+
+ An approximate error bound for the angle between the ith computed
+ eigenvector VL(i) or VR(i) is given by
+
+ EPS * norm(ABNRM, BBNRM) / DIF(i).
+
+ For further explanation of the reciprocal condition numbers RCONDE
+ and RCONDV, see section 4.11 of LAPACK User's Guide.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{sggevx.f}
+\index{sggevx.f}
+\begin{chunk}{sggevx.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK sggevx}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\chapter{LAPACK  General Matrices, Eigenvalue , Complex}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{cgees}
+\label{cgees}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{cgees.input}
+)set break resume
+)sys rm f cgees.output
+)spool cgees.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{cgees.help}
+====================================================================
+cgees examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine cgees (JOBVS, SORT, SELECT, N, A, LDA, SDIM, W, VS, LDVS,
+ WORK, LWORK, RWORK, BWORK, INFO)
+ CGEES computes the eigenvalues, the Schur form, and, optionally,
+ the matrix of Schur vectors for GE matrices
+
+Function/Subroutine Documentation
+ subroutine cgees (character JOBVS, character SORT, external SELECT, integer
+ N, complex, dimension( lda, * ) A, integer LDA, integer SDIM, complex,
+ dimension( * ) W, complex, dimension( ldvs, * ) VS, integer LDVS,
+ complex, dimension( * ) WORK, integer LWORK, real, dimension( * )
+ RWORK, logical, dimension( * ) BWORK, integer INFO)
+ CGEES computes the eigenvalues, the Schur form, and, optionally, the
+ matrix of Schur vectors for GE matrices
+
+Purpose:
+ CGEES computes for an NbyN complex nonsymmetric matrix A, the
+ eigenvalues, the Schur form T, and, optionally, the matrix of Schur
+ vectors Z. This gives the Schur factorization A = Z*T*(Z**H).
+
+ Optionally, it also orders the eigenvalues on the diagonal of the
+ Schur form so that selected eigenvalues are at the top left.
+ The leading columns of Z then form an orthonormal basis for the
+ invariant subspace corresponding to the selected eigenvalues.
+
+ A complex matrix is in Schur form if it is upper triangular.
+
+Parameters:
+
+ JOBVS
+ JOBVS is CHARACTER*1
+ = 'N': Schur vectors are not computed;
+ = 'V': Schur vectors are computed.
+
+ SORT
+ SORT is CHARACTER*1
+ Specifies whether or not to order the eigenvalues on the
+ diagonal of the Schur form.
+ = 'N': Eigenvalues are not ordered:
+ = 'S': Eigenvalues are ordered (see SELECT).
+
+ SELECT
+ SELECT is a LOGICAL FUNCTION of one COMPLEX argument
+ SELECT must be declared EXTERNAL in the calling subroutine.
+ If SORT = 'S', SELECT is used to select eigenvalues to order
+ to the top left of the Schur form.
+ IF SORT = 'N', SELECT is not referenced.
+ The eigenvalue W(j) is selected if SELECT(W(j)) is true.
+
+ N
+ N is INTEGER
+ The order of the matrix A. N >= 0.
+
+ A
+ A is COMPLEX array, dimension (LDA,N)
+ On entry, the NbyN matrix A.
+ On exit, A has been overwritten by its Schur form T.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,N).
+
+ SDIM
+ SDIM is INTEGER
+ If SORT = 'N', SDIM = 0.
+ If SORT = 'S', SDIM = number of eigenvalues for which
+ SELECT is true.
+
+ W
+ W is COMPLEX array, dimension (N)
+ W contains the computed eigenvalues, in the same order that
+ they appear on the diagonal of the output Schur form T.
+
+ VS
+ VS is COMPLEX array, dimension (LDVS,N)
+ If JOBVS = 'V', VS contains the unitary matrix Z of Schur vectors.
+ If JOBVS = 'N', VS is not referenced.
+
+ LDVS
+ LDVS is INTEGER
+ The leading dimension of the array VS. LDVS >= 1; if
+ JOBVS = 'V', LDVS >= N.
+
+ WORK
+ WORK is COMPLEX array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK. LWORK >= max(1,2*N).
+ For good performance, LWORK must generally be larger.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ RWORK
+ RWORK is REAL array, dimension (N)
+
+ BWORK
+ BWORK is LOGICAL array, dimension (N)
+ Not referenced if SORT = 'N'.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value.
+ > 0: if INFO = i, and i is
+ <= N: the QR algorithm failed to compute all the
+ eigenvalues; elements 1:ILO1 and i+1:N of W
+ contain those eigenvalues which have converged;
+ if JOBVS = 'V', VS contains the matrix which
+ reduces A to its partially converged Schur form.
+ = N+1: the eigenvalues could not be reordered because
+ some eigenvalues were too close to separate (the
+ problem is very illconditioned);
+ = N+2: after reordering, roundoff changed values of
+ some complex eigenvalues so that leading
+ eigenvalues in the Schur form no longer satisfy
+ SELECT = .TRUE.. This could also be caused by
+ underflow due to scaling.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{cgees.f}
+\index{cgees.f}
+\begin{chunk}{cgees.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK cgees}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{cgeesx}
+\label{cgeesx}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{cgeesx.input}
+)set break resume
+)sys rm f cgeesx.output
+)spool cgeesx.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{cgeesx.help}
+====================================================================
+cgeesx examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine cgeesx (JOBVS, SORT, SELECT, SENSE, N, A, LDA, SDIM, W, VS,
+ LDVS, RCONDE, RCONDV, WORK, LWORK, RWORK, BWORK, INFO)
+ CGEESX computes the eigenvalues, the Schur form, and, optionally,
+ the matrix of Schur vectors for GE matrices
+
+Function/Subroutine Documentation
+ subroutine cgeesx (character JOBVS, character SORT, external SELECT,
+ character SENSE, integer N, complex, dimension( lda, * ) A, integer
+ LDA, integer SDIM, complex, dimension( * ) W, complex, dimension( ldvs,
+ * ) VS, integer LDVS, real RCONDE, real RCONDV, complex, dimension( * )
+ WORK, integer LWORK, real, dimension( * ) RWORK, logical, dimension( *
+ ) BWORK, integer INFO)
+ CGEESX computes the eigenvalues, the Schur form, and, optionally, the
+ matrix of Schur vectors for GE matrices
+
+Purpose:
+ CGEESX computes for an NbyN complex nonsymmetric matrix A, the
+ eigenvalues, the Schur form T, and, optionally, the matrix of Schur
+ vectors Z. This gives the Schur factorization A = Z*T*(Z**H).
+
+ Optionally, it also orders the eigenvalues on the diagonal of the
+ Schur form so that selected eigenvalues are at the top left;
+ computes a reciprocal condition number for the average of the
+ selected eigenvalues (RCONDE); and computes a reciprocal condition
+ number for the right invariant subspace corresponding to the
+ selected eigenvalues (RCONDV). The leading columns of Z form an
+ orthonormal basis for this invariant subspace.
+
+ For further explanation of the reciprocal condition numbers RCONDE
+ and RCONDV, see Section 4.10 of the LAPACK Users' Guide (where
+ these quantities are called s and sep respectively).
+
+ A complex matrix is in Schur form if it is upper triangular.
+
+Parameters:
+
+ JOBVS
+ JOBVS is CHARACTER*1
+ = 'N': Schur vectors are not computed;
+ = 'V': Schur vectors are computed.
+
+ SORT
+ SORT is CHARACTER*1
+ Specifies whether or not to order the eigenvalues on the
+ diagonal of the Schur form.
+ = 'N': Eigenvalues are not ordered;
+ = 'S': Eigenvalues are ordered (see SELECT).
+
+ SELECT
+ SELECT is procedure) LOGICAL FUNCTION of one COMPLEX argument
+ SELECT must be declared EXTERNAL in the calling subroutine.
+ If SORT = 'S', SELECT is used to select eigenvalues to order
+ to the top left of the Schur form.
+ If SORT = 'N', SELECT is not referenced.
+ An eigenvalue W(j) is selected if SELECT(W(j)) is true.
+
+ SENSE
+ SENSE is CHARACTER*1
+ Determines which reciprocal condition numbers are computed.
+ = 'N': None are computed;
+ = 'E': Computed for average of selected eigenvalues only;
+ = 'V': Computed for selected right invariant subspace only;
+ = 'B': Computed for both.
+ If SENSE = 'E', 'V' or 'B', SORT must equal 'S'.
+
+ N
+ N is INTEGER
+ The order of the matrix A. N >= 0.
+
+ A
+ A is COMPLEX array, dimension (LDA, N)
+ On entry, the NbyN matrix A.
+ On exit, A is overwritten by its Schur form T.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,N).
+
+ SDIM
+ SDIM is INTEGER
+ If SORT = 'N', SDIM = 0.
+ If SORT = 'S', SDIM = number of eigenvalues for which SELECT is true.
+
+ W
+ W is COMPLEX array, dimension (N)
+ W contains the computed eigenvalues, in the same order
+ that they appear on the diagonal of the output Schur form T.
+
+ VS
+ VS is COMPLEX array, dimension (LDVS,N)
+ If JOBVS = 'V', VS contains the unitary matrix Z of Schur vectors.
+ If JOBVS = 'N', VS is not referenced.
+
+ LDVS
+ LDVS is INTEGER
+ The leading dimension of the array VS. LDVS >= 1, and if
+ JOBVS = 'V', LDVS >= N.
+
+ RCONDE
+ RCONDE is REAL
+ If SENSE = 'E' or 'B', RCONDE contains the reciprocal
+ condition number for the average of the selected eigenvalues.
+ Not referenced if SENSE = 'N' or 'V'.
+
+ RCONDV
+ RCONDV is REAL
+ If SENSE = 'V' or 'B', RCONDV contains the reciprocal
+ condition number for the selected right invariant subspace.
+ Not referenced if SENSE = 'N' or 'E'.
+
+ WORK
+ WORK is COMPLEX array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK. LWORK >= max(1,2*N).
+ Also, if SENSE = 'E' or 'V' or 'B', LWORK >= 2*SDIM*(NSDIM),
+ where SDIM is the number of selected eigenvalues computed by
+ this routine. Note that 2*SDIM*(NSDIM) <= N*N/2. Note also
+ that an error is only returned if LWORK < max(1,2*N), but if
+ SENSE = 'E' or 'V' or 'B' this may not be large enough.
+ For good performance, LWORK must generally be larger.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates upper bound on the optimal size of the
+ array WORK, returns this value as the first entry of the WORK
+ array, and no error message related to LWORK is issued by XERBLA.
+
+ RWORK
+ RWORK is REAL array, dimension (N)
+
+ BWORK
+ BWORK is LOGICAL array, dimension (N)
+ Not referenced if SORT = 'N'.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value.
+ > 0: if INFO = i, and i is
+ <= N: the QR algorithm failed to compute all the
+ eigenvalues; elements 1:ILO1 and i+1:N of W
+ contain those eigenvalues which have converged; if
+ JOBVS = 'V', VS contains the transformation which
+ reduces A to its partially converged Schur form.
+ = N+1: the eigenvalues could not be reordered because some
+ eigenvalues were too close to separate (the problem
+ is very illconditioned);
+ = N+2: after reordering, roundoff changed values of some
+ complex eigenvalues so that leading eigenvalues in
+ the Schur form no longer satisfy SELECT=.TRUE. This
+ could also be caused by underflow due to scaling.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{cgeesx.f}
+\index{cgeesx.f}
+\begin{chunk}{cgeesx.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK cgeesx}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{cgeev}
+\label{cgeev}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{cgeev.input}
+)set break resume
+)sys rm f cgeev.output
+)spool cgeev.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{cgeev.help}
+====================================================================
+cgeev examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine cgeev (JOBVL, JOBVR, N, A, LDA, W, VL, LDVL, VR, LDVR, WORK,
+ LWORK, RWORK, INFO)
+ CGEEV computes the eigenvalues and, optionally, the left and/or
+ right eigenvectors for GE matrices
+
+Function/Subroutine Documentation
+ subroutine cgeev (character JOBVL, character JOBVR, integer N, complex,
+ dimension( lda, * ) A, integer LDA, complex, dimension( * ) W, complex,
+ dimension( ldvl, * ) VL, integer LDVL, complex, dimension( ldvr, * )
+ VR, integer LDVR, complex, dimension( * ) WORK, integer LWORK, real,
+ dimension( * ) RWORK, integer INFO)
+ CGEEV computes the eigenvalues and, optionally, the left and/or right
+ eigenvectors for GE matrices
+
+Purpose:
+ CGEEV computes for an NbyN complex nonsymmetric matrix A, the
+ eigenvalues and, optionally, the left and/or right eigenvectors.
+
+ The right eigenvector v(j) of A satisfies
+ A * v(j) = lambda(j) * v(j)
+ where lambda(j) is its eigenvalue.
+
+ The left eigenvector u(j) of A satisfies
+ u(j)**H * A = lambda(j) * u(j)**H
+ where u(j)**H denotes the conjugate transpose of u(j).
+
+ The computed eigenvectors are normalized to have Euclidean norm
+ equal to 1 and largest component real.
+
+Parameters:
+
+ JOBVL
+ JOBVL is CHARACTER*1
+ = 'N': left eigenvectors of A are not computed;
+ = 'V': left eigenvectors of are computed.
+
+ JOBVR
+ JOBVR is CHARACTER*1
+ = 'N': right eigenvectors of A are not computed;
+ = 'V': right eigenvectors of A are computed.
+
+ N
+ N is INTEGER
+ The order of the matrix A. N >= 0.
+
+ A
+ A is COMPLEX array, dimension (LDA,N)
+ On entry, the NbyN matrix A.
+ On exit, A has been overwritten.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,N).
+
+ W
+ W is COMPLEX array, dimension (N)
+ W contains the computed eigenvalues.
+
+ VL
+ VL is COMPLEX array, dimension (LDVL,N)
+ If JOBVL = 'V', the left eigenvectors u(j) are stored one
+ after another in the columns of VL, in the same order
+ as their eigenvalues.
+ If JOBVL = 'N', VL is not referenced.
+ u(j) = VL(:,j), the jth column of VL.
+
+ LDVL
+ LDVL is INTEGER
+ The leading dimension of the array VL. LDVL >= 1; if
+ JOBVL = 'V', LDVL >= N.
+
+ VR
+ VR is COMPLEX array, dimension (LDVR,N)
+ If JOBVR = 'V', the right eigenvectors v(j) are stored one
+ after another in the columns of VR, in the same order
+ as their eigenvalues.
+ If JOBVR = 'N', VR is not referenced.
+ v(j) = VR(:,j), the jth column of VR.
+
+ LDVR
+ LDVR is INTEGER
+ The leading dimension of the array VR. LDVR >= 1; if
+ JOBVR = 'V', LDVR >= N.
+
+ WORK
+ WORK is COMPLEX array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK. LWORK >= max(1,2*N).
+ For good performance, LWORK must generally be larger.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ RWORK
+ RWORK is REAL array, dimension (2*N)
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value.
+ > 0: if INFO = i, the QR algorithm failed to compute all the
+ eigenvalues, and no eigenvectors have been computed;
+ elements and i+1:N of W contain eigenvalues which have converged.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{cgeev.f}
+\index{cgeev.f}
+\begin{chunk}{cgeev.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK cgeev}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{cgeevx}
+\label{cgeevx}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{cgeevx.input}
+)set break resume
+)sys rm f cgeevx.output
+)spool cgeevx.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{cgeevx.help}
+====================================================================
+cgeevx examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine cgeevx (BALANC, JOBVL, JOBVR, SENSE, N, A, LDA, W, VL, LDVL,
+ VR, LDVR, ILO, IHI, SCALE, ABNRM, RCONDE, RCONDV, WORK, LWORK,
+ RWORK, INFO)
+ CGEEVX computes the eigenvalues and, optionally, the left and/or
+ right eigenvectors for GE matrices
+
+Function/Subroutine Documentation
+ subroutine cgeevx (character BALANC, character JOBVL, character JOBVR,
+ character SENSE, integer N, complex, dimension( lda, * ) A, integer
+ LDA, complex, dimension( * ) W, complex, dimension( ldvl, * ) VL,
+ integer LDVL, complex, dimension( ldvr, * ) VR, integer LDVR, integer
+ ILO, integer IHI, real, dimension( * ) SCALE, real ABNRM, real,
+ dimension( * ) RCONDE, real, dimension( * ) RCONDV, complex, dimension(
+ * ) WORK, integer LWORK, real, dimension( * ) RWORK, integer INFO)
+ CGEEVX computes the eigenvalues and, optionally, the left and/or right
+ eigenvectors for GE matrices
+
+Purpose:
+ CGEEVX computes for an NbyN complex nonsymmetric matrix A, the
+ eigenvalues and, optionally, the left and/or right eigenvectors.
+
+ Optionally also, it computes a balancing transformation to improve
+ the conditioning of the eigenvalues and eigenvectors (ILO, IHI,
+ SCALE, and ABNRM), reciprocal condition numbers for the eigenvalues
+ (RCONDE), and reciprocal condition numbers for the right
+ eigenvectors (RCONDV).
+
+ The right eigenvector v(j) of A satisfies
+ A * v(j) = lambda(j) * v(j)
+ where lambda(j) is its eigenvalue.
+
+ The left eigenvector u(j) of A satisfies
+ u(j)**H * A = lambda(j) * u(j)**H
+ where u(j)**H denotes the conjugate transpose of u(j).
+
+ The computed eigenvectors are normalized to have Euclidean norm
+ equal to 1 and largest component real.
+
+ Balancing a matrix means permuting the rows and columns to make it
+ more nearly upper triangular, and applying a diagonal similarity
+ transformation D * A * D**(1), where D is a diagonal matrix, to
+ make its rows and columns closer in norm and the condition numbers
+ of its eigenvalues and eigenvectors smaller. The computed
+ reciprocal condition numbers correspond to the balanced matrix.
+ Permuting rows and columns will not change the condition numbers
+ (in exact arithmetic) but diagonal scaling will. For further
+ explanation of balancing, see section 4.10.2 of the LAPACK Users' Guide.
+
+Parameters:
+
+ BALANC
+ BALANC is CHARACTER*1
+ Indicates how the input matrix should be diagonally scaled
+ and/or permuted to improve the conditioning of its eigenvalues.
+ = 'N': Do not diagonally scale or permute;
+ = 'P': Perform permutations to make the matrix more nearly
+ upper triangular. Do not diagonally scale;
+ = 'S': Diagonally scale the matrix, ie. replace A by
+ D*A*D**(1), where D is a diagonal matrix chosen
+ to make the rows and columns of A more equal in
+ norm. Do not permute;
+ = 'B': Both diagonally scale and permute A.
+
+ Computed reciprocal condition numbers will be for the matrix
+ after balancing and/or permuting. Permuting does not change
+ condition numbers (in exact arithmetic), but balancing does.
+
+ JOBVL
+ JOBVL is CHARACTER*1
+ = 'N': left eigenvectors of A are not computed;
+ = 'V': left eigenvectors of A are computed.
+ If SENSE = 'E' or 'B', JOBVL must = 'V'.
+
+ JOBVR
+ JOBVR is CHARACTER*1
+ = 'N': right eigenvectors of A are not computed;
+ = 'V': right eigenvectors of A are computed.
+ If SENSE = 'E' or 'B', JOBVR must = 'V'.
+
+ SENSE
+ SENSE is CHARACTER*1
+ Determines which reciprocal condition numbers are computed.
+ = 'N': None are computed;
+ = 'E': Computed for eigenvalues only;
+ = 'V': Computed for right eigenvectors only;
+ = 'B': Computed for eigenvalues and right eigenvectors.
+
+ If SENSE = 'E' or 'B', both left and right eigenvectors
+ must also be computed (JOBVL = 'V' and JOBVR = 'V').
+
+ N
+ N is INTEGER
+ The order of the matrix A. N >= 0.
+
+ A
+ A is COMPLEX array, dimension (LDA,N)
+ On entry, the NbyN matrix A.
+ On exit, A has been overwritten. If JOBVL = 'V' or
+ JOBVR = 'V', A contains the Schur form of the balanced
+ version of the matrix A.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,N).
+
+ W
+ W is COMPLEX array, dimension (N)
+ W contains the computed eigenvalues.
+
+ VL
+ VL is COMPLEX array, dimension (LDVL,N)
+ If JOBVL = 'V', the left eigenvectors u(j) are stored one
+ after another in the columns of VL, in the same order
+ as their eigenvalues.
+ If JOBVL = 'N', VL is not referenced.
+ u(j) = VL(:,j), the jth column of VL.
+
+ LDVL
+ LDVL is INTEGER
+ The leading dimension of the array VL. LDVL >= 1; if
+ JOBVL = 'V', LDVL >= N.
+
+ VR
+ VR is COMPLEX array, dimension (LDVR,N)
+ If JOBVR = 'V', the right eigenvectors v(j) are stored one
+ after another in the columns of VR, in the same order
+ as their eigenvalues.
+ If JOBVR = 'N', VR is not referenced.
+ v(j) = VR(:,j), the jth column of VR.
+
+ LDVR
+ LDVR is INTEGER
+ The leading dimension of the array VR. LDVR >= 1; if
+ JOBVR = 'V', LDVR >= N.
+
+ ILO
+ ILO is INTEGER
+
+ IHI
+ IHI is INTEGER
+ ILO and IHI are integer values determined when A was
+ balanced. The balanced A(i,j) = 0 if I > J and
+ J = 1,...,ILO1 or I = IHI+1,...,N.
+
+ SCALE
+ SCALE is REAL array, dimension (N)
+ Details of the permutations and scaling factors applied
+ when balancing A. If P(j) is the index of the row and column
+ interchanged with row and column j, and D(j) is the scaling
+ factor applied to row and column j, then
+ SCALE(J) = P(J), for J = 1,...,ILO1
+ = D(J), for J = ILO,...,IHI
+ = P(J) for J = IHI+1,...,N.
+ The order in which the interchanges are made is N to IHI+1,
+ then 1 to ILO1.
+
+ ABNRM
+ ABNRM is REAL
+ The onenorm of the balanced matrix (the maximum
+ of the sum of absolute values of elements of any column).
+
+ RCONDE
+ RCONDE is REAL array, dimension (N)
+ RCONDE(j) is the reciprocal condition number of the jth eigenvalue.
+
+ RCONDV
+ RCONDV is REAL array, dimension (N)
+ RCONDV(j) is the reciprocal condition number of the jth
+ right eigenvector.
+
+ WORK
+ WORK is COMPLEX array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK. If SENSE = 'N' or 'E',
+ LWORK >= max(1,2*N), and if SENSE = 'V' or 'B',
+ LWORK >= N*N+2*N.
+ For good performance, LWORK must generally be larger.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ RWORK
+ RWORK is REAL array, dimension (2*N)
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value.
+ > 0: if INFO = i, the QR algorithm failed to compute all the
+ eigenvalues, and no eigenvectors or condition numbers
+ have been computed; elements 1:ILO1 and i+1:N of W
+ contain eigenvalues which have converged.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{cgeevx.f}
+\index{cgeevx.f}
+\begin{chunk}{cgeevx.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK cgeevx}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{cgegs  DEPRECATED use cgges}
+\label{cgegs}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{cgegv  DEPRECATED use cggev}
+\label{cgegv}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{cgges}
+\label{cgges}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{cgges.input}
+)set break resume
+)sys rm f cgges.output
+)spool cgges.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{cgges.help}
+====================================================================
+cgges examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine cgges (JOBVSL, JOBVSR, SORT, SELCTG, N, A, LDA, B, LDB,
+ SDIM, ALPHA, BETA, VSL, LDVSL, VSR, LDVSR, WORK, LWORK, RWORK,
+ BWORK, INFO)
+ CGGES computes the eigenvalues, the Schur form, and, optionally,
+ the matrix of Schur vectors for GE matrices
+
+Function/Subroutine Documentation
+ subroutine cgges (character JOBVSL, character JOBVSR, character SORT,
+ external SELCTG, integer N, complex, dimension( lda, * ) A, integer
+ LDA, complex, dimension( ldb, * ) B, integer LDB, integer SDIM,
+ complex, dimension( * ) ALPHA, complex, dimension( * ) BETA, complex,
+ dimension( ldvsl, * ) VSL, integer LDVSL, complex, dimension( ldvsr, *
+ ) VSR, integer LDVSR, complex, dimension( * ) WORK, integer LWORK,
+ real, dimension( * ) RWORK, logical, dimension( * ) BWORK, integer
+ INFO)
+ CGGES computes the eigenvalues, the Schur form, and, optionally, the
+ matrix of Schur vectors for GE matrices
+
+Purpose:
+ CGGES computes for a pair of NbyN complex nonsymmetric matrices
+ (A,B), the generalized eigenvalues, the generalized complex Schur
+ form (S, T), and optionally left and/or right Schur vectors (VSL
+ and VSR). This gives the generalized Schur factorization
+
+ (A,B) = ( (VSL)*S*(VSR)**H, (VSL)*T*(VSR)**H )
+
+ where (VSR)**H is the conjugatetranspose of VSR.
+
+ Optionally, it also orders the eigenvalues so that a selected cluster
+ of eigenvalues appears in the leading diagonal blocks of the upper
+ triangular matrix S and the upper triangular matrix T. The leading
+ columns of VSL and VSR then form an unitary basis for the
+ corresponding left and right eigenspaces (deflating subspaces).
+
+ (If only the generalized eigenvalues are needed, use the driver
+ CGGEV instead, which is faster.)
+
+ A generalized eigenvalue for a pair of matrices (A,B) is a scalar w
+ or a ratio alpha/beta = w, such that A  w*B is singular. It is
+ usually represented as the pair (alpha,beta), as there is a
+ reasonable interpretation for beta=0, and even for both being zero.
+
+ A pair of matrices (S,T) is in generalized complex Schur form if S
+ and T are upper triangular and, in addition, the diagonal elements
+ of T are nonnegative real numbers.
+
+Parameters:
+
+ JOBVSL
+ JOBVSL is CHARACTER*1
+ = 'N': do not compute the left Schur vectors;
+ = 'V': compute the left Schur vectors.
+
+ JOBVSR
+ JOBVSR is CHARACTER*1
+ = 'N': do not compute the right Schur vectors;
+ = 'V': compute the right Schur vectors.
+
+ SORT
+ SORT is CHARACTER*1
+ Specifies whether or not to order the eigenvalues on the
+ diagonal of the generalized Schur form.
+ = 'N': Eigenvalues are not ordered;
+ = 'S': Eigenvalues are ordered (see SELCTG).
+
+ SELCTG
+ SELCTG is a LOGICAL FUNCTION of two COMPLEX arguments
+ SELCTG must be declared EXTERNAL in the calling subroutine.
+ If SORT = 'N', SELCTG is not referenced.
+ If SORT = 'S', SELCTG is used to select eigenvalues to sort
+ to the top left of the Schur form.
+ An eigenvalue ALPHA(j)/BETA(j) is selected if
+ SELCTG(ALPHA(j),BETA(j)) is true.
+
+ Note that a selected complex eigenvalue may no longer satisfy
+ SELCTG(ALPHA(j),BETA(j)) = .TRUE. after ordering, since
+ ordering may change the value of complex eigenvalues
+ (especially if the eigenvalue is illconditioned), in this
+ case INFO is set to N+2 (See INFO below).
+
+ N
+ N is INTEGER
+ The order of the matrices A, B, VSL, and VSR. N >= 0.
+
+ A
+ A is COMPLEX array, dimension (LDA, N)
+ On entry, the first of the pair of matrices.
+ On exit, A has been overwritten by its generalized Schur form S.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of A. LDA >= max(1,N).
+
+ B
+ B is COMPLEX array, dimension (LDB, N)
+ On entry, the second of the pair of matrices.
+ On exit, B has been overwritten by its generalized Schur form T.
+
+ LDB
+ LDB is INTEGER
+ The leading dimension of B. LDB >= max(1,N).
+
+ SDIM
+ SDIM is INTEGER
+ If SORT = 'N', SDIM = 0.
+ If SORT = 'S', SDIM = number of eigenvalues (after sorting)
+ for which SELCTG is true.
+
+ ALPHA
+ ALPHA is COMPLEX array, dimension (N)
+
+ BETA
+ BETA is COMPLEX array, dimension (N)
+ On exit, ALPHA(j)/BETA(j), j=1,...,N, will be the
+ generalized eigenvalues. ALPHA(j), j=1,...,N and BETA(j),
+ j=1,...,N are the diagonals of the complex Schur form (A,B)
+ output by CGGES. The BETA(j) will be nonnegative real.
+
+ Note: the quotients ALPHA(j)/BETA(j) may easily over or
+ underflow, and BETA(j) may even be zero. Thus, the user
+ should avoid naively computing the ratio alpha/beta.
+ However, ALPHA will be always less than and usually
+ comparable with norm(A) in magnitude, and BETA always less
+ than and usually comparable with norm(B).
+
+ VSL
+ VSL is COMPLEX array, dimension (LDVSL,N)
+ If JOBVSL = 'V', VSL will contain the left Schur vectors.
+ Not referenced if JOBVSL = 'N'.
+
+ LDVSL
+ LDVSL is INTEGER
+ The leading dimension of the matrix VSL. LDVSL >= 1, and
+ if JOBVSL = 'V', LDVSL >= N.
+
+ VSR
+ VSR is COMPLEX array, dimension (LDVSR,N)
+ If JOBVSR = 'V', VSR will contain the right Schur vectors.
+ Not referenced if JOBVSR = 'N'.
+
+ LDVSR
+ LDVSR is INTEGER
+ The leading dimension of the matrix VSR. LDVSR >= 1, and
+ if JOBVSR = 'V', LDVSR >= N.
+
+ WORK
+ WORK is COMPLEX array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK. LWORK >= max(1,2*N).
+ For good performance, LWORK must generally be larger.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ RWORK
+ RWORK is REAL array, dimension (8*N)
+
+ BWORK
+ BWORK is LOGICAL array, dimension (N)
+ Not referenced if SORT = 'N'.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value.
+ =1,...,N:
+ The QZ iteration failed. (A,B) are not in Schur
+ form, but ALPHA(j) and BETA(j) should be correct for
+ j=INFO+1,...,N.
+ > N: =N+1: other than QZ iteration failed in CHGEQZ
+ =N+2: after reordering, roundoff changed values of
+ some complex eigenvalues so that leading
+ eigenvalues in the Generalized Schur form no
+ longer satisfy SELCTG=.TRUE. This could also
+ be caused due to scaling.
+ =N+3: reordering failed in CTGSEN.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{cgges.f}
+\index{cgges.f}
+\begin{chunk}{cgges.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK cgges}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{cgges3}
+\label{cgges3}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{cgges3.input}
+)set break resume
+)sys rm f cgges3.output
+)spool cgges3.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{cgges3.help}
+====================================================================
+cgges3 examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine cgges3 (JOBVSL, JOBVSR, SORT, SELCTG, N, A, LDA, B, LDB,
+ SDIM, ALPHA, BETA, VSL, LDVSL, VSR, LDVSR, WORK, LWORK, RWORK,
+ BWORK, INFO)
+ CGGES3 computes the eigenvalues, the Schur form, and, optionally,
+ the matrix of Schur vectors for GE matrices (blocked algorithm)
+
+Function/Subroutine Documentation
+ subroutine cgges3 (character JOBVSL, character JOBVSR, character SORT,
+ external SELCTG, integer N, complex, dimension( lda, * ) A, integer
+ LDA, complex, dimension( ldb, * ) B, integer LDB, integer SDIM,
+ complex, dimension( * ) ALPHA, complex, dimension( * ) BETA, complex,
+ dimension( ldvsl, * ) VSL, integer LDVSL, complex, dimension( ldvsr, *
+ ) VSR, integer LDVSR, complex, dimension( * ) WORK, integer LWORK,
+ real, dimension( * ) RWORK, logical, dimension( * ) BWORK, integer
+ INFO)
+ CGGES3 computes the eigenvalues, the Schur form, and, optionally, the
+ matrix of Schur vectors for GE matrices (blocked algorithm)
+
+Purpose:
+ CGGES3 computes for a pair of NbyN complex nonsymmetric matrices
+ (A,B), the generalized eigenvalues, the generalized complex Schur
+ form (S, T), and optionally left and/or right Schur vectors (VSL
+ and VSR). This gives the generalized Schur factorization
+
+ (A,B) = ( (VSL)*S*(VSR)**H, (VSL)*T*(VSR)**H )
+
+ where (VSR)**H is the conjugatetranspose of VSR.
+
+ Optionally, it also orders the eigenvalues so that a selected cluster
+ of eigenvalues appears in the leading diagonal blocks of the upper
+ triangular matrix S and the upper triangular matrix T. The leading
+ columns of VSL and VSR then form an unitary basis for the
+ corresponding left and right eigenspaces (deflating subspaces).
+
+ (If only the generalized eigenvalues are needed, use the driver
+ CGGEV instead, which is faster.)
+
+ A generalized eigenvalue for a pair of matrices (A,B) is a scalar w
+ or a ratio alpha/beta = w, such that A  w*B is singular. It is
+ usually represented as the pair (alpha,beta), as there is a
+ reasonable interpretation for beta=0, and even for both being zero.
+
+ A pair of matrices (S,T) is in generalized complex Schur form if S
+ and T are upper triangular and, in addition, the diagonal elements
+ of T are nonnegative real numbers.
+
+Parameters:
+
+ JOBVSL
+ JOBVSL is CHARACTER*1
+ = 'N': do not compute the left Schur vectors;
+ = 'V': compute the left Schur vectors.
+
+ JOBVSR
+ JOBVSR is CHARACTER*1
+ = 'N': do not compute the right Schur vectors;
+ = 'V': compute the right Schur vectors.
+
+ SORT
+ SORT is CHARACTER*1
+ Specifies whether or not to order the eigenvalues on the
+ diagonal of the generalized Schur form.
+ = 'N': Eigenvalues are not ordered;
+ = 'S': Eigenvalues are ordered (see SELCTG).
+
+ SELCTG
+ SELCTG is a LOGICAL FUNCTION of two COMPLEX arguments
+ SELCTG must be declared EXTERNAL in the calling subroutine.
+ If SORT = 'N', SELCTG is not referenced.
+ If SORT = 'S', SELCTG is used to select eigenvalues to sort
+ to the top left of the Schur form.
+ An eigenvalue ALPHA(j)/BETA(j) is selected if
+ SELCTG(ALPHA(j),BETA(j)) is true.
+
+ Note that a selected complex eigenvalue may no longer satisfy
+ SELCTG(ALPHA(j),BETA(j)) = .TRUE. after ordering, since
+ ordering may change the value of complex eigenvalues
+ (especially if the eigenvalue is illconditioned), in this
+ case INFO is set to N+2 (See INFO below).
+
+ N
+ N is INTEGER
+ The order of the matrices A, B, VSL, and VSR. N >= 0.
+
+ A
+ A is COMPLEX array, dimension (LDA, N)
+ On entry, the first of the pair of matrices.
+ On exit, A has been overwritten by its generalized Schur form S.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of A. LDA >= max(1,N).
+
+ B
+ B is COMPLEX array, dimension (LDB, N)
+ On entry, the second of the pair of matrices.
+ On exit, B has been overwritten by its generalized Schur form T.
+
+ LDB
+ LDB is INTEGER
+ The leading dimension of B. LDB >= max(1,N).
+
+ SDIM
+ SDIM is INTEGER
+ If SORT = 'N', SDIM = 0.
+ If SORT = 'S', SDIM = number of eigenvalues (after sorting)
+ for which SELCTG is true.
+
+ ALPHA
+ ALPHA is COMPLEX array, dimension (N)
+
+ BETA
+ BETA is COMPLEX array, dimension (N)
+ On exit, ALPHA(j)/BETA(j), j=1,...,N, will be the
+ generalized eigenvalues. ALPHA(j), j=1,...,N and BETA(j),
+ j=1,...,N are the diagonals of the complex Schur form (A,B)
+ output by CGGES3. The BETA(j) will be nonnegative real.
+
+ Note: the quotients ALPHA(j)/BETA(j) may easily over or
+ underflow, and BETA(j) may even be zero. Thus, the user
+ should avoid naively computing the ratio alpha/beta.
+ However, ALPHA will be always less than and usually
+ comparable with norm(A) in magnitude, and BETA always less
+ than and usually comparable with norm(B).
+
+ VSL
+ VSL is COMPLEX array, dimension (LDVSL,N)
+ If JOBVSL = 'V', VSL will contain the left Schur vectors.
+ Not referenced if JOBVSL = 'N'.
+
+ LDVSL
+ LDVSL is INTEGER
+ The leading dimension of the matrix VSL. LDVSL >= 1, and
+ if JOBVSL = 'V', LDVSL >= N.
+
+ VSR
+ VSR is COMPLEX array, dimension (LDVSR,N)
+ If JOBVSR = 'V', VSR will contain the right Schur vectors.
+ Not referenced if JOBVSR = 'N'.
+
+ LDVSR
+ LDVSR is INTEGER
+ The leading dimension of the matrix VSR. LDVSR >= 1, and
+ if JOBVSR = 'V', LDVSR >= N.
+
+ WORK
+ WORK is COMPLEX array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ RWORK
+ RWORK is REAL array, dimension (8*N)
+
+ BWORK
+ BWORK is LOGICAL array, dimension (N)
+ Not referenced if SORT = 'N'.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value.
+ =1,...,N:
+ The QZ iteration failed. (A,B) are not in Schur
+ form, but ALPHA(j) and BETA(j) should be correct for
+ j=INFO+1,...,N.
+ > N: =N+1: other than QZ iteration failed in CHGEQZ
+ =N+2: after reordering, roundoff changed values of
+ some complex eigenvalues so that leading
+ eigenvalues in the Generalized Schur form no
+ longer satisfy SELCTG=.TRUE. This could also
+ be caused due to scaling.
+ =N+3: reordering failed in CTGSEN.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{cgges3.f}
+\index{cgges3.f}
+\begin{chunk}{cgges3.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK cgges3}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{cggesx}
+\label{cggesx}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{cggesx.input}
+)set break resume
+)sys rm f cggesx.output
+)spool cggesx.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{cggesx.help}
+====================================================================
+cggesx examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine cggesx (JOBVSL, JOBVSR, SORT, SELCTG, SENSE, N, A, LDA, B,
+ LDB, SDIM, ALPHA, BETA, VSL, LDVSL, VSR, LDVSR, RCONDE, RCONDV,
+ WORK, LWORK, RWORK, IWORK, LIWORK, BWORK, INFO)
+ CGGESX computes the eigenvalues, the Schur form, and, optionally,
+ the matrix of Schur vectors for GE matrices
+
+Function/Subroutine Documentation
+ subroutine cggesx (character JOBVSL, character JOBVSR, character SORT,
+ external SELCTG, character SENSE, integer N, complex, dimension( lda, *
+ ) A, integer LDA, complex, dimension( ldb, * ) B, integer LDB, integer
+ SDIM, complex, dimension( * ) ALPHA, complex, dimension( * ) BETA,
+ complex, dimension( ldvsl, * ) VSL, integer LDVSL, complex, dimension(
+ ldvsr, * ) VSR, integer LDVSR, real, dimension( 2 ) RCONDE, real,
+ dimension( 2 ) RCONDV, complex, dimension( * ) WORK, integer LWORK,
+ real, dimension( * ) RWORK, integer, dimension( * ) IWORK, integer
+ LIWORK, logical, dimension( * ) BWORK, integer INFO)
+ CGGESX computes the eigenvalues, the Schur form, and, optionally, the
+ matrix of Schur vectors for GE matrices
+
+Purpose:
+ CGGESX computes for a pair of NbyN complex nonsymmetric matrices
+ (A,B), the generalized eigenvalues, the complex Schur form (S,T),
+ and, optionally, the left and/or right matrices of Schur vectors (VSL
+ and VSR). This gives the generalized Schur factorization
+
+ (A,B) = ( (VSL) S (VSR)**H, (VSL) T (VSR)**H )
+
+ where (VSR)**H is the conjugatetranspose of VSR.
+
+ Optionally, it also orders the eigenvalues so that a selected cluster
+ of eigenvalues appears in the leading diagonal blocks of the upper
+ triangular matrix S and the upper triangular matrix T; computes
+ a reciprocal condition number for the average of the selected
+ eigenvalues (RCONDE); and computes a reciprocal condition number for
+ the right and left deflating subspaces corresponding to the selected
+ eigenvalues (RCONDV). The leading columns of VSL and VSR then form
+ an orthonormal basis for the corresponding left and right eigenspaces
+ (deflating subspaces).
+
+ A generalized eigenvalue for a pair of matrices (A,B) is a scalar w
+ or a ratio alpha/beta = w, such that A  w*B is singular. It is
+ usually represented as the pair (alpha,beta), as there is a
+ reasonable interpretation for beta=0 or for both being zero.
+
+ A pair of matrices (S,T) is in generalized complex Schur form if T is
+ upper triangular with nonnegative diagonal and S is upper
+ triangular.
+
+Parameters:
+
+ JOBVSL
+ JOBVSL is CHARACTER*1
+ = 'N': do not compute the left Schur vectors;
+ = 'V': compute the left Schur vectors.
+
+ JOBVSR
+ JOBVSR is CHARACTER*1
+ = 'N': do not compute the right Schur vectors;
+ = 'V': compute the right Schur vectors.
+
+ SORT
+ SORT is CHARACTER*1
+ Specifies whether or not to order the eigenvalues on the
+ diagonal of the generalized Schur form.
+ = 'N': Eigenvalues are not ordered;
+ = 'S': Eigenvalues are ordered (see SELCTG).
+
+ SELCTG
+ SELCTG is procedure) LOGICAL FUNCTION of two COMPLEX arguments
+ SELCTG must be declared EXTERNAL in the calling subroutine.
+ If SORT = 'N', SELCTG is not referenced.
+ If SORT = 'S', SELCTG is used to select eigenvalues to sort
+ to the top left of the Schur form.
+ Note that a selected complex eigenvalue may no longer satisfy
+ SELCTG(ALPHA(j),BETA(j)) = .TRUE. after ordering, since
+ ordering may change the value of complex eigenvalues
+ (especially if the eigenvalue is illconditioned), in this
+ case INFO is set to N+3 see INFO below).
+
+ SENSE
+ SENSE is CHARACTER*1
+ Determines which reciprocal condition numbers are computed.
+ = 'N' : None are computed;
+ = 'E' : Computed for average of selected eigenvalues only;
+ = 'V' : Computed for selected deflating subspaces only;
+ = 'B' : Computed for both.
+ If SENSE = 'E', 'V', or 'B', SORT must equal 'S'.
+
+ N
+ N is INTEGER
+ The order of the matrices A, B, VSL, and VSR. N >= 0.
+
+ A
+ A is COMPLEX array, dimension (LDA, N)
+ On entry, the first of the pair of matrices.
+ On exit, A has been overwritten by its generalized Schur form S.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of A. LDA >= max(1,N).
+
+ B
+ B is COMPLEX array, dimension (LDB, N)
+ On entry, the second of the pair of matrices.
+ On exit, B has been overwritten by its generalized Schur form T.
+
+ LDB
+ LDB is INTEGER
+ The leading dimension of B. LDB >= max(1,N).
+
+ SDIM
+ SDIM is INTEGER
+ If SORT = 'N', SDIM = 0.
+ If SORT = 'S', SDIM = number of eigenvalues (after sorting)
+ for which SELCTG is true.
+
+ ALPHA
+ ALPHA is COMPLEX array, dimension (N)
+
+ BETA
+ BETA is COMPLEX array, dimension (N)
+ On exit, ALPHA(j)/BETA(j), j=1,...,N, will be the
+ generalized eigenvalues. ALPHA(j) and BETA(j),j=1,...,N are
+ the diagonals of the complex Schur form (S,T). BETA(j) will
+ be nonnegative real.
+
+ Note: the quotients ALPHA(j)/BETA(j) may easily over or
+ underflow, and BETA(j) may even be zero. Thus, the user
+ should avoid naively computing the ratio alpha/beta.
+ However, ALPHA will be always less than and usually
+ comparable with norm(A) in magnitude, and BETA always less
+ than and usually comparable with norm(B).
+
+ VSL
+ VSL is COMPLEX array, dimension (LDVSL,N)
+ If JOBVSL = 'V', VSL will contain the left Schur vectors.
+ Not referenced if JOBVSL = 'N'.
+
+ LDVSL
+ LDVSL is INTEGER
+ The leading dimension of the matrix VSL. LDVSL >=1, and
+ if JOBVSL = 'V', LDVSL >= N.
+
+ VSR
+ VSR is COMPLEX array, dimension (LDVSR,N)
+ If JOBVSR = 'V', VSR will contain the right Schur vectors.
+ Not referenced if JOBVSR = 'N'.
+
+ LDVSR
+ LDVSR is INTEGER
+ The leading dimension of the matrix VSR. LDVSR >= 1, and
+ if JOBVSR = 'V', LDVSR >= N.
+
+ RCONDE
+ RCONDE is REAL array, dimension ( 2 )
+ If SENSE = 'E' or 'B', RCONDE(1) and RCONDE(2) contain the
+ reciprocal condition numbers for the average of the selected
+ eigenvalues.
+ Not referenced if SENSE = 'N' or 'V'.
+
+ RCONDV
+ RCONDV is REAL array, dimension ( 2 )
+ If SENSE = 'V' or 'B', RCONDV(1) and RCONDV(2) contain the
+ reciprocal condition number for the selected deflating
+ subspaces.
+ Not referenced if SENSE = 'N' or 'E'.
+
+ WORK
+ WORK is COMPLEX array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK.
+ If N = 0, LWORK >= 1, else if SENSE = 'E', 'V', or 'B',
+ LWORK >= MAX(1,2*N,2*SDIM*(NSDIM)), else
+ LWORK >= MAX(1,2*N). Note that 2*SDIM*(NSDIM) <= N*N/2.
+ Note also that an error is only returned if
+ LWORK < MAX(1,2*N), but if SENSE = 'E' or 'V' or 'B' this may
+ not be large enough.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the bound on the optimal size of the WORK
+ array and the minimum size of the IWORK array, returns these
+ values as the first entries of the WORK and IWORK arrays, and
+ no error message related to LWORK or LIWORK is issued by XERBLA.
+
+ RWORK
+ RWORK is REAL array, dimension ( 8*N )
+ Real workspace.
+
+ IWORK
+ IWORK is INTEGER array, dimension (MAX(1,LIWORK))
+ On exit, if INFO = 0, IWORK(1) returns the minimum LIWORK.
+
+ LIWORK
+ LIWORK is INTEGER
+ The dimension of the array WORK.
+ If SENSE = 'N' or N = 0, LIWORK >= 1, otherwise
+ LIWORK >= N+2.
+
+ If LIWORK = 1, then a workspace query is assumed; the
+ routine only calculates the bound on the optimal size of the
+ WORK array and the minimum size of the IWORK array, returns
+ these values as the first entries of the WORK and IWORK
+ arrays, and no error message related to LWORK or LIWORK is
+ issued by XERBLA.
+
+ BWORK
+ BWORK is LOGICAL array, dimension (N)
+ Not referenced if SORT = 'N'.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value.
+ = 1,...,N:
+ The QZ iteration failed. (A,B) are not in Schur
+ form, but ALPHA(j) and BETA(j) should be correct for
+ j=INFO+1,...,N.
+ > N: =N+1: other than QZ iteration failed in CHGEQZ
+ =N+2: after reordering, roundoff changed values of
+ some complex eigenvalues so that leading
+ eigenvalues in the Generalized Schur form no
+ longer satisfy SELCTG=.TRUE. This could also
+ be caused due to scaling.
+ =N+3: reordering failed in CTGSEN.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{cggesx.f}
+\index{cggesx.f}
+\begin{chunk}{cggesx.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK cggesx}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{cggev}
+\label{cggev}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{cggev.input}
+)set break resume
+)sys rm f cggev.output
+)spool cggev.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{cggev.help}
+====================================================================
+cggev examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine cggev (JOBVL, JOBVR, N, A, LDA, B, LDB, ALPHA, BETA, VL,
+ LDVL, VR, LDVR, WORK, LWORK, RWORK, INFO)
+ CGGEV computes the eigenvalues and, optionally, the left and/or
+ right eigenvectors for GE matrices
+
+Function/Subroutine Documentation
+ subroutine cggev (character JOBVL, character JOBVR, integer N, complex,
+ dimension( lda, * ) A, integer LDA, complex, dimension( ldb, * ) B,
+ integer LDB, complex, dimension( * ) ALPHA, complex, dimension( * )
+ BETA, complex, dimension( ldvl, * ) VL, integer LDVL, complex,
+ dimension( ldvr, * ) VR, integer LDVR, complex, dimension( * ) WORK,
+ integer LWORK, real, dimension( * ) RWORK, integer INFO)
+ CGGEV computes the eigenvalues and, optionally, the left and/or right
+ eigenvectors for GE matrices
+
+Purpose:
+ CGGEV computes for a pair of NbyN complex nonsymmetric matrices
+ (A,B), the generalized eigenvalues, and optionally, the left and/or
+ right generalized eigenvectors.
+
+ A generalized eigenvalue for a pair of matrices (A,B) is a scalar
+ lambda or a ratio alpha/beta = lambda, such that A  lambda*B is
+ singular. It is usually represented as the pair (alpha,beta), as
+ there is a reasonable interpretation for beta=0, and even for both
+ being zero.
+
+ The right generalized eigenvector v(j) corresponding to the
+ generalized eigenvalue lambda(j) of (A,B) satisfies
+
+ A * v(j) = lambda(j) * B * v(j).
+
+ The left generalized eigenvector u(j) corresponding to the
+ generalized eigenvalues lambda(j) of (A,B) satisfies
+
+ u(j)**H * A = lambda(j) * u(j)**H * B
+
+ where u(j)**H is the conjugatetranspose of u(j).
+
+Parameters:
+
+ JOBVL
+ JOBVL is CHARACTER*1
+ = 'N': do not compute the left generalized eigenvectors;
+ = 'V': compute the left generalized eigenvectors.
+
+ JOBVR
+ JOBVR is CHARACTER*1
+ = 'N': do not compute the right generalized eigenvectors;
+ = 'V': compute the right generalized eigenvectors.
+
+ N
+ N is INTEGER
+ The order of the matrices A, B, VL, and VR. N >= 0.
+
+ A
+ A is COMPLEX array, dimension (LDA, N)
+ On entry, the matrix A in the pair (A,B).
+ On exit, A has been overwritten.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of A. LDA >= max(1,N).
+
+ B
+ B is COMPLEX array, dimension (LDB, N)
+ On entry, the matrix B in the pair (A,B).
+ On exit, B has been overwritten.
+
+ LDB
+ LDB is INTEGER
+ The leading dimension of B. LDB >= max(1,N).
+
+ ALPHA
+ ALPHA is COMPLEX array, dimension (N)
+
+ BETA
+ BETA is COMPLEX array, dimension (N)
+ On exit, ALPHA(j)/BETA(j), j=1,...,N, will be the
+ generalized eigenvalues.
+
+ Note: the quotients ALPHA(j)/BETA(j) may easily over or
+ underflow, and BETA(j) may even be zero. Thus, the user
+ should avoid naively computing the ratio alpha/beta.
+ However, ALPHA will be always less than and usually
+ comparable with norm(A) in magnitude, and BETA always less
+ than and usually comparable with norm(B).
+
+ VL
+ VL is COMPLEX array, dimension (LDVL,N)
+ If JOBVL = 'V', the left generalized eigenvectors u(j) are
+ stored one after another in the columns of VL, in the same
+ order as their eigenvalues.
+ Each eigenvector is scaled so the largest component has
+ abs(real part) + abs(imag. part) = 1.
+ Not referenced if JOBVL = 'N'.
+
+ LDVL
+ LDVL is INTEGER
+ The leading dimension of the matrix VL. LDVL >= 1, and
+ if JOBVL = 'V', LDVL >= N.
+
+ VR
+ VR is COMPLEX array, dimension (LDVR,N)
+ If JOBVR = 'V', the right generalized eigenvectors v(j) are
+ stored one after another in the columns of VR, in the same
+ order as their eigenvalues.
+ Each eigenvector is scaled so the largest component has
+ abs(real part) + abs(imag. part) = 1.
+ Not referenced if JOBVR = 'N'.
+
+ LDVR
+ LDVR is INTEGER
+ The leading dimension of the matrix VR. LDVR >= 1, and
+ if JOBVR = 'V', LDVR >= N.
+
+ WORK
+ WORK is COMPLEX array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK. LWORK >= max(1,2*N).
+ For good performance, LWORK must generally be larger.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ RWORK
+ RWORK is REAL array, dimension (8*N)
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value.
+ =1,...,N:
+ The QZ iteration failed. No eigenvectors have been
+ calculated, but ALPHA(j) and BETA(j) should be
+ correct for j=INFO+1,...,N.
+ > N: =N+1: other then QZ iteration failed in SHGEQZ,
+ =N+2: error return from STGEVC.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{cggev.f}
+\index{cggev.f}
+\begin{chunk}{cggev.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK cggev}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{cggev3}
+\label{cggev3}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{cggev3.input}
+)set break resume
+)sys rm f cggev3.output
+)spool cggev3.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{cggev3.help}
+====================================================================
+cggev3 examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine cggev3 (JOBVL, JOBVR, N, A, LDA, B, LDB, ALPHA, BETA, VL,
+ LDVL, VR, LDVR, WORK, LWORK, RWORK, INFO)
+ CGGEV3 computes the eigenvalues and, optionally, the left and/or
+ right eigenvectors for GE matrices (blocked algorithm)
+
+Function/Subroutine Documentation
+ subroutine cggev3 (character JOBVL, character JOBVR, integer N, complex,
+ dimension( lda, * ) A, integer LDA, complex, dimension( ldb, * ) B,
+ integer LDB, complex, dimension( * ) ALPHA, complex, dimension( * )
+ BETA, complex, dimension( ldvl, * ) VL, integer LDVL, complex,
+ dimension( ldvr, * ) VR, integer LDVR, complex, dimension( * ) WORK,
+ integer LWORK, real, dimension( * ) RWORK, integer INFO)
+ CGGEV3 computes the eigenvalues and, optionally, the left and/or right
+ eigenvectors for GE matrices (blocked algorithm)
+
+Purpose:
+ CGGEV3 computes for a pair of NbyN complex nonsymmetric matrices
+ (A,B), the generalized eigenvalues, and optionally, the left and/or
+ right generalized eigenvectors.
+
+ A generalized eigenvalue for a pair of matrices (A,B) is a scalar
+ lambda or a ratio alpha/beta = lambda, such that A  lambda*B is
+ singular. It is usually represented as the pair (alpha,beta), as
+ there is a reasonable interpretation for beta=0, and even for both
+ being zero.
+
+ The right generalized eigenvector v(j) corresponding to the
+ generalized eigenvalue lambda(j) of (A,B) satisfies
+
+ A * v(j) = lambda(j) * B * v(j).
+
+ The left generalized eigenvector u(j) corresponding to the
+ generalized eigenvalues lambda(j) of (A,B) satisfies
+
+ u(j)**H * A = lambda(j) * u(j)**H * B
+
+ where u(j)**H is the conjugatetranspose of u(j).
+
+Parameters:
+
+ JOBVL
+ JOBVL is CHARACTER*1
+ = 'N': do not compute the left generalized eigenvectors;
+ = 'V': compute the left generalized eigenvectors.
+
+ JOBVR
+e JOBVR is CHARACTER*1
+ = 'N': do not compute the right generalized eigenvectors;
+ = 'V': compute the right generalized eigenvectors.
+
+ N
+ N is INTEGER
+ The order of the matrices A, B, VL, and VR. N >= 0.
+
+ A
+ A is COMPLEX array, dimension (LDA, N)
+ On entry, the matrix A in the pair (A,B).
+ On exit, A has been overwritten.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of A. LDA >= max(1,N).
+
+ B
+ B is COMPLEX array, dimension (LDB, N)
+ On entry, the matrix B in the pair (A,B).
+ On exit, B has been overwritten.
+
+ LDB
+ LDB is INTEGER
+ The leading dimension of B. LDB >= max(1,N).
+
+ ALPHA
+ ALPHA is COMPLEX array, dimension (N)
+
+ BETA
+ BETA is COMPLEX array, dimension (N)
+ On exit, ALPHA(j)/BETA(j), j=1,...,N, will be the
+ generalized eigenvalues.
+
+ Note: the quotients ALPHA(j)/BETA(j) may easily over or
+ underflow, and BETA(j) may even be zero. Thus, the user
+ should avoid naively computing the ratio alpha/beta.
+ However, ALPHA will be always less than and usually
+ comparable with norm(A) in magnitude, and BETA always less
+ than and usually comparable with norm(B).
+
+ VL
+ VL is COMPLEX array, dimension (LDVL,N)
+ If JOBVL = 'V', the left generalized eigenvectors u(j) are
+ stored one after another in the columns of VL, in the same
+ order as their eigenvalues.
+ Each eigenvector is scaled so the largest component has
+ abs(real part) + abs(imag. part) = 1.
+ Not referenced if JOBVL = 'N'.
+
+ LDVL
+ LDVL is INTEGER
+ The leading dimension of the matrix VL. LDVL >= 1, and
+ if JOBVL = 'V', LDVL >= N.
+
+ VR
+ VR is COMPLEX array, dimension (LDVR,N)
+ If JOBVR = 'V', the right generalized eigenvectors v(j) are
+ stored one after another in the columns of VR, in the same
+ order as their eigenvalues.
+ Each eigenvector is scaled so the largest component has
+ abs(real part) + abs(imag. part) = 1.
+ Not referenced if JOBVR = 'N'.
+
+ LDVR
+ LDVR is INTEGER
+ The leading dimension of the matrix VR. LDVR >= 1, and
+ if JOBVR = 'V', LDVR >= N.
+
+ WORK
+ WORK is COMPLEX array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ RWORK
+ RWORK is REAL array, dimension (8*N)
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value.
+ =1,...,N:
+ The QZ iteration failed. No eigenvectors have been
+ calculated, but ALPHA(j) and BETA(j) should be
+ correct for j=INFO+1,...,N.
+ > N: =N+1: other then QZ iteration failed in SHGEQZ,
+ =N+2: error return from STGEVC.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{cggev3.f}
+\index{cggev3.f}
+\begin{chunk}{cggev3.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK cggev3}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{cggevx}
+\label{cggevx}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{cggevx.input}
+)set break resume
+)sys rm f cggevx.output
+)spool cggevx.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{cggevx.help}
+====================================================================
+cggevx examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine cggevx (BALANC, JOBVL, JOBVR, SENSE, N, A, LDA, B, LDB,
+ ALPHA, BETA, VL, LDVL, VR, LDVR, ILO, IHI, LSCALE, RSCALE, ABNRM,
+ BBNRM, RCONDE, RCONDV, WORK, LWORK, RWORK, IWORK, BWORK, INFO)
+ CGGEVX computes the eigenvalues and, optionally, the left and/or
+ right eigenvectors for GE matrices
+
+Function/Subroutine Documentation
+ subroutine cggevx (character BALANC, character JOBVL, character JOBVR,
+ character SENSE, integer N, complex, dimension( lda, * ) A, integer
+ LDA, complex, dimension( ldb, * ) B, integer LDB, complex, dimension( *
+ ) ALPHA, complex, dimension( * ) BETA, complex, dimension( ldvl, * )
+ VL, integer LDVL, complex, dimension( ldvr, * ) VR, integer LDVR,
+ integer ILO, integer IHI, real, dimension( * ) LSCALE, real, dimension(
+ * ) RSCALE, real ABNRM, real BBNRM, real, dimension( * ) RCONDE, real,
+ dimension( * ) RCONDV, complex, dimension( * ) WORK, integer LWORK,
+ real, dimension( * ) RWORK, integer, dimension( * ) IWORK, logical,
+ dimension( * ) BWORK, integer INFO)
+ CGGEVX computes the eigenvalues and, optionally, the left and/or right
+ eigenvectors for GE matrices
+
+Purpose:
+ CGGEVX computes for a pair of NbyN complex nonsymmetric matrices
+ (A,B) the generalized eigenvalues, and optionally, the left and/or
+ right generalized eigenvectors.
+
+ Optionally, it also computes a balancing transformation to improve
+ the conditioning of the eigenvalues and eigenvectors (ILO, IHI,
+ LSCALE, RSCALE, ABNRM, and BBNRM), reciprocal condition numbers for
+ the eigenvalues (RCONDE), and reciprocal condition numbers for the
+ right eigenvectors (RCONDV).
+
+ A generalized eigenvalue for a pair of matrices (A,B) is a scalar
+ lambda or a ratio alpha/beta = lambda, such that A  lambda*B is
+ singular. It is usually represented as the pair (alpha,beta), as
+ there is a reasonable interpretation for beta=0, and even for both
+ being zero.
+
+ The right eigenvector v(j) corresponding to the eigenvalue lambda(j)
+ of (A,B) satisfies
+ A * v(j) = lambda(j) * B * v(j) .
+ The left eigenvector u(j) corresponding to the eigenvalue lambda(j)
+ of (A,B) satisfies
+ u(j)**H * A = lambda(j) * u(j)**H * B.
+ where u(j)**H is the conjugatetranspose of u(j).
+
+Parameters:
+
+ BALANC
+ BALANC is CHARACTER*1
+ Specifies the balance option to be performed:
+ = 'N': do not diagonally scale or permute;
+ = 'P': permute only;
+ = 'S': scale only;
+ = 'B': both permute and scale.
+ Computed reciprocal condition numbers will be for the
+ matrices after permuting and/or balancing. Permuting does
+ not change condition numbers (in exact arithmetic), but balancing does.
+
+ JOBVL
+ JOBVL is CHARACTER*1
+ = 'N': do not compute the left generalized eigenvectors;
+ = 'V': compute the left generalized eigenvectors.
+
+ JOBVR
+ JOBVR is CHARACTER*1
+ = 'N': do not compute the right generalized eigenvectors;
+ = 'V': compute the right generalized eigenvectors.
+
+ SENSE
+ SENSE is CHARACTER*1
+ Determines which reciprocal condition numbers are computed.
+ = 'N': none are computed;
+ = 'E': computed for eigenvalues only;
+ = 'V': computed for eigenvectors only;
+ = 'B': computed for eigenvalues and eigenvectors.
+
+ N
+ N is INTEGER
+ The order of the matrices A, B, VL, and VR. N >= 0.
+
+ A
+ A is COMPLEX array, dimension (LDA, N)
+ On entry, the matrix A in the pair (A,B).
+ On exit, A has been overwritten. If JOBVL='V' or JOBVR='V'
+ or both, then A contains the first part of the complex Schur
+ form of the "balanced" versions of the input A and B.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of A. LDA >= max(1,N).
+
+ B
+ B is COMPLEX array, dimension (LDB, N)
+ On entry, the matrix B in the pair (A,B).
+ On exit, B has been overwritten. If JOBVL='V' or JOBVR='V'
+ or both, then B contains the second part of the complex
+ Schur form of the "balanced" versions of the input A and B.
+
+ LDB
+ LDB is INTEGER
+ The leading dimension of B. LDB >= max(1,N).
+
+ ALPHA
+ ALPHA is COMPLEX array, dimension (N)
+
+ BETA
+ BETA is COMPLEX array, dimension (N)
+ On exit, ALPHA(j)/BETA(j), j=1,...,N, will be the generalized
+ eigenvalues.
+
+ Note: the quotient ALPHA(j)/BETA(j) ) may easily over or
+ underflow, and BETA(j) may even be zero. Thus, the user
+ should avoid naively computing the ratio ALPHA/BETA.
+ However, ALPHA will be always less than and usually
+ comparable with norm(A) in magnitude, and BETA always less
+ than and usually comparable with norm(B).
+
+ VL
+ VL is COMPLEX array, dimension (LDVL,N)
+ If JOBVL = 'V', the left generalized eigenvectors u(j) are
+ stored one after another in the columns of VL, in the same
+ order as their eigenvalues.
+ Each eigenvector will be scaled so the largest component
+ will have abs(real part) + abs(imag. part) = 1.
+ Not referenced if JOBVL = 'N'.
+
+ LDVL
+ LDVL is INTEGER
+ The leading dimension of the matrix VL. LDVL >= 1, and
+ if JOBVL = 'V', LDVL >= N.
+
+ VR
+ VR is COMPLEX array, dimension (LDVR,N)
+ If JOBVR = 'V', the right generalized eigenvectors v(j) are
+ stored one after another in the columns of VR, in the same
+ order as their eigenvalues.
+ Each eigenvector will be scaled so the largest component
+ will have abs(real part) + abs(imag. part) = 1.
+ Not referenced if JOBVR = 'N'.
+
+ LDVR
+ LDVR is INTEGER
+ The leading dimension of the matrix VR. LDVR >= 1, and
+ if JOBVR = 'V', LDVR >= N.
+
+ ILO
+ ILO is INTEGER
+
+ IHI
+ IHI is INTEGER
+ ILO and IHI are integer values such that on exit
+ A(i,j) = 0 and B(i,j) = 0 if i > j and
+ j = 1,...,ILO1 or i = IHI+1,...,N.
+ If BALANC = 'N' or 'S', ILO = 1 and IHI = N.
+
+ LSCALE
+ LSCALE is REAL array, dimension (N)
+ Details of the permutations and scaling factors applied
+ to the left side of A and B. If PL(j) is the index of the
+ row interchanged with row j, and DL(j) is the scaling
+ factor applied to row j, then
+ LSCALE(j) = PL(j) for j = 1,...,ILO1
+ = DL(j) for j = ILO,...,IHI
+ = PL(j) for j = IHI+1,...,N.
+ The order in which the interchanges are made is N to IHI+1,
+ then 1 to ILO1.
+
+ RSCALE
+ RSCALE is REAL array, dimension (N)
+ Details of the permutations and scaling factors applied
+ to the right side of A and B. If PR(j) is the index of the
+ column interchanged with column j, and DR(j) is the scaling
+ factor applied to column j, then
+ RSCALE(j) = PR(j) for j = 1,...,ILO1
+ = DR(j) for j = ILO,...,IHI
+ = PR(j) for j = IHI+1,...,N
+ The order in which the interchanges are made is N to IHI+1,
+ then 1 to ILO1.
+
+ ABNRM
+ ABNRM is REAL
+ The onenorm of the balanced matrix A.
+
+ BBNRM
+ BBNRM is REAL
+ The onenorm of the balanced matrix B.
+
+ RCONDE
+ RCONDE is REAL array, dimension (N)
+ If SENSE = 'E' or 'B', the reciprocal condition numbers of
+ the eigenvalues, stored in consecutive elements of the array.
+ If SENSE = 'N' or 'V', RCONDE is not referenced.
+
+ RCONDV
+ RCONDV is REAL array, dimension (N)
+ If SENSE = 'V' or 'B', the estimated reciprocal condition
+ numbers of the eigenvectors, stored in consecutive elements
+ of the array. If the eigenvalues cannot be reordered to
+ compute RCONDV(j), RCONDV(j) is set to 0; this can only occur
+ when the true value would be very small anyway.
+ If SENSE = 'N' or 'E', RCONDV is not referenced.
+
+ WORK
+ WORK is COMPLEX array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK. LWORK >= max(1,2*N).
+ If SENSE = 'E', LWORK >= max(1,4*N).
+ If SENSE = 'V' or 'B', LWORK >= max(1,2*N*N+2*N).
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ RWORK
+ RWORK is REAL array, dimension (lrwork)
+ lrwork must be at least max(1,6*N) if BALANC = 'S' or 'B',
+ and at least max(1,2*N) otherwise.
+ Real workspace.
+
+ IWORK
+ IWORK is INTEGER array, dimension (N+2)
+ If SENSE = 'E', IWORK is not referenced.
+
+ BWORK
+ BWORK is LOGICAL array, dimension (N)
+ If SENSE = 'N', BWORK is not referenced.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value.
+ = 1,...,N:
+ The QZ iteration failed. No eigenvectors have been
+ calculated, but ALPHA(j) and BETA(j) should be correct
+ for j=INFO+1,...,N.
+ > N: =N+1: other than QZ iteration failed in CHGEQZ.
+ =N+2: error return from CTGEVC.
+
+ Balancing a matrix pair (A,B) includes, first, permuting rows and
+ columns to isolate eigenvalues, second, applying diagonal similarity
+ transformation to the rows and columns to make the rows and columns
+ as close in norm as possible. The computed reciprocal condition
+ numbers correspond to the balanced matrix. Permuting rows and columns
+ will not change the condition numbers (in exact arithmetic) but
+ diagonal scaling will. For further explanation of balancing, see
+ section 4.11.1.2 of LAPACK Users' Guide.
+
+ An approximate error bound on the chordal distance between the ith
+ computed generalized eigenvalue w and the corresponding exact
+ eigenvalue lambda is
+
+ chord(w, lambda) <= EPS * norm(ABNRM, BBNRM) / RCONDE(I)
+
+ An approximate error bound for the angle between the ith computed
+ eigenvector VL(i) or VR(i) is given by
+
+ EPS * norm(ABNRM, BBNRM) / DIF(i).
+
+ For further explanation of the reciprocal condition numbers RCONDE
+ and RCONDV, see section 4.11 of LAPACK User's Guide.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{cggevx.f}
+\index{cggevx.f}
+\begin{chunk}{cggevx.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK cggevx}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\chapter{LAPACK  General Matrices, Eigenvalue , Complex16}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{zgees}
+\label{zgees}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{zgees.input}
+)set break resume
+)sys rm f zgees.output
+)spool zgees.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{zgees.help}
+====================================================================
+zgees examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine zgees (JOBVS, SORT, SELECT, N, A, LDA, SDIM, W, VS, LDVS,
+ WORK, LWORK, RWORK, BWORK, INFO)
+ ZGEES computes the eigenvalues, the Schur form, and, optionally,
+ the matrix of Schur vectors for GE matrices
+
+Function/Subroutine Documentation
+ subroutine zgees (character JOBVS, character SORT, external SELECT, integer
+ N, complex*16, dimension( lda, * ) A, integer LDA, integer SDIM,
+ complex*16, dimension( * ) W, complex*16, dimension( ldvs, * ) VS,
+ integer LDVS, complex*16, dimension( * ) WORK, integer LWORK, double
+ precision, dimension( * ) RWORK, logical, dimension( * ) BWORK, integer
+ INFO)
+ ZGEES computes the eigenvalues, the Schur form, and, optionally, the
+ matrix of Schur vectors for GE matrices
+
+Purpose:
+ ZGEES computes for an NbyN complex nonsymmetric matrix A, the
+ eigenvalues, the Schur form T, and, optionally, the matrix of Schur
+ vectors Z. This gives the Schur factorization A = Z*T*(Z**H).
+
+ Optionally, it also orders the eigenvalues on the diagonal of the
+ Schur form so that selected eigenvalues are at the top left.
+ The leading columns of Z then form an orthonormal basis for the
+ invariant subspace corresponding to the selected eigenvalues.
+
+ A complex matrix is in Schur form if it is upper triangular.
+
+Parameters:
+
+ JOBVS
+ JOBVS is CHARACTER*1
+ = 'N': Schur vectors are not computed;
+ = 'V': Schur vectors are computed.
+
+ SORT
+ SORT is CHARACTER*1
+ Specifies whether or not to order the eigenvalues on the
+ diagonal of the Schur form.
+ = 'N': Eigenvalues are not ordered:
+ = 'S': Eigenvalues are ordered (see SELECT).
+
+ SELECT
+ SELECT is a LOGICAL FUNCTION of one COMPLEX*16 argument
+ SELECT must be declared EXTERNAL in the calling subroutine.
+ If SORT = 'S', SELECT is used to select eigenvalues to order
+ to the top left of the Schur form.
+ IF SORT = 'N', SELECT is not referenced.
+ The eigenvalue W(j) is selected if SELECT(W(j)) is true.
+
+ N
+ N is INTEGER
+ The order of the matrix A. N >= 0.
+
+ A
+ A is COMPLEX*16 array, dimension (LDA,N)
+ On entry, the NbyN matrix A.
+ On exit, A has been overwritten by its Schur form T.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,N).
+
+ SDIM
+ SDIM is INTEGER
+ If SORT = 'N', SDIM = 0.
+ If SORT = 'S', SDIM = number of eigenvalues for which SELECT is true.
+
+ W
+ W is COMPLEX*16 array, dimension (N)
+ W contains the computed eigenvalues, in the same order that
+ they appear on the diagonal of the output Schur form T.
+
+ VS
+ VS is COMPLEX*16 array, dimension (LDVS,N)
+ If JOBVS = 'V', VS contains the unitary matrix Z of Schur vectors.
+ If JOBVS = 'N', VS is not referenced.
+
+ LDVS
+ LDVS is INTEGER
+ The leading dimension of the array VS. LDVS >= 1; if
+ JOBVS = 'V', LDVS >= N.
+
+ WORK
+ WORK is COMPLEX*16 array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK. LWORK >= max(1,2*N).
+ For good performance, LWORK must generally be larger.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ RWORK
+ RWORK is DOUBLE PRECISION array, dimension (N)
+
+ BWORK
+ BWORK is LOGICAL array, dimension (N)
+ Not referenced if SORT = 'N'.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value.
+ > 0: if INFO = i, and i is
+ <= N: the QR algorithm failed to compute all the
+ eigenvalues; elements 1:ILO1 and i+1:N of W
+ contain those eigenvalues which have converged;
+ if JOBVS = 'V', VS contains the matrix which
+ reduces A to its partially converged Schur form.
+ = N+1: the eigenvalues could not be reordered because
+ some eigenvalues were too close to separate (the
+ problem is very illconditioned);
+ = N+2: after reordering, roundoff changed values of
+ some complex eigenvalues so that leading
+ eigenvalues in the Schur form no longer satisfy
+ SELECT = .TRUE.. This could also be caused by
+ underflow due to scaling.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{zgees.f}
+\index{zgees.f}
+\begin{chunk}{zgees.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK zgees}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{zgeesx}
+\label{zgeesx}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{zgeesx.input}
+)set break resume
+)sys rm f zgeesx.output
+)spool zgeesx.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{zgeesx.help}
+====================================================================
+zgeesx examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine zgeesx (JOBVS, SORT, SELECT, SENSE, N, A, LDA, SDIM, W, VS,
+ LDVS, RCONDE, RCONDV, WORK, LWORK, RWORK, BWORK, INFO)
+ ZGEESX computes the eigenvalues, the Schur form, and, optionally,
+ the matrix of Schur vectors for GE matrices
+
+Function/Subroutine Documentation
+ subroutine zgeesx (character JOBVS, character SORT, external SELECT,
+ character SENSE, integer N, complex*16, dimension( lda, * ) A, integer
+ LDA, integer SDIM, complex*16, dimension( * ) W, complex*16, dimension(
+ ldvs, * ) VS, integer LDVS, double precision RCONDE, double precision
+ RCONDV, complex*16, dimension( * ) WORK, integer LWORK, double
+ precision, dimension( * ) RWORK, logical, dimension( * ) BWORK, integer
+ INFO)
+ ZGEESX computes the eigenvalues, the Schur form, and, optionally, the
+ matrix of Schur vectors for GE matrices
+
+Purpose:
+ ZGEESX computes for an NbyN complex nonsymmetric matrix A, the
+ eigenvalues, the Schur form T, and, optionally, the matrix of Schur
+ vectors Z. This gives the Schur factorization A = Z*T*(Z**H).
+
+ Optionally, it also orders the eigenvalues on the diagonal of the
+ Schur form so that selected eigenvalues are at the top left;
+ computes a reciprocal condition number for the average of the
+ selected eigenvalues (RCONDE); and computes a reciprocal condition
+ number for the right invariant subspace corresponding to the
+ selected eigenvalues (RCONDV). The leading columns of Z form an
+ orthonormal basis for this invariant subspace.
+
+ For further explanation of the reciprocal condition numbers RCONDE
+ and RCONDV, see Section 4.10 of the LAPACK Users' Guide (where
+ these quantities are called s and sep respectively).
+
+ A complex matrix is in Schur form if it is upper triangular.
+
+Parameters:
+
+ JOBVS
+ JOBVS is CHARACTER*1
+ = 'N': Schur vectors are not computed;
+ = 'V': Schur vectors are computed.
+
+ SORT
+ SORT is CHARACTER*1
+ Specifies whether or not to order the eigenvalues on the
+ diagonal of the Schur form.
+ = 'N': Eigenvalues are not ordered;
+ = 'S': Eigenvalues are ordered (see SELECT).
+
+ SELECT
+ SELECT is procedure) LOGICAL FUNCTION of one COMPLEX*16 argument
+ SELECT must be declared EXTERNAL in the calling subroutine.
+ If SORT = 'S', SELECT is used to select eigenvalues to order
+ to the top left of the Schur form.
+ If SORT = 'N', SELECT is not referenced.
+ An eigenvalue W(j) is selected if SELECT(W(j)) is true.
+
+ SENSE
+ SENSE is CHARACTER*1
+ Determines which reciprocal condition numbers are computed.
+ = 'N': None are computed;
+ = 'E': Computed for average of selected eigenvalues only;
+ = 'V': Computed for selected right invariant subspace only;
+ = 'B': Computed for both.
+ If SENSE = 'E', 'V' or 'B', SORT must equal 'S'.
+
+ N
+ N is INTEGER
+ The order of the matrix A. N >= 0.
+
+ A
+ A is COMPLEX*16 array, dimension (LDA, N)
+ On entry, the NbyN matrix A.
+ On exit, A is overwritten by its Schur form T.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,N).
+
+ SDIM
+ SDIM is INTEGER
+ If SORT = 'N', SDIM = 0.
+ If SORT = 'S', SDIM = number of eigenvalues for which SELECT is true.
+
+ W
+ W is COMPLEX*16 array, dimension (N)
+ W contains the computed eigenvalues, in the same order
+ that they appear on the diagonal of the output Schur form T.
+
+ VS
+ VS is COMPLEX*16 array, dimension (LDVS,N)
+ If JOBVS = 'V', VS contains the unitary matrix Z of Schur vectors.
+ If JOBVS = 'N', VS is not referenced.
+
+ LDVS
+ LDVS is INTEGER
+ The leading dimension of the array VS. LDVS >= 1, and if
+ JOBVS = 'V', LDVS >= N.
+
+ RCONDE
+ RCONDE is DOUBLE PRECISION
+ If SENSE = 'E' or 'B', RCONDE contains the reciprocal
+ condition number for the average of the selected eigenvalues.
+ Not referenced if SENSE = 'N' or 'V'.
+
+ RCONDV
+ RCONDV is DOUBLE PRECISION
+ If SENSE = 'V' or 'B', RCONDV contains the reciprocal
+ condition number for the selected right invariant subspace.
+ Not referenced if SENSE = 'N' or 'E'.
+
+ WORK
+ WORK is COMPLEX*16 array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK. LWORK >= max(1,2*N).
+ Also, if SENSE = 'E' or 'V' or 'B', LWORK >= 2*SDIM*(NSDIM),
+ where SDIM is the number of selected eigenvalues computed by
+ this routine. Note that 2*SDIM*(NSDIM) <= N*N/2. Note also
+ that an error is only returned if LWORK < max(1,2*N), but if
+ SENSE = 'E' or 'V' or 'B' this may not be large enough.
+ For good performance, LWORK must generally be larger.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates upper bound on the optimal size of the
+ array WORK, returns this value as the first entry of the WORK
+ array, and no error message related to LWORK is issued by XERBLA.
+
+ RWORK
+ RWORK is DOUBLE PRECISION array, dimension (N)
+
+ BWORK
+ BWORK is LOGICAL array, dimension (N)
+ Not referenced if SORT = 'N'.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value.
+ > 0: if INFO = i, and i is
+ <= N: the QR algorithm failed to compute all the
+ eigenvalues; elements 1:ILO1 and i+1:N of W
+ contain those eigenvalues which have converged; if
+ JOBVS = 'V', VS contains the transformation which
+ reduces A to its partially converged Schur form.
+ = N+1: the eigenvalues could not be reordered because some
+ eigenvalues were too close to separate (the problem
+ is very illconditioned);
+ = N+2: after reordering, roundoff changed values of some
+ complex eigenvalues so that leading eigenvalues in
+ the Schur form no longer satisfy SELECT=.TRUE. This
+ could also be caused by underflow due to scaling.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{zgeesx.f}
+\index{zgeesx.f}
+\begin{chunk}{zgeesx.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK zgeesx}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{zgeev}
+\label{zgeev}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{zgeev.input}
+)set break resume
+)sys rm f zgeev.output
+)spool zgeev.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{zgeev.help}
+====================================================================
+zgeev examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine zgeev (JOBVL, JOBVR, N, A, LDA, W, VL, LDVL, VR, LDVR, WORK,
+ LWORK, RWORK, INFO)
+ ZGEEV computes the eigenvalues and, optionally, the left and/or
+ right eigenvectors for GE matrices
+
+Function/Subroutine Documentation
+ subroutine zgeev (character JOBVL, character JOBVR, integer N, complex*16,
+ dimension( lda, * ) A, integer LDA, complex*16, dimension( * ) W,
+ complex*16, dimension( ldvl, * ) VL, integer LDVL, complex*16,
+ dimension( ldvr, * ) VR, integer LDVR, complex*16, dimension( * ) WORK,
+ integer LWORK, double precision, dimension( * ) RWORK, integer INFO)
+ ZGEEV computes the eigenvalues and, optionally, the left and/or right
+ eigenvectors for GE matrices
+
+Purpose:
+ ZGEEV computes for an NbyN complex nonsymmetric matrix A, the
+ eigenvalues and, optionally, the left and/or right eigenvectors.
+
+ The right eigenvector v(j) of A satisfies
+ A * v(j) = lambda(j) * v(j)
+ where lambda(j) is its eigenvalue.
+ The left eigenvector u(j) of A satisfies
+ u(j)**H * A = lambda(j) * u(j)**H
+ where u(j)**H denotes the conjugate transpose of u(j).
+
+ The computed eigenvectors are normalized to have Euclidean norm
+ equal to 1 and largest component real.
+
+Parameters:
+
+ JOBVL
+ JOBVL is CHARACTER*1
+ = 'N': left eigenvectors of A are not computed;
+ = 'V': left eigenvectors of are computed.
+
+ JOBVR
+ JOBVR is CHARACTER*1
+ = 'N': right eigenvectors of A are not computed;
+ = 'V': right eigenvectors of A are computed.
+
+ N
+ N is INTEGER
+ The order of the matrix A. N >= 0.
+
+ A
+ A is COMPLEX*16 array, dimension (LDA,N)
+ On entry, the NbyN matrix A.
+ On exit, A has been overwritten.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,N).
+
+ W
+ W is COMPLEX*16 array, dimension (N)
+ W contains the computed eigenvalues.
+
+ VL
+ VL is COMPLEX*16 array, dimension (LDVL,N)
+ If JOBVL = 'V', the left eigenvectors u(j) are stored one
+ after another in the columns of VL, in the same order
+ as their eigenvalues.
+ If JOBVL = 'N', VL is not referenced.
+ u(j) = VL(:,j), the jth column of VL.
+
+ LDVL
+ LDVL is INTEGER
+ The leading dimension of the array VL. LDVL >= 1; if
+ JOBVL = 'V', LDVL >= N.
+
+ VR
+ VR is COMPLEX*16 array, dimension (LDVR,N)
+ If JOBVR = 'V', the right eigenvectors v(j) are stored one
+ after another in the columns of VR, in the same order
+ as their eigenvalues.
+ If JOBVR = 'N', VR is not referenced.
+ v(j) = VR(:,j), the jth column of VR.
+
+ LDVR
+ LDVR is INTEGER
+ The leading dimension of the array VR. LDVR >= 1; if
+ JOBVR = 'V', LDVR >= N.
+
+ WORK
+ WORK is COMPLEX*16 array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK. LWORK >= max(1,2*N).
+ For good performance, LWORK must generally be larger.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ RWORK
+ RWORK is DOUBLE PRECISION array, dimension (2*N)
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value.
+ > 0: if INFO = i, the QR algorithm failed to compute all the
+ eigenvalues, and no eigenvectors have been computed;
+ elements and i+1:N of W contain eigenvalues which have converged.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{zgeev.f}
+\index{zgeev.f}
+\begin{chunk}{zgeev.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK zgeev}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{zgeevx}
+\label{zgeevx}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{zgeevx.input}
+)set break resume
+)sys rm f zgeevx.output
+)spool zgeevx.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{zgeevx.help}
+====================================================================
+zgeevx examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine zgeevx (BALANC, JOBVL, JOBVR, SENSE, N, A, LDA, W, VL, LDVL,
+ VR, LDVR, ILO, IHI, SCALE, ABNRM, RCONDE, RCONDV, WORK, LWORK,
+ RWORK, INFO)
+ ZGEEVX computes the eigenvalues and, optionally, the left and/or
+ right eigenvectors for GE matrices
+
+Function/Subroutine Documentation
+ subroutine zgeevx (character BALANC, character JOBVL, character JOBVR,
+ character SENSE, integer N, complex*16, dimension( lda, * ) A, integer
+ LDA, complex*16, dimension( * ) W, complex*16, dimension( ldvl, * ) VL,
+ integer LDVL, complex*16, dimension( ldvr, * ) VR, integer LDVR,
+ integer ILO, integer IHI, double precision, dimension( * ) SCALE,
+ double precision ABNRM, double precision, dimension( * ) RCONDE, double
+ precision, dimension( * ) RCONDV, complex*16, dimension( * ) WORK,
+ integer LWORK, double precision, dimension( * ) RWORK, integer INFO)
+ ZGEEVX computes the eigenvalues and, optionally, the left and/or right
+ eigenvectors for GE matrices
+
+Purpose:
+ ZGEEVX computes for an NbyN complex nonsymmetric matrix A, the
+ eigenvalues and, optionally, the left and/or right eigenvectors.
+
+ Optionally also, it computes a balancing transformation to improve
+ the conditioning of the eigenvalues and eigenvectors (ILO, IHI,
+ SCALE, and ABNRM), reciprocal condition numbers for the eigenvalues
+ (RCONDE), and reciprocal condition numbers for the right
+ eigenvectors (RCONDV).
+
+ The right eigenvector v(j) of A satisfies
+ A * v(j) = lambda(j) * v(j)
+ where lambda(j) is its eigenvalue.
+ The left eigenvector u(j) of A satisfies
+ u(j)**H * A = lambda(j) * u(j)**H
+ where u(j)**H denotes the conjugate transpose of u(j).
+
+ The computed eigenvectors are normalized to have Euclidean norm
+ equal to 1 and largest component real.
+
+ Balancing a matrix means permuting the rows and columns to make it
+ more nearly upper triangular, and applying a diagonal similarity
+ transformation D * A * D**(1), where D is a diagonal matrix, to
+ make its rows and columns closer in norm and the condition numbers
+ of its eigenvalues and eigenvectors smaller. The computed
+ reciprocal condition numbers correspond to the balanced matrix.
+ Permuting rows and columns will not change the condition numbers
+ (in exact arithmetic) but diagonal scaling will. For further
+ explanation of balancing, see section 4.10.2 of the LAPACK Users' Guide.
+
+Parameters:
+
+ BALANC
+ BALANC is CHARACTER*1
+ Indicates how the input matrix should be diagonally scaled
+ and/or permuted to improve the conditioning of its
+ eigenvalues.
+ = 'N': Do not diagonally scale or permute;
+ = 'P': Perform permutations to make the matrix more nearly
+ upper triangular. Do not diagonally scale;
+ = 'S': Diagonally scale the matrix, ie. replace A by
+ D*A*D**(1), where D is a diagonal matrix chosen
+ to make the rows and columns of A more equal in
+ norm. Do not permute;
+ = 'B': Both diagonally scale and permute A.
+
+ Computed reciprocal condition numbers will be for the matrix
+ after balancing and/or permuting. Permuting does not change
+ condition numbers (in exact arithmetic), but balancing does.
+
+ JOBVL
+ JOBVL is CHARACTER*1
+ = 'N': left eigenvectors of A are not computed;
+ = 'V': left eigenvectors of A are computed.
+ If SENSE = 'E' or 'B', JOBVL must = 'V'.
+
+ JOBVR
+ JOBVR is CHARACTER*1
+ = 'N': right eigenvectors of A are not computed;
+ = 'V': right eigenvectors of A are computed.
+ If SENSE = 'E' or 'B', JOBVR must = 'V'.
+
+ SENSE
+ SENSE is CHARACTER*1
+ Determines which reciprocal condition numbers are computed.
+ = 'N': None are computed;
+ = 'E': Computed for eigenvalues only;
+ = 'V': Computed for right eigenvectors only;
+ = 'B': Computed for eigenvalues and right eigenvectors.
+
+ If SENSE = 'E' or 'B', both left and right eigenvectors
+ must also be computed (JOBVL = 'V' and JOBVR = 'V').
+
+ N
+ N is INTEGER
+ The order of the matrix A. N >= 0.
+
+ A
+ A is COMPLEX*16 array, dimension (LDA,N)
+ On entry, the NbyN matrix A.
+ On exit, A has been overwritten. If JOBVL = 'V' or
+ JOBVR = 'V', A contains the Schur form of the balanced
+ version of the matrix A.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,N).
+
+ W
+ W is COMPLEX*16 array, dimension (N)
+ W contains the computed eigenvalues.
+
+ VL
+ VL is COMPLEX*16 array, dimension (LDVL,N)
+ If JOBVL = 'V', the left eigenvectors u(j) are stored one
+ after another in the columns of VL, in the same order
+ as their eigenvalues.
+ If JOBVL = 'N', VL is not referenced.
+ u(j) = VL(:,j), the jth column of VL.
+
+ LDVL
+ LDVL is INTEGER
+ The leading dimension of the array VL. LDVL >= 1; if
+ JOBVL = 'V', LDVL >= N.
+
+ VR
+ VR is COMPLEX*16 array, dimension (LDVR,N)
+ If JOBVR = 'V', the right eigenvectors v(j) are stored one
+ after another in the columns of VR, in the same order
+ as their eigenvalues.
+ If JOBVR = 'N', VR is not referenced.
+ v(j) = VR(:,j), the jth column of VR.
+
+ LDVR
+ LDVR is INTEGER
+ The leading dimension of the array VR. LDVR >= 1; if
+ JOBVR = 'V', LDVR >= N.
+
+ ILO
+ ILO is INTEGER
+
+ IHI
+ IHI is INTEGER
+ ILO and IHI are integer values determined when A was
+ balanced. The balanced A(i,j) = 0 if I > J and
+ J = 1,...,ILO1 or I = IHI+1,...,N.
+
+ SCALE
+ SCALE is DOUBLE PRECISION array, dimension (N)
+ Details of the permutations and scaling factors applied
+ when balancing A. If P(j) is the index of the row and column
+ interchanged with row and column j, and D(j) is the scaling
+ factor applied to row and column j, then
+ SCALE(J) = P(J), for J = 1,...,ILO1
+ = D(J), for J = ILO,...,IHI
+ = P(J) for J = IHI+1,...,N.
+ The order in which the interchanges are made is N to IHI+1,
+ then 1 to ILO1.
+
+ ABNRM
+ ABNRM is DOUBLE PRECISION
+ The onenorm of the balanced matrix (the maximum
+ of the sum of absolute values of elements of any column).
+
+ RCONDE
+ RCONDE is DOUBLE PRECISION array, dimension (N)
+ RCONDE(j) is the reciprocal condition number of the jth eigenvalue.
+
+ RCONDV
+ RCONDV is DOUBLE PRECISION array, dimension (N)
+ RCONDV(j) is the reciprocal condition number of the jth
+ right eigenvector.
+
+ WORK
+ WORK is COMPLEX*16 array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK. If SENSE = 'N' or 'E',
+ LWORK >= max(1,2*N), and if SENSE = 'V' or 'B',
+ LWORK >= N*N+2*N.
+ For good performance, LWORK must generally be larger.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ RWORK
+ RWORK is DOUBLE PRECISION array, dimension (2*N)
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value.
+ > 0: if INFO = i, the QR algorithm failed to compute all the
+ eigenvalues, and no eigenvectors or condition numbers
+ have been computed; elements 1:ILO1 and i+1:N of W
+ contain eigenvalues which have converged.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{zgeevx.f}
+\index{zgeevx.f}
+\begin{chunk}{zgeevx.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK zgeevx}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{zgegs  DEPRECATED use zgges}
+\label{zgegs}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{zgegv  DEPRECATED use zggev}
+\label{zgegv}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{zgges}
+\label{zgges}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{zgges.input}
+)set break resume
+)sys rm f zgges.output
+)spool zgges.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{zgges.help}
+====================================================================
+zgges examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine zgges (JOBVSL, JOBVSR, SORT, SELCTG, N, A, LDA, B, LDB,
+ SDIM, ALPHA, BETA, VSL, LDVSL, VSR, LDVSR, WORK, LWORK, RWORK,
+ BWORK, INFO)
+ ZGGES computes the eigenvalues, the Schur form, and, optionally,
+ the matrix of Schur vectors for GE matrices
+
+Function/Subroutine Documentation
+ subroutine zgges (character JOBVSL, character JOBVSR, character SORT,
+ external SELCTG, integer N, complex*16, dimension( lda, * ) A, integer
+ LDA, complex*16, dimension( ldb, * ) B, integer LDB, integer SDIM,
+ complex*16, dimension( * ) ALPHA, complex*16, dimension( * ) BETA,
+ complex*16, dimension( ldvsl, * ) VSL, integer LDVSL, complex*16,
+ dimension( ldvsr, * ) VSR, integer LDVSR, complex*16, dimension( * )
+ WORK, integer LWORK, double precision, dimension( * ) RWORK, logical,
+ dimension( * ) BWORK, integer INFO)
+ ZGGES computes the eigenvalues, the Schur form, and, optionally, the
+ matrix of Schur vectors for GE matrices
+
+Purpose:
+ ZGGES computes for a pair of NbyN complex nonsymmetric matrices
+ (A,B), the generalized eigenvalues, the generalized complex Schur
+ form (S, T), and optionally left and/or right Schur vectors (VSL
+ and VSR). This gives the generalized Schur factorization
+
+ (A,B) = ( (VSL)*S*(VSR)**H, (VSL)*T*(VSR)**H )
+
+ where (VSR)**H is the conjugatetranspose of VSR.
+
+ Optionally, it also orders the eigenvalues so that a selected cluster
+ of eigenvalues appears in the leading diagonal blocks of the upper
+ triangular matrix S and the upper triangular matrix T. The leading
+ columns of VSL and VSR then form an unitary basis for the
+ corresponding left and right eigenspaces (deflating subspaces).
+
+ (If only the generalized eigenvalues are needed, use the driver
+ ZGGEV instead, which is faster.)
+
+ A generalized eigenvalue for a pair of matrices (A,B) is a scalar w
+ or a ratio alpha/beta = w, such that A  w*B is singular. It is
+ usually represented as the pair (alpha,beta), as there is a
+ reasonable interpretation for beta=0, and even for both being zero.
+
+ A pair of matrices (S,T) is in generalized complex Schur form if S
+ and T are upper triangular and, in addition, the diagonal elements
+ of T are nonnegative real numbers.
+
+Parameters:
+
+ JOBVSL
+ JOBVSL is CHARACTER*1
+ = 'N': do not compute the left Schur vectors;
+ = 'V': compute the left Schur vectors.
+
+ JOBVSR
+ JOBVSR is CHARACTER*1
+ = 'N': do not compute the right Schur vectors;
+ = 'V': compute the right Schur vectors.
+
+ SORT
+ SORT is CHARACTER*1
+ Specifies whether or not to order the eigenvalues on the
+ diagonal of the generalized Schur form.
+ = 'N': Eigenvalues are not ordered;
+ = 'S': Eigenvalues are ordered (see SELCTG).
+
+ SELCTG
+ SELCTG is a LOGICAL FUNCTION of two COMPLEX*16 arguments
+ SELCTG must be declared EXTERNAL in the calling subroutine.
+ If SORT = 'N', SELCTG is not referenced.
+ If SORT = 'S', SELCTG is used to select eigenvalues to sort
+ to the top left of the Schur form.
+ An eigenvalue ALPHA(j)/BETA(j) is selected if
+ SELCTG(ALPHA(j),BETA(j)) is true.
+
+ Note that a selected complex eigenvalue may no longer satisfy
+ SELCTG(ALPHA(j),BETA(j)) = .TRUE. after ordering, since
+ ordering may change the value of complex eigenvalues
+ (especially if the eigenvalue is illconditioned), in this
+ case INFO is set to N+2 (See INFO below).
+
+ N
+ N is INTEGER
+ The order of the matrices A, B, VSL, and VSR. N >= 0.
+
+ A
+ A is COMPLEX*16 array, dimension (LDA, N)
+ On entry, the first of the pair of matrices.
+ On exit, A has been overwritten by its generalized Schur form S.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of A. LDA >= max(1,N).
+
+ B
+ B is COMPLEX*16 array, dimension (LDB, N)
+ On entry, the second of the pair of matrices.
+ On exit, B has been overwritten by its generalized Schur form T.
+
+ LDB
+ LDB is INTEGER
+ The leading dimension of B. LDB >= max(1,N).
+
+ SDIM
+ SDIM is INTEGER
+ If SORT = 'N', SDIM = 0.
+ If SORT = 'S', SDIM = number of eigenvalues (after sorting)
+ for which SELCTG is true.
+
+ ALPHA
+ ALPHA is COMPLEX*16 array, dimension (N)
+
+ BETA
+ BETA is COMPLEX*16 array, dimension (N)
+ On exit, ALPHA(j)/BETA(j), j=1,...,N, will be the
+ generalized eigenvalues. ALPHA(j), j=1,...,N and BETA(j),
+ j=1,...,N are the diagonals of the complex Schur form (A,B)
+ output by ZGGES. The BETA(j) will be nonnegative real.
+
+ Note: the quotients ALPHA(j)/BETA(j) may easily over or
+ underflow, and BETA(j) may even be zero. Thus, the user
+ should avoid naively computing the ratio alpha/beta.
+ However, ALPHA will be always less than and usually
+ comparable with norm(A) in magnitude, and BETA always less
+ than and usually comparable with norm(B).
+
+ VSL
+ VSL is COMPLEX*16 array, dimension (LDVSL,N)
+ If JOBVSL = 'V', VSL will contain the left Schur vectors.
+ Not referenced if JOBVSL = 'N'.
+
+ LDVSL
+ LDVSL is INTEGER
+ The leading dimension of the matrix VSL. LDVSL >= 1, and
+ if JOBVSL = 'V', LDVSL >= N.
+
+ VSR
+ VSR is COMPLEX*16 array, dimension (LDVSR,N)
+ If JOBVSR = 'V', VSR will contain the right Schur vectors.
+ Not referenced if JOBVSR = 'N'.
+
+ LDVSR
+ LDVSR is INTEGER
+ The leading dimension of the matrix VSR. LDVSR >= 1, and
+ if JOBVSR = 'V', LDVSR >= N.
+
+ WORK
+ WORK is COMPLEX*16 array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK. LWORK >= max(1,2*N).
+ For good performance, LWORK must generally be larger.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ RWORK
+ RWORK is DOUBLE PRECISION array, dimension (8*N)
+
+ BWORK
+ BWORK is LOGICAL array, dimension (N)
+ Not referenced if SORT = 'N'.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value.
+ =1,...,N:
+ The QZ iteration failed. (A,B) are not in Schur
+ form, but ALPHA(j) and BETA(j) should be correct for
+ j=INFO+1,...,N.
+ > N: =N+1: other than QZ iteration failed in ZHGEQZ
+ =N+2: after reordering, roundoff changed values of
+ some complex eigenvalues so that leading
+ eigenvalues in the Generalized Schur form no
+ longer satisfy SELCTG=.TRUE. This could also
+ be caused due to scaling.
+ =N+3: reordering failed in ZTGSEN.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{zgges.f}
+\index{zgges.f}
+\begin{chunk}{zgges.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK zgges}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{zgges3}
+\label{zgges3}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{zgges3.input}
+)set break resume
+)sys rm f zgges3.output
+)spool zgges3.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{zgges3.help}
+====================================================================
+zgges3 examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine zgges3 (JOBVSL, JOBVSR, SORT, SELCTG, N, A, LDA, B, LDB,
+ SDIM, ALPHA, BETA, VSL, LDVSL, VSR, LDVSR, WORK, LWORK, RWORK,
+ BWORK, INFO)
+ ZGGES3 computes the eigenvalues, the Schur form, and, optionally,
+ the matrix of Schur vectors for GE matrices (blocked algorithm)
+
+Function/Subroutine Documentation
+ subroutine zgges3 (character JOBVSL, character JOBVSR, character SORT,
+ external SELCTG, integer N, complex*16, dimension( lda, * ) A, integer
+ LDA, complex*16, dimension( ldb, * ) B, integer LDB, integer SDIM,
+ complex*16, dimension( * ) ALPHA, complex*16, dimension( * ) BETA,
+ complex*16, dimension( ldvsl, * ) VSL, integer LDVSL, complex*16,
+ dimension( ldvsr, * ) VSR, integer LDVSR, complex*16, dimension( * )
+ WORK, integer LWORK, double precision, dimension( * ) RWORK, logical,
+ dimension( * ) BWORK, integer INFO)
+ ZGGES3 computes the eigenvalues, the Schur form, and, optionally, the
+ matrix of Schur vectors for GE matrices (blocked algorithm)
+
+Purpose:
+ ZGGES3 computes for a pair of NbyN complex nonsymmetric matrices
+ (A,B), the generalized eigenvalues, the generalized complex Schur
+ form (S, T), and optionally left and/or right Schur vectors (VSL
+ and VSR). This gives the generalized Schur factorization
+
+ (A,B) = ( (VSL)*S*(VSR)**H, (VSL)*T*(VSR)**H )
+
+ where (VSR)**H is the conjugatetranspose of VSR.
+
+ Optionally, it also orders the eigenvalues so that a selected cluster
+ of eigenvalues appears in the leading diagonal blocks of the upper
+ triangular matrix S and the upper triangular matrix T. The leading
+ columns of VSL and VSR then form an unitary basis for the
+ corresponding left and right eigenspaces (deflating subspaces).
+
+ (If only the generalized eigenvalues are needed, use the driver
+ ZGGEV instead, which is faster.)
+
+ A generalized eigenvalue for a pair of matrices (A,B) is a scalar w
+ or a ratio alpha/beta = w, such that A  w*B is singular. It is
+ usually represented as the pair (alpha,beta), as there is a
+ reasonable interpretation for beta=0, and even for both being zero.
+
+ A pair of matrices (S,T) is in generalized complex Schur form if S
+ and T are upper triangular and, in addition, the diagonal elements
+ of T are nonnegative real numbers.
+
+Parameters:
+
+ JOBVSL
+ JOBVSL is CHARACTER*1
+ = 'N': do not compute the left Schur vectors;
+ = 'V': compute the left Schur vectors.
+
+ JOBVSR
+ JOBVSR is CHARACTER*1
+ = 'N': do not compute the right Schur vectors;
+ = 'V': compute the right Schur vectors.
+
+ SORT
+ SORT is CHARACTER*1
+ Specifies whether or not to order the eigenvalues on the
+ diagonal of the generalized Schur form.
+ = 'N': Eigenvalues are not ordered;
+ = 'S': Eigenvalues are ordered (see SELCTG).
+
+ SELCTG
+ SELCTG is a LOGICAL FUNCTION of two COMPLEX*16 arguments
+ SELCTG must be declared EXTERNAL in the calling subroutine.
+ If SORT = 'N', SELCTG is not referenced.
+ If SORT = 'S', SELCTG is used to select eigenvalues to sort
+ to the top left of the Schur form.
+ An eigenvalue ALPHA(j)/BETA(j) is selected if
+ SELCTG(ALPHA(j),BETA(j)) is true.
+
+ Note that a selected complex eigenvalue may no longer satisfy
+ SELCTG(ALPHA(j),BETA(j)) = .TRUE. after ordering, since
+ ordering may change the value of complex eigenvalues
+ (especially if the eigenvalue is illconditioned), in this
+ case INFO is set to N+2 (See INFO below).
+
+ N
+ N is INTEGER
+ The order of the matrices A, B, VSL, and VSR. N >= 0.
+
+ A
+ A is COMPLEX*16 array, dimension (LDA, N)
+ On entry, the first of the pair of matrices.
+ On exit, A has been overwritten by its generalized Schur form S.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of A. LDA >= max(1,N).
+
+ B
+ B is COMPLEX*16 array, dimension (LDB, N)
+ On entry, the second of the pair of matrices.
+ On exit, B has been overwritten by its generalized Schur form T.
+
+ LDB
+ LDB is INTEGER
+ The leading dimension of B. LDB >= max(1,N).
+
+ SDIM
+ SDIM is INTEGER
+ If SORT = 'N', SDIM = 0.
+ If SORT = 'S', SDIM = number of eigenvalues (after sorting)
+ for which SELCTG is true.
+
+ ALPHA
+ ALPHA is COMPLEX*16 array, dimension (N)
+
+ BETA
+ BETA is COMPLEX*16 array, dimension (N)
+ On exit, ALPHA(j)/BETA(j), j=1,...,N, will be the
+ generalized eigenvalues. ALPHA(j), j=1,...,N and BETA(j),
+ j=1,...,N are the diagonals of the complex Schur form (A,B)
+ output by ZGGES3. The BETA(j) will be nonnegative real.
+
+ Note: the quotients ALPHA(j)/BETA(j) may easily over or
+ underflow, and BETA(j) may even be zero. Thus, the user
+ should avoid naively computing the ratio alpha/beta.
+ However, ALPHA will be always less than and usually
+ comparable with norm(A) in magnitude, and BETA always less
+ than and usually comparable with norm(B).
+
+ VSL
+ VSL is COMPLEX*16 array, dimension (LDVSL,N)
+ If JOBVSL = 'V', VSL will contain the left Schur vectors.
+ Not referenced if JOBVSL = 'N'.
+
+ LDVSL
+ LDVSL is INTEGER
+ The leading dimension of the matrix VSL. LDVSL >= 1, and
+ if JOBVSL = 'V', LDVSL >= N.
+
+ VSR
+ VSR is COMPLEX*16 array, dimension (LDVSR,N)
+ If JOBVSR = 'V', VSR will contain the right Schur vectors.
+ Not referenced if JOBVSR = 'N'.
+
+ LDVSR
+ LDVSR is INTEGER
+ The leading dimension of the matrix VSR. LDVSR >= 1, and
+ if JOBVSR = 'V', LDVSR >= N.
+
+ WORK
+ WORK is COMPLEX*16 array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ RWORK
+ RWORK is DOUBLE PRECISION array, dimension (8*N)
+
+ BWORK
+ BWORK is LOGICAL array, dimension (N)
+ Not referenced if SORT = 'N'.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value.
+ =1,...,N:
+ The QZ iteration failed. (A,B) are not in Schur
+ form, but ALPHA(j) and BETA(j) should be correct for
+ j=INFO+1,...,N.
+ > N: =N+1: other than QZ iteration failed in ZHGEQZ
+ =N+2: after reordering, roundoff changed values of
+ some complex eigenvalues so that leading
+ eigenvalues in the Generalized Schur form no
+ longer satisfy SELCTG=.TRUE. This could also
+ be caused due to scaling.
+ =N+3: reordering failed in ZTGSEN.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{zgges3.f}
+\index{zgges3.f}
+\begin{chunk}{zgges3.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK zgges3}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{zggesx}
+\label{zggesx}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{zggesx.input}
+)set break resume
+)sys rm f zggesx.output
+)spool zggesx.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{zggesx.help}
+====================================================================
+zggesx examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine zggesx (JOBVSL, JOBVSR, SORT, SELCTG, SENSE, N, A, LDA, B,
+ LDB, SDIM, ALPHA, BETA, VSL, LDVSL, VSR, LDVSR, RCONDE, RCONDV,
+ WORK, LWORK, RWORK, IWORK, LIWORK, BWORK, INFO)
+ ZGGESX computes the eigenvalues, the Schur form, and, optionally,
+ the matrix of Schur vectors for GE matrices
+
+Function/Subroutine Documentation
+ subroutine zggesx (character JOBVSL, character JOBVSR, character SORT,
+ external SELCTG, character SENSE, integer N, complex*16, dimension(
+ lda, * ) A, integer LDA, complex*16, dimension( ldb, * ) B, integer
+ LDB, integer SDIM, complex*16, dimension( * ) ALPHA, complex*16,
+ dimension( * ) BETA, complex*16, dimension( ldvsl, * ) VSL, integer
+ LDVSL, complex*16, dimension( ldvsr, * ) VSR, integer LDVSR, double
+ precision, dimension( 2 ) RCONDE, double precision, dimension( 2 )
+ RCONDV, complex*16, dimension( * ) WORK, integer LWORK, double
+ precision, dimension( * ) RWORK, integer, dimension( * ) IWORK, integer
+ LIWORK, logical, dimension( * ) BWORK, integer INFO)
+ ZGGESX computes the eigenvalues, the Schur form, and, optionally, the
+ matrix of Schur vectors for GE matrices
+
+Purpose:
+ ZGGESX computes for a pair of NbyN complex nonsymmetric matrices
+ (A,B), the generalized eigenvalues, the complex Schur form (S,T),
+ and, optionally, the left and/or right matrices of Schur vectors (VSL
+ and VSR). This gives the generalized Schur factorization
+
+ (A,B) = ( (VSL) S (VSR)**H, (VSL) T (VSR)**H )
+
+ where (VSR)**H is the conjugatetranspose of VSR.
+
+ Optionally, it also orders the eigenvalues so that a selected cluster
+ of eigenvalues appears in the leading diagonal blocks of the upper
+ triangular matrix S and the upper triangular matrix T; computes
+ a reciprocal condition number for the average of the selected
+ eigenvalues (RCONDE); and computes a reciprocal condition number for
+ the right and left deflating subspaces corresponding to the selected
+ eigenvalues (RCONDV). The leading columns of VSL and VSR then form
+ an orthonormal basis for the corresponding left and right eigenspaces
+ (deflating subspaces).
+
+ A generalized eigenvalue for a pair of matrices (A,B) is a scalar w
+ or a ratio alpha/beta = w, such that A  w*B is singular. It is
+ usually represented as the pair (alpha,beta), as there is a
+ reasonable interpretation for beta=0 or for both being zero.
+
+ A pair of matrices (S,T) is in generalized complex Schur form if T is
+ upper triangular with nonnegative diagonal and S is upper
+ triangular.
+
+Parameters:
+
+ JOBVSL
+ JOBVSL is CHARACTER*1
+ = 'N': do not compute the left Schur vectors;
+ = 'V': compute the left Schur vectors.
+
+ JOBVSR
+ JOBVSR is CHARACTER*1
+ = 'N': do not compute the right Schur vectors;
+ = 'V': compute the right Schur vectors.
+
+ SORT
+ SORT is CHARACTER*1
+ Specifies whether or not to order the eigenvalues on the
+ diagonal of the generalized Schur form.
+ = 'N': Eigenvalues are not ordered;
+ = 'S': Eigenvalues are ordered (see SELCTG).
+
+ SELCTG
+ SELCTG is procedure) LOGICAL FUNCTION of two COMPLEX*16 arguments
+ SELCTG must be declared EXTERNAL in the calling subroutine.
+ If SORT = 'N', SELCTG is not referenced.
+ If SORT = 'S', SELCTG is used to select eigenvalues to sort
+ to the top left of the Schur form.
+ Note that a selected complex eigenvalue may no longer satisfy
+ SELCTG(ALPHA(j),BETA(j)) = .TRUE. after ordering, since
+ ordering may change the value of complex eigenvalues
+ (especially if the eigenvalue is illconditioned), in this
+ case INFO is set to N+3 see INFO below).
+
+ SENSE
+ SENSE is CHARACTER*1
+ Determines which reciprocal condition numbers are computed.
+ = 'N' : None are computed;
+ = 'E' : Computed for average of selected eigenvalues only;
+ = 'V' : Computed for selected deflating subspaces only;
+ = 'B' : Computed for both.
+ If SENSE = 'E', 'V', or 'B', SORT must equal 'S'.
+
+ N
+ N is INTEGER
+ The order of the matrices A, B, VSL, and VSR. N >= 0.
+
+ A
+ A is COMPLEX*16 array, dimension (LDA, N)
+ On entry, the first of the pair of matrices.
+ On exit, A has been overwritten by its generalized Schur form S.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of A. LDA >= max(1,N).
+
+ B
+ B is COMPLEX*16 array, dimension (LDB, N)
+ On entry, the second of the pair of matrices.
+ On exit, B has been overwritten by its generalized Schur form T.
+
+ LDB
+ LDB is INTEGER
+ The leading dimension of B. LDB >= max(1,N).
+
+ SDIM
+ SDIM is INTEGER
+ If SORT = 'N', SDIM = 0.
+ If SORT = 'S', SDIM = number of eigenvalues (after sorting)
+ for which SELCTG is true.
+
+ ALPHA
+ ALPHA is COMPLEX*16 array, dimension (N)
+
+ BETA
+ BETA is COMPLEX*16 array, dimension (N)
+ On exit, ALPHA(j)/BETA(j), j=1,...,N, will be the
+ generalized eigenvalues. ALPHA(j) and BETA(j),j=1,...,N are
+ the diagonals of the complex Schur form (S,T). BETA(j) will
+ be nonnegative real.
+
+ Note: the quotients ALPHA(j)/BETA(j) may easily over or
+ underflow, and BETA(j) may even be zero. Thus, the user
+ should avoid naively computing the ratio alpha/beta.
+ However, ALPHA will be always less than and usually
+ comparable with norm(A) in magnitude, and BETA always less
+ than and usually comparable with norm(B).
+
+ VSL
+ VSL is COMPLEX*16 array, dimension (LDVSL,N)
+ If JOBVSL = 'V', VSL will contain the left Schur vectors.
+ Not referenced if JOBVSL = 'N'.
+
+ LDVSL
+ LDVSL is INTEGER
+ The leading dimension of the matrix VSL. LDVSL >=1, and
+ if JOBVSL = 'V', LDVSL >= N.
+
+ VSR
+ VSR is COMPLEX*16 array, dimension (LDVSR,N)
+ If JOBVSR = 'V', VSR will contain the right Schur vectors.
+ Not referenced if JOBVSR = 'N'.
+
+ LDVSR
+ LDVSR is INTEGER
+ The leading dimension of the matrix VSR. LDVSR >= 1, and
+ if JOBVSR = 'V', LDVSR >= N.
+
+ RCONDE
+ RCONDE is DOUBLE PRECISION array, dimension ( 2 )
+ If SENSE = 'E' or 'B', RCONDE(1) and RCONDE(2) contain the
+ reciprocal condition numbers for the average of the selected eigenvalues.
+ Not referenced if SENSE = 'N' or 'V'.
+
+ RCONDV
+ RCONDV is DOUBLE PRECISION array, dimension ( 2 )
+ If SENSE = 'V' or 'B', RCONDV(1) and RCONDV(2) contain the
+ reciprocal condition number for the selected deflating subspaces.
+ Not referenced if SENSE = 'N' or 'E'.
+
+ WORK
+ WORK is COMPLEX*16 array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK.
+ If N = 0, LWORK >= 1, else if SENSE = 'E', 'V', or 'B',
+ LWORK >= MAX(1,2*N,2*SDIM*(NSDIM)), else
+ LWORK >= MAX(1,2*N). Note that 2*SDIM*(NSDIM) <= N*N/2.
+ Note also that an error is only returned if
+ LWORK < MAX(1,2*N), but if SENSE = 'E' or 'V' or 'B' this may
+ not be large enough.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the bound on the optimal size of the WORK
+ array and the minimum size of the IWORK array, returns these
+ values as the first entries of the WORK and IWORK arrays, and
+ no error message related to LWORK or LIWORK is issued by XERBLA.
+
+ RWORK
+ RWORK is DOUBLE PRECISION array, dimension ( 8*N )
+ Real workspace.
+
+ IWORK
+ IWORK is INTEGER array, dimension (MAX(1,LIWORK))
+ On exit, if INFO = 0, IWORK(1) returns the minimum LIWORK.
+
+ LIWORK
+ LIWORK is INTEGER
+ The dimension of the array IWORK.
+ If SENSE = 'N' or N = 0, LIWORK >= 1, otherwise
+ LIWORK >= N+2.
+
+ If LIWORK = 1, then a workspace query is assumed; the
+ routine only calculates the bound on the optimal size of the
+ WORK array and the minimum size of the IWORK array, returns
+ these values as the first entries of the WORK and IWORK
+ arrays, and no error message related to LWORK or LIWORK is
+ issued by XERBLA.
+
+ BWORK
+ BWORK is LOGICAL array, dimension (N)
+ Not referenced if SORT = 'N'.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value.
+ = 1,...,N:
+ The QZ iteration failed. (A,B) are not in Schur
+ form, but ALPHA(j) and BETA(j) should be correct for
+ j=INFO+1,...,N.
+ > N: =N+1: other than QZ iteration failed in ZHGEQZ
+ =N+2: after reordering, roundoff changed values of
+ some complex eigenvalues so that leading
+ eigenvalues in the Generalized Schur form no
+ longer satisfy SELCTG=.TRUE. This could also
+ be caused due to scaling.
+ =N+3: reordering failed in ZTGSEN.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{zggesx.f}
+\index{zggesx.f}
+\begin{chunk}{zggesx.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK zggesx}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{zggev}
+\label{zggev}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{zggev.input}
+)set break resume
+)sys rm f zggev.output
+)spool zggev.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{zggev.help}
+====================================================================
+zggev examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine zggev (JOBVL, JOBVR, N, A, LDA, B, LDB, ALPHA, BETA, VL,
+ LDVL, VR, LDVR, WORK, LWORK, RWORK, INFO)
+ ZGGEV computes the eigenvalues and, optionally, the left and/or
+ right eigenvectors for GE matrices
+
+Function/Subroutine Documentation
+ subroutine zggev (character JOBVL, character JOBVR, integer N, complex*16,
+ dimension( lda, * ) A, integer LDA, complex*16, dimension( ldb, * ) B,
+ integer LDB, complex*16, dimension( * ) ALPHA, complex*16, dimension( *
+ ) BETA, complex*16, dimension( ldvl, * ) VL, integer LDVL, complex*16,
+ dimension( ldvr, * ) VR, integer LDVR, complex*16, dimension( * ) WORK,
+ integer LWORK, double precision, dimension( * ) RWORK, integer INFO)
+ ZGGEV computes the eigenvalues and, optionally, the left and/or right
+ eigenvectors for GE matrices
+
+Purpose:
+ ZGGEV computes for a pair of NbyN complex nonsymmetric matrices
+ (A,B), the generalized eigenvalues, and optionally, the left and/or
+ right generalized eigenvectors.
+
+ A generalized eigenvalue for a pair of matrices (A,B) is a scalar
+ lambda or a ratio alpha/beta = lambda, such that A  lambda*B is
+ singular. It is usually represented as the pair (alpha,beta), as
+ there is a reasonable interpretation for beta=0, and even for both
+ being zero.
+
+ The right generalized eigenvector v(j) corresponding to the
+ generalized eigenvalue lambda(j) of (A,B) satisfies
+
+ A * v(j) = lambda(j) * B * v(j).
+
+ The left generalized eigenvector u(j) corresponding to the
+ generalized eigenvalues lambda(j) of (A,B) satisfies
+
+ u(j)**H * A = lambda(j) * u(j)**H * B
+
+ where u(j)**H is the conjugatetranspose of u(j).
+
+Parameters:
+
+ JOBVL
+ JOBVL is CHARACTER*1
+ = 'N': do not compute the left generalized eigenvectors;
+ = 'V': compute the left generalized eigenvectors.
+
+ JOBVR
+ JOBVR is CHARACTER*1
+ = 'N': do not compute the right generalized eigenvectors;
+ = 'V': compute the right generalized eigenvectors.
+
+ N
+ N is INTEGER
+ The order of the matrices A, B, VL, and VR. N >= 0.
+
+ A
+ A is COMPLEX*16 array, dimension (LDA, N)
+ On entry, the matrix A in the pair (A,B).
+ On exit, A has been overwritten.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of A. LDA >= max(1,N).
+
+ B
+ B is COMPLEX*16 array, dimension (LDB, N)
+ On entry, the matrix B in the pair (A,B).
+ On exit, B has been overwritten.
+
+ LDB
+ LDB is INTEGER
+ The leading dimension of B. LDB >= max(1,N).
+
+ ALPHA
+ ALPHA is COMPLEX*16 array, dimension (N)
+
+ BETA
+ BETA is COMPLEX*16 array, dimension (N)
+ On exit, ALPHA(j)/BETA(j), j=1,...,N, will be the
+ generalized eigenvalues.
+
+ Note: the quotients ALPHA(j)/BETA(j) may easily over or
+ underflow, and BETA(j) may even be zero. Thus, the user
+ should avoid naively computing the ratio alpha/beta.
+ However, ALPHA will be always less than and usually
+ comparable with norm(A) in magnitude, and BETA always less
+ than and usually comparable with norm(B).
+
+ VL
+ VL is COMPLEX*16 array, dimension (LDVL,N)
+ If JOBVL = 'V', the left generalized eigenvectors u(j) are
+ stored one after another in the columns of VL, in the same
+ order as their eigenvalues.
+ Each eigenvector is scaled so the largest component has
+ abs(real part) + abs(imag. part) = 1.
+ Not referenced if JOBVL = 'N'.
+
+ LDVL
+ LDVL is INTEGER
+ The leading dimension of the matrix VL. LDVL >= 1, and
+ if JOBVL = 'V', LDVL >= N.
+
+ VR
+ VR is COMPLEX*16 array, dimension (LDVR,N)
+ If JOBVR = 'V', the right generalized eigenvectors v(j) are
+ stored one after another in the columns of VR, in the same
+ order as their eigenvalues.
+ Each eigenvector is scaled so the largest component has
+ abs(real part) + abs(imag. part) = 1.
+ Not referenced if JOBVR = 'N'.
+
+ LDVR
+ LDVR is INTEGER
+ The leading dimension of the matrix VR. LDVR >= 1, and
+ if JOBVR = 'V', LDVR >= N.
+
+ WORK
+ WORK is COMPLEX*16 array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK. LWORK >= max(1,2*N).
+ For good performance, LWORK must generally be larger.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ RWORK
+ RWORK is DOUBLE PRECISION array, dimension (8*N)
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value.
+ =1,...,N:
+ The QZ iteration failed. No eigenvectors have been
+ calculated, but ALPHA(j) and BETA(j) should be
+ correct for j=INFO+1,...,N.
+ > N: =N+1: other then QZ iteration failed in DHGEQZ,
+ =N+2: error return from DTGEVC.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{zggev.f}
+\index{zggev.f}
+\begin{chunk}{zggev.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK zggev}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{zggev3}
+\label{zggev3}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{zggev3.input}
+)set break resume
+)sys rm f zggev3.output
+)spool zggev3.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{zggev3.help}
+====================================================================
+zggev3 examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine zggev3 (JOBVL, JOBVR, N, A, LDA, B, LDB, ALPHA, BETA, VL,
+ LDVL, VR, LDVR, WORK, LWORK, RWORK, INFO)
+ ZGGEV3 computes the eigenvalues and, optionally, the left and/or
+ right eigenvectors for GE matrices (blocked algorithm)
+
+Function/Subroutine Documentation
+ subroutine zggev3 (character JOBVL, character JOBVR, integer N, complex*16,
+ dimension( lda, * ) A, integer LDA, complex*16, dimension( ldb, * ) B,
+ integer LDB, complex*16, dimension( * ) ALPHA, complex*16, dimension( *
+ ) BETA, complex*16, dimension( ldvl, * ) VL, integer LDVL, complex*16,
+ dimension( ldvr, * ) VR, integer LDVR, complex*16, dimension( * ) WORK,
+ integer LWORK, double precision, dimension( * ) RWORK, integer INFO)
+ ZGGEV3 computes the eigenvalues and, optionally, the left and/or right
+ eigenvectors for GE matrices (blocked algorithm)
+
+Purpose:
+ ZGGEV3 computes for a pair of NbyN complex nonsymmetric matrices
+ (A,B), the generalized eigenvalues, and optionally, the left and/or
+ right generalized eigenvectors.
+
+ A generalized eigenvalue for a pair of matrices (A,B) is a scalar
+ lambda or a ratio alpha/beta = lambda, such that A  lambda*B is
+ singular. It is usually represented as the pair (alpha,beta), as
+ there is a reasonable interpretation for beta=0, and even for both
+ being zero.
+
+ The right generalized eigenvector v(j) corresponding to the
+ generalized eigenvalue lambda(j) of (A,B) satisfies
+
+ A * v(j) = lambda(j) * B * v(j).
+
+ The left generalized eigenvector u(j) corresponding to the
+ generalized eigenvalues lambda(j) of (A,B) satisfies
+
+ u(j)**H * A = lambda(j) * u(j)**H * B
+
+ where u(j)**H is the conjugatetranspose of u(j).
+
+Parameters:
+
+ JOBVL
+ JOBVL is CHARACTER*1
+ = 'N': do not compute the left generalized eigenvectors;
+ = 'V': compute the left generalized eigenvectors.
+
+ JOBVR
+ JOBVR is CHARACTER*1
+ = 'N': do not compute the right generalized eigenvectors;
+ = 'V': compute the right generalized eigenvectors.
+
+ N
+ N is INTEGER
+ The order of the matrices A, B, VL, and VR. N >= 0.
+
+ A
+ A is COMPLEX*16 array, dimension (LDA, N)
+ On entry, the matrix A in the pair (A,B).
+ On exit, A has been overwritten.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of A. LDA >= max(1,N).
+
+ B
+ B is COMPLEX*16 array, dimension (LDB, N)
+ On entry, the matrix B in the pair (A,B).
+ On exit, B has been overwritten.
+
+ LDB
+ LDB is INTEGER
+ The leading dimension of B. LDB >= max(1,N).
+
+ ALPHA
+ ALPHA is COMPLEX*16 array, dimension (N)
+
+ BETA
+ BETA is COMPLEX*16 array, dimension (N)
+ On exit, ALPHA(j)/BETA(j), j=1,...,N, will be the
+ generalized eigenvalues.
+
+ Note: the quotients ALPHA(j)/BETA(j) may easily over or
+ underflow, and BETA(j) may even be zero. Thus, the user
+ should avoid naively computing the ratio alpha/beta.
+ However, ALPHA will be always less than and usually
+ comparable with norm(A) in magnitude, and BETA always less
+ than and usually comparable with norm(B).
+
+ VL
+ VL is COMPLEX*16 array, dimension (LDVL,N)
+ If JOBVL = 'V', the left generalized eigenvectors u(j) are
+ stored one after another in the columns of VL, in the same
+ order as their eigenvalues.
+ Each eigenvector is scaled so the largest component has
+ abs(real part) + abs(imag. part) = 1.
+ Not referenced if JOBVL = 'N'.
+
+ LDVL
+ LDVL is INTEGER
+ The leading dimension of the matrix VL. LDVL >= 1, and
+ if JOBVL = 'V', LDVL >= N.
+
+ VR
+ VR is COMPLEX*16 array, dimension (LDVR,N)
+ If JOBVR = 'V', the right generalized eigenvectors v(j) are
+ stored one after another in the columns of VR, in the same
+ order as their eigenvalues.
+ Each eigenvector is scaled so the largest component has
+ abs(real part) + abs(imag. part) = 1.
+ Not referenced if JOBVR = 'N'.
+
+ LDVR
+ LDVR is INTEGER
+ The leading dimension of the matrix VR. LDVR >= 1, and
+ if JOBVR = 'V', LDVR >= N.
+
+ WORK
+ WORK is COMPLEX*16 array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ RWORK
+ RWORK is DOUBLE PRECISION array, dimension (8*N)
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value.
+ =1,...,N:
+ The QZ iteration failed. No eigenvectors have been
+ calculated, but ALPHA(j) and BETA(j) should be
+ correct for j=INFO+1,...,N.
+ > N: =N+1: other then QZ iteration failed in DHGEQZ,
+ =N+2: error return from DTGEVC.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{zggev3.f}
+\index{zggev3.f}
+\begin{chunk}{zggev3.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK zggev3}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{zggevx}
+\label{zggevx}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{zggevx.input}
+)set break resume
+)sys rm f zggevx.output
+)spool zggevx.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{zggevx.help}
+====================================================================
+zggevx examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine zggevx (BALANC, JOBVL, JOBVR, SENSE, N, A, LDA, B, LDB,
+ ALPHA, BETA, VL, LDVL, VR, LDVR, ILO, IHI, LSCALE, RSCALE, ABNRM,
+ BBNRM, RCONDE, RCONDV, WORK, LWORK, RWORK, IWORK, BWORK, INFO)
+ ZGGEVX computes the eigenvalues and, optionally, the left and/or
+ right eigenvectors for GE matrices
+
+Function/Subroutine Documentation
+ subroutine zggevx (character BALANC, character JOBVL, character JOBVR,
+ character SENSE, integer N, complex*16, dimension( lda, * ) A, integer
+ LDA, complex*16, dimension( ldb, * ) B, integer LDB, complex*16,
+ dimension( * ) ALPHA, complex*16, dimension( * ) BETA, complex*16,
+ dimension( ldvl, * ) VL, integer LDVL, complex*16, dimension( ldvr, * )
+ VR, integer LDVR, integer ILO, integer IHI, double precision,
+ dimension( * ) LSCALE, double precision, dimension( * ) RSCALE, double
+ precision ABNRM, double precision BBNRM, double precision, dimension( *
+ ) RCONDE, double precision, dimension( * ) RCONDV, complex*16,
+ dimension( * ) WORK, integer LWORK, double precision, dimension( * )
+ RWORK, integer, dimension( * ) IWORK, logical, dimension( * ) BWORK,
+ integer INFO)
+ ZGGEVX computes the eigenvalues and, optionally, the left and/or right
+ eigenvectors for GE matrices
+
+Purpose:
+ ZGGEVX computes for a pair of NbyN complex nonsymmetric matrices
+ (A,B) the generalized eigenvalues, and optionally, the left and/or
+ right generalized eigenvectors.
+
+ Optionally, it also computes a balancing transformation to improve
+ the conditioning of the eigenvalues and eigenvectors (ILO, IHI,
+ LSCALE, RSCALE, ABNRM, and BBNRM), reciprocal condition numbers for
+ the eigenvalues (RCONDE), and reciprocal condition numbers for the
+ right eigenvectors (RCONDV).
+
+ A generalized eigenvalue for a pair of matrices (A,B) is a scalar
+ lambda or a ratio alpha/beta = lambda, such that A  lambda*B is
+ singular. It is usually represented as the pair (alpha,beta), as
+ there is a reasonable interpretation for beta=0, and even for both
+ being zero.
+
+ The right eigenvector v(j) corresponding to the eigenvalue lambda(j)
+ of (A,B) satisfies
+ A * v(j) = lambda(j) * B * v(j) .
+ The left eigenvector u(j) corresponding to the eigenvalue lambda(j)
+ of (A,B) satisfies
+ u(j)**H * A = lambda(j) * u(j)**H * B.
+ where u(j)**H is the conjugatetranspose of u(j).
+
+Parameters:
+
+ BALANC
+ BALANC is CHARACTER*1
+ Specifies the balance option to be performed:
+ = 'N': do not diagonally scale or permute;
+ = 'P': permute only;
+ = 'S': scale only;
+ = 'B': both permute and scale.
+ Computed reciprocal condition numbers will be for the
+ matrices after permuting and/or balancing. Permuting does
+ not change condition numbers (in exact arithmetic), but balancing does.
+
+ JOBVL
+ JOBVL is CHARACTER*1
+ = 'N': do not compute the left generalized eigenvectors;
+ = 'V': compute the left generalized eigenvectors.
+
+ JOBVR
+ JOBVR is CHARACTER*1
+ = 'N': do not compute the right generalized eigenvectors;
+ = 'V': compute the right generalized eigenvectors.
+
+ SENSE
+ SENSE is CHARACTER*1
+ Determines which reciprocal condition numbers are computed.
+ = 'N': none are computed;
+ = 'E': computed for eigenvalues only;
+ = 'V': computed for eigenvectors only;
+ = 'B': computed for eigenvalues and eigenvectors.
+
+ N
+ N is INTEGER
+ The order of the matrices A, B, VL, and VR. N >= 0.
+
+ A
+ A is COMPLEX*16 array, dimension (LDA, N)
+ On entry, the matrix A in the pair (A,B).
+ On exit, A has been overwritten. If JOBVL='V' or JOBVR='V'
+ or both, then A contains the first part of the complex Schur
+ form of the "balanced" versions of the input A and B.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of A. LDA >= max(1,N).
+
+ B
+ B is COMPLEX*16 array, dimension (LDB, N)
+ On entry, the matrix B in the pair (A,B).
+ On exit, B has been overwritten. If JOBVL='V' or JOBVR='V'
+ or both, then B contains the second part of the complex
+ Schur form of the "balanced" versions of the input A and B.
+
+ LDB
+ LDB is INTEGER
+ The leading dimension of B. LDB >= max(1,N).
+
+ ALPHA
+ ALPHA is COMPLEX*16 array, dimension (N)
+
+ BETA
+ BETA is COMPLEX*16 array, dimension (N)
+ On exit, ALPHA(j)/BETA(j), j=1,...,N, will be the generalized
+ eigenvalues.
+
+ Note: the quotient ALPHA(j)/BETA(j) ) may easily over or
+ underflow, and BETA(j) may even be zero. Thus, the user
+ should avoid naively computing the ratio ALPHA/BETA.
+ However, ALPHA will be always less than and usually
+ comparable with norm(A) in magnitude, and BETA always less
+ than and usually comparable with norm(B).
+
+ VL
+ VL is COMPLEX*16 array, dimension (LDVL,N)
+ If JOBVL = 'V', the left generalized eigenvectors u(j) are
+ stored one after another in the columns of VL, in the same
+ order as their eigenvalues.
+ Each eigenvector will be scaled so the largest component
+ will have abs(real part) + abs(imag. part) = 1.
+ Not referenced if JOBVL = 'N'.
+
+ LDVL
+ LDVL is INTEGER
+ The leading dimension of the matrix VL. LDVL >= 1, and
+ if JOBVL = 'V', LDVL >= N.
+
+ VR
+ VR is COMPLEX*16 array, dimension (LDVR,N)
+ If JOBVR = 'V', the right generalized eigenvectors v(j) are
+ stored one after another in the columns of VR, in the same
+ order as their eigenvalues.
+ Each eigenvector will be scaled so the largest component
+ will have abs(real part) + abs(imag. part) = 1.
+ Not referenced if JOBVR = 'N'.
+
+ LDVR
+ LDVR is INTEGER
+ The leading dimension of the matrix VR. LDVR >= 1, and
+ if JOBVR = 'V', LDVR >= N.
+
+ ILO
+ ILO is INTEGER
+
+ IHI
+ IHI is INTEGER
+ ILO and IHI are integer values such that on exit
+ A(i,j) = 0 and B(i,j) = 0 if i > j and
+ j = 1,...,ILO1 or i = IHI+1,...,N.
+ If BALANC = 'N' or 'S', ILO = 1 and IHI = N.
+
+ LSCALE
+ LSCALE is DOUBLE PRECISION array, dimension (N)
+ Details of the permutations and scaling factors applied
+ to the left side of A and B. If PL(j) is the index of the
+ row interchanged with row j, and DL(j) is the scaling
+ factor applied to row j, then
+ LSCALE(j) = PL(j) for j = 1,...,ILO1
+ = DL(j) for j = ILO,...,IHI
+ = PL(j) for j = IHI+1,...,N.
+ The order in which the interchanges are made is N to IHI+1,
+ then 1 to ILO1.
+
+ RSCALE
+ RSCALE is DOUBLE PRECISION array, dimension (N)
+ Details of the permutations and scaling factors applied
+ to the right side of A and B. If PR(j) is the index of the
+ column interchanged with column j, and DR(j) is the scaling
+ factor applied to column j, then
+ RSCALE(j) = PR(j) for j = 1,...,ILO1
+ = DR(j) for j = ILO,...,IHI
+ = PR(j) for j = IHI+1,...,N
+ The order in which the interchanges are made is N to IHI+1,
+ then 1 to ILO1.
+
+ ABNRM
+ ABNRM is DOUBLE PRECISION
+ The onenorm of the balanced matrix A.
+
+ BBNRM
+ BBNRM is DOUBLE PRECISION
+ The onenorm of the balanced matrix B.
+
+ RCONDE
+ RCONDE is DOUBLE PRECISION array, dimension (N)
+ If SENSE = 'E' or 'B', the reciprocal condition numbers of
+ the eigenvalues, stored in consecutive elements of the array.
+ If SENSE = 'N' or 'V', RCONDE is not referenced.
+
+ RCONDV
+ RCONDV is DOUBLE PRECISION array, dimension (N)
+ If JOB = 'V' or 'B', the estimated reciprocal condition
+ numbers of the eigenvectors, stored in consecutive elements
+ of the array. If the eigenvalues cannot be reordered to
+ compute RCONDV(j), RCONDV(j) is set to 0; this can only occur
+ when the true value would be very small anyway.
+ If SENSE = 'N' or 'E', RCONDV is not referenced.
+
+ WORK
+ WORK is COMPLEX*16 array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK. LWORK >= max(1,2*N).
+ If SENSE = 'E', LWORK >= max(1,4*N).
+ If SENSE = 'V' or 'B', LWORK >= max(1,2*N*N+2*N).
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ RWORK
+ RWORK is DOUBLE PRECISION array, dimension (lrwork)
+ lrwork must be at least max(1,6*N) if BALANC = 'S' or 'B',
+ and at least max(1,2*N) otherwise.
+ Real workspace.
+
+ IWORK
+ IWORK is INTEGER array, dimension (N+2)
+ If SENSE = 'E', IWORK is not referenced.
+
+ BWORK
+ BWORK is LOGICAL array, dimension (N)
+ If SENSE = 'N', BWORK is not referenced.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value.
+ = 1,...,N:
+ The QZ iteration failed. No eigenvectors have been
+ calculated, but ALPHA(j) and BETA(j) should be correct
+ for j=INFO+1,...,N.
+ > N: =N+1: other than QZ iteration failed in ZHGEQZ.
+ =N+2: error return from ZTGEVC.
+
+Further Details:
+ Balancing a matrix pair (A,B) includes, first, permuting rows and
+ columns to isolate eigenvalues, second, applying diagonal similarity
+ transformation to the rows and columns to make the rows and columns
+ as close in norm as possible. The computed reciprocal condition
+ numbers correspond to the balanced matrix. Permuting rows and columns
+ will not change the condition numbers (in exact arithmetic) but
+ diagonal scaling will. For further explanation of balancing, see
+ section 4.11.1.2 of LAPACK Users' Guide.
+
+ An approximate error bound on the chordal distance between the ith
+ computed generalized eigenvalue w and the corresponding exact
+ eigenvalue lambda is
+
+ chord(w, lambda) <= EPS * norm(ABNRM, BBNRM) / RCONDE(I)
+
+ An approximate error bound for the angle between the ith computed
+ eigenvector VL(i) or VR(i) is given by
+
+ EPS * norm(ABNRM, BBNRM) / DIF(i).
+
+ For further explanation of the reciprocal condition numbers RCONDE
+ and RCONDV, see section 4.11 of LAPACK User's Guide.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{zggevx.f}
+\index{zggevx.f}
+\begin{chunk}{zggevx.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK zggevx}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\chapter{LAPACK  General Matrices, Singular Value, Double}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{dgejsv}
+\label{dgejsv}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{dgejsv.input}
+)set break resume
+)sys rm f dgejsv.output
+)spool dgejsv.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{dgejsv.help}
+====================================================================
+dgejsv examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine dgejsv (JOBA, JOBU, JOBV, JOBR, JOBT, JOBP, M, N, A, LDA,
+ SVA, U, LDU, V, LDV, WORK, LWORK, IWORK, INFO)
+ DGEJSV
+
+Function/Subroutine Documentation
+ subroutine dgejsv (character*1 JOBA, character*1 JOBU, character*1 JOBV,
+ character*1 JOBR, character*1 JOBT, character*1 JOBP, integer M,
+ integer N, double precision, dimension( lda, * ) A, integer LDA, double
+ precision, dimension( n ) SVA, double precision, dimension( ldu, * ) U,
+ integer LDU, double precision, dimension( ldv, * ) V, integer LDV,
+ double precision, dimension( lwork ) WORK, integer LWORK, integer,
+ dimension( * ) IWORK, integer INFO)
+ DGEJSV
+
+Purpose:
+ DGEJSV computes the singular value decomposition (SVD) of a real MbyN
+ matrix [A], where M >= N. The SVD of [A] is written as
+
+ [A] = [U] * [SIGMA] * [V]^t,
+
+ where [SIGMA] is an NbyN (MbyN) matrix which is zero except for its N
+ diagonal elements, [U] is an MbyN (or MbyM) orthonormal matrix, and
+ [V] is an NbyN orthogonal matrix. The diagonal elements of [SIGMA] are
+ the singular values of [A]. The columns of [U] and [V] are the left and
+ the right singular vectors of [A], respectively. The matrices [U] and [V]
+ are computed and stored in the arrays U and V, respectively. The diagonal
+ of [SIGMA] is computed and stored in the array SVA.
+ DGEJSV can sometimes compute tiny singular values and their singular
+ vectors much more accurately than other SVD routines,
+ see below under Further Details.*>
+
+Parameters:
+
+ JOBA
+ JOBA is CHARACTER*1
+ Specifies the level of accuracy:
+ = 'C': This option works well (high relative accuracy) if A = B * D,
+ with wellconditioned B and arbitrary diagonal matrix D.
+ The accuracy cannot be spoiled by COLUMN scaling. The
+ accuracy of the computed output depends on the condition of
+ B, and the procedure aims at the best theoretical accuracy.
+ The relative error max_{i=1:N}d sigma_i / sigma_i is
+ bounded by f(M,N)*epsilon* cond(B), independent of D.
+ The input matrix is preprocessed with the QRF with column
+ pivoting. This initial preprocessing and preconditioning by
+ a rank revealing QR factorization is common for all values of
+ JOBA. Additional actions are specified as follows:
+ = 'E': Computation as with 'C' with an additional estimate of the
+ condition number of B. It provides a realistic error bound.
+ = 'F': If A = D1 * C * D2 with illconditioned diagonal scalings
+ D1, D2, and wellconditioned matrix C, this option gives
+ higher accuracy than the 'C' option. If the structure of the
+ input matrix is not known, and relative accuracy is
+ desirable, then this option is advisable. The input matrix A
+ is preprocessed with QR factorization with FULL (row and
+ column) pivoting.
+ = 'G' Computation as with 'F' with an additional estimate of the
+ condition number of B, where A=D*B. If A has heavily weighted
+ rows, then using this condition number gives too pessimistic
+ error bound.
+ = 'A': Small singular values are the noise and the matrix is treated
+ as numerically rank defficient. The error in the computed
+ singular values is bounded by f(m,n)*epsilon*A.
+ The computed SVD A = U * S * V^t restores A up to
+ f(m,n)*epsilon*A.
+ This gives the procedure the licence to discard (set to zero)
+ all singular values below N*epsilon*A.
+ = 'R': Similar as in 'A'. Rank revealing property of the initial
+ QR factorization is used do reveal (using triangular factor)
+ a gap sigma_{r+1} < epsilon * sigma_r in which case the
+ numerical RANK is declared to be r. The SVD is computed with
+ absolute error bounds, but more accurately than with 'A'.
+
+ JOBU
+ JOBU is CHARACTER*1
+ Specifies whether to compute the columns of U:
+ = 'U': N columns of U are returned in the array U.
+ = 'F': full set of M left sing. vectors is returned in the array U.
+ = 'W': U may be used as workspace of length M*N. See the description of U.
+ = 'N': U is not computed.
+
+ JOBV
+ JOBV is CHARACTER*1
+ Specifies whether to compute the matrix V:
+ = 'V': N columns of V are returned in the array V; Jacobi rotations
+ are not explicitly accumulated.
+ = 'J': N columns of V are returned in the array V, but they are
+ computed as the product of Jacobi rotations. This option is
+ allowed only if JOBU .NE. 'N', i.e. in computing the full SVD.
+ = 'W': V may be used as workspace of length N*N. See the description of V.
+ = 'N': V is not computed.
+
+ JOBR
+ JOBR is CHARACTER*1
+ Specifies the RANGE for the singular values. Issues the licence to
+ set to zero small positive singular values if they are outside
+ specified range. If A .NE. 0 is scaled so that the largest singular
+ value of c*A is around DSQRT(BIG), BIG=SLAMCH('O'), then JOBR issues
+ the licence to kill columns of A whose norm in c*A is less than
+ DSQRT(SFMIN) (for JOBR.EQ.'R'), or less than SMALL=SFMIN/EPSLN,
+ where SFMIN=SLAMCH('S'), EPSLN=SLAMCH('E').
+ = 'N': Do not kill small columns of c*A. This option assumes that
+ BLAS and QR factorizations and triangular solvers are
+ implemented to work in that range. If the condition of A
+ is greater than BIG, use DGESVJ.
+ = 'R': RESTRICTED range for sigma(c*A) is [DSQRT(SFMIN), DSQRT(BIG)]
+ (roughly, as described above). This option is recommended.
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ For computing the singular values in the FULL range [SFMIN,BIG]
+ use DGESVJ.
+
+ JOBT
+ JOBT is CHARACTER*1
+ If the matrix is square then the procedure may determine to use
+ transposed A if A^t seems to be better with respect to convergence.
+ If the matrix is not square, JOBT is ignored. This is subject to
+ changes in the future.
+ The decision is based on two values of entropy over the adjoint
+ orbit of A^t * A. See the descriptions of WORK(6) and WORK(7).
+ = 'T': transpose if entropy test indicates possibly faster
+ convergence of Jacobi process if A^t is taken as input. If A is
+ replaced with A^t, then the row pivoting is included automatically.
+ = 'N': do not speculate.
+ This option can be used to compute only the singular values, or the
+ full SVD (U, SIGMA and V). For only one set of singular vectors
+ (U or V), the caller should provide both U and V, as one of the
+ matrices is used as workspace if the matrix A is transposed.
+ The implementer can easily remove this constraint and make the
+ code more complicated. See the descriptions of U and V.
+
+ JOBP
+ JOBP is CHARACTER*1
+ Issues the licence to introduce structured perturbations to drown
+ denormalized numbers. This licence should be active if the
+ denormals are poorly implemented, causing slow computation,
+ especially in cases of fast convergence (!). For details see [1,2].
+ For the sake of simplicity, this perturbations are included only
+ when the full SVD or only the singular values are requested. The
+ implementer/user can easily add the perturbation for the cases of
+ computing one set of singular vectors.
+ = 'P': introduce perturbation
+ = 'N': do not perturb
+
+ M
+ M is INTEGER
+ The number of rows of the input matrix A. M >= 0.
+
+ N
+ N is INTEGER
+ The number of columns of the input matrix A. M >= N >= 0.
+
+ A
+ A is DOUBLE PRECISION array, dimension (LDA,N)
+ On entry, the MbyN matrix A.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+
+ SVA
+ SVA is DOUBLE PRECISION array, dimension (N)
+ On exit,
+  For WORK(1)/WORK(2) = ONE: The singular values of A. During the
+ computation SVA contains Euclidean column norms of the
+ iterated matrices in the array A.
+  For WORK(1) .NE. WORK(2): The singular values of A are
+ (WORK(1)/WORK(2)) * SVA(1:N). This factored form is used if
+ sigma_max(A) overflows or if small singular values have been
+ saved from underflow by scaling the input matrix A.
+  If JOBR='R' then some of the singular values may be returned
+ as exact zeros obtained by "set to zero" because they are
+ below the numerical rank threshold or are denormalized numbers.
+
+ U
+ U is DOUBLE PRECISION array, dimension ( LDU, N )
+ If JOBU = 'U', then U contains on exit the MbyN matrix of
+ the left singular vectors.
+ If JOBU = 'F', then U contains on exit the MbyM matrix of
+ the left singular vectors, including an ONB
+ of the orthogonal complement of the Range(A).
+ If JOBU = 'W' .AND. (JOBV.EQ.'V' .AND. JOBT.EQ.'T' .AND. M.EQ.N),
+ then U is used as workspace if the procedure
+ replaces A with A^t. In that case, [V] is computed
+ in U as left singular vectors of A^t and then
+ copied back to the V array. This 'W' option is just
+ a reminder to the caller that in this case U is
+ reserved as workspace of length N*N.
+ If JOBU = 'N' U is not referenced.
+
+ LDU
+ LDU is INTEGER
+ The leading dimension of the array U, LDU >= 1.
+ IF JOBU = 'U' or 'F' or 'W', then LDU >= M.
+
+ V
+ V is DOUBLE PRECISION array, dimension ( LDV, N )
+ If JOBV = 'V', 'J' then V contains on exit the NbyN matrix of
+ the right singular vectors;
+ If JOBV = 'W', AND (JOBU.EQ.'U' AND JOBT.EQ.'T' AND M.EQ.N),
+ then V is used as workspace if the pprocedure
+ replaces A with A^t. In that case, [U] is computed
+ in V as right singular vectors of A^t and then
+ copied back to the U array. This 'W' option is just
+ a reminder to the caller that in this case V is
+ reserved as workspace of length N*N.
+ If JOBV = 'N' V is not referenced.
+
+ LDV
+ LDV is INTEGER
+ The leading dimension of the array V, LDV >= 1.
+ If JOBV = 'V' or 'J' or 'W', then LDV >= N.
+
+ WORK
+ WORK is DOUBLE PRECISION array, dimension at least LWORK.
+ On exit, if N.GT.0 .AND. M.GT.0 (else not referenced),
+ WORK(1) = SCALE = WORK(2) / WORK(1) is the scaling factor such
+ that SCALE*SVA(1:N) are the computed singular values
+ of A. (See the description of SVA().)
+ WORK(2) = See the description of WORK(1).
+ WORK(3) = SCONDA is an estimate for the condition number of
+ column equilibrated A. (If JOBA .EQ. 'E' or 'G')
+ SCONDA is an estimate of DSQRT((R^t * R)^(1)_1).
+ It is computed using DPOCON. It holds
+ N^(1/4) * SCONDA <= R^(1)_2 <= N^(1/4) * SCONDA
+ where R is the triangular factor from the QRF of A.
+ However, if R is truncated and the numerical rank is
+ determined to be strictly smaller than N, SCONDA is
+ returned as 1, thus indicating that the smallest
+ singular values might be lost.
+
+ If full SVD is needed, the following two condition numbers are
+ useful for the analysis of the algorithm. They are provied for
+ a developer/implementer who is familiar with the details of
+ the method.
+
+ WORK(4) = an estimate of the scaled condition number of the
+ triangular factor in the first QR factorization.
+ WORK(5) = an estimate of the scaled condition number of the
+ triangular factor in the second QR factorization.
+
+ The following two parameters are computed if JOBT .EQ. 'T'.
+ They are provided for a developer/implementer who is familiar
+ with the details of the method.
+
+ WORK(6) = the entropy of A^t*A :: this is the Shannon entropy
+ of diag(A^t*A) / Trace(A^t*A) taken as point in the
+ probability simplex.
+ WORK(7) = the entropy of A*A^t.
+
+ LWORK
+ LWORK is INTEGER
+ Length of WORK to confirm proper allocation of work space.
+ LWORK depends on the job:
+
+ If only SIGMA is needed ( JOBU.EQ.'N', JOBV.EQ.'N' ) and
+ > .. no scaled condition estimate required (JOBE.EQ.'N'):
+ LWORK >= max(2*M+N,4*N+1,7). This is the minimal requirement.
+ >> For optimal performance (blocked code) the optimal value
+ is LWORK >= max(2*M+N,3*N+(N+1)*NB,7). Here NB is the optimal
+ block size for DGEQP3 and DGEQRF.
+ In general, optimal LWORK is computed as
+ LWORK >= max(2*M+N,N+LWORK(DGEQP3),N+LWORK(DGEQRF), 7).
+ > .. an estimate of the scaled condition number of A is
+ required (JOBA='E', 'G'). In this case, LWORK is the maximum
+ of the above and N*N+4*N, i.e. LWORK >= max(2*M+N,N*N+4*N,7).
+ >> For optimal performance (blocked code) the optimal value
+ is LWORK >= max(2*M+N,3*N+(N+1)*NB, N*N+4*N, 7).
+ In general, the optimal length LWORK is computed as
+ LWORK >= max(2*M+N,N+LWORK(DGEQP3),N+LWORK(DGEQRF),
+ N+N*N+LWORK(DPOCON),7).
+
+ If SIGMA and the right singular vectors are needed (JOBV.EQ.'V'),
+ > the minimal requirement is LWORK >= max(2*M+N,4*N+1,7).
+ > For optimal performance, LWORK >= max(2*M+N,3*N+(N+1)*NB,7),
+ where NB is the optimal block size for DGEQP3, DGEQRF, DGELQ,
+ DORMLQ. In general, the optimal length LWORK is computed as
+ LWORK >= max(2*M+N,N+LWORK(DGEQP3), N+LWORK(DPOCON),
+ N+LWORK(DGELQ), 2*N+LWORK(DGEQRF), N+LWORK(DORMLQ)).
+
+ If SIGMA and the left singular vectors are needed
+ > the minimal requirement is LWORK >= max(2*M+N,4*N+1,7).
+ > For optimal performance:
+ if JOBU.EQ.'U' :: LWORK >= max(2*M+N,3*N+(N+1)*NB,7),
+ if JOBU.EQ.'F' :: LWORK >= max(2*M+N,3*N+(N+1)*NB,N+M*NB,7),
+ where NB is the optimal block size for DGEQP3, DGEQRF, DORMQR.
+ In general, the optimal length LWORK is computed as
+ LWORK >= max(2*M+N,N+LWORK(DGEQP3),N+LWORK(DPOCON),
+ 2*N+LWORK(DGEQRF), N+LWORK(DORMQR)).
+ Here LWORK(DORMQR) equals N*NB (for JOBU.EQ.'U') or
+ M*NB (for JOBU.EQ.'F').
+
+ If the full SVD is needed: (JOBU.EQ.'U' or JOBU.EQ.'F') and
+ > if JOBV.EQ.'V'
+ the minimal requirement is LWORK >= max(2*M+N,6*N+2*N*N).
+ > if JOBV.EQ.'J' the minimal requirement is
+ LWORK >= max(2*M+N, 4*N+N*N,2*N+N*N+6).
+ > For optimal performance, LWORK should be additionally
+ larger than N+M*NB, where NB is the optimal block size for DORMQR.
+
+ IWORK
+ IWORK is INTEGER array, dimension M+3*N.
+ On exit,
+ IWORK(1) = the numerical rank determined after the initial
+ QR factorization with pivoting. See the descriptions
+ of JOBA and JOBR.
+ IWORK(2) = the number of the computed nonzero singular values
+ IWORK(3) = if nonzero, a warning message:
+ If IWORK(3).EQ.1 then some of the column norms of A
+ were denormalized floats. The requested high accuracy
+ is not warranted by the data.
+
+ INFO
+ INFO is INTEGER
+ < 0 : if INFO = i, then the ith argument had an illegal value.
+ = 0 : successfull exit;
+ > 0 : DGEJSV did not converge in the maximal allowed number
+ of sweeps. The computed values may be inaccurate.
+
+ Further Details:
+ DGEJSV implements a preconditioned Jacobi SVD algorithm. It uses DGEQP3,
+ DGEQRF, and DGELQF as preprocessors and preconditioners. Optionally, an
+ additional row pivoting can be used as a preprocessor, which in some
+ cases results in much higher accuracy. An example is matrix A with the
+ structure A = D1 * C * D2, where D1, D2 are arbitrarily illconditioned
+ diagonal matrices and C is wellconditioned matrix. In that case, complete
+ pivoting in the first QR factorizations provides accuracy dependent on the
+ condition number of C, and independent of D1, D2. Such higher accuracy is
+ not completely understood theoretically, but it works well in practice.
+ Further, if A can be written as A = B*D, with wellconditioned B and some
+ diagonal D, then the high accuracy is guaranteed, both theoretically and
+ in software, independent of D. For more details see [1], [2].
+ The computational range for the singular values can be the full range
+ ( UNDERFLOW,OVERFLOW ), provided that the machine arithmetic and the BLAS
+ & LAPACK routines called by DGEJSV are implemented to work in that range.
+ If that is not the case, then the restriction for safe computation with
+ the singular values in the range of normalized IEEE numbers is that the
+ spectral condition number kappa(A)=sigma_max(A)/sigma_min(A) does not
+ overflow. This code (DGEJSV) is best used in this restricted range,
+ meaning that singular values of magnitude below A_2 / DLAMCH('O') are
+ returned as zeros. See JOBR for details on this.
+ Further, this implementation is somewhat slower than the one described
+ in [1,2] due to replacement of some nonLAPACK components, and because
+ the choice of some tuning parameters in the iterative part (DGESVJ) is
+ left to the implementer on a particular machine.
+ The rank revealing QR factorization (in this code: DGEQP3) should be
+ implemented as in [3]. We have a new version of DGEQP3 under development
+ that is more robust than the current one in LAPACK, with a cleaner cut in
+ rank defficient cases. It will be available in the SIGMA library [4].
+ If M is much larger than N, it is obvious that the inital QRF with
+ column pivoting can be preprocessed by the QRF without pivoting. That
+ well known trick is not used in DGEJSV because in some cases heavy row
+ weighting can be treated with complete pivoting. The overhead in cases
+ M much larger than N is then only due to pivoting, but the benefits in
+ terms of accuracy have prevailed. The implementer/user can incorporate
+ this extra QRF step easily. The implementer can also improve data movement
+ (matrix transpose, matrix copy, matrix transposed copy)  this
+ implementation of DGEJSV uses only the simplest, naive data movement.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{dgejsv.f}
+\index{dgejsv.f}
+\begin{chunk}{dgejsv.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK dgejsv}
+
+\end{chunk}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{dgesdd}
+\label{dgesdd}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{dgesdd.input}
+)set break resume
+)sys rm f dgesdd.output
+)spool dgesdd.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{dgesdd.help}
+====================================================================
+dgesdd examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine dgesdd (JOBZ, M, N, A, LDA, S, U, LDU, VT, LDVT, WORK,
+ LWORK, IWORK, INFO)
+ DGESDD
+
+Function/Subroutine Documentation
+ subroutine dgesdd (character JOBZ, integer M, integer N, double precision,
+ dimension( lda, * ) A, integer LDA, double precision, dimension( * ) S,
+ double precision, dimension( ldu, * ) U, integer LDU, double precision,
+ dimension( ldvt, * ) VT, integer LDVT, double precision, dimension( * )
+ WORK, integer LWORK, integer, dimension( * ) IWORK, integer INFO)
+ DGESDD
+
+Purpose:
+ DGESDD computes the singular value decomposition (SVD) of a real
+ MbyN matrix A, optionally computing the left and right singular
+ vectors. If singular vectors are desired, it uses a
+ divideandconquer algorithm.
+
+ The SVD is written
+
+ A = U * SIGMA * transpose(V)
+
+ where SIGMA is an MbyN matrix which is zero except for its
+ min(m,n) diagonal elements, U is an MbyM orthogonal matrix, and
+ V is an NbyN orthogonal matrix. The diagonal elements of SIGMA
+ are the singular values of A; they are real and nonnegative, and
+ are returned in descending order. The first min(m,n) columns of
+ U and V are the left and right singular vectors of A.
+
+ Note that the routine returns VT = V**T, not V.
+
+ The divide and conquer algorithm makes very mild assumptions about
+ floating point arithmetic. It will work on machines with a guard
+ digit in add/subtract, or on those binary machines without guard
+ digits which subtract like the Cray XMP, Cray YMP, Cray C90, or
+ Cray2. It could conceivably fail on hexadecimal or decimal machines
+ without guard digits, but we know of none.
+
+Parameters:
+
+ JOBZ
+ JOBZ is CHARACTER*1
+ Specifies options for computing all or part of the matrix U:
+ = 'A': all M columns of U and all N rows of V**T are
+ returned in the arrays U and VT;
+ = 'S': the first min(M,N) columns of U and the first
+ min(M,N) rows of V**T are returned in the arrays U and VT;
+ = 'O': If M >= N, the first N columns of U are overwritten
+ on the array A and all rows of V**T are returned in
+ the array VT;
+ otherwise, all columns of U are returned in the
+ array U and the first M rows of V**T are overwritten
+ in the array A;
+ = 'N': no columns of U or rows of V**T are computed.
+
+ M
+ M is INTEGER
+ The number of rows of the input matrix A. M >= 0.
+
+ N
+ N is INTEGER
+ The number of columns of the input matrix A. N >= 0.
+
+ A
+
+ A is DOUBLE PRECISION array, dimension (LDA,N)
+ On entry, the MbyN matrix A.
+ On exit,
+ if JOBZ = 'O', A is overwritten with the first N columns
+ of U (the left singular vectors, stored
+ columnwise) if M >= N;
+ A is overwritten with the first M rows
+ of V**T (the right singular vectors, stored
+ rowwise) otherwise.
+ if JOBZ .ne. 'O', the contents of A are destroyed.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+
+ S
+ S is DOUBLE PRECISION array, dimension (min(M,N))
+ The singular values of A, sorted so that S(i) >= S(i+1).
+
+ U
+ U is DOUBLE PRECISION array, dimension (LDU,UCOL)
+ UCOL = M if JOBZ = 'A' or JOBZ = 'O' and M < N;
+ UCOL = min(M,N) if JOBZ = 'S'.
+ If JOBZ = 'A' or JOBZ = 'O' and M < N, U contains the MbyM
+ orthogonal matrix U;
+ if JOBZ = 'S', U contains the first min(M,N) columns of U
+ (the left singular vectors, stored columnwise);
+ if JOBZ = 'O' and M >= N, or JOBZ = 'N', U is not referenced.
+
+ LDU
+ LDU is INTEGER
+ The leading dimension of the array U. LDU >= 1; if
+ JOBZ = 'S' or 'A' or JOBZ = 'O' and M < N, LDU >= M.
+
+ VT
+ VT is DOUBLE PRECISION array, dimension (LDVT,N)
+ If JOBZ = 'A' or JOBZ = 'O' and M >= N, VT contains the
+ NbyN orthogonal matrix V**T;
+ if JOBZ = 'S', VT contains the first min(M,N) rows of
+ V**T (the right singular vectors, stored rowwise);
+ if JOBZ = 'O' and M < N, or JOBZ = 'N', VT is not referenced.
+
+ LDVT
+ LDVT is INTEGER
+ The leading dimension of the array VT. LDVT >= 1; if
+ JOBZ = 'A' or JOBZ = 'O' and M >= N, LDVT >= N;
+ if JOBZ = 'S', LDVT >= min(M,N).
+
+ WORK
+ WORK is DOUBLE PRECISION array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK;
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK. LWORK >= 1.
+ If JOBZ = 'N', LWORK >= 3*min(M,N) + max(max(M,N),7*min(M,N)).
+ If JOBZ = 'O', LWORK >= 3*min(M,N) +
+ max(max(M,N),5*min(M,N)*min(M,N)+4*min(M,N)).
+ If JOBZ = 'S' or 'A' LWORK >= min(M,N)*(7+4*min(M,N))
+ For good performance, LWORK should generally be larger.
+ If LWORK = 1 but other input arguments are legal, WORK(1)
+ returns the optimal LWORK.
+
+ IWORK
+ IWORK is INTEGER array, dimension (8*min(M,N))
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit.
+ < 0: if INFO = i, the ith argument had an illegal value.
+ > 0: DBDSDC did not converge, updating process failed.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{dgesdd.f}
+\index{dgesdd.f}
+\begin{chunk}{dgesdd.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK dgesdd}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{dgesvd}
+\label{dgesvd}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{dgesvd.input}
+)set break resume
+)sys rm f dgesvd.output
+)spool dgesvd.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{dgesvd.help}
+====================================================================
+dgesvd examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine dgesvd (JOBU, JOBVT, M, N, A, LDA, S, U, LDU, VT, LDVT,
+ WORK, LWORK, INFO)
+ DGESVD computes the singular value decomposition (SVD) for GE
+ matrices
+
+Function/Subroutine Documentation
+ subroutine dgesvd (character JOBU, character JOBVT, integer M, integer N,
+ double precision, dimension( lda, * ) A, integer LDA, double precision,
+ dimension( * ) S, double precision, dimension( ldu, * ) U, integer LDU,
+ double precision, dimension( ldvt, * ) VT, integer LDVT, double
+ precision, dimension( * ) WORK, integer LWORK, integer INFO)
+ DGESVD computes the singular value decomposition (SVD) for GE matrices
+
+Purpose:
+ DGESVD computes the singular value decomposition (SVD) of a real
+ MbyN matrix A, optionally computing the left and/or right singular
+ vectors. The SVD is written
+
+ A = U * SIGMA * transpose(V)
+
+ where SIGMA is an MbyN matrix which is zero except for its
+ min(m,n) diagonal elements, U is an MbyM orthogonal matrix, and
+ V is an NbyN orthogonal matrix. The diagonal elements of SIGMA
+ are the singular values of A; they are real and nonnegative, and
+ are returned in descending order. The first min(m,n) columns of
+ U and V are the left and right singular vectors of A.
+
+ Note that the routine returns V**T, not V.
+
+Parameters:
+
+ JOBU
+ JOBU is CHARACTER*1
+ Specifies options for computing all or part of the matrix U:
+ = 'A': all M columns of U are returned in array U:
+ = 'S': the first min(m,n) columns of U (the left singular
+ vectors) are returned in the array U;
+ = 'O': the first min(m,n) columns of U (the left singular
+ vectors) are overwritten on the array A;
+ = 'N': no columns of U (no left singular vectors) are computed.
+
+ JOBVT
+ JOBVT is CHARACTER*1
+ Specifies options for computing all or part of the matrix V**T:
+ = 'A': all N rows of V**T are returned in the array VT;
+ = 'S': the first min(m,n) rows of V**T (the right singular
+ vectors) are returned in the array VT;
+ = 'O': the first min(m,n) rows of V**T (the right singular
+ vectors) are overwritten on the array A;
+ = 'N': no rows of V**T (no right singular vectors) are computed.
+
+ JOBVT and JOBU cannot both be 'O'.
+
+ M
+ M is INTEGER
+ The number of rows of the input matrix A. M >= 0.
+
+ N
+ N is INTEGER
+ The number of columns of the input matrix A. N >= 0.
+
+ A
+ A is DOUBLE PRECISION array, dimension (LDA,N)
+ On entry, the MbyN matrix A.
+ On exit,
+ if JOBU = 'O', A is overwritten with the first min(m,n)
+ columns of U (the left singular vectors,
+ stored columnwise);
+ if JOBVT = 'O', A is overwritten with the first min(m,n)
+ rows of V**T (the right singular vectors,
+ stored rowwise);
+ if JOBU .ne. 'O' and JOBVT .ne. 'O', the contents of A are destroyed.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+
+ S
+ S is DOUBLE PRECISION array, dimension (min(M,N))
+ The singular values of A, sorted so that S(i) >= S(i+1).
+
+ U
+ U is DOUBLE PRECISION array, dimension (LDU,UCOL)
+ (LDU,M) if JOBU = 'A' or (LDU,min(M,N)) if JOBU = 'S'.
+ If JOBU = 'A', U contains the MbyM orthogonal matrix U;
+ if JOBU = 'S', U contains the first min(m,n) columns of U
+ (the left singular vectors, stored columnwise);
+ if JOBU = 'N' or 'O', U is not referenced.
+
+ LDU
+ LDU is INTEGER
+ The leading dimension of the array U. LDU >= 1; if
+ JOBU = 'S' or 'A', LDU >= M.
+
+ VT
+ VT is DOUBLE PRECISION array, dimension (LDVT,N)
+ If JOBVT = 'A', VT contains the NbyN orthogonal matrix V**T;
+ if JOBVT = 'S', VT contains the first min(m,n) rows of
+ V**T (the right singular vectors, stored rowwise);
+ if JOBVT = 'N' or 'O', VT is not referenced.
+
+ LDVT
+ LDVT is INTEGER
+ The leading dimension of the array VT. LDVT >= 1; if
+ JOBVT = 'A', LDVT >= N; if JOBVT = 'S', LDVT >= min(M,N).
+
+ WORK
+ WORK is DOUBLE PRECISION array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK;
+ if INFO > 0, WORK(2:MIN(M,N)) contains the unconverged
+ superdiagonal elements of an upper bidiagonal matrix B
+ whose diagonal is in S (not necessarily sorted). B
+ satisfies A = U * B * VT, so it has the same singular values
+ as A, and singular vectors related by U and VT.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK.
+ LWORK >= MAX(1,5*MIN(M,N)) for the paths (see comments inside code):
+  PATH 1 (M much larger than N, JOBU='N')
+  PATH 1t (N much larger than M, JOBVT='N')
+ LWORK >= MAX(1,3*MIN(M,N)+MAX(M,N),5*MIN(M,N)) for the other paths
+ For good performance, LWORK should generally be larger.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit.
+ < 0: if INFO = i, the ith argument had an illegal value.
+ > 0: if DBDSQR did not converge, INFO specifies how many
+ superdiagonals of an intermediate bidiagonal form B
+ did not converge to zero. See the description of WORK
+ above for details.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{dgesvd.f}
+\index{dgesvd.f}
+\begin{chunk}{dgesvd.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK dgesvd}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{dgesvdx}
+\label{dgesvdx}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{dgesvdx.input}
+)set break resume
+)sys rm f dgesvdx.output
+)spool dgesvdx.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{dgesvdx.help}
+====================================================================
+dgesvdx examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine dgesvdx (JOBU, JOBVT, RANGE, M, N, A, LDA, VL, VU, IL, IU,
+ NS, S, U, LDU, VT, LDVT, WORK, LWORK, IWORK, INFO)
+ DGESVDX computes the singular value decomposition (SVD) for GE
+ matrices
+
+Function/Subroutine Documentation
+ subroutine dgesvdx (character JOBU, character JOBVT, character RANGE,
+ integer M, integer N, double precision, dimension( lda, * ) A, integer
+ LDA, double precision VL, double precision VU, integer IL, integer IU,
+ integer NS, double precision, dimension( * ) S, double precision,
+ dimension( ldu, * ) U, integer LDU, double precision, dimension( ldvt,
+ * ) VT, integer LDVT, double precision, dimension( * ) WORK, integer
+ LWORK, integer, dimension( * ) IWORK, integer INFO)
+ DGESVDX computes the singular value decomposition (SVD) for GE
+ matrices
+
+Purpose:
+ DGESVDX computes the singular value decomposition (SVD) of a real
+ MbyN matrix A, optionally computing the left and/or right singular
+ vectors. The SVD is written
+
+ A = U * SIGMA * transpose(V)
+
+ where SIGMA is an MbyN matrix which is zero except for its
+ min(m,n) diagonal elements, U is an MbyM orthogonal matrix, and
+ V is an NbyN orthogonal matrix. The diagonal elements of SIGMA
+ are the singular values of A; they are real and nonnegative, and
+ are returned in descending order. The first min(m,n) columns of
+ U and V are the left and right singular vectors of A.
+
+ DGESVDX uses an eigenvalue problem for obtaining the SVD, which
+ allows for the computation of a subset of singular values and
+ vectors. See DBDSVDX for details.
+
+ Note that the routine returns V**T, not V.
+
+Parameters:
+
+ JOBU
+ JOBU is CHARACTER*1
+ Specifies options for computing all or part of the matrix U:
+ = 'V': the first min(m,n) columns of U (the left singular
+ vectors) or as specified by RANGE are returned in
+ the array U;
+ = 'N': no columns of U (no left singular vectors) are computed.
+
+ JOBVT
+ JOBVT is CHARACTER*1
+ Specifies options for computing all or part of the matrix V**T:
+ = 'V': the first min(m,n) rows of V**T (the right singular
+ vectors) or as specified by RANGE are returned in
+ the array VT;
+ = 'N': no rows of V**T (no right singular vectors) are computed.
+
+ RANGE
+ RANGE is CHARACTER*1
+ = 'A': all singular values will be found.
+ = 'V': all singular values in the halfopen interval (VL,VU]
+ will be found.
+ = 'I': the ILth through IUth singular values will be found.
+
+ M
+ M is INTEGER
+ The number of rows of the input matrix A. M >= 0.
+
+ N
+ N is INTEGER
+ The number of columns of the input matrix A. N >= 0.
+
+ A
+ A is DOUBLE PRECISION array, dimension (LDA,N)
+ On entry, the MbyN matrix A.
+ On exit, the contents of A are destroyed.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+
+ VL
+ VL is DOUBLE PRECISION
+ VL >=0.
+
+ VU
+ VU is DOUBLE PRECISION
+ If RANGE='V', the lower and upper bounds of the interval to
+ be searched for singular values. VU > VL.
+ Not referenced if RANGE = 'A' or 'I'.
+
+ IL
+ IL is INTEGER
+
+ IU
+ IU is INTEGER
+ If RANGE='I', the indices (in ascending order) of the
+ smallest and largest singular values to be returned.
+ 1 <= IL <= IU <= min(M,N), if min(M,N) > 0.
+ Not referenced if RANGE = 'A' or 'V'.
+
+ NS
+ NS is INTEGER
+ The total number of singular values found,
+ 0 <= NS <= min(M,N).
+ If RANGE = 'A', NS = min(M,N); if RANGE = 'I', NS = IUIL+1.
+
+ S
+ S is DOUBLE PRECISION array, dimension (min(M,N))
+ The singular values of A, sorted so that S(i) >= S(i+1).
+
+ U
+ U is DOUBLE PRECISION array, dimension (LDU,UCOL)
+ If JOBU = 'V', U contains columns of U (the left singular
+ vectors, stored columnwise) as specified by RANGE; if
+ JOBU = 'N', U is not referenced.
+ Note: The user must ensure that UCOL >= NS; if RANGE = 'V',
+ the exact value of NS is not known ILQFin advance and an upper
+ bound must be used.
+
+ LDU
+ LDU is INTEGER
+ The leading dimension of the array U. LDU >= 1; if
+ JOBU = 'V', LDU >= M.
+
+ VT
+ VT is DOUBLE PRECISION array, dimension (LDVT,N)
+ If JOBVT = 'V', VT contains the rows of V**T (the right singular
+ vectors, stored rowwise) as specified by RANGE; if JOBVT = 'N',
+ VT is not referenced.
+ Note: The user must ensure that LDVT >= NS; if RANGE = 'V',
+ the exact value of NS is not known in advance and an upper
+ bound must be used.
+
+ LDVT
+ LDVT is INTEGER
+ The leading dimension of the array VT. LDVT >= 1; if
+ JOBVT = 'V', LDVT >= NS (see above).
+
+ WORK
+ WORK is DOUBLE PRECISION array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK;
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK.
+ LWORK >= MAX(1,MIN(M,N)*(MIN(M,N)+4)) for the paths (see
+ comments inside the code):
+  PATH 1 (M much larger than N)
+  PATH 1t (N much larger than M)
+ LWORK >= MAX(1,MIN(M,N)*2+MAX(M,N)) for the other paths.
+ For good performance, LWORK should generally be larger.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ IWORK
+ IWORK is INTEGER array, dimension (12*MIN(M,N))
+ If INFO = 0, the first NS elements of IWORK are zero. If INFO > 0,
+ then IWORK contains the indices of the eigenvectors that failed
+ to converge in DBDSVDX/DSTEVX.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value
+ > 0: if INFO = i, then i eigenvectors failed to converge
+ in DBDSVDX/DSTEVX.
+ if INFO = N*2 + 1, an internal error occurred in DBDSVDX
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{dgesvdx.f}
+\index{dgesvdx.f}
+\begin{chunk}{dgesvdx.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK dgesvdx}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\chapter{LAPACK  General Matrices, Singular Value, Real}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{sgejsv}
+\label{sgejsv}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{sgejsv.input}
+)set break resume
+)sys rm f sgejsv.output
+)spool sgejsv.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{sgejsv.help}
+====================================================================
+sgejsv examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine sgejsv (JOBA, JOBU, JOBV, JOBR, JOBT, JOBP, M, N, A, LDA,
+ SVA, U, LDU, V, LDV, WORK, LWORK, IWORK, INFO)
+ SGEJSV
+
+Function/Subroutine Documentation
+ subroutine sgejsv (character*1 JOBA, character*1 JOBU, character*1 JOBV,
+ character*1 JOBR, character*1 JOBT, character*1 JOBP, integer M,
+ integer N, real, dimension( lda, * ) A, integer LDA, real, dimension( n
+ ) SVA, real, dimension( ldu, * ) U, integer LDU, real, dimension( ldv,
+ * ) V, integer LDV, real, dimension( lwork ) WORK, integer LWORK,
+ integer, dimension( * ) IWORK, integer INFO)
+ SGEJSV
+
+Purpose:
+ SGEJSV computes the singular value decomposition (SVD) of a real MbyN
+ matrix [A], where M >= N. The SVD of [A] is written as
+
+ [A] = [U] * [SIGMA] * [V]^t,
+
+ where [SIGMA] is an NbyN (MbyN) matrix which is zero except for its N
+ diagonal elements, [U] is an MbyN (or MbyM) orthonormal matrix, and
+ [V] is an NbyN orthogonal matrix. The diagonal elements of [SIGMA] are
+ the singular values of [A]. The columns of [U] and [V] are the left and
+ the right singular vectors of [A], respectively. The matrices [U] and [V]
+ are computed and stored in the arrays U and V, respectively. The diagonal
+ of [SIGMA] is computed and stored in the array SVA.
+ SGEJSV can sometimes compute tiny singular values and their singular
+ vectors much more accurately than other SVD routines,
+ see below under Further Details.
+
+Parameters:
+
+ JOBA
+ JOBA is CHARACTER*1
+ Specifies the level of accuracy:
+ = 'C': This option works well (high relative accuracy) if A = B * D,
+ with wellconditioned B and arbitrary diagonal matrix D.
+ The accuracy cannot be spoiled by COLUMN scaling. The
+ accuracy of the computed output depends on the condition of
+ B, and the procedure aims at the best theoretical accuracy.
+ The relative error max_{i=1:N}d sigma_i / sigma_i is
+ bounded by f(M,N)*epsilon* cond(B), independent of D.
+ The input matrix is preprocessed with the QRF with column
+ pivoting. This initial preprocessing and preconditioning by
+ a rank revealing QR factorization is common for all values of
+ JOBA. Additional actions are specified as follows:
+ = 'E': Computation as with 'C' with an additional estimate of the
+ condition number of B. It provides a realistic error bound.
+ = 'F': If A = D1 * C * D2 with illconditioned diagonal scalings
+ D1, D2, and wellconditioned matrix C, this option gives
+ higher accuracy than the 'C' option. If the structure of the
+ input matrix is not known, and relative accuracy is
+ desirable, then this option is advisable. The input matrix A
+ is preprocessed with QR factorization with FULL (row and
+ column) pivoting.
+ = 'G' Computation as with 'F' with an additional estimate of the
+ condition number of B, where A=D*B. If A has heavily weighted
+ rows, then using this condition number gives too pessimistic
+ error bound.
+ = 'A': Small singular values are the noise and the matrix is treated
+ as numerically rank defficient. The error in the computed
+ singular values is bounded by f(m,n)*epsilon*A.
+ The computed SVD A = U * S * V^t restores A up to
+ f(m,n)*epsilon*A.
+ This gives the procedure the licence to discard (set to zero)
+ all singular values below N*epsilon*A.
+ = 'R': Similar as in 'A'. Rank revealing property of the initial
+ QR factorization is used do reveal (using triangular factor)
+ a gap sigma_{r+1} < epsilon * sigma_r in which case the
+ numerical RANK is declared to be r. The SVD is computed with
+ absolute error bounds, but more accurately than with 'A'.
+
+ JOBU
+ JOBU is CHARACTER*1
+ Specifies whether to compute the columns of U:
+ = 'U': N columns of U are returned in the array U.
+ = 'F': full set of M left sing. vectors is returned in the array U.
+ = 'W': U may be used as workspace of length M*N. See the description of U.
+ = 'N': U is not computed.
+
+ JOBV
+ JOBV is CHARACTER*1
+ Specifies whether to compute the matrix V:
+ = 'V': N columns of V are returned in the array V; Jacobi rotations
+ are not explicitly accumulated.
+ = 'J': N columns of V are returned in the array V, but they are
+ computed as the product of Jacobi rotations. This option is
+ allowed only if JOBU .NE. 'N', i.e. in computing the full SVD.
+ = 'W': V may be used as workspace of length N*N. See the description of V.
+ = 'N': V is not computed.
+
+ JOBR
+ JOBR is CHARACTER*1
+ Specifies the RANGE for the singular values. Issues the licence to
+ set to zero small positive singular values if they are outside
+ specified range. If A .NE. 0 is scaled so that the largest singular
+ value of c*A is around SQRT(BIG), BIG=SLAMCH('O'), then JOBR issues
+ the licence to kill columns of A whose norm in c*A is less than
+ SQRT(SFMIN) (for JOBR.EQ.'R'), or less than SMALL=SFMIN/EPSLN,
+ where SFMIN=SLAMCH('S'), EPSLN=SLAMCH('E').
+ = 'N': Do not kill small columns of c*A. This option assumes that
+ BLAS and QR factorizations and triangular solvers are
+ implemented to work in that range. If the condition of A
+ is greater than BIG, use SGESVJ.
+ = 'R': RESTRICTED range for sigma(c*A) is [SQRT(SFMIN), SQRT(BIG)]
+ (roughly, as described above). This option is recommended.
+ ===========================
+ For computing the singular values in the FULL range [SFMIN,BIG]
+ use SGESVJ.
+
+ JOBT
+ JOBT is CHARACTER*1
+ If the matrix is square then the procedure may determine to use
+ transposed A if A^t seems to be better with respect to convergence.
+ If the matrix is not square, JOBT is ignored. This is subject to
+ changes in the future.
+ The decision is based on two values of entropy over the adjoint
+ orbit of A^t * A. See the descriptions of WORK(6) and WORK(7).
+ = 'T': transpose if entropy test indicates possibly faster
+ convergence of Jacobi process if A^t is taken as input. If A is
+ replaced with A^t, then the row pivoting is included automatically.
+ = 'N': do not speculate.
+ This option can be used to compute only the singular values, or the
+ full SVD (U, SIGMA and V). For only one set of singular vectors
+ (U or V), the caller should provide both U and V, as one of the
+ matrices is used as workspace if the matrix A is transposed.
+ The implementer can easily remove this constraint and make the
+ code more complicated. See the descriptions of U and V.
+
+ JOBP
+ JOBP is CHARACTER*1
+ Issues the licence to introduce structured perturbations to drown
+ denormalized numbers. This licence should be active if the
+ denormals are poorly implemented, causing slow computation,
+ especially in cases of fast convergence (!). For details see [1,2].
+ For the sake of simplicity, this perturbations are included only
+ when the full SVD or only the singular values are requested. The
+ implementer/user can easily add the perturbation for the cases of
+ computing one set of singular vectors.
+ = 'P': introduce perturbation
+ = 'N': do not perturb
+
+ M
+ M is INTEGER
+ The number of rows of the input matrix A. M >= 0.
+
+ N
+ N is INTEGER
+ The number of columns of the input matrix A. M >= N >= 0.
+
+ A
+ A is REAL array, dimension (LDA,N)
+ On entry, the MbyN matrix A.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+
+ SVA
+ SVA is REAL array, dimension (N)
+ On exit,
+  For WORK(1)/WORK(2) = ONE: The singular values of A. During the
+ computation SVA contains Euclidean column norms of the
+ iterated matrices in the array A.
+  For WORK(1) .NE. WORK(2): The singular values of A are
+ (WORK(1)/WORK(2)) * SVA(1:N). This factored form is used if
+ sigma_max(A) overflows or if small singular values have been
+ saved from underflow by scaling the input matrix A.
+  If JOBR='R' then some of the singular values may be returned
+ as exact zeros obtained by "set to zero" because they are
+ below the numerical rank threshold or are denormalized numbers.
+
+ U
+ U is REAL array, dimension ( LDU, N )
+ If JOBU = 'U', then U contains on exit the MbyN matrix of
+ the left singular vectors.
+ If JOBU = 'F', then U contains on exit the MbyM matrix of
+ the left singular vectors, including an ONB
+ of the orthogonal complement of the Range(A).
+ If JOBU = 'W' .AND. (JOBV.EQ.'V' .AND. JOBT.EQ.'T' .AND. M.EQ.N),
+ then U is used as workspace if the procedure
+ replaces A with A^t. In that case, [V] is computed
+ in U as left singular vectors of A^t and then
+ copied back to the V array. This 'W' option is just
+ a reminder to the caller that in this case U is
+ reserved as workspace of length N*N.
+ If JOBU = 'N' U is not referenced.
+
+ LDU
+ LDU is INTEGER
+ The leading dimension of the array U, LDU >= 1.
+ IF JOBU = 'U' or 'F' or 'W', then LDU >= M.
+
+ V
+ V is REAL array, dimension ( LDV, N )
+ If JOBV = 'V', 'J' then V contains on exit the NbyN matrix of
+ the right singular vectors;
+ If JOBV = 'W', AND (JOBU.EQ.'U' AND JOBT.EQ.'T' AND M.EQ.N),
+ then V is used as workspace if the pprocedure
+ replaces A with A^t. In that case, [U] is computed
+ in V as right singular vectors of A^t and then
+ copied back to the U array. This 'W' option is just
+ a reminder to the caller that in this case V is
+ reserved as workspace of length N*N.
+ If JOBV = 'N' V is not referenced.
+
+ LDV
+ LDV is INTEGER
+ The leading dimension of the array V, LDV >= 1.
+ If JOBV = 'V' or 'J' or 'W', then LDV >= N.
+
+ WORK
+ WORK is REAL array, dimension at least LWORK.
+ On exit,
+ WORK(1) = SCALE = WORK(2) / WORK(1) is the scaling factor such
+ that SCALE*SVA(1:N) are the computed singular values
+ of A. (See the description of SVA().)
+ WORK(2) = See the description of WORK(1).
+ WORK(3) = SCONDA is an estimate for the condition number of
+ column equilibrated A. (If JOBA .EQ. 'E' or 'G')
+ SCONDA is an estimate of SQRT((R^t * R)^(1)_1).
+ It is computed using SPOCON. It holds
+ N^(1/4) * SCONDA <= R^(1)_2 <= N^(1/4) * SCONDA
+ where R is the triangular factor from the QRF of A.
+ However, if R is truncated and the numerical rank is
+ determined to be strictly smaller than N, SCONDA is
+ returned as 1, thus indicating that the smallest
+ singular values might be lost.
+
+ If full SVD is needed, the following two condition numbers are
+ useful for the analysis of the algorithm. They are provied for
+ a developer/implementer who is familiar with the details of
+ the method.
+
+ WORK(4) = an estimate of the scaled condition number of the
+ triangular factor in the first QR factorization.
+ WORK(5) = an estimate of the scaled condition number of the
+ triangular factor in the second QR factorization.
+
+ The following two parameters are computed if JOBT .EQ. 'T'.
+ They are provided for a developer/implementer who is familiar
+ with the details of the method.
+
+ WORK(6) = the entropy of A^t*A :: this is the Shannon entropy
+ of diag(A^t*A) / Trace(A^t*A) taken as point in the
+ probability simplex.
+ WORK(7) = the entropy of A*A^t.
+
+ LWORK
+ LWORK is INTEGER
+ Length of WORK to confirm proper allocation of work space.
+ LWORK depends on the job:
+
+ If only SIGMA is needed ( JOBU.EQ.'N', JOBV.EQ.'N' ) and
+ > .. no scaled condition estimate required (JOBE.EQ.'N'):
+ LWORK >= max(2*M+N,4*N+1,7). This is the minimal requirement.
+ >> For optimal performance (blocked code) the optimal value
+ is LWORK >= max(2*M+N,3*N+(N+1)*NB,7). Here NB is the optimal
+ block size for DGEQP3 and DGEQRF.
+ In general, optimal LWORK is computed as
+ LWORK >= max(2*M+N,N+LWORK(DGEQP3),N+LWORK(DGEQRF), 7).
+ > .. an estimate of the scaled condition number of A is
+ required (JOBA='E', 'G'). In this case, LWORK is the maximum
+ of the above and N*N+4*N, i.e. LWORK >= max(2*M+N,N*N+4*N,7).
+ >> For optimal performance (blocked code) the optimal value
+ is LWORK >= max(2*M+N,3*N+(N+1)*NB, N*N+4*N, 7).
+ In general, the optimal length LWORK is computed as
+ LWORK >= max(2*M+N,N+LWORK(DGEQP3),N+LWORK(DGEQRF),
+ N+N*N+LWORK(DPOCON),7).
+
+ If SIGMA and the right singular vectors are needed (JOBV.EQ.'V'),
+ > the minimal requirement is LWORK >= max(2*M+N,4*N+1,7).
+ > For optimal performance, LWORK >= max(2*M+N,3*N+(N+1)*NB,7),
+ where NB is the optimal block size for DGEQP3, DGEQRF, DGELQ,
+ DORMLQ. In general, the optimal length LWORK is computed as
+ LWORK >= max(2*M+N,N+LWORK(DGEQP3), N+LWORK(DPOCON),
+ N+LWORK(DGELQ), 2*N+LWORK(DGEQRF), N+LWORK(DORMLQ)).
+
+ If SIGMA and the left singular vectors are needed
+ > the minimal requirement is LWORK >= max(2*M+N,4*N+1,7).
+ > For optimal performance:
+ if JOBU.EQ.'U' :: LWORK >= max(2*M+N,3*N+(N+1)*NB,7),
+ if JOBU.EQ.'F' :: LWORK >= max(2*M+N,3*N+(N+1)*NB,N+M*NB,7),
+ where NB is the optimal block size for DGEQP3, DGEQRF, DORMQR.
+ In general, the optimal length LWORK is computed as
+ LWORK >= max(2*M+N,N+LWORK(DGEQP3),N+LWORK(DPOCON),
+ 2*N+LWORK(DGEQRF), N+LWORK(DORMQR)).
+ Here LWORK(DORMQR) equals N*NB (for JOBU.EQ.'U') or
+ M*NB (for JOBU.EQ.'F').
+
+ If the full SVD is needed: (JOBU.EQ.'U' or JOBU.EQ.'F') and
+ > if JOBV.EQ.'V' the minimal requirement is
+ LWORK >= max(2*M+N,6*N+2*N*N).
+ > if JOBV.EQ.'J' the minimal requirement is
+ LWORK >= max(2*M+N, 4*N+N*N,2*N+N*N+6).
+ > For optimal performance, LWORK should be additionally
+ larger than N+M*NB, where NB is the optimal block size for DORMQR.
+
+ IWORK
+ IWORK is INTEGER array, dimension M+3*N.
+ On exit,
+ IWORK(1) = the numerical rank determined after the initial
+ QR factorization with pivoting. See the descriptions
+ of JOBA and JOBR.
+ IWORK(2) = the number of the computed nonzero singular values
+ IWORK(3) = if nonzero, a warning message:
+ If IWORK(3).EQ.1 then some of the column norms of A
+ were denormalized floats. The requested high accuracy
+ is not warranted by the data.
+
+ INFO
+ INFO is INTEGER
+ < 0 : if INFO = i, then the ith argument had an illegal value.
+ = 0 : successfull exit;
+ > 0 : SGEJSV did not converge in the maximal allowed number
+ of sweeps. The computed values may be inaccurate.
+
+Further Details:
+ SGEJSV implements a preconditioned Jacobi SVD algorithm. It uses SGEQP3,
+ SGEQRF, and SGELQF as preprocessors and preconditioners. Optionally, an
+ additional row pivoting can be used as a preprocessor, which in some
+ cases results in much higher accuracy. An example is matrix A with the
+ structure A = D1 * C * D2, where D1, D2 are arbitrarily illconditioned
+ diagonal matrices and C is wellconditioned matrix. In that case, complete
+ pivoting in the first QR factorizations provides accuracy dependent on the
+ condition number of C, and independent of D1, D2. Such higher accuracy is
+ not completely understood theoretically, but it works well in practice.
+ Further, if A can be written as A = B*D, with wellconditioned B and some
+ diagonal D, then the high accuracy is guaranteed, both theoretically and
+ in software, independent of D. For more details see [1], [2].
+ The computational range for the singular values can be the full range
+ ( UNDERFLOW,OVERFLOW ), provided that the machine arithmetic and the BLAS
+ & LAPACK routines called by SGEJSV are implemented to work in that range.
+ If that is not the case, then the restriction for safe computation with
+ the singular values in the range of normalized IEEE numbers is that the
+ spectral condition number kappa(A)=sigma_max(A)/sigma_min(A) does not
+ overflow. This code (SGEJSV) is best used in this restricted range,
+ meaning that singular values of magnitude below A_2 / SLAMCH('O') are
+ returned as zeros. See JOBR for details on this.
+ Further, this implementation is somewhat slower than the one described
+ in [1,2] due to replacement of some nonLAPACK components, and because
+ the choice of some tuning parameters in the iterative part (SGESVJ) is
+ left to the implementer on a particular machine.
+ The rank revealing QR factorization (in this code: SGEQP3) should be
+ implemented as in [3]. We have a new version of SGEQP3 under development
+ that is more robust than the current one in LAPACK, with a cleaner cut in
+ rank defficient cases. It will be available in the SIGMA library [4].
+ If M is much larger than N, it is obvious that the inital QRF with
+ column pivoting can be preprocessed by the QRF without pivoting. That
+ well known trick is not used in SGEJSV because in some cases heavy row
+ weighting can be treated with complete pivoting. The overhead in cases
+ M much larger than N is then only due to pivoting, but the benefits in
+ terms of accuracy have prevailed. The implementer/user can incorporate
+ this extra QRF step easily. The implementer can also improve data movement
+ (matrix transpose, matrix copy, matrix transposed copy)  this
+ implementation of SGEJSV uses only the simplest, naive data movement.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{sgejsv.f}
+\index{sgejsv.f}
+\begin{chunk}{sgejsv.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK sgejsv}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{sgesdd}
+\label{sgesdd}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{sgesdd.input}
+)set break resume
+)sys rm f sgesdd.output
+)spool sgesdd.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{sgesdd.help}
+====================================================================
+sgesdd examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine sgesdd (JOBZ, M, N, A, LDA, S, U, LDU, VT, LDVT, WORK,
+ LWORK, IWORK, INFO)
+ SGESDD
+
+Function/Subroutine Documentation
+ subroutine sgesdd (character JOBZ, integer M, integer N, real, dimension(
+ lda, * ) A, integer LDA, real, dimension( * ) S, real, dimension( ldu,
+ * ) U, integer LDU, real, dimension( ldvt, * ) VT, integer LDVT, real,
+ dimension( * ) WORK, integer LWORK, integer, dimension( * ) IWORK,
+ integer INFO)
+ SGESDD
+
+Purpose:
+ SGESDD computes the singular value decomposition (SVD) of a real
+ MbyN matrix A, optionally computing the left and right singular
+ vectors. If singular vectors are desired, it uses a
+ divideandconquer algorithm.
+
+ The SVD is written
+
+ A = U * SIGMA * transpose(V)
+
+ where SIGMA is an MbyN matrix which is zero except for its
+ min(m,n) diagonal elements, U is an MbyM orthogonal matrix, and
+ V is an NbyN orthogonal matrix. The diagonal elements of SIGMA
+ are the singular values of A; they are real and nonnegative, and
+ are returned in descending order. The first min(m,n) columns of
+ U and V are the left and right singular vectors of A.
+
+ Note that the routine returns VT = V**T, not V.
+
+ The divide and conquer algorithm makes very mild assumptions about
+ floating point arithmetic. It will work on machines with a guard
+ digit in add/subtract, or on those binary machines without guard
+ digits which subtract like the Cray XMP, Cray YMP, Cray C90, or
+ Cray2. It could conceivably fail on hexadecimal or decimal machines
+ without guard digits, but we know of none.
+
+Parameters:
+
+ JOBZ
+ JOBZ is CHARACTER*1
+ Specifies options for computing all or part of the matrix U:
+ = 'A': all M columns of U and all N rows of V**T are
+ returned in the arrays U and VT;
+ = 'S': the first min(M,N) columns of U and the first
+ min(M,N) rows of V**T are returned in the arrays U and VT;
+ = 'O': If M >= N, the first N columns of U are overwritten
+ on the array A and all rows of V**T are returned in the array VT;
+ otherwise, all columns of U are returned in the
+ array U and the first M rows of V**T are overwritten
+ in the array A;
+ = 'N': no columns of U or rows of V**T are computed.
+
+ M
+ M is INTEGER
+ The number of rows of the input matrix A. M >= 0.
+
+ N
+ N is INTEGER
+ The number of columns of the input matrix A. N >= 0.
+
+ A
+ A is REAL array, dimension (LDA,N)
+ On entry, the MbyN matrix A.
+ On exit,
+ if JOBZ = 'O', A is overwritten with the first N columns
+ of U (the left singular vectors, stored columnwise) if M >= N;
+ A is overwritten with the first M rows
+ of V**T (the right singular vectors, stored rowwise) otherwise.
+ if JOBZ .ne. 'O', the contents of A are destroyed.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+
+ S
+ S is REAL array, dimension (min(M,N))
+ The singular values of A, sorted so that S(i) >= S(i+1).
+
+ U
+ U is REAL array, dimension (LDU,UCOL)
+ UCOL = M if JOBZ = 'A' or JOBZ = 'O' and M < N;
+ UCOL = min(M,N) if JOBZ = 'S'.
+ If JOBZ = 'A' or JOBZ = 'O' and M < N, U contains the MbyM
+ orthogonal matrix U;
+ if JOBZ = 'S', U contains the first min(M,N) columns of U
+ (the left singular vectors, stored columnwise);
+ if JOBZ = 'O' and M >= N, or JOBZ = 'N', U is not referenced.
+
+ LDU
+ LDU is INTEGER
+ The leading dimension of the array U. LDU >= 1; if
+ JOBZ = 'S' or 'A' or JOBZ = 'O' and M < N, LDU >= M.
+
+ VT
+ VT is REAL array, dimension (LDVT,N)
+ If JOBZ = 'A' or JOBZ = 'O' and M >= N, VT contains the
+ NbyN orthogonal matrix V**T;
+ if JOBZ = 'S', VT contains the first min(M,N) rows of
+ V**T (the right singular vectors, stored rowwise);
+ if JOBZ = 'O' and M < N, or JOBZ = 'N', VT is not referenced.
+
+ LDVT
+ LDVT is INTEGER
+ The leading dimension of the array VT. LDVT >= 1; if
+ JOBZ = 'A' or JOBZ = 'O' and M >= N, LDVT >= N;
+ if JOBZ = 'S', LDVT >= min(M,N).
+
+ WORK
+ WORK is REAL array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK;
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK. LWORK >= 1.
+ If JOBZ = 'N', LWORK >= 3*min(M,N) + max(max(M,N),6*min(M,N)).
+ If JOBZ = 'O', LWORK >= 3*min(M,N) +
+ max(max(M,N),5*min(M,N)*min(M,N)+4*min(M,N)).
+ If JOBZ = 'S' or 'A' LWORK >= min(M,N)*(7+4*min(M,N))
+ For good performance, LWORK should generally be larger.
+ If LWORK = 1 but other input arguments are legal, WORK(1)
+ returns the optimal LWORK.
+
+ IWORK
+ IWORK is INTEGER array, dimension (8*min(M,N))
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit.
+ < 0: if INFO = i, the ith argument had an illegal value.
+ > 0: SBDSDC did not converge, updating process failed.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{sgesdd.f}
+\index{sgesdd.f}
+\begin{chunk}{sgesdd.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK sgesdd}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{sgesvd}
+\label{sgesvd}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{sgesvd.input}
+)set break resume
+)sys rm f sgesvd.output
+)spool sgesvd.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{sgesvd.help}
+====================================================================
+sgesvd examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine sgesvd (JOBU, JOBVT, M, N, A, LDA, S, U, LDU, VT, LDVT,
+ WORK, LWORK, INFO)
+ SGESVD computes the singular value decomposition (SVD) for GE
+ matrices
+
+Function/Subroutine Documentation
+ subroutine sgesvd (character JOBU, character JOBVT, integer M, integer N,
+ real, dimension( lda, * ) A, integer LDA, real, dimension( * ) S, real,
+ dimension( ldu, * ) U, integer LDU, real, dimension( ldvt, * ) VT,
+ integer LDVT, real, dimension( * ) WORK, integer LWORK, integer INFO)
+ SGESVD computes the singular value decomposition (SVD) for GE matrices
+
+Purpose:
+ SGESVD computes the singular value decomposition (SVD) of a real
+ MbyN matrix A, optionally computing the left and/or right singular
+ vectors. The SVD is written
+
+ A = U * SIGMA * transpose(V)
+
+ where SIGMA is an MbyN matrix which is zero except for its
+ min(m,n) diagonal elements, U is an MbyM orthogonal matrix, and
+ V is an NbyN orthogonal matrix. The diagonal elements of SIGMA
+ are the singular values of A; they are real and nonnegative, and
+ are returned in descending order. The first min(m,n) columns of
+ U and V are the left and right singular vectors of A.
+
+ Note that the routine returns V**T, not V.
+
+Parameters:
+
+ JOBU
+ JOBU is CHARACTER*1
+ Specifies options for computing all or part of the matrix U:
+ = 'A': all M columns of U are returned in array U:
+ = 'S': the first min(m,n) columns of U (the left singular
+ vectors) are returned in the array U;
+ = 'O': the first min(m,n) columns of U (the left singular
+ vectors) are overwritten on the array A;
+ = 'N': no columns of U (no left singular vectors) are computed.
+
+ JOBVT
+ JOBVT is CHARACTER*1
+ Specifies options for computing all or part of the matrix
+ V**T:
+ = 'A': all N rows of V**T are returned in the array VT;
+ = 'S': the first min(m,n) rows of V**T (the right singular
+ vectors) are returned in the array VT;
+ = 'O': the first min(m,n) rows of V**T (the right singular
+ vectors) are overwritten on the array A;
+ = 'N': no rows of V**T (no right singular vectors) are computed.
+
+ JOBVT and JOBU cannot both be 'O'.
+
+ M
+ M is INTEGER
+ The number of rows of the input matrix A. M >= 0.
+
+ N
+ N is INTEGER
+ The number of columns of the input matrix A. N >= 0.
+
+ A
+ A is REAL array, dimension (LDA,N)
+ On entry, the MbyN matrix A.
+ On exit,
+ if JOBU = 'O', A is overwritten with the first min(m,n)
+ columns of U (the left singular vectors, stored columnwise);
+ if JOBVT = 'O', A is overwritten with the first min(m,n)
+ rows of V**T (the right singular vectors, stored rowwise);
+ if JOBU .ne. 'O' and JOBVT .ne. 'O', the contents of A are destroyed.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+
+ S
+ S is REAL array, dimension (min(M,N))
+ The singular values of A, sorted so that S(i) >= S(i+1).
+
+ U
+ U is REAL array, dimension (LDU,UCOL)
+ (LDU,M) if JOBU = 'A' or (LDU,min(M,N)) if JOBU = 'S'.
+ If JOBU = 'A', U contains the MbyM orthogonal matrix U;
+ if JOBU = 'S', U contains the first min(m,n) columns of U
+ (the left singular vectors, stored columnwise);
+ if JOBU = 'N' or 'O', U is not referenced.
+
+ LDU
+ LDU is INTEGER
+ The leading dimension of the array U. LDU >= 1; if
+ JOBU = 'S' or 'A', LDU >= M.
+
+ VT
+ VT is REAL array, dimension (LDVT,N)
+ If JOBVT = 'A', VT contains the NbyN orthogonal matrix V**T;
+ if JOBVT = 'S', VT contains the first min(m,n) rows of
+ V**T (the right singular vectors, stored rowwise);
+ if JOBVT = 'N' or 'O', VT is not referenced.
+
+ LDVT
+ LDVT is INTEGER
+ The leading dimension of the array VT. LDVT >= 1; if
+ JOBVT = 'A', LDVT >= N; if JOBVT = 'S', LDVT >= min(M,N).
+
+ WORK
+ WORK is REAL array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK;
+ if INFO > 0, WORK(2:MIN(M,N)) contains the unconverged
+ superdiagonal elements of an upper bidiagonal matrix B
+ whose diagonal is in S (not necessarily sorted). B
+ satisfies A = U * B * VT, so it has the same singular values
+ as A, and singular vectors related by U and VT.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK.
+ LWORK >= MAX(1,5*MIN(M,N)) for the paths (see comments inside code):
+  PATH 1 (M much larger than N, JOBU='N')
+  PATH 1t (N much larger than M, JOBVT='N')
+ LWORK >= MAX(1,3*MIN(M,N)+MAX(M,N),5*MIN(M,N)) for the other paths
+ For good performance, LWORK should generally be larger.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit.
+ < 0: if INFO = i, the ith argument had an illegal value.
+ > 0: if SBDSQR did not converge, INFO specifies how many
+ superdiagonals of an intermediate bidiagonal form B
+ did not converge to zero. See the description of WORK
+ above for details.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{sgesvd.f}
+\index{sgesvd.f}
+\begin{chunk}{sgesvd.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK sgesvd}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{sgesvdx}
+\label{sgesvdx}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{sgesvdx.input}
+)set break resume
+)sys rm f sgesvdx.output
+)spool sgesvdx.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{sgesvdx.help}
+====================================================================
+sgesvdx examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine sgesvdx (JOBU, JOBVT, RANGE, M, N, A, LDA, VL, VU, IL, IU,
+ NS, S, U, LDU, VT, LDVT, WORK, LWORK, IWORK, INFO)
+ SGESVDX computes the singular value decomposition (SVD) for GE
+ matrices
+
+Function/Subroutine Documentation
+ subroutine sgesvdx (character JOBU, character JOBVT, character RANGE,
+ integer M, integer N, real, dimension( lda, * ) A, integer LDA, real
+ VL, real VU, integer IL, integer IU, integer NS, real, dimension( * )
+ S, real, dimension( ldu, * ) U, integer LDU, real, dimension( ldvt, * )
+ VT, integer LDVT, real, dimension( * ) WORK, integer LWORK, integer,
+ dimension( * ) IWORK, integer INFO)
+ SGESVDX computes the singular value decomposition (SVD) for GE
+ matrices
+
+Purpose:
+ SGESVDX computes the singular value decomposition (SVD) of a real
+ MbyN matrix A, optionally computing the left and/or right singular
+ vectors. The SVD is written
+
+ A = U * SIGMA * transpose(V)
+
+ where SIGMA is an MbyN matrix which is zero except for its
+ min(m,n) diagonal elements, U is an MbyM orthogonal matrix, and
+ V is an NbyN orthogonal matrix. The diagonal elements of SIGMA
+ are the singular values of A; they are real and nonnegative, and
+ are returned in descending order. The first min(m,n) columns of
+ U and V are the left and right singular vectors of A.
+
+ SGESVDX uses an eigenvalue problem for obtaining the SVD, which
+ allows for the computation of a subset of singular values and
+ vectors. See SBDSVDX for details.
+
+ Note that the routine returns V**T, not V.
+
+Parameters:
+
+ JOBU
+ JOBU is CHARACTER*1
+ Specifies options for computing all or part of the matrix U:
+ = 'V': the first min(m,n) columns of U (the left singular
+ vectors) or as specified by RANGE are returned in the array U;
+ = 'N': no columns of U (no left singular vectors) are computed.
+
+ JOBVT
+ JOBVT is CHARACTER*1
+ Specifies options for computing all or part of the matrix
+ V**T:
+ = 'V': the first min(m,n) rows of V**T (the right singular
+ vectors) or as specified by RANGE are returned in the array VT;
+ = 'N': no rows of V**T (no right singular vectors) are computed.
+
+ RANGE
+ RANGE is CHARACTER*1
+ = 'A': all singular values will be found.
+ = 'V': all singular values in the halfopen interval (VL,VU] will be found.
+ = 'I': the ILth through IUth singular values will be found.
+
+ M
+ M is INTEGER
+ The number of rows of the input matrix A. M >= 0.
+
+ N
+ N is INTEGER
+ The number of columns of the input matrix A. N >= 0.
+
+ A
+ A is REAL array, dimension (LDA,N)
+ On entry, the MbyN matrix A.
+ On exit, the contents of A are destroyed.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+
+ VL
+ VL is REAL
+ VL >=0.
+
+ VU
+ VU is REAL
+ If RANGE='V', the lower and upper bounds of the interval to
+ be searched for singular values. VU > VL.
+ Not referenced if RANGE = 'A' or 'I'.
+
+ IL
+ IL is INTEGER
+
+ IU
+ IU is INTEGER
+ If RANGE='I', the indices (in ascending order) of the
+ smallest and largest singular values to be returned.
+ 1 <= IL <= IU <= min(M,N), if min(M,N) > 0.
+ Not referenced if RANGE = 'A' or 'V'.
+
+ NS
+ NS is INTEGER
+ The total number of singular values found,
+ 0 <= NS <= min(M,N).
+ If RANGE = 'A', NS = min(M,N); if RANGE = 'I', NS = IUIL+1.
+
+ S
+ S is REAL array, dimension (min(M,N))
+ The singular values of A, sorted so that S(i) >= S(i+1).
+
+ U
+ U is REAL array, dimension (LDU,UCOL)
+ If JOBU = 'V', U contains columns of U (the left singular
+ vectors, stored columnwise) as specified by RANGE; if
+ JOBU = 'N', U is not referenced.
+ Note: The user must ensure that UCOL >= NS; if RANGE = 'V',
+ the exact value of NS is not known ILQFin advance and an upper
+ bound must be used.
+
+ LDU
+ LDU is INTEGER
+ The leading dimension of the array U. LDU >= 1; if
+ JOBU = 'V', LDU >= M.
+
+ VT
+ VT is REAL array, dimension (LDVT,N)
+ If JOBVT = 'V', VT contains the rows of V**T (the right singular
+ vectors, stored rowwise) as specified by RANGE; if JOBVT = 'N',
+ VT is not referenced.
+ Note: The user must ensure that LDVT >= NS; if RANGE = 'V',
+ the exact value of NS is not known in advance and an upper
+ bound must be used.
+
+ LDVT
+ LDVT is INTEGER
+ The leading dimension of the array VT. LDVT >= 1; if
+ JOBVT = 'V', LDVT >= NS (see above).
+
+ WORK
+ WORK is REAL array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK;
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK.
+ LWORK >= MAX(1,MIN(M,N)*(MIN(M,N)+4)) for the paths (see
+ comments inside the code):
+  PATH 1 (M much larger than N)
+  PATH 1t (N much larger than M)
+ LWORK >= MAX(1,MIN(M,N)*2+MAX(M,N)) for the other paths.
+ For good performance, LWORK should generally be larger.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ IWORK
+ IWORK is INTEGER array, dimension (12*MIN(M,N))
+ If INFO = 0, the first NS elements of IWORK are zero. If INFO > 0,
+ then IWORK contains the indices of the eigenvectors that failed
+ to converge in SBDSVDX/SSTEVX.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value
+ > 0: if INFO = i, then i eigenvectors failed to converge
+ in SBDSVDX/SSTEVX.
+ if INFO = N*2 + 1, an internal error occurred in SBDSVDX
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{sgesvdx.f}
+\index{sgesvdx.f}
+\begin{chunk}{sgesvdx.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK sgesvdx}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\chapter{LAPACK  General Matrices, Singular Value, Complex}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{cgejsv}
+\label{cgejsv}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{cgejsv.input}
+)set break resume
+)sys rm f cgejsv.output
+)spool cgejsv.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{cgejsv.help}
+====================================================================
+cgejsv examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine cgejsv (JOBA, JOBU, JOBV, JOBR, JOBT, JOBP, M, N, A, LDA,
+ SVA, U, LDU, V, LDV, CWORK, LWORK, RWORK, LRWORK, IWORK, INFO)
+ CGEJSV
+
+Function/Subroutine Documentation
+ subroutine cgejsv (character*1 JOBA, character*1 JOBU, character*1 JOBV,
+ character*1 JOBR, character*1 JOBT, character*1 JOBP, integer M,
+ integer N, complex, dimension( lda, * ) A, integer LDA, real,
+ dimension( n ) SVA, complex, dimension( ldu, * ) U, integer LDU,
+ complex, dimension( ldv, * ) V, integer LDV, complex, dimension( lwork
+ ) CWORK, integer LWORK, real, dimension( * ) RWORK, integer LRWORK,
+ integer, dimension( * ) IWORK, integer INFO)
+ CGEJSV
+
+Purpose:
+ CGEJSV computes the singular value decomposition (SVD) of a real MbyN
+ matrix [A], where M >= N. The SVD of [A] is written as
+
+ [A] = [U] * [SIGMA] * [V]^*,
+
+ where [SIGMA] is an NbyN (MbyN) matrix which is zero except for its N
+ diagonal elements, [U] is an MbyN (or MbyM) orthonormal matrix, and
+ [V] is an NbyN orthogonal matrix. The diagonal elements of [SIGMA] are
+ the singular values of [A]. The columns of [U] and [V] are the left and
+ the right singular vectors of [A], respectively. The matrices [U] and [V]
+ are computed and stored in the arrays U and V, respectively. The diagonal
+ of [SIGMA] is computed and stored in the array SVA.
+
+ Arguments:
+ ==========
+
+ JOBA
+ JOBA is CHARACTER*1
+ Specifies the level of accuracy:
+ = 'C': This option works well (high relative accuracy) if A = B * D,
+ with wellconditioned B and arbitrary diagonal matrix D.
+ The accuracy cannot be spoiled by COLUMN scaling. The
+ accuracy of the computed output depends on the condition of
+ B, and the procedure aims at the best theoretical accuracy.
+ The relative error max_{i=1:N}d sigma_i / sigma_i is
+ bounded by f(M,N)*epsilon* cond(B), independent of D.
+ The input matrix is preprocessed with the QRF with column
+ pivoting. This initial preprocessing and preconditioning by
+ a rank revealing QR factorization is common for all values of
+ JOBA. Additional actions are specified as follows:
+
+ = 'E': Computation as with 'C' with an additional estimate of the
+ condition number of B. It provides a realistic error bound.
+
+ = 'F':
+ If A = D1 * C * D2 with illconditioned diagonal scalings
+ D1, D2, and wellconditioned matrix C, this option gives
+ higher accuracy than the 'C' option. If the structure of the
+ input matrix is not known, and relative accuracy is
+ desirable, then this option is advisable. The input matrix A
+ is preprocessed with QR factorization with FULL (row and
+ column) pivoting.
+ = 'G' Computation as with 'F' with an additional estimate of the
+ condition number of B, where A=D*B. If A has heavily weighted
+ rows, then using this condition number gives too pessimistic
+ error bound.
+ = 'A': Small singular values are the noise and the matrix is treated
+ as numerically rank defficient. The error in the computed
+ singular values is bounded by f(m,n)*epsilon*A.
+ The computed SVD A = U * S * V^* restores A up to
+ f(m,n)*epsilon*A.
+ This gives the procedure the licence to discard (set to zero)
+ all singular values below N*epsilon*A.
+ = 'R': Similar as in 'A'. Rank revealing property of the initial
+ QR factorization is used do reveal (using triangular factor)
+ a gap sigma_{r+1} < epsilon * sigma_r in which case the
+ numerical RANK is declared to be r. The SVD is computed with
+ absolute error bounds, but more accurately than with 'A'.
+
+Parameters:
+
+ JOBU
+ JOBU is CHARACTER*1
+ Specifies whether to compute the columns of U:
+ = 'U': N columns of U are returned in the array U.
+ = 'F': full set of M left sing. vectors is returned in the array U.
+ = 'W': U may be used as workspace of length M*N. See the description of U.
+ = 'N': U is not computed.
+
+ JOBV
+ JOBV is CHARACTER*1
+ Specifies whether to compute the matrix V:
+ = 'V': N columns of V are returned in the array V; Jacobi rotations
+ are not explicitly accumulated.
+ = 'J': N columns of V are returned in the array V, but they are
+ computed as the product of Jacobi rotations. This option is
+ allowed only if JOBU .NE. 'N', i.e. in computing the full SVD.
+ = 'W': V may be used as workspace of length N*N. See the description of V.
+ = 'N': V is not computed.
+
+ JOBR
+ JOBR is CHARACTER*1
+ Specifies the RANGE for the singular values. Issues the licence to
+ set to zero small positive singular values if they are outside
+ specified range. If A .NE. 0 is scaled so that the largest singular
+ value of c*A is around SQRT(BIG), BIG=SLAMCH('O'), then JOBR issues
+ the licence to kill columns of A whose norm in c*A is less than
+ SQRT(SFMIN) (for JOBR.EQ.'R'), or less than SMALL=SFMIN/EPSLN,
+ where SFMIN=SLAMCH('S'), EPSLN=SLAMCH('E').
+ = 'N': Do not kill small columns of c*A. This option assumes that
+ BLAS and QR factorizations and triangular solvers are
+ implemented to work in that range. If the condition of A
+ is greater than BIG, use CGESVJ.
+ = 'R': RESTRICTED range for sigma(c*A) is [SQRT(SFMIN), SQRT(BIG)]
+ (roughly, as described above). This option is recommended.
+
+ ===========================
+ For computing the singular values in the FULL range [SFMIN,BIG]
+ use CGESVJ.
+
+ JOBT
+ JOBT is CHARACTER*1
+ If the matrix is square then the procedure may determine to use
+ transposed A if A^* seems to be better with respect to convergence.
+ If the matrix is not square, JOBT is ignored. This is subject to
+ changes in the future.
+ The decision is based on two values of entropy over the adjoint
+ orbit of A^* * A. See the descriptions of WORK(6) and WORK(7).
+ = 'T': transpose if entropy test indicates possibly faster
+ convergence of Jacobi process if A^* is taken as input. If A is
+ replaced with A^*, then the row pivoting is included automatically.
+ = 'N': do not speculate.
+ This option can be used to compute only the singular values, or the
+ full SVD (U, SIGMA and V). For only one set of singular vectors
+ (U or V), the caller should provide both U and V, as one of the
+ matrices is used as workspace if the matrix A is transposed.
+ The implementer can easily remove this constraint and make the
+ code more complicated. See the descriptions of U and V.
+
+ JOBP
+ JOBP is CHARACTER*1
+ Issues the licence to introduce structured perturbations to drown
+ denormalized numbers. This licence should be active if the
+ denormals are poorly implemented, causing slow computation,
+ especially in cases of fast convergence (!). For details see [1,2].
+ For the sake of simplicity, this perturbations are included only
+ when the full SVD or only the singular values are requested. The
+ implementer/user can easily add the perturbation for the cases of
+ computing one set of singular vectors.
+ = 'P': introduce perturbation
+ = 'N': do not perturb
+
+ M
+ M is INTEGER
+ The number of rows of the input matrix A. M >= 0.
+
+ N
+ N is INTEGER
+ The number of columns of the input matrix A. M >= N >= 0.
+
+ A
+ A is COMPLEX array, dimension (LDA,N)
+ On entry, the MbyN matrix A.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+
+ SVA
+ SVA is REAL array, dimension (N)
+ On exit,
+  For WORK(1)/WORK(2) = ONE: The singular values of A. During the
+ computation SVA contains Euclidean column norms of the
+ iterated matrices in the array A.
+  For WORK(1) .NE. WORK(2): The singular values of A are
+ (WORK(1)/WORK(2)) * SVA(1:N). This factored form is used if
+ sigma_max(A) overflows or if small singular values have been
+ saved from underflow by scaling the input matrix A.
+  If JOBR='R' then some of the singular values may be returned
+ as exact zeros obtained by "set to zero" because they are
+ below the numerical rank threshold or are denormalized numbers.
+
+ U
+ U is COMPLEX array, dimension ( LDU, N )
+ If JOBU = 'U', then U contains on exit the MbyN matrix of
+ the left singular vectors.
+ If JOBU = 'F', then U contains on exit the MbyM matrix of
+ the left singular vectors, including an ONB
+ of the orthogonal complement of the Range(A).
+ If JOBU = 'W' .AND. (JOBV.EQ.'V' .AND. JOBT.EQ.'T' .AND. M.EQ.N),
+ then U is used as workspace if the procedure
+ replaces A with A^*. In that case, [V] is computed
+ in U as left singular vectors of A^* and then
+ copied back to the V array. This 'W' option is just
+ a reminder to the caller that in this case U is
+ reserved as workspace of length N*N.
+ If JOBU = 'N' U is not referenced.
+
+ LDU
+ LDU is INTEGER
+ The leading dimension of the array U, LDU >= 1.
+ IF JOBU = 'U' or 'F' or 'W', then LDU >= M.
+
+ V
+ V is COMPLEX array, dimension ( LDV, N )
+ If JOBV = 'V', 'J' then V contains on exit the NbyN matrix of
+ the right singular vectors;
+ If JOBV = 'W', AND (JOBU.EQ.'U' AND JOBT.EQ.'T' AND M.EQ.N),
+ then V is used as workspace if the pprocedure
+ replaces A with A^*. In that case, [U] is computed
+ in V as right singular vectors of A^* and then
+ copied back to the U array. This 'W' option is just
+ a reminder to the caller that in this case V is
+ reserved as workspace of length N*N.
+ If JOBV = 'N' V is not referenced.
+
+ LDV
+ LDV is INTEGER
+ The leading dimension of the array V, LDV >= 1.
+ If JOBV = 'V' or 'J' or 'W', then LDV >= N.
+
+ CWORK
+ CWORK is COMPLEX array, dimension at least LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ Length of CWORK to confirm proper allocation of workspace.
+ LWORK depends on the job:
+
+ 1. If only SIGMA is needed ( JOBU.EQ.'N', JOBV.EQ.'N' ) and
+ 1.1 .. no scaled condition estimate required (JOBE.EQ.'N'):
+ LWORK >= 2*N+1. This is the minimal requirement.
+ >> For optimal performance (blocked code) the optimal value
+ is LWORK >= N + (N+1)*NB. Here NB is the optimal
+ block size for CGEQP3 and CGEQRF.
+ In general, optimal LWORK is computed as
+ LWORK >= max(N+LWORK(CGEQP3),N+LWORK(CGEQRF)).
+ 1.2. .. an estimate of the scaled condition number of A is
+ required (JOBA='E', or 'G'). In this case, LWORK the minimal
+ requirement is LWORK >= N*N + 3*N.
+ >> For optimal performance (blocked code) the optimal value
+ is LWORK >= max(N+(N+1)*NB, N*N+3*N).
+ In general, the optimal length LWORK is computed as
+ LWORK >= max(N+LWORK(CGEQP3),N+LWORK(CGEQRF), N+N*N+LWORK(CPOCON)).
+
+ 2. If SIGMA and the right singular vectors are needed (JOBV.EQ.'V'),
+ (JOBU.EQ.'N')
+ > the minimal requirement is LWORK >= 3*N.
+ > For optimal performance, LWORK >= max(N+(N+1)*NB, 3*N,2*N+N*NB),
+ where NB is the optimal block size for CGEQP3, CGEQRF, CGELQ,
+ CUNMLQ. In general, the optimal length LWORK is computed as
+ LWORK >= max(N+LWORK(CGEQP3), N+LWORK(CPOCON), N+LWORK(CGESVJ),
+ N+LWORK(CGELQF), 2*N+LWORK(CGEQRF), N+LWORK(CUNMLQ)).
+
+ 3. If SIGMA and the left singular vectors are needed
+ > the minimal requirement is LWORK >= 3*N.
+ > For optimal performance:
+ if JOBU.EQ.'U' :: LWORK >= max(3*N, N+(N+1)*NB, 2*N+N*NB),
+ where NB is the optimal block size for CGEQP3, CGEQRF, CUNMQR.
+ In general, the optimal length LWORK is computed as
+ LWORK >= max(N+LWORK(CGEQP3),N+LWORK(CPOCON),
+ 2*N+LWORK(CGEQRF), N+LWORK(CUNMQR)).
+
+ 4. If the full SVD is needed: (JOBU.EQ.'U' or JOBU.EQ.'F') and
+ 4.1. if JOBV.EQ.'V' the minimal requirement is LWORK >= 5*N+2*N*N.
+ 4.2. if JOBV.EQ.'J' the minimal requirement is LWORK >= 4*N+N*N.
+ In both cases, the allocated CWORK can accomodate blocked runs
+ of CGEQP3, CGEQRF, CGELQF, SUNMQR, CUNMLQ.
+
+ RWORK
+ RWORK is REAL array, dimension at least LRWORK.
+ On exit,
+
+ RWORK(1) = Determines the scaling factor SCALE = RWORK(2) / RWORK(1)
+ such that SCALE*SVA(1:N) are the computed singular values
+ of A. (See the description of SVA().)
+
+ RWORK(2) = See the description of RWORK(1).
+
+ RWORK(3) = SCONDA is an estimate for the condition number of
+ column equilibrated A. (If JOBA .EQ. 'E' or 'G')
+ SCONDA is an estimate of SQRT((R^* * R)^(1)_1).
+ It is computed using SPOCON. It holds
+ N^(1/4) * SCONDA <= R^(1)_2 <= N^(1/4) * SCONDA
+ where R is the triangular factor from the QRF of A.
+ However, if R is truncated and the numerical rank is
+ determined to be strictly smaller than N, SCONDA is
+ returned as 1, thus indicating that the smallest
+ singular values might be lost.
+
+ If full SVD is needed, the following two condition numbers are
+ useful for the analysis of the algorithm. They are provied for
+ a developer/implementer who is familiar with the details of
+ the method.
+
+ RWORK(4) = an estimate of the scaled condition number of the
+ triangular factor in the first QR factorization.
+
+ RWORK(5) = an estimate of the scaled condition number of the
+ triangular factor in the second QR factorization.
+ The following two parameters are computed if JOBT .EQ. 'T'.
+ They are provided for a developer/implementer who is familiar
+ with the details of the method.
+
+ RWORK(6) = the entropy of A^* * A :: this is the Shannon entropy
+ of diag(A^* * A) / Trace(A^* * A) taken as point in the
+ probability simplex.
+
+ RWORK(7) = the entropy of A * A^*. (See the description of RWORK(6).)
+
+ LRWORK
+ LRWORK is INTEGER
+ Length of RWORK to confirm proper allocation of workspace.
+ LRWORK depends on the job:
+
+ 1. If only singular values are requested i.e. if
+ LSAME(JOBU,'N') .AND. LSAME(JOBV,'N') then:
+ 1.1. If LSAME(JOBT,'T') .OR. LSAME(JOBA,'F') .OR. LSAME(JOBA,'G'),
+ then LRWORK = max( 7, N + 2 * M ).
+ 1.2. Otherwise, LRWORK = max( 7, 2 * N ).
+
+ 2. If singular values with the right singular vectors are requested
+ i.e. if
+ (LSAME(JOBV,'V').OR.LSAME(JOBV,'J')) .AND.
+ .NOT.(LSAME(JOBU,'U').OR.LSAME(JOBU,'F'))
+ then:
+ 2.1. If LSAME(JOBT,'T') .OR. LSAME(JOBA,'F') .OR. LSAME(JOBA,'G'),
+ then LRWORK = max( 7, N + 2 * M ).
+ 2.2. Otherwise, LRWORK = max( 7, 2 * N ).
+
+ 3. If singular values with the left singular vectors are requested, i.e. if
+ (LSAME(JOBU,'U').OR.LSAME(JOBU,'F')) .AND.
+ .NOT.(LSAME(JOBV,'V').OR.LSAME(JOBV,'J'))
+ then:
+ 3.1. If LSAME(JOBT,'T') .OR. LSAME(JOBA,'F') .OR. LSAME(JOBA,'G'),
+ then LRWORK = max( 7, N + 2 * M ).
+ 3.2. Otherwise, LRWORK = max( 7, 2 * N ).
+
+ 4. If singular values with both the left and the right singular vectors
+ are requested, i.e. if
+ (LSAME(JOBU,'U').OR.LSAME(JOBU,'F')) .AND.
+ (LSAME(JOBV,'V').OR.LSAME(JOBV,'J'))
+ then:
+ 4.1. If LSAME(JOBT,'T') .OR. LSAME(JOBA,'F') .OR. LSAME(JOBA,'G'),
+ then LRWORK = max( 7, N + 2 * M ).
+ 4.2. Otherwise, LRWORK = max( 7, 2 * N ).
+
+ IWORK
+ IWORK is INTEGER array, of dimension:
+ If LSAME(JOBA,'F') .OR. LSAME(JOBA,'G'), then
+ the dimension of IWORK is max( 3, 2 * N + M ).
+ Otherwise, the dimension of IWORK is
+ > max( 3, 2*N ) for full SVD
+ > max( 3, N ) for singular values only or singular
+ values with one set of singular vectors (left or right)
+ On exit,
+
+ IWORK(1) = the numerical rank determined after the initial
+ QR factorization with pivoting. See the descriptions
+ of JOBA and JOBR.
+
+ IWORK(2) = the number of the computed nonzero singular values
+
+ IWORK(3) = if nonzero, a warning message:
+ If IWORK(3).EQ.1 then some of the column norms of A
+ were denormalized floats. The requested high accuracy
+ is not warranted by the data.
+
+ INFO
+ INFO is INTEGER
+ < 0 : if INFO = i, then the ith argument had an illegal value.
+ = 0 : successfull exit;
+ > 0 : CGEJSV did not converge in the maximal allowed number
+ of sweeps. The computed values may be inaccurate.
+
+ CGEJSV implements a preconditioned Jacobi SVD algorithm. It uses CGEQP3,
+ CGEQRF, and CGELQF as preprocessors and preconditioners. Optionally, an
+ additional row pivoting can be used as a preprocessor, which in some
+ cases results in much higher accuracy. An example is matrix A with the
+ structure A = D1 * C * D2, where D1, D2 are arbitrarily illconditioned
+ diagonal matrices and C is wellconditioned matrix. In that case, complete
+ pivoting in the first QR factorizations provides accuracy dependent on the
+ condition number of C, and independent of D1, D2. Such higher accuracy is
+ not completely understood theoretically, but it works well in practice.
+ Further, if A can be written as A = B*D, with wellconditioned B and some
+ diagonal D, then the high accuracy is guaranteed, both theoretically and
+ in software, independent of D. For more details see [1], [2].
+
+ The computational range for the singular values can be the full range
+ ( UNDERFLOW,OVERFLOW ), provided that the machine arithmetic and the BLAS
+ & LAPACK routines called by CGEJSV are implemented to work in that range.
+ If that is not the case, then the restriction for safe computation with
+ the singular values in the range of normalized IEEE numbers is that the
+ spectral condition number kappa(A)=sigma_max(A)/sigma_min(A) does not
+ overflow. This code (CGEJSV) is best used in this restricted range,
+ meaning that singular values of magnitude below A_2 / SLAMCH('O') are
+ returned as zeros. See JOBR for details on this.
+
+ Further, this implementation is somewhat slower than the one described
+ in [1,2] due to replacement of some nonLAPACK components, and because
+ the choice of some tuning parameters in the iterative part (CGESVJ) is
+ left to the implementer on a particular machine.
+
+ The rank revealing QR factorization (in this code: CGEQP3) should be
+ implemented as in [3]. We have a new version of CGEQP3 under development
+ that is more robust than the current one in LAPACK, with a cleaner cut in
+ rank defficient cases. It will be available in the SIGMA library [4].
+
+ If M is much larger than N, it is obvious that the inital QRF with
+ column pivoting can be preprocessed by the QRF without pivoting. That
+ well known trick is not used in CGEJSV because in some cases heavy row
+ weighting can be treated with complete pivoting. The overhead in cases
+ M much larger than N is then only due to pivoting, but the benefits in
+ terms of accuracy have prevailed. The implementer/user can incorporate
+ this extra QRF step easily. The implementer can also improve data movement
+ (matrix transpose, matrix copy, matrix transposed copy)  this
+ implementation of CGEJSV uses only the simplest, naive data movement.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{cgejsv.f}
+\index{cgejsv.f}
+\begin{chunk}{cgejsv.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK cgejsv}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{cgesdd}
+\label{cgesdd}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{cgesdd.input}
+)set break resume
+)sys rm f cgesdd.output
+)spool cgesdd.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{cgesdd.help}
+====================================================================
+cgesdd examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine cgesdd (JOBZ, M, N, A, LDA, S, U, LDU, VT, LDVT, WORK,
+ LWORK, RWORK, IWORK, INFO)
+ CGESDD
+
+Function/Subroutine Documentation
+ subroutine cgesdd (character JOBZ, integer M, integer N, complex,
+ dimension( lda, * ) A, integer LDA, real, dimension( * ) S, complex,
+ dimension( ldu, * ) U, integer LDU, complex, dimension( ldvt, * ) VT,
+ integer LDVT, complex, dimension( * ) WORK, integer LWORK, real,
+ dimension( * ) RWORK, integer, dimension( * ) IWORK, integer INFO)
+ CGESDD
+
+Purpose:
+ CGESDD computes the singular value decomposition (SVD) of a complex
+ MbyN matrix A, optionally computing the left and/or right singular
+ vectors, by using divideandconquer method. The SVD is written
+
+ A = U * SIGMA * conjugatetranspose(V)
+
+ where SIGMA is an MbyN matrix which is zero except for its
+ min(m,n) diagonal elements, U is an MbyM unitary matrix, and
+ V is an NbyN unitary matrix. The diagonal elements of SIGMA
+ are the singular values of A; they are real and nonnegative, and
+ are returned in descending order. The first min(m,n) columns of
+ U and V are the left and right singular vectors of A.
+
+ Note that the routine returns VT = V**H, not V.
+
+ The divide and conquer algorithm makes very mild assumptions about
+ floating point arithmetic. It will work on machines with a guard
+ digit in add/subtract, or on those binary machines without guard
+ digits which subtract like the Cray XMP, Cray YMP, Cray C90, or
+ Cray2. It could conceivably fail on hexadecimal or decimal machines
+ without guard digits, but we know of none.
+
+Parameters:
+
+ JOBZ
+ JOBZ is CHARACTER*1
+ Specifies options for computing all or part of the matrix U:
+ = 'A': all M columns of U and all N rows of V**H are
+ returned in the arrays U and VT;
+ = 'S': the first min(M,N) columns of U and the first
+ min(M,N) rows of V**H are returned in the arrays U and VT;
+ = 'O': If M >= N, the first N columns of U are overwritten
+ in the array A and all rows of V**H are returned in the array VT;
+ otherwise, all columns of U are returned in the
+ array U and the first M rows of V**H are overwritten
+ in the array A;
+ = 'N': no columns of U or rows of V**H are computed.
+
+ M
+ M is INTEGER
+ The number of rows of the input matrix A. M >= 0.
+
+ N
+ N is INTEGER
+ The number of columns of the input matrix A. N >= 0.
+
+ A
+ A is COMPLEX array, dimension (LDA,N)
+ On entry, the MbyN matrix A.
+ On exit,
+ if JOBZ = 'O', A is overwritten with the first N columns
+ of U (the left singular vectors, stored columnwise) if M >= N;
+ A is overwritten with the first M rows
+ of V**H (the right singular vectors, stored rowwise) otherwise.
+ if JOBZ .ne. 'O', the contents of A are destroyed.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+
+ S
+ S is REAL array, dimension (min(M,N))
+ The singular values of A, sorted so that S(i) >= S(i+1).
+
+ U
+ U is COMPLEX array, dimension (LDU,UCOL)
+ UCOL = M if JOBZ = 'A' or JOBZ = 'O' and M < N;
+ UCOL = min(M,N) if JOBZ = 'S'.
+ If JOBZ = 'A' or JOBZ = 'O' and M < N, U contains the MbyM
+ unitary matrix U;
+ if JOBZ = 'S', U contains the first min(M,N) columns of U
+ (the left singular vectors, stored columnwise);
+ if JOBZ = 'O' and M >= N, or JOBZ = 'N', U is not referenced.
+
+ LDU
+ LDU is INTEGER
+ The leading dimension of the array U. LDU >= 1; if
+ JOBZ = 'S' or 'A' or JOBZ = 'O' and M < N, LDU >= M.
+
+ VT
+ VT is COMPLEX array, dimension (LDVT,N)
+ If JOBZ = 'A' or JOBZ = 'O' and M >= N, VT contains the
+ NbyN unitary matrix V**H;
+ if JOBZ = 'S', VT contains the first min(M,N) rows of
+ V**H (the right singular vectors, stored rowwise);
+ if JOBZ = 'O' and M < N, or JOBZ = 'N', VT is not referenced.
+
+ LDVT
+ LDVT is INTEGER
+ The leading dimension of the array VT. LDVT >= 1; if
+ JOBZ = 'A' or JOBZ = 'O' and M >= N, LDVT >= N;
+ if JOBZ = 'S', LDVT >= min(M,N).
+
+ WORK
+ WORK is COMPLEX array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK. LWORK >= 1.
+ if JOBZ = 'N', LWORK >= 2*min(M,N)+max(M,N).
+ if JOBZ = 'O',
+ LWORK >= 2*min(M,N)*min(M,N)+2*min(M,N)+max(M,N).
+ if JOBZ = 'S' or 'A',
+ LWORK >= min(M,N)*min(M,N)+2*min(M,N)+max(M,N).
+ For good performance, LWORK should generally be larger.
+
+ If LWORK = 1, a workspace query is assumed. The optimal
+ size for the WORK array is calculated and stored in WORK(1),
+ and no other work except argument checking is performed.
+
+ RWORK
+ RWORK is REAL array, dimension (MAX(1,LRWORK))
+ If JOBZ = 'N', LRWORK >= 7*min(M,N).
+ Otherwise,
+ LRWORK >= min(M,N)*max(5*min(M,N)+7,2*max(M,N)+2*min(M,N)+1)
+
+ IWORK
+ IWORK is INTEGER array, dimension (8*min(M,N))
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit.
+ < 0: if INFO = i, the ith argument had an illegal value.
+ > 0: The updating process of SBDSDC did not converge.
+
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{cgesdd.f}
+\index{cgesdd.f}
+\begin{chunk}{cgesdd.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK cgesdd}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{cgesvd}
+\label{cgesvd}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{cgesvd.input}
+)set break resume
+)sys rm f cgesvd.output
+)spool cgesvd.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{cgesvd.help}
+====================================================================
+cgesvd examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine cgesvd (JOBU, JOBVT, M, N, A, LDA, S, U, LDU, VT, LDVT,
+ WORK, LWORK, RWORK, INFO)
+ CGESVD computes the singular value decomposition (SVD) for GE
+ matrices
+
+Function/Subroutine Documentation
+ subroutine cgesvd (character JOBU, character JOBVT, integer M, integer N,
+ complex, dimension( lda, * ) A, integer LDA, real, dimension( * ) S,
+ complex, dimension( ldu, * ) U, integer LDU, complex, dimension( ldvt,
+ * ) VT, integer LDVT, complex, dimension( * ) WORK, integer LWORK,
+ real, dimension( * ) RWORK, integer INFO)
+ CGESVD computes the singular value decomposition (SVD) for GE matrices
+
+Purpose:
+ CGESVD computes the singular value decomposition (SVD) of a complex
+ MbyN matrix A, optionally computing the left and/or right singular
+ vectors. The SVD is written
+
+ A = U * SIGMA * conjugatetranspose(V)
+
+ where SIGMA is an MbyN matrix which is zero except for its
+ min(m,n) diagonal elements, U is an MbyM unitary matrix, and
+ V is an NbyN unitary matrix. The diagonal elements of SIGMA
+ are the singular values of A; they are real and nonnegative, and
+ are returned in descending order. The first min(m,n) columns of
+ U and V are the left and right singular vectors of A.
+
+ Note that the routine returns V**H, not V.
+
+Parameters:
+
+ JOBU
+ JOBU is CHARACTER*1
+ Specifies options for computing all or part of the matrix U:
+ = 'A': all M columns of U are returned in array U:
+ = 'S': the first min(m,n) columns of U (the left singular
+ vectors) are returned in the array U;
+ = 'O': the first min(m,n) columns of U (the left singular
+ vectors) are overwritten on the array A;
+ = 'N': no columns of U (no left singular vectors) are computed.
+
+ JOBVT
+ JOBVT is CHARACTER*1
+ Specifies options for computing all or part of the matrix
+ V**H:
+ = 'A': all N rows of V**H are returned in the array VT;
+ = 'S': the first min(m,n) rows of V**H (the right singular
+ vectors) are returned in the array VT;
+ = 'O': the first min(m,n) rows of V**H (the right singular
+ vectors) are overwritten on the array A;
+ = 'N': no rows of V**H (no right singular vectors) are computed.
+
+ JOBVT and JOBU cannot both be 'O'.
+
+ M
+ M is INTEGER
+ The number of rows of the input matrix A. M >= 0.
+
+ N
+ N is INTEGER
+ The number of columns of the input matrix A. N >= 0.
+
+ A
+ A is COMPLEX array, dimension (LDA,N)
+ On entry, the MbyN matrix A.
+ On exit,
+ if JOBU = 'O', A is overwritten with the first min(m,n)
+ columns of U (the left singular vectors, stored columnwise);
+ if JOBVT = 'O', A is overwritten with the first min(m,n)
+ rows of V**H (the right singular vectors, stored rowwise);
+ if JOBU .ne. 'O' and JOBVT .ne. 'O', the contents of A are destroyed.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+
+ S
+ S is REAL array, dimension (min(M,N))
+ The singular values of A, sorted so that S(i) >= S(i+1).
+
+ U
+ U is COMPLEX array, dimension (LDU,UCOL)
+ (LDU,M) if JOBU = 'A' or (LDU,min(M,N)) if JOBU = 'S'.
+ If JOBU = 'A', U contains the MbyM unitary matrix U;
+ if JOBU = 'S', U contains the first min(m,n) columns of U
+ (the left singular vectors, stored columnwise);
+ if JOBU = 'N' or 'O', U is not referenced.
+
+ LDU
+ LDU is INTEGER
+ The leading dimension of the array U. LDU >= 1; if
+ JOBU = 'S' or 'A', LDU >= M.
+
+ VT
+ VT is COMPLEX array, dimension (LDVT,N)
+ If JOBVT = 'A', VT contains the NbyN unitary matrix V**H;
+ if JOBVT = 'S', VT contains the first min(m,n) rows of
+ V**H (the right singular vectors, stored rowwise);
+ if JOBVT = 'N' or 'O', VT is not referenced.
+
+ LDVT
+ LDVT is INTEGER
+ The leading dimension of the array VT. LDVT >= 1; if
+ JOBVT = 'A', LDVT >= N; if JOBVT = 'S', LDVT >= min(M,N).
+
+ WORK
+ WORK is COMPLEX array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK.
+ LWORK >= MAX(1,2*MIN(M,N)+MAX(M,N)).
+ For good performance, LWORK should generally be larger.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ RWORK
+ RWORK is REAL array, dimension (5*min(M,N))
+ On exit, if INFO > 0, RWORK(1:MIN(M,N)1) contains the
+ unconverged superdiagonal elements of an upper bidiagonal
+ matrix B whose diagonal is in S (not necessarily sorted).
+ B satisfies A = U * B * VT, so it has the same singular
+ values as A, and singular vectors related by U and VT.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit.
+ < 0: if INFO = i, the ith argument had an illegal value.
+ > 0: if CBDSQR did not converge, INFO specifies how many
+ superdiagonals of an intermediate bidiagonal form B
+ did not converge to zero. See the description of RWORK
+ above for details.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{cgesvd.f}
+\index{cgesvd.f}
+\begin{chunk}{cgesvd.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK cgesvd}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{cgesvdx}
+\label{cgesvdx}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{cgesvdx.input}
+)set break resume
+)sys rm f cgesvdx.output
+)spool cgesvdx.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{cgesvdx.help}
+====================================================================
+cgesvdx examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine cgesvdx (JOBU, JOBVT, RANGE, M, N, A, LDA, VL, VU, IL, IU,
+ NS, S, U, LDU, VT, LDVT, WORK, LWORK, RWORK, IWORK, INFO)
+ CGESVDX computes the singular value decomposition (SVD) for GE
+ matrices
+
+Function/Subroutine Documentation
+ subroutine cgesvdx (character JOBU, character JOBVT, character RANGE,
+ integer M, integer N, complex, dimension( lda, * ) A, integer LDA, real
+ VL, real VU, integer IL, integer IU, integer NS, real, dimension( * )
+ S, complex, dimension( ldu, * ) U, integer LDU, complex, dimension(
+ ldvt, * ) VT, integer LDVT, complex, dimension( * ) WORK, integer
+ LWORK, real, dimension( * ) RWORK, integer, dimension( * ) IWORK,
+ integer INFO)
+ CGESVDX computes the singular value decomposition (SVD) for GE
+ matrices
+
+Purpose:
+ CGESVDX computes the singular value decomposition (SVD) of a complex
+ MbyN matrix A, optionally computing the left and/or right singular
+ vectors. The SVD is written
+
+ A = U * SIGMA * transpose(V)
+
+ where SIGMA is an MbyN matrix which is zero except for its
+ min(m,n) diagonal elements, U is an MbyM unitary matrix, and
+ V is an NbyN unitary matrix. The diagonal elements of SIGMA
+ are the singular values of A; they are real and nonnegative, and
+ are returned in descending order. The first min(m,n) columns of
+ U and V are the left and right singular vectors of A.
+
+ CGESVDX uses an eigenvalue problem for obtaining the SVD, which
+ allows for the computation of a subset of singular values and
+ vectors. See SBDSVDX for details.
+
+ Note that the routine returns V**T, not V.
+
+Parameters:
+
+ JOBU
+ JOBU is CHARACTER*1
+ Specifies options for computing all or part of the matrix U:
+ = 'V': the first min(m,n) columns of U (the left singular
+ vectors) or as specified by RANGE are returned in the array U;
+ = 'N': no columns of U (no left singular vectors) are computed.
+
+ JOBVT
+ JOBVT is CHARACTER*1
+ Specifies options for computing all or part of the matrix
+ V**T:
+ = 'V': the first min(m,n) rows of V**T (the right singular
+ vectors) or as specified by RANGE are returned in the array VT;
+ = 'N': no rows of V**T (no right singular vectors) are computed.
+
+ RANGE
+ RANGE is CHARACTER*1
+ = 'A': all singular values will be found.
+ = 'V': all singular values in the halfopen interval (VL,VU] will be found.
+ = 'I': the ILth through IUth singular values will be found.
+
+ M
+ M is INTEGER
+ The number of rows of the input matrix A. M >= 0.
+
+ N
+ N is INTEGER
+ The number of columns of the input matrix A. N >= 0.
+
+ A
+ A is COMPLEX array, dimension (LDA,N)
+ On entry, the MbyN matrix A.
+ On exit, the contents of A are destroyed.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+
+ VL
+ VL is REAL
+ VL >=0.
+
+ VU
+ VU is REAL
+ If RANGE='V', the lower and upper bounds of the interval to
+ be searched for singular values. VU > VL.
+ Not referenced if RANGE = 'A' or 'I'.
+
+ IL
+ IL is INTEGER
+
+ IU
+ IU is INTEGER
+ If RANGE='I', the indices (in ascending order) of the
+ smallest and largest singular values to be returned.
+ 1 <= IL <= IU <= min(M,N), if min(M,N) > 0.
+ Not referenced if RANGE = 'A' or 'V'.
+
+ NS
+ NS is INTEGER
+ The total number of singular values found,
+ 0 <= NS <= min(M,N).
+ If RANGE = 'A', NS = min(M,N); if RANGE = 'I', NS = IUIL+1.
+
+ S
+ S is REAL array, dimension (min(M,N))
+ The singular values of A, sorted so that S(i) >= S(i+1).
+
+ U
+ U is COMPLEX array, dimension (LDU,UCOL)
+ If JOBU = 'V', U contains columns of U (the left singular
+ vectors, stored columnwise) as specified by RANGE; if
+ JOBU = 'N', U is not referenced.
+ Note: The user must ensure that UCOL >= NS; if RANGE = 'V',
+ the exact value of NS is not known ILQFin advance and an upper
+ bound must be used.
+
+ LDU
+ LDU is INTEGER
+ The leading dimension of the array U. LDU >= 1; if
+ JOBU = 'V', LDU >= M.
+
+ VT
+ VT is COMPLEX array, dimension (LDVT,N)
+ If JOBVT = 'V', VT contains the rows of V**T (the right singular
+ vectors, stored rowwise) as specified by RANGE; if JOBVT = 'N',
+ VT is not referenced.
+ Note: The user must ensure that LDVT >= NS; if RANGE = 'V',
+ the exact value of NS is not known in advance and an upper
+ bound must be used.
+
+ LDVT
+ LDVT is INTEGER
+ The leading dimension of the array VT. LDVT >= 1; if
+ JOBVT = 'V', LDVT >= NS (see above).
+
+ WORK
+ WORK is COMPLEX array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK;
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK.
+ LWORK >= MAX(1,MIN(M,N)*(MIN(M,N)+4)) for the paths (see
+ comments inside the code):
+  PATH 1 (M much larger than N)
+  PATH 1t (N much larger than M)
+ LWORK >= MAX(1,MIN(M,N)*2+MAX(M,N)) for the other paths.
+ For good performance, LWORK should generally be larger.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ RWORK
+ RWORK is REAL array, dimension (MAX(1,LRWORK))
+ LRWORK >= MIN(M,N)*(MIN(M,N)*2+15*MIN(M,N)).
+
+ IWORK
+ IWORK is INTEGER array, dimension (12*MIN(M,N))
+ If INFO = 0, the first NS elements of IWORK are zero. If INFO > 0,
+ then IWORK contains the indices of the eigenvectors that failed
+ to converge in SBDSVDX/SSTEVX.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value
+ > 0: if INFO = i, then i eigenvectors failed to converge
+ in SBDSVDX/SSTEVX. if INFO = N*2 + 1, an internal error occurred
+ in SBDSVDX
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{cgesvdx.f}
+\index{cgesvdx.f}
+\begin{chunk}{cgesvdx.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK cgesvdx}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\chapter{LAPACK  General Matrices, Singular Value, Complex16}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{zgejsv}
+\label{zgejsv}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{zgejsv.input}
+)set break resume
+)sys rm f zgejsv.output
+)spool zgejsv.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{zgejsv.help}
+====================================================================
+zgejsv examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine zgejsv (JOBA, JOBU, JOBV, JOBR, JOBT, JOBP, M, N, A, LDA,
+ SVA, U, LDU, V, LDV, CWORK, LWORK, RWORK, LRWORK, IWORK, INFO)
+ ZGEJSV
+
+Function/Subroutine Documentation
+ subroutine zgejsv (character*1 JOBA, character*1 JOBU, character*1 JOBV,
+ character*1 JOBR, character*1 JOBT, character*1 JOBP, integer M,
+ integer N, double complex, dimension( lda, * ) A, integer LDA, double
+ precision, dimension( n ) SVA, double complex, dimension( ldu, * ) U,
+ integer LDU, double complex, dimension( ldv, * ) V, integer LDV, double
+ complex, dimension( lwork ) CWORK, integer LWORK, double precision,
+ dimension( * ) RWORK, integer LRWORK, integer, dimension( * ) IWORK,
+ integer INFO)
+ ZGEJSV
+
+Purpose:
+
+ JOBA
+ JOBA is CHARACTER*1
+ Specifies the level of accuracy:
+ = 'C': This option works well (high relative accuracy) if A = B * D,
+ with wellconditioned B and arbitrary diagonal matrix D.
+ The accuracy cannot be spoiled by COLUMN scaling. The
+ accuracy of the computed output depends on the condition of
+ B, and the procedure aims at the best theoretical accuracy.
+ The relative error max_{i=1:N}d sigma_i / sigma_i is
+ bounded by f(M,N)*epsilon* cond(B), independent of D.
+ The input matrix is preprocessed with the QRF with column
+ pivoting. This initial preprocessing and preconditioning by
+ a rank revealing QR factorization is common for all values of
+ JOBA. Additional actions are specified as follows:
+ = 'E': Computation as with 'C' with an additional estimate of the
+ condition number of B. It provides a realistic error bound.
+ = 'F': If A = D1 * C * D2 with illconditioned diagonal scalings
+ D1, D2, and wellconditioned matrix C, this option gives
+ higher accuracy than the 'C' option. If the structure of the
+ input matrix is not known, and relative accuracy is
+ desirable, then this option is advisable. The input matrix A
+ is preprocessed with QR factorization with FULL (row and
+ column) pivoting.
+ = 'G' Computation as with 'F' with an additional estimate of the
+ condition number of B, where A=D*B. If A has heavily weighted
+ rows, then using this condition number gives too pessimistic
+ error bound.
+ = 'A': Small singular values are the noise and the matrix is treated
+ as numerically rank defficient. The error in the computed
+ singular values is bounded by f(m,n)*epsilon*A.
+ The computed SVD A = U * S * V^* restores A up to
+ f(m,n)*epsilon*A.
+ This gives the procedure the licence to discard (set to zero)
+ all singular values below N*epsilon*A.
+ = 'R': Similar as in 'A'. Rank revealing property of the initial
+ QR factorization is used do reveal (using triangular factor)
+ a gap sigma_{r+1} < epsilon * sigma_r in which case the
+ numerical RANK is declared to be r. The SVD is computed with
+ absolute error bounds, but more accurately than with 'A'.
+
+Parameters:
+
+ JOBU
+ JOBU is CHARACTER*1
+ Specifies whether to compute the columns of U:
+ = 'U': N columns of U are returned in the array U.
+ = 'F': full set of M left sing. vectors is returned in the array U.
+ = 'W': U may be used as workspace of length M*N. See the description of U.
+ = 'N': U is not computed.
+
+ JOBV
+ JOBV is CHARACTER*1
+ Specifies whether to compute the matrix V:
+ = 'V': N columns of V are returned in the array V; Jacobi rotations
+ are not explicitly accumulated.
+ = 'J': N columns of V are returned in the array V, but they are
+ computed as the product of Jacobi rotations. This option is
+ allowed only if JOBU .NE. 'N', i.e. in computing the full SVD.
+ = 'W': V may be used as workspace of length N*N. See the description of V.
+ = 'N': V is not computed.
+
+ JOBR
+ JOBR is CHARACTER*1
+ Specifies the RANGE for the singular values. Issues the licence to
+ set to zero small positive singular values if they are outside
+ specified range. If A .NE. 0 is scaled so that the largest singular
+ value of c*A is around SQRT(BIG), BIG=DLAMCH('O'), then JOBR issues
+ the licence to kill columns of A whose norm in c*A is less than
+ SQRT(SFMIN) (for JOBR.EQ.'R'), or less than SMALL=SFMIN/EPSLN,
+ where SFMIN=DLAMCH('S'), EPSLN=DLAMCH('E').
+ = 'N': Do not kill small columns of c*A. This option assumes that
+ BLAS and QR factorizations and triangular solvers are
+ implemented to work in that range. If the condition of A
+ is greater than BIG, use ZGESVJ.
+ = 'R': RESTRICTED range for sigma(c*A) is [SQRT(SFMIN), SQRT(BIG)]
+ (roughly, as described above). This option is recommended.
+ ===========================
+ For computing the singular values in the FULL range [SFMIN,BIG]
+ use ZGESVJ.
+
+ JOBT
+ JOBT is CHARACTER*1
+ If the matrix is square then the procedure may determine to use
+ transposed A if A^* seems to be better with respect to convergence.
+ If the matrix is not square, JOBT is ignored. This is subject to
+ changes in the future.
+ The decision is based on two values of entropy over the adjoint
+ orbit of A^* * A. See the descriptions of WORK(6) and WORK(7).
+ = 'T': transpose if entropy test indicates possibly faster
+ convergence of Jacobi process if A^* is taken as input. If A is
+ replaced with A^*, then the row pivoting is included automatically.
+ = 'N': do not speculate.
+ This option can be used to compute only the singular values, or the
+ full SVD (U, SIGMA and V). For only one set of singular vectors
+ (U or V), the caller should provide both U and V, as one of the
+ matrices is used as workspace if the matrix A is transposed.
+ The implementer can easily remove this constraint and make the
+ code more complicated. See the descriptions of U and V.
+
+ JOBP
+ JOBP is CHARACTER*1
+ Issues the licence to introduce structured perturbations to drown
+ denormalized numbers. This licence should be active if the
+ denormals are poorly implemented, causing slow computation,
+ especially in cases of fast convergence (!). For details see [1,2].
+ For the sake of simplicity, this perturbations are included only
+ when the full SVD or only the singular values are requested. The
+ implementer/user can easily add the perturbation for the cases of
+ computing one set of singular vectors.
+ = 'P': introduce perturbation
+ = 'N': do not perturb
+
+ M
+ M is INTEGER
+ The number of rows of the input matrix A. M >= 0.
+
+ N
+ N is INTEGER
+ The number of columns of the input matrix A. M >= N >= 0.
+
+ A
+ A is DOUBLE COMPLEX array, dimension (LDA,N)
+ On entry, the MbyN matrix A.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+
+ SVA
+ SVA is DOUBLE PRECISION array, dimension (N)
+ On exit,
+  For WORK(1)/WORK(2) = ONE: The singular values of A. During the
+ computation SVA contains Euclidean column norms of the
+ iterated matrices in the array A.
+  For WORK(1) .NE. WORK(2): The singular values of A are
+ (WORK(1)/WORK(2)) * SVA(1:N). This factored form is used if
+ sigma_max(A) overflows or if small singular values have been
+ saved from underflow by scaling the input matrix A.
+  If JOBR='R' then some of the singular values may be returned
+ as exact zeros obtained by "set to zero" because they are
+ below the numerical rank threshold or are denormalized numbers.
+
+ U
+ U is DOUBLE COMPLEX array, dimension ( LDU, N )
+ If JOBU = 'U', then U contains on exit the MbyN matrix of
+ the left singular vectors.
+ If JOBU = 'F', then U contains on exit the MbyM matrix of
+ the left singular vectors, including an ONB
+ of the orthogonal complement of the Range(A).
+ If JOBU = 'W' .AND. (JOBV.EQ.'V' .AND. JOBT.EQ.'T' .AND. M.EQ.N),
+ then U is used as workspace if the procedure
+ replaces A with A^*. In that case, [V] is computed
+ in U as left singular vectors of A^* and then
+ copied back to the V array. This 'W' option is just
+ a reminder to the caller that in this case U is
+ reserved as workspace of length N*N.
+ If JOBU = 'N' U is not referenced.
+
+ LDU
+ LDU is INTEGER
+ The leading dimension of the array U, LDU >= 1.
+ IF JOBU = 'U' or 'F' or 'W', then LDU >= M.
+
+ V
+ V is DOUBLE COMPLEX array, dimension ( LDV, N )
+ If JOBV = 'V', 'J' then V contains on exit the NbyN matrix of
+ the right singular vectors;
+ If JOBV = 'W', AND (JOBU.EQ.'U' AND JOBT.EQ.'T' AND M.EQ.N),
+ then V is used as workspace if the pprocedure
+ replaces A with A^*. In that case, [U] is computed
+ in V as right singular vectors of A^* and then
+ copied back to the U array. This 'W' option is just
+ a reminder to the caller that in this case V is
+ reserved as workspace of length N*N.
+ If JOBV = 'N' V is not referenced.
+
+ LDV
+ LDV is INTEGER
+ The leading dimension of the array V, LDV >= 1.
+ If JOBV = 'V' or 'J' or 'W', then LDV >= N.
+
+ CWORK
+ CWORK (workspace)
+ CWORK is DOUBLE COMPLEX array, dimension at least LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ Length of CWORK to confirm proper allocation of workspace.
+ LWORK depends on the job:
+
+ 1. If only SIGMA is needed ( JOBU.EQ.'N', JOBV.EQ.'N' ) and
+ 1.1 .. no scaled condition estimate required (JOBE.EQ.'N'):
+ LWORK >= 2*N+1. This is the minimal requirement.
+ >> For optimal performance (blocked code) the optimal value
+ is LWORK >= N + (N+1)*NB. Here NB is the optimal
+ block size for ZGEQP3 and ZGEQRF.
+ In general, optimal LWORK is computed as
+ LWORK >= max(N+LWORK(ZGEQP3),N+LWORK(ZGEQRF)).
+ 1.2. .. an estimate of the scaled condition number of A is
+ required (JOBA='E', or 'G'). In this case, LWORK the minimal
+ requirement is LWORK >= N*N + 3*N.
+ >> For optimal performance (blocked code) the optimal value
+ is LWORK >= max(N+(N+1)*NB, N*N+3*N).
+ In general, the optimal length LWORK is computed as
+ LWORK >= max(N+LWORK(ZGEQP3),N+LWORK(ZGEQRF),
+ N+N*N+LWORK(CPOCON)).
+
+ 2. If SIGMA and the right singular vectors are needed (JOBV.EQ.'V'),
+ (JOBU.EQ.'N')
+ > the minimal requirement is LWORK >= 3*N.
+ > For optimal performance, LWORK >= max(N+(N+1)*NB, 3*N,2*N+N*NB),
+ where NB is the optimal block size for ZGEQP3, ZGEQRF, ZGELQ,
+ CUNMLQ. In general, the optimal length LWORK is computed as
+ LWORK >= max(N+LWORK(ZGEQP3), N+LWORK(CPOCON), N+LWORK(ZGESVJ),
+ N+LWORK(ZGELQF), 2*N+LWORK(ZGEQRF), N+LWORK(CUNMLQ)).
+
+ 3. If SIGMA and the left singular vectors are needed
+ > the minimal requirement is LWORK >= 3*N.
+ > For optimal performance:
+ if JOBU.EQ.'U' :: LWORK >= max(3*N, N+(N+1)*NB, 2*N+N*NB),
+ where NB is the optimal block size for ZGEQP3, ZGEQRF, CUNMQR.
+ In general, the optimal length LWORK is computed as
+ LWORK >= max(N+LWORK(ZGEQP3),N+LWORK(CPOCON),
+ 2*N+LWORK(ZGEQRF), N+LWORK(CUNMQR)).
+
+ 4. If the full SVD is needed: (JOBU.EQ.'U' or JOBU.EQ.'F') and
+ 4.1. if JOBV.EQ.'V' the minimal requirement is LWORK >= 5*N+2*N*N.
+ 4.2. if JOBV.EQ.'J' the minimal requirement is LWORK >= 4*N+N*N.
+ In both cases, the allocated CWORK can accomodate blocked runs
+ of ZGEQP3, ZGEQRF, ZGELQF, SUNMQR, CUNMLQ.
+
+ RWORK
+ RWORK is DOUBLE PRECISION array, dimension at least LRWORK.
+ On exit,
+ RWORK(1) = Determines the scaling factor SCALE = RWORK(2) / RWORK(1)
+ such that SCALE*SVA(1:N) are the computed singular values
+ of A. (See the description of SVA().)
+ RWORK(2) = See the description of RWORK(1).
+ RWORK(3) = SCONDA is an estimate for the condition number of
+ column equilibrated A. (If JOBA .EQ. 'E' or 'G')
+ SCONDA is an estimate of SQRT((R^* * R)^(1)_1).
+ It is computed using SPOCON. It holds
+ N^(1/4) * SCONDA <= R^(1)_2 <= N^(1/4) * SCONDA
+ where R is the triangular factor from the QRF of A.
+ However, if R is truncated and the numerical rank is
+ determined to be strictly smaller than N, SCONDA is
+ returned as 1, thus indicating that the smallest
+ singular values might be lost.
+
+ If full SVD is needed, the following two condition numbers are
+ useful for the analysis of the algorithm. They are provied for
+ a developer/implementer who is familiar with the details of
+ the method.
+
+ RWORK(4) = an estimate of the scaled condition number of the
+ triangular factor in the first QR factorization.
+ RWORK(5) = an estimate of the scaled condition number of the
+ triangular factor in the second QR factorization.
+
+ The following two parameters are computed if JOBT .EQ. 'T'.
+ They are provided for a developer/implementer who is familiar
+ with the details of the method.
+ RWORK(6) = the entropy of A^* * A :: this is the Shannon entropy
+ of diag(A^* * A) / Trace(A^* * A) taken as point in the
+ probability simplex.
+ RWORK(7) = the entropy of A * A^*. (See the description of RWORK(6).)
+
+ LRWORK
+ LRWORK is INTEGER
+ Length of RWORK to confirm proper allocation of workspace.
+ LRWORK depends on the job:
+
+ 1. If only singular values are requested i.e. if
+ LSAME(JOBU,'N') .AND. LSAME(JOBV,'N')
+ then:
+ 1.1. If LSAME(JOBT,'T') .OR. LSAME(JOBA,'F') .OR. LSAME(JOBA,'G'),
+ then LRWORK = max( 7, N + 2 * M ).
+ 1.2. Otherwise, LRWORK = max( 7, 2 * N ).
+ 2. If singular values with the right singular vectors are requested
+ i.e. if
+ (LSAME(JOBV,'V').OR.LSAME(JOBV,'J')) .AND.
+ .NOT.(LSAME(JOBU,'U').OR.LSAME(JOBU,'F'))
+ then:
+ 2.1. If LSAME(JOBT,'T') .OR. LSAME(JOBA,'F') .OR. LSAME(JOBA,'G'),
+ then LRWORK = max( 7, N + 2 * M ).
+ 2.2. Otherwise, LRWORK = max( 7, 2 * N ).
+ 3. If singular values with the left singular vectors are requested, i.e. if
+ (LSAME(JOBU,'U').OR.LSAME(JOBU,'F')) .AND.
+ .NOT.(LSAME(JOBV,'V').OR.LSAME(JOBV,'J'))
+ then:
+ 3.1. If LSAME(JOBT,'T') .OR. LSAME(JOBA,'F') .OR. LSAME(JOBA,'G'),
+ then LRWORK = max( 7, N + 2 * M ).
+ 3.2. Otherwise, LRWORK = max( 7, 2 * N ).
+ 4. If singular values with both the left and the right singular vectors
+ are requested, i.e. if
+ (LSAME(JOBU,'U').OR.LSAME(JOBU,'F')) .AND.
+ (LSAME(JOBV,'V').OR.LSAME(JOBV,'J'))
+ then:
+ 4.1. If LSAME(JOBT,'T') .OR. LSAME(JOBA,'F') .OR. LSAME(JOBA,'G'),
+ then LRWORK = max( 7, N + 2 * M ).
+ 4.2. Otherwise, LRWORK = max( 7, 2 * N ).
+
+ IWORK
+ IWORK is INTEGER array, of dimension:
+ If LSAME(JOBA,'F') .OR. LSAME(JOBA,'G'), then
+ the dimension of IWORK is max( 3, 2 * N + M ).
+ Otherwise, the dimension of IWORK is
+ > max( 3, 2*N ) for full SVD
+ > max( 3, N ) for singular values only or singular
+ values with one set of singular vectors (left or right)
+ On exit,
+ IWORK(1) = the numerical rank determined after the initial
+ QR factorization with pivoting. See the descriptions
+ of JOBA and JOBR.
+ IWORK(2) = the number of the computed nonzero singular values
+ IWORK(3) = if nonzero, a warning message:
+ If IWORK(3).EQ.1 then some of the column norms of A
+ were denormalized floats. The requested high accuracy
+ is not warranted by the data.
+
+ INFO
+ INFO is INTEGER
+ < 0 : if INFO = i, then the ith argument had an illegal value.
+ = 0 : successfull exit;
+ > 0 : ZGEJSV did not converge in the maximal allowed number
+ of sweeps. The computed values may be inaccurate.
+
+Further Details:
+ ZGEJSV implements a preconditioned Jacobi SVD algorithm. It uses ZGEQP3,
+ ZGEQRF, and ZGELQF as preprocessors and preconditioners. Optionally, an
+ additional row pivoting can be used as a preprocessor, which in some
+ cases results in much higher accuracy. An example is matrix A with the
+ structure A = D1 * C * D2, where D1, D2 are arbitrarily illconditioned
+ diagonal matrices and C is wellconditioned matrix. In that case, complete
+ pivoting in the first QR factorizations provides accuracy dependent on the
+ condition number of C, and independent of D1, D2. Such higher accuracy is
+ not completely understood theoretically, but it works well in practice.
+ Further, if A can be written as A = B*D, with wellconditioned B and some
+ diagonal D, then the high accuracy is guaranteed, both theoretically and
+ in software, independent of D. For more details see [1], [2].
+ The computational range for the singular values can be the full range
+ ( UNDERFLOW,OVERFLOW ), provided that the machine arithmetic and the BLAS
+ & LAPACK routines called by ZGEJSV are implemented to work in that range.
+ If that is not the case, then the restriction for safe computation with
+ the singular values in the range of normalized IEEE numbers is that the
+ spectral condition number kappa(A)=sigma_max(A)/sigma_min(A) does not
+ overflow. This code (ZGEJSV) is best used in this restricted range,
+ meaning that singular values of magnitude below A_2 / DLAMCH('O') are
+ returned as zeros. See JOBR for details on this.
+ Further, this implementation is somewhat slower than the one described
+ in [1,2] due to replacement of some nonLAPACK components, and because
+ the choice of some tuning parameters in the iterative part (ZGESVJ) is
+ left to the implementer on a particular machine.
+ The rank revealing QR factorization (in this code: ZGEQP3) should be
+ implemented as in [3]. We have a new version of ZGEQP3 under development
+ that is more robust than the current one in LAPACK, with a cleaner cut in
+ rank defficient cases. It will be available in the SIGMA library [4].
+ If M is much larger than N, it is obvious that the inital QRF with
+ column pivoting can be preprocessed by the QRF without pivoting. That
+ well known trick is not used in ZGEJSV because in some cases heavy row
+ weighting can be treated with complete pivoting. The overhead in cases
+ M much larger than N is then only due to pivoting, but the benefits in
+ terms of accuracy have prevailed. The implementer/user can incorporate
+ this extra QRF step easily. The implementer can also improve data movement
+ (matrix transpose, matrix copy, matrix transposed copy)  this
+ implementation of ZGEJSV uses only the simplest, naive data movement.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{zgejsv.f}
+\index{zgejsv.f}
+\begin{chunk}{zgejsv.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK zgejsv}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{zgesdd}
+\label{zgesdd}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{zgesdd.input}
+)set break resume
+)sys rm f zgesdd.output
+)spool zgesdd.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{zgesdd.help}
+====================================================================
+zgesdd examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine zgesdd (JOBZ, M, N, A, LDA, S, U, LDU, VT, LDVT, WORK,
+ LWORK, RWORK, IWORK, INFO)
+ ZGESDD
+
+Function/Subroutine Documentation
+ subroutine zgesdd (character JOBZ, integer M, integer N, complex*16,
+ dimension( lda, * ) A, integer LDA, double precision, dimension( * ) S,
+ complex*16, dimension( ldu, * ) U, integer LDU, complex*16, dimension(
+ ldvt, * ) VT, integer LDVT, complex*16, dimension( * ) WORK, integer
+ LWORK, double precision, dimension( * ) RWORK, integer, dimension( * )
+ IWORK, integer INFO)
+ ZGESDD
+
+Purpose:
+ ZGESDD computes the singular value decomposition (SVD) of a complex
+ MbyN matrix A, optionally computing the left and/or right singular
+ vectors, by using divideandconquer method. The SVD is written
+
+ A = U * SIGMA * conjugatetranspose(V)
+
+ where SIGMA is an MbyN matrix which is zero except for its
+ min(m,n) diagonal elements, U is an MbyM unitary matrix, and
+ V is an NbyN unitary matrix. The diagonal elements of SIGMA
+ are the singular values of A; they are real and nonnegative, and
+ are returned in descending order. The first min(m,n) columns of
+ U and V are the left and right singular vectors of A.
+
+ Note that the routine returns VT = V**H, not V.
+
+ The divide and conquer algorithm makes very mild assumptions about
+ floating point arithmetic. It will work on machines with a guard
+ digit in add/subtract, or on those binary machines without guard
+ digits which subtract like the Cray XMP, Cray YMP, Cray C90, or
+ Cray2. It could conceivably fail on hexadecimal or decimal machines
+ without guard digits, but we know of none.
+
+Parameters:
+
+ JOBZ
+ JOBZ is CHARACTER*1
+ Specifies options for computing all or part of the matrix U:
+ = 'A': all M columns of U and all N rows of V**H are
+ returned in the arrays U and VT;
+ = 'S': the first min(M,N) columns of U and the first
+ min(M,N) rows of V**H are returned in the arrays U and VT;
+ = 'O': If M >= N, the first N columns of U are overwritten
+ in the array A and all rows of V**H are returned in the array VT;
+ otherwise, all columns of U are returned in the
+ array U and the first M rows of V**H are overwritten
+ in the array A;
+ = 'N': no columns of U or rows of V**H are computed.
+
+ M
+ M is INTEGER
+ The number of rows of the input matrix A. M >= 0.
+
+ N
+ N is INTEGER
+ The number of columns of the input matrix A. N >= 0.
+
+ A
+ A is COMPLEX*16 array, dimension (LDA,N)
+ On entry, the MbyN matrix A.
+ On exit,
+ if JOBZ = 'O', A is overwritten with the first N columns
+ of U (the left singular vectors, stored columnwise) if M >= N;
+ A is overwritten with the first M rows
+ of V**H (the right singular vectors, stored rowwise) otherwise.
+ if JOBZ .ne. 'O', the contents of A are destroyed.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+
+ S
+ S is DOUBLE PRECISION array, dimension (min(M,N))
+ The singular values of A, sorted so that S(i) >= S(i+1).
+
+ U
+ U is COMPLEX*16 array, dimension (LDU,UCOL)
+ UCOL = M if JOBZ = 'A' or JOBZ = 'O' and M < N;
+ UCOL = min(M,N) if JOBZ = 'S'.
+ If JOBZ = 'A' or JOBZ = 'O' and M < N, U contains the MbyM
+ unitary matrix U;
+ if JOBZ = 'S', U contains the first min(M,N) columns of U
+ (the left singular vectors, stored columnwise);
+ if JOBZ = 'O' and M >= N, or JOBZ = 'N', U is not referenced.
+
+ LDU
+ LDU is INTEGER
+ The leading dimension of the array U. LDU >= 1; if
+ JOBZ = 'S' or 'A' or JOBZ = 'O' and M < N, LDU >= M.
+
+ VT
+ VT is COMPLEX*16 array, dimension (LDVT,N)
+ If JOBZ = 'A' or JOBZ = 'O' and M >= N, VT contains the
+ NbyN unitary matrix V**H;
+ if JOBZ = 'S', VT contains the first min(M,N) rows of
+ V**H (the right singular vectors, stored rowwise);
+ if JOBZ = 'O' and M < N, or JOBZ = 'N', VT is not referenced.
+
+ LDVT
+ LDVT is INTEGER
+ The leading dimension of the array VT. LDVT >= 1; if
+ JOBZ = 'A' or JOBZ = 'O' and M >= N, LDVT >= N;
+ if JOBZ = 'S', LDVT >= min(M,N).
+
+ WORK
+ WORK is COMPLEX*16 array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK. LWORK >= 1.
+ if JOBZ = 'N', LWORK >= 2*min(M,N)+max(M,N).
+ if JOBZ = 'O',
+ LWORK >= 2*min(M,N)*min(M,N)+2*min(M,N)+max(M,N).
+ if JOBZ = 'S' or 'A',
+ LWORK >= min(M,N)*min(M,N)+2*min(M,N)+max(M,N).
+ For good performance, LWORK should generally be larger.
+
+ If LWORK = 1, a workspace query is assumed. The optimal
+ size for the WORK array is calculated and stored in WORK(1),
+ and no other work except argument checking is performed.
+
+ RWORK
+ RWORK is DOUBLE PRECISION array, dimension (MAX(1,LRWORK))
+ If JOBZ = 'N', LRWORK >= 7*min(M,N).
+ Otherwise,
+ LRWORK >= min(M,N)*max(5*min(M,N)+7,2*max(M,N)+2*min(M,N)+1)
+
+ IWORK
+ IWORK is INTEGER array, dimension (8*min(M,N))
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit.
+ < 0: if INFO = i, the ith argument had an illegal value.
+ > 0: The updating process of DBDSDC did not converge.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{zgesdd.f}
+\index{zgesdd.f}
+\begin{chunk}{zgesdd.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK zgesdd}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{zgesvd}
+\label{zgesvd}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{zgesvd.input}
+)set break resume
+)sys rm f zgesvd.output
+)spool zgesvd.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{zgesvd.help}
+====================================================================
+zgesvd examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine zgesvd (JOBU, JOBVT, M, N, A, LDA, S, U, LDU, VT, LDVT,
+ WORK, LWORK, RWORK, INFO)
+ ZGESVD computes the singular value decomposition (SVD) for GE
+ matrices
+
+Function/Subroutine Documentation
+ subroutine zgesvd (character JOBU, character JOBVT, integer M, integer N,
+ complex*16, dimension( lda, * ) A, integer LDA, double precision,
+ dimension( * ) S, complex*16, dimension( ldu, * ) U, integer LDU,
+ complex*16, dimension( ldvt, * ) VT, integer LDVT, complex*16,
+ dimension( * ) WORK, integer LWORK, double precision, dimension( * )
+ RWORK, integer INFO)
+ ZGESVD computes the singular value decomposition (SVD) for GE matrices
+
+Purpose:
+ ZGESVD computes the singular value decomposition (SVD) of a complex
+ MbyN matrix A, optionally computing the left and/or right singular
+ vectors. The SVD is written
+
+ A = U * SIGMA * conjugatetranspose(V)
+
+ where SIGMA is an MbyN matrix which is zero except for its
+ min(m,n) diagonal elements, U is an MbyM unitary matrix, and
+ V is an NbyN unitary matrix. The diagonal elements of SIGMA
+ are the singular values of A; they are real and nonnegative, and
+ are returned in descending order. The first min(m,n) columns of
+ U and V are the left and right singular vectors of A.
+
+ Note that the routine returns V**H, not V.
+
+Parameters:
+
+ JOBU
+ JOBU is CHARACTER*1
+ Specifies options for computing all or part of the matrix U:
+ = 'A': all M columns of U are returned in array U:
+ = 'S': the first min(m,n) columns of U (the left singular
+ vectors) are returned in the array U;
+ = 'O': the first min(m,n) columns of U (the left singular
+ vectors) are overwritten on the array A;
+ = 'N': no columns of U (no left singular vectors) are computed.
+
+ JOBVT
+ JOBVT is CHARACTER*1
+ Specifies options for computing all or part of the matrix V**H:
+ = 'A': all N rows of V**H are returned in the array VT;
+ = 'S': the first min(m,n) rows of V**H (the right singular
+ vectors) are returned in the array VT;
+ = 'O': the first min(m,n) rows of V**H (the right singular
+ vectors) are overwritten on the array A;
+ = 'N': no rows of V**H (no right singular vectors) are computed.
+
+ JOBVT and JOBU cannot both be 'O'.
+
+ M
+ M is INTEGER
+ The number of rows of the input matrix A. M >= 0.
+
+ N
+ N is INTEGER
+ The number of columns of the input matrix A. N >= 0.
+
+ A
+ A is COMPLEX*16 array, dimension (LDA,N)
+ On entry, the MbyN matrix A.
+ On exit,
+ if JOBU = 'O', A is overwritten with the first min(m,n)
+ columns of U (the left singular vectors, stored columnwise);
+ if JOBVT = 'O', A is overwritten with the first min(m,n)
+ rows of V**H (the right singular vectors, stored rowwise);
+ if JOBU .ne. 'O' and JOBVT .ne. 'O', the contents of A
+ are destroyed.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+
+ S
+ S is DOUBLE PRECISION array, dimension (min(M,N))
+ The singular values of A, sorted so that S(i) >= S(i+1).
+
+ U
+ U is COMPLEX*16 array, dimension (LDU,UCOL)
+ (LDU,M) if JOBU = 'A' or (LDU,min(M,N)) if JOBU = 'S'.
+ If JOBU = 'A', U contains the MbyM unitary matrix U;
+ if JOBU = 'S', U contains the first min(m,n) columns of U
+ (the left singular vectors, stored columnwise);
+ if JOBU = 'N' or 'O', U is not referenced.
+
+ LDU
+ LDU is INTEGER
+ The leading dimension of the array U. LDU >= 1; if
+ JOBU = 'S' or 'A', LDU >= M.
+
+ VT
+ VT is COMPLEX*16 array, dimension (LDVT,N)
+ If JOBVT = 'A', VT contains the NbyN unitary matrix V**H;
+ if JOBVT = 'S', VT contains the first min(m,n) rows of
+ V**H (the right singular vectors, stored rowwise);
+ if JOBVT = 'N' or 'O', VT is not referenced.
+
+ LDVT
+ LDVT is INTEGER
+ The leading dimension of the array VT. LDVT >= 1; if
+ JOBVT = 'A', LDVT >= N; if JOBVT = 'S', LDVT >= min(M,N).
+
+ WORK
+ WORK is COMPLEX*16 array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK.
+ LWORK >= MAX(1,2*MIN(M,N)+MAX(M,N)).
+ For good performance, LWORK should generally be larger.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ RWORK
+ RWORK is DOUBLE PRECISION array, dimension (5*min(M,N))
+ On exit, if INFO > 0, RWORK(1:MIN(M,N)1) contains the
+ unconverged superdiagonal elements of an upper bidiagonal
+ matrix B whose diagonal is in S (not necessarily sorted).
+ B satisfies A = U * B * VT, so it has the same singular
+ values as A, and singular vectors related by U and VT.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit.
+ < 0: if INFO = i, the ith argument had an illegal value.
+ > 0: if ZBDSQR did not converge, INFO specifies how many
+ superdiagonals of an intermediate bidiagonal form B
+ did not converge to zero. See the description of RWORK
+ above for details.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{zgesvd.f}
+\index{zgesvd.f}
+\begin{chunk}{zgesvd.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK zgesvd}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{zgesvdx}
+\label{zgesvdx}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{zgesvdx.input}
+)set break resume
+)sys rm f zgesvdx.output
+)spool zgesvdx.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{zgesvdx.help}
+====================================================================
+zgesvdx examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine zgesvdx (JOBU, JOBVT, RANGE, M, N, A, LDA, VL, VU, IL, IU,
+ NS, S, U, LDU, VT, LDVT, WORK, LWORK, RWORK, IWORK, INFO)
+ ZGESVDX computes the singular value decomposition (SVD) for GE
+ matrices
+
+Function/Subroutine Documentation
+ subroutine zgesvdx (character JOBU, character JOBVT, character RANGE,
+ integer M, integer N, complex*16, dimension( lda, * ) A, integer LDA,
+ double precision VL, double precision VU, integer IL, integer IU,
+ integer NS, double precision, dimension( * ) S, complex*16, dimension(
+ ldu, * ) U, integer LDU, complex*16, dimension( ldvt, * ) VT, integer
+ LDVT, complex*16, dimension( * ) WORK, integer LWORK, double precision,
+ dimension( * ) RWORK, integer, dimension( * ) IWORK, integer INFO)
+ ZGESVDX computes the singular value decomposition (SVD) for GE
+ matrices
+
+Parameters:
+
+ JOBU
+ JOBU is CHARACTER*1
+ Specifies options for computing all or part of the matrix U:
+ = 'V': the first min(m,n) columns of U (the left singular
+ vectors) or as specified by RANGE are returned in the array U;
+ = 'N': no columns of U (no left singular vectors) are computed.
+
+ JOBVT
+ JOBVT is CHARACTER*1
+ Specifies options for computing all or part of the matrix
+ V**T:
+ = 'V': the first min(m,n) rows of V**T (the right singular
+ vectors) or as specified by RANGE are returned in the array VT;
+ = 'N': no rows of V**T (no right singular vectors) are computed.
+
+ RANGE
+ RANGE is CHARACTER*1
+ = 'A': all singular values will be found.
+ = 'V': all singular values in the halfopen interval (VL,VU] will be found.
+ = 'I': the ILth through IUth singular values will be found.
+
+ M
+ M is INTEGER
+ The number of rows of the input matrix A. M >= 0.
+
+ N
+ N is INTEGER
+ The number of columns of the input matrix A. N >= 0.
+
+ A
+ A is COMPLEX array, dimension (LDA,N)
+ On entry, the MbyN matrix A.
+ On exit, the contents of A are destroyed.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+
+ VL
+ VL is DOUBLE PRECISION
+ VL >=0.
+
+ VU
+ VU is DOUBLE PRECISION
+ If RANGE='V', the lower and upper bounds of the interval to
+ be searched for singular values. VU > VL.
+ Not referenced if RANGE = 'A' or 'I'.
+
+ IL
+ IL is INTEGER
+
+ IU
+ IU is INTEGER
+ If RANGE='I', the indices (in ascending order) of the
+ smallest and largest singular values to be returned.
+ 1 <= IL <= IU <= min(M,N), if min(M,N) > 0.
+ Not referenced if RANGE = 'A' or 'V'.
+
+ NS
+ NS is INTEGER
+ The total number of singular values found,
+ 0 <= NS <= min(M,N).
+ If RANGE = 'A', NS = min(M,N); if RANGE = 'I', NS = IUIL+1.
+
+ S
+ S is DOUBLE PRECISION array, dimension (min(M,N))
+ The singular values of A, sorted so that S(i) >= S(i+1).
+
+ U
+ U is COMPLEX*16 array, dimension (LDU,UCOL)
+ If JOBU = 'V', U contains columns of U (the left singular
+ vectors, stored columnwise) as specified by RANGE; if
+ JOBU = 'N', U is not referenced.
+ Note: The user must ensure that UCOL >= NS; if RANGE = 'V',
+ the exact value of NS is not known ILQFin advance and an upper
+ bound must be used.
+
+ LDU
+ LDU is INTEGER
+ The leading dimension of the array U. LDU >= 1; if
+ JOBU = 'V', LDU >= M.
+
+ VT
+ VT is COMPLEX*16 array, dimension (LDVT,N)
+ If JOBVT = 'V', VT contains the rows of V**T (the right singular
+ vectors, stored rowwise) as specified by RANGE; if JOBVT = 'N',
+ VT is not referenced.
+ Note: The user must ensure that LDVT >= NS; if RANGE = 'V',
+ the exact value of NS is not known in advance and an upper
+ bound must be used.
+
+ LDVT
+ LDVT is INTEGER
+ The leading dimension of the array VT. LDVT >= 1; if
+ JOBVT = 'V', LDVT >= NS (see above).
+
+ WORK
+ WORK is COMPLEX*16 array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK;
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK.
+ LWORK >= MAX(1,MIN(M,N)*(MIN(M,N)+4)) for the paths (see
+ comments inside the code):
+  PATH 1 (M much larger than N)
+  PATH 1t (N much larger than M)
+ LWORK >= MAX(1,MIN(M,N)*2+MAX(M,N)) for the other paths.
+ For good performance, LWORK should generally be larger.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ RWORK
+ RWORK is DOUBLE PRECISION array, dimension (MAX(1,LRWORK))
+ LRWORK >= MIN(M,N)*(MIN(M,N)*2+15*MIN(M,N)).
+
+ IWORK
+ IWORK is INTEGER array, dimension (12*MIN(M,N))
+ If INFO = 0, the first NS elements of IWORK are zero. If INFO > 0,
+ then IWORK contains the indices of the eigenvectors that failed
+ to converge in DBDSVDX/DSTEVX.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value
+ > 0: if INFO = i, then i eigenvectors failed to converge
+ in DBDSVDX/DSTEVX.
+ if INFO = N*2 + 1, an internal error occurred in DBDSVDX
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{zgesvdx.f}
+\index{zgesvdx.f}
+\begin{chunk}{zgesvdx.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK zgesvdx}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\chapter{LAPACK  General Matrices, Comp. Routines, Double}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{dgebak}
+\label{dgebak}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{dgebak.input}
+)set break resume
+)sys rm f dgebak.output
+)spool dgebak.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{dgebak.help}
+====================================================================
+dgebak examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine dgebak (JOB, SIDE, N, ILO, IHI, SCALE, M, V, LDV, INFO)
+ DGEBAK
+
+Function/Subroutine Documentation
+ subroutine dgebak (character JOB, character SIDE, integer N, integer ILO,
+ integer IHI, double precision, dimension( * ) SCALE, integer M, double
+ precision, dimension( ldv, * ) V, integer LDV, integer INFO)
+ DGEBAK
+
+Purpose:
+ DGEBAK forms the right or left eigenvectors of a real general matrix
+ by backward transformation on the computed eigenvectors of the
+ balanced matrix output by DGEBAL.
+
+Parameters:
+
+ JOB
+ JOB is CHARACTER*1
+ Specifies the type of backward transformation required:
+ = 'N', do nothing, return immediately;
+ = 'P', do backward transformation for permutation only;
+ = 'S', do backward transformation for scaling only;
+ = 'B', do backward transformations for both permutation and scaling.
+ JOB must be the same as the argument JOB supplied to DGEBAL.
+
+ SIDE
+ SIDE is CHARACTER*1
+ = 'R': V contains right eigenvectors;
+ = 'L': V contains left eigenvectors.
+
+ N
+ N is INTEGER
+ The number of rows of the matrix V. N >= 0.
+
+ ILO
+ ILO is INTEGER
+
+ IHI
+ IHI is INTEGER
+ The integers ILO and IHI determined by DGEBAL.
+ 1 <= ILO <= IHI <= N, if N > 0; ILO=1 and IHI=0, if N=0.
+
+ SCALE
+ SCALE is DOUBLE PRECISION array, dimension (N)
+ Details of the permutation and scaling factors, as returned by DGEBAL.
+
+ M
+ M is INTEGER
+ The number of columns of the matrix V. M >= 0.
+
+ V
+ V is DOUBLE PRECISION array, dimension (LDV,M)
+ On entry, the matrix of right or left eigenvectors to be
+ transformed, as returned by DHSEIN or DTREVC.
+ On exit, V is overwritten by the transformed eigenvectors.
+
+ LDV
+ LDV is INTEGER
+ The leading dimension of the array V. LDV >= max(1,N).
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{dgebak.f}
+\index{dgebak.f}
+\begin{chunk}{dgebak.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK dgebak}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{dgebal}
+\label{dgebal}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{dgebal.input}
+)set break resume
+)sys rm f dgebal.output
+)spool dgebal.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{dgebal.help}
+====================================================================
+dgebal examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine dgebal (JOB, N, A, LDA, ILO, IHI, SCALE, INFO)
+ DGEBAL
+
+Function/Subroutine Documentation
+ subroutine dgebal (character JOB, integer N, double precision, dimension(
+ lda, * ) A, integer LDA, integer ILO, integer IHI, double precision,
+ dimension( * ) SCALE, integer INFO)
+ DGEBAL
+
+Purpose:
+ DGEBAL balances a general real matrix A. This involves, first,
+ permuting A by a similarity transformation to isolate eigenvalues
+ in the first 1 to ILO1 and last IHI+1 to N elements on the
+ diagonal; and second, applying a diagonal similarity transformation
+ to rows and columns ILO to IHI to make the rows and columns as
+ close in norm as possible. Both steps are optional.
+
+ Balancing may reduce the 1norm of the matrix, and improve the
+ accuracy of the computed eigenvalues and/or eigenvectors.
+
+Parameters:
+
+ JOB
+ JOB is CHARACTER*1
+ Specifies the operations to be performed on A:
+ = 'N': none: simply set ILO = 1, IHI = N, SCALE(I) = 1.0 for i = 1,...,N;
+ = 'P': permute only;
+ = 'S': scale only;
+ = 'B': both permute and scale.
+
+ N
+ N is INTEGER
+ The order of the matrix A. N >= 0.
+
+ A
+ A is DOUBLE array, dimension (LDA,N)
+ On entry, the input matrix A.
+ On exit, A is overwritten by the balanced matrix.
+ If JOB = 'N', A is not referenced.
+ See Further Details.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,N).
+
+ ILO
+ ILO is INTEGER
+
+ IHI
+ IHI is INTEGER
+ ILO and IHI are set to integers such that on exit
+ A(i,j) = 0 if i > j and j = 1,...,ILO1 or I = IHI+1,...,N.
+ If JOB = 'N' or 'S', ILO = 1 and IHI = N.
+
+ SCALE
+ SCALE is DOUBLE array, dimension (N)
+ Details of the permutations and scaling factors applied to
+ A. If P(j) is the index of the row and column interchanged
+ with row and column j and D(j) is the scaling factor
+ applied to row and column j, then
+ SCALE(j) = P(j) for j = 1,...,ILO1
+ = D(j) for j = ILO,...,IHI
+ = P(j) for j = IHI+1,...,N.
+ The order in which the interchanges are made is N to IHI+1,
+ then 1 to ILO1.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit.
+ < 0: if INFO = i, the ith argument had an illegal value.
+
+Further Details:
+ The permutations consist of row and column interchanges which put
+ the matrix in the form
+
+ ( T1 X Y )
+ P A P = ( 0 B Z )
+ ( 0 0 T2 )
+
+ where T1 and T2 are upper triangular matrices whose eigenvalues lie
+ along the diagonal. The column indices ILO and IHI mark the starting
+ and ending columns of the submatrix B. Balancing consists of applying
+ a diagonal similarity transformation inv(D) * B * D to make the
+ 1norms of each row of B and its corresponding column nearly equal.
+ The output matrix is
+
+ ( T1 X*D Y )
+ ( 0 inv(D)*B*D inv(D)*Z ).
+ ( 0 0 T2 )
+
+ Information about the permutations P and the diagonal matrix D is
+ returned in the vector SCALE.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{dgebal.f}
+\index{dgebal.f}
+\begin{chunk}{dgebal.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK dgebal}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{dgebd2}
+\label{dgebd2}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{dgebd2.input}
+)set break resume
+)sys rm f dgebd2.output
+)spool dgebd2.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{dgebd2.help}
+====================================================================
+dgebd2 examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine dgebd2 (M, N, A, LDA, D, E, TAUQ, TAUP, WORK, INFO)
+ DGEBD2 reduces a general matrix to bidiagonal form using an
+ unblocked algorithm.
+
+Function/Subroutine Documentation
+ subroutine dgebd2 (integer M, integer N, double precision, dimension( lda,
+ * ) A, integer LDA, double precision, dimension( * ) D, double
+ precision, dimension( * ) E, double precision, dimension( * ) TAUQ,
+ double precision, dimension( * ) TAUP, double precision, dimension( * )
+ WORK, integer INFO)
+ DGEBD2 reduces a general matrix to bidiagonal form using an unblocked
+ algorithm.
+
+Purpose:
+ DGEBD2 reduces a real general m by n matrix A to upper or lower
+ bidiagonal form B by an orthogonal transformation: Q**T * A * P = B.
+
+ If m >= n, B is upper bidiagonal; if m < n, B is lower bidiagonal.
+
+Parameters:
+
+ M
+ M is INTEGER
+ The number of rows in the matrix A. M >= 0.
+
+ N
+ N is INTEGER
+ The number of columns in the matrix A. N >= 0.
+
+ A
+ A is DOUBLE PRECISION array, dimension (LDA,N)
+ On entry, the m by n general matrix to be reduced.
+ On exit,
+ if m >= n, the diagonal and the first superdiagonal are
+ overwritten with the upper bidiagonal matrix B; the
+ elements below the diagonal, with the array TAUQ, represent
+ the orthogonal matrix Q as a product of elementary
+ reflectors, and the elements above the first superdiagonal,
+ with the array TAUP, represent the orthogonal matrix P as
+ a product of elementary reflectors;
+ if m < n, the diagonal and the first subdiagonal are
+ overwritten with the lower bidiagonal matrix B; the
+ elements below the first subdiagonal, with the array TAUQ,
+ represent the orthogonal matrix Q as a product of
+ elementary reflectors, and the elements above the diagonal,
+ with the array TAUP, represent the orthogonal matrix P as
+ a product of elementary reflectors.
+ See Further Details.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+
+ D
+ D is DOUBLE PRECISION array, dimension (min(M,N))
+ The diagonal elements of the bidiagonal matrix B: D(i) = A(i,i).
+
+ E
+ E is DOUBLE PRECISION array, dimension (min(M,N)1)
+ The offdiagonal elements of the bidiagonal matrix B:
+ if m >= n, E(i) = A(i,i+1) for i = 1,2,...,n1;
+ if m < n, E(i) = A(i+1,i) for i = 1,2,...,m1.
+
+ TAUQ
+ TAUQ is DOUBLE PRECISION array dimension (min(M,N))
+ The scalar factors of the elementary reflectors which
+ represent the orthogonal matrix Q. See Further Details.
+
+ TAUP
+ TAUP is DOUBLE PRECISION array, dimension (min(M,N))
+ The scalar factors of the elementary reflectors which
+ represent the orthogonal matrix P. See Further Details.
+
+ WORK
+ WORK is DOUBLE PRECISION array, dimension (max(M,N))
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit.
+ < 0: if INFO = i, the ith argument had an illegal value.
+
+Further Details:
+ The matrices Q and P are represented as products of elementary
+ reflectors:
+
+ If m >= n,
+
+ Q = H(1) H(2) . . . H(n) and P = G(1) G(2) . . . G(n1)
+
+ Each H(i) and G(i) has the form:
+
+ H(i) = I  tauq * v * v**T and G(i) = I  taup * u * u**T
+
+ where tauq and taup are real scalars, and v and u are real vectors;
+ v(1:i1) = 0, v(i) = 1, and v(i+1:m) is stored on exit in A(i+1:m,i);
+ u(1:i) = 0, u(i+1) = 1, and u(i+2:n) is stored on exit in A(i,i+2:n);
+ tauq is stored in TAUQ(i) and taup in TAUP(i).
+
+ If m < n,
+
+ Q = H(1) H(2) . . . H(m1) and P = G(1) G(2) . . . G(m)
+
+ Each H(i) and G(i) has the form:
+
+ H(i) = I  tauq * v * v**T and G(i) = I  taup * u * u**T
+
+ where tauq and taup are real scalars, and v and u are real vectors;
+ v(1:i) = 0, v(i+1) = 1, and v(i+2:m) is stored on exit in A(i+2:m,i);
+ u(1:i1) = 0, u(i) = 1, and u(i+1:n) is stored on exit in A(i,i+1:n);
+ tauq is stored in TAUQ(i) and taup in TAUP(i).
+
+ The contents of A on exit are illustrated by the following examples:
+
+ m = 6 and n = 5 (m > n): m = 5 and n = 6 (m < n):
+
+ ( d e u1 u1 u1 ) ( d u1 u1 u1 u1 u1 )
+ ( v1 d e u2 u2 ) ( e d u2 u2 u2 u2 )
+ ( v1 v2 d e u3 ) ( v1 e d u3 u3 u3 )
+ ( v1 v2 v3 d e ) ( v1 v2 e d u4 u4 )
+ ( v1 v2 v3 v4 d ) ( v1 v2 v3 e d u5 )
+ ( v1 v2 v3 v4 v5 )
+
+ where d and e denote diagonal and offdiagonal elements of B, vi
+ denotes an element of the vector defining H(i), and ui an element of
+ the vector defining G(i).
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{dgebd2.f}
+\index{dgebd2.f}
+\begin{chunk}{dgebd2.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK dgebd2}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{dgebrd}
+\label{dgebrd}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{dgebrd.input}
+)set break resume
+)sys rm f dgebrd.output
+)spool dgebrd.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{dgebrd.help}
+====================================================================
+dgebrd examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine dgebrd (M, N, A, LDA, D, E, TAUQ, TAUP, WORK, LWORK, INFO)
+ DGEBRD
+
+Function/Subroutine Documentation
+ subroutine dgebrd (integer M, integer N, double precision, dimension( lda,
+ * ) A, integer LDA, double precision, dimension( * ) D, double
+ precision, dimension( * ) E, double precision, dimension( * ) TAUQ,
+ double precision, dimension( * ) TAUP, double precision, dimension( * )
+ WORK, integer LWORK, integer INFO)
+ DGEBRD
+
+Purpose:
+ DGEBRD reduces a general real MbyN matrix A to upper or lower
+ bidiagonal form B by an orthogonal transformation: Q**T * A * P = B.
+
+ If m >= n, B is upper bidiagonal; if m < n, B is lower bidiagonal.
+
+Parameters:
+
+ M
+ M is INTEGER
+ The number of rows in the matrix A. M >= 0.
+
+ N
+ N is INTEGER
+ The number of columns in the matrix A. N >= 0.
+
+ A
+ A is DOUBLE PRECISION array, dimension (LDA,N)
+ On entry, the MbyN general matrix to be reduced.
+ On exit,
+ if m >= n, the diagonal and the first superdiagonal are
+ overwritten with the upper bidiagonal matrix B; the
+ elements below the diagonal, with the array TAUQ, represent
+ the orthogonal matrix Q as a product of elementary
+ reflectors, and the elements above the first superdiagonal,
+ with the array TAUP, represent the orthogonal matrix P as
+ a product of elementary reflectors;
+ if m < n, the diagonal and the first subdiagonal are
+ overwritten with the lower bidiagonal matrix B; the
+ elements below the first subdiagonal, with the array TAUQ,
+ represent the orthogonal matrix Q as a product of
+ elementary reflectors, and the elements above the diagonal,
+ with the array TAUP, represent the orthogonal matrix P as
+ a product of elementary reflectors.
+ See Further Details.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+
+ D
+ D is DOUBLE PRECISION array, dimension (min(M,N))
+ The diagonal elements of the bidiagonal matrix B: D(i) = A(i,i).
+
+ E
+ E is DOUBLE PRECISION array, dimension (min(M,N)1)
+ The offdiagonal elements of the bidiagonal matrix B:
+ if m >= n, E(i) = A(i,i+1) for i = 1,2,...,n1;
+ if m < n, E(i) = A(i+1,i) for i = 1,2,...,m1.
+
+ TAUQ
+ TAUQ is DOUBLE PRECISION array dimension (min(M,N))
+ The scalar factors of the elementary reflectors which
+ represent the orthogonal matrix Q. See Further Details.
+
+ TAUP
+ TAUP is DOUBLE PRECISION array, dimension (min(M,N))
+ The scalar factors of the elementary reflectors which
+ represent the orthogonal matrix P. See Further Details.
+
+ WORK
+ WORK is DOUBLE PRECISION array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The length of the array WORK. LWORK >= max(1,M,N).
+ For optimum performance LWORK >= (M+N)*NB, where NB
+ is the optimal blocksize.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value.
+
+Further Details:
+ The matrices Q and P are represented as products of elementary
+ reflectors:
+
+ If m >= n,
+
+ Q = H(1) H(2) . . . H(n) and P = G(1) G(2) . . . G(n1)
+
+ Each H(i) and G(i) has the form:
+
+ H(i) = I  tauq * v * v**T and G(i) = I  taup * u * u**T
+
+ where tauq and taup are real scalars, and v and u are real vectors;
+ v(1:i1) = 0, v(i) = 1, and v(i+1:m) is stored on exit in A(i+1:m,i);
+ u(1:i) = 0, u(i+1) = 1, and u(i+2:n) is stored on exit in A(i,i+2:n);
+ tauq is stored in TAUQ(i) and taup in TAUP(i).
+
+ If m < n,
+
+ Q = H(1) H(2) . . . H(m1) and P = G(1) G(2) . . . G(m)
+
+ Each H(i) and G(i) has the form:
+
+ H(i) = I  tauq * v * v**T and G(i) = I  taup * u * u**T
+
+ where tauq and taup are real scalars, and v and u are real vectors;
+ v(1:i) = 0, v(i+1) = 1, and v(i+2:m) is stored on exit in A(i+2:m,i);
+ u(1:i1) = 0, u(i) = 1, and u(i+1:n) is stored on exit in A(i,i+1:n);
+ tauq is stored in TAUQ(i) and taup in TAUP(i).
+
+ The contents of A on exit are illustrated by the following examples:
+
+ m = 6 and n = 5 (m > n): m = 5 and n = 6 (m < n):
+
+ ( d e u1 u1 u1 ) ( d u1 u1 u1 u1 u1 )
+ ( v1 d e u2 u2 ) ( e d u2 u2 u2 u2 )
+ ( v1 v2 d e u3 ) ( v1 e d u3 u3 u3 )
+ ( v1 v2 v3 d e ) ( v1 v2 e d u4 u4 )
+ ( v1 v2 v3 v4 d ) ( v1 v2 v3 e d u5 )
+ ( v1 v2 v3 v4 v5 )
+
+ where d and e denote diagonal and offdiagonal elements of B, vi
+ denotes an element of the vector defining H(i), and ui an element of
+ the vector defining G(i).
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{dgebrd.f}
+\index{dgebrd.f}
+\begin{chunk}{dgebrd.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK dgebrd}
+
+\end{chunk}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{dgecon}
+\label{dgecon}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{dgecon.input}
+)set break resume
+)sys rm f dgecon.output
+)spool dgecon.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{dgecon.help}
+====================================================================
+dgecon examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine dgecon (NORM, N, A, LDA, ANORM, RCOND, WORK, IWORK, INFO)
+ DGECON
+
+Function/Subroutine Documentation
+ subroutine dgecon (character NORM, integer N, double precision, dimension(
+ lda, * ) A, integer LDA, double precision ANORM, double precision
+ RCOND, double precision, dimension( * ) WORK, integer, dimension( * )
+ IWORK, integer INFO)
+ DGECON
+
+Purpose:
+ DGECON estimates the reciprocal of the condition number of a general
+ real matrix A, in either the 1norm or the infinitynorm, using
+ the LU factorization computed by DGETRF.
+
+ An estimate is obtained for norm(inv(A)), and the reciprocal of the
+ condition number is computed as
+ RCOND = 1 / ( norm(A) * norm(inv(A)) ).
+
+Parameters:
+
+ NORM
+ NORM is CHARACTER*1
+ Specifies whether the 1norm condition number or the
+ infinitynorm condition number is required:
+ = '1' or 'O': 1norm;
+ = 'I': Infinitynorm.
+
+ N
+ N is INTEGER
+ The order of the matrix A. N >= 0.
+
+ A
+ A is DOUBLE PRECISION array, dimension (LDA,N)
+ The factors L and U from the factorization A = P*L*U
+ as computed by DGETRF.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,N).
+
+ ANORM
+ ANORM is DOUBLE PRECISION
+ If NORM = '1' or 'O', the 1norm of the original matrix A.
+ If NORM = 'I', the infinitynorm of the original matrix A.
+
+ RCOND
+ RCOND is DOUBLE PRECISION
+ The reciprocal of the condition number of the matrix A,
+ computed as RCOND = 1/(norm(A) * norm(inv(A))).
+
+ WORK
+ WORK is DOUBLE PRECISION array, dimension (4*N)
+
+ IWORK
+ IWORK is INTEGER array, dimension (N)
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{dgecon.f}
+\index{dgecon.f}
+\begin{chunk}{dgecon.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK dgecon}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{dgeequ}
+\label{dgeequ}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{dgeequ.input}
+)set break resume
+)sys rm f dgeequ.output
+)spool dgeequ.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{dgeequ.help}
+====================================================================
+dgeequ examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine dgeequ (M, N, A, LDA, R, C, ROWCND, COLCND, AMAX, INFO)
+ DGEEQU
+
+Function/Subroutine Documentation
+ subroutine dgeequ (integer M, integer N, double precision, dimension( lda,
+ * ) A, integer LDA, double precision, dimension( * ) R, double
+ precision, dimension( * ) C, double precision ROWCND, double precision
+ COLCND, double precision AMAX, integer INFO)
+ DGEEQU
+
+Purpose:
+ DGEEQU computes row and column scalings intended to equilibrate an
+ MbyN matrix A and reduce its condition number. R returns the row
+ scale factors and C the column scale factors, chosen to try to make
+ the largest element in each row and column of the matrix B with
+ elements B(i,j)=R(i)*A(i,j)*C(j) have absolute value 1.
+
+ R(i) and C(j) are restricted to be between SMLNUM = smallest safe
+ number and BIGNUM = largest safe number. Use of these scaling
+ factors is not guaranteed to reduce the condition number of A but
+ works well in practice.
+
+Parameters:
+
+ M
+ M is INTEGER
+ The number of rows of the matrix A. M >= 0.
+
+ N
+ N is INTEGER
+ The number of columns of the matrix A. N >= 0.
+
+ A
+ A is DOUBLE PRECISION array, dimension (LDA,N)
+ The MbyN matrix whose equilibration factors are to be computed.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+
+ R
+ R is DOUBLE PRECISION array, dimension (M)
+ If INFO = 0 or INFO > M, R contains the row scale factors for A.
+
+ C
+ C is DOUBLE PRECISION array, dimension (N)
+ If INFO = 0, C contains the column scale factors for A.
+
+ ROWCND
+ ROWCND is DOUBLE PRECISION
+ If INFO = 0 or INFO > M, ROWCND contains the ratio of the
+ smallest R(i) to the largest R(i). If ROWCND >= 0.1 and
+ AMAX is neither too large nor too small, it is not worth scaling by R.
+
+ COLCND
+ COLCND is DOUBLE PRECISION
+ If INFO = 0, COLCND contains the ratio of the smallest
+ C(i) to the largest C(i). If COLCND >= 0.1, it is not
+ worth scaling by C.
+
+ AMAX
+ AMAX is DOUBLE PRECISION
+ Absolute value of largest matrix element. If AMAX is very
+ close to overflow or very close to underflow, the matrix should be scaled.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value
+ > 0: if INFO = i, and i is
+ <= M: the ith row of A is exactly zero
+ > M: the (iM)th column of A is exactly zero
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{dgeequ.f}
+\index{dgeequ.f}
+\begin{chunk}{dgeequ.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK dgeequ}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{dgeequb}
+\label{dgeequb}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{dgeequb.input}
+)set break resume
+)sys rm f dgeequb.output
+)spool dgeequb.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{dgeequb.help}
+====================================================================
+dgeequb examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine dgeequb (M, N, A, LDA, R, C, ROWCND, COLCND, AMAX, INFO)
+ DGEEQUB
+
+Function/Subroutine Documentation
+ subroutine dgeequb (integer M, integer N, double precision, dimension( lda,
+ * ) A, integer LDA, double precision, dimension( * ) R, double
+ precision, dimension( * ) C, double precision ROWCND, double precision
+ COLCND, double precision AMAX, integer INFO)
+ DGEEQUB
+
+Purpose:
+ DGEEQUB computes row and column scalings intended to equilibrate an
+ MbyN matrix A and reduce its condition number. R returns the row
+ scale factors and C the column scale factors, chosen to try to make
+ the largest element in each row and column of the matrix B with
+ elements B(i,j)=R(i)*A(i,j)*C(j) have an absolute value of at most
+ the radix.
+
+ R(i) and C(j) are restricted to be a power of the radix between
+ SMLNUM = smallest safe number and BIGNUM = largest safe number. Use
+ of these scaling factors is not guaranteed to reduce the condition
+ number of A but works well in practice.
+
+ This routine differs from DGEEQU by restricting the scaling factors
+ to a power of the radix. Baring over and underflow, scaling by
+ these factors introduces no additional rounding errors. However, the
+ scaled entries' magnitured are no longer approximately 1 but lie
+ between sqrt(radix) and 1/sqrt(radix).
+
+Parameters:
+
+ M
+ M is INTEGER
+ The number of rows of the matrix A. M >= 0.
+
+ N
+ N is INTEGER
+ The number of columns of the matrix A. N >= 0.
+
+ A
+ A is DOUBLE PRECISION array, dimension (LDA,N)
+ The MbyN matrix whose equilibration factors are to be computed.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+
+ R
+ R is DOUBLE PRECISION array, dimension (M)
+ If INFO = 0 or INFO > M, R contains the row scale factors for A.
+
+ C
+ C is DOUBLE PRECISION array, dimension (N)
+ If INFO = 0, C contains the column scale factors for A.
+
+ ROWCND
+ ROWCND is DOUBLE PRECISION
+ If INFO = 0 or INFO > M, ROWCND contains the ratio of the
+ smallest R(i) to the largest R(i). If ROWCND >= 0.1 and
+ AMAX is neither too large nor too small, it is not worth scaling by R.
+
+ COLCND
+ COLCND is DOUBLE PRECISION
+ If INFO = 0, COLCND contains the ratio of the smallest
+ C(i) to the largest C(i). If COLCND >= 0.1, it is not worth scaling by C.
+
+ AMAX
+ AMAX is DOUBLE PRECISION
+ Absolute value of largest matrix element. If AMAX is very
+ close to overflow or very close to underflow, the matrix should be scaled.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value
+ > 0: if INFO = i, and i is
+ <= M: the ith row of A is exactly zero
+ > M: the (iM)th column of A is exactly zero
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{dgeequb.f}
+\index{dgeequb.f}
+\begin{chunk}{dgeequb.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK dgeequb}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{dgehd2}
+\label{dgehd2}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{dgehd2.input}
+)set break resume
+)sys rm f dgehd2.output
+)spool dgehd2.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{dgehd2.help}
+====================================================================
+dgehd2 examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine dgehd2 (N, ILO, IHI, A, LDA, TAU, WORK, INFO)
+ DGEHD2 reduces a general square matrix to upper Hessenberg form
+ using an unblocked algorithm.
+
+Function/Subroutine Documentation
+ subroutine dgehd2 (integer N, integer ILO, integer IHI, double precision,
+ dimension( lda, * ) A, integer LDA, double precision, dimension( * )
+ TAU, double precision, dimension( * ) WORK, integer INFO)
+ DGEHD2 reduces a general square matrix to upper Hessenberg form using
+ an unblocked algorithm.
+
+Purpose:
+ DGEHD2 reduces a real general matrix A to upper Hessenberg form H by
+ an orthogonal similarity transformation: Q**T * A * Q = H .
+
+ Parameters:
+
+ N
+ N is INTEGER
+ The order of the matrix A. N >= 0.
+
+ ILO
+ ILO is INTEGER
+
+ IHI
+ IHI is INTEGER
+
+ It is assumed that A is already upper triangular in rows
+ and columns 1:ILO1 and IHI+1:N. ILO and IHI are normally
+ set by a previous call to DGEBAL; otherwise they should be
+ set to 1 and N respectively. See Further Details.
+ 1 <= ILO <= IHI <= max(1,N).
+
+ A
+ A is DOUBLE PRECISION array, dimension (LDA,N)
+ On entry, the n by n general matrix to be reduced.
+ On exit, the upper triangle and the first subdiagonal of A
+ are overwritten with the upper Hessenberg matrix H, and the
+ elements below the first subdiagonal, with the array TAU,
+ represent the orthogonal matrix Q as a product of elementary
+ reflectors. See Further Details.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,N).
+
+ TAU
+ TAU is DOUBLE PRECISION array, dimension (N1)
+ The scalar factors of the elementary reflectors (see Further Details).
+
+ WORK
+ WORK is DOUBLE PRECISION array, dimension (N)
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit.
+ < 0: if INFO = i, the ith argument had an illegal value.
+
+Further Details:
+ The matrix Q is represented as a product of (ihiilo) elementary
+ reflectors
+
+ Q = H(ilo) H(ilo+1) . . . H(ihi1).
+
+ Each H(i) has the form
+
+ H(i) = I  tau * v * v**T
+
+ where tau is a real scalar, and v is a real vector with
+ v(1:i) = 0, v(i+1) = 1 and v(ihi+1:n) = 0; v(i+2:ihi) is stored on
+ exit in A(i+2:ihi,i), and tau in TAU(i).
+
+ The contents of A are illustrated by the following example, with
+ n = 7, ilo = 2 and ihi = 6:
+
+ on entry, on exit,
+
+ ( a a a a a a a ) ( a a h h h h a )
+ ( a a a a a a ) ( a h h h h a )
+ ( a a a a a a ) ( h h h h h h )
+ ( a a a a a a ) ( v2 h h h h h )
+ ( a a a a a a ) ( v2 v3 h h h h )
+ ( a a a a a a ) ( v2 v3 v4 h h h )
+ ( a ) ( a )
+
+ where a denotes an element of the original matrix A, h denotes a
+ modified element of the upper Hessenberg matrix H, and vi denotes an
+ element of the vector defining H(i).
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{dgehd2.f}
+\index{dgehd2.f}
+\begin{chunk}{dgehd2.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK dgehd2}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{dgehrd}
+\label{dgehrd}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{dgehrd.input}
+)set break resume
+)sys rm f dgehrd.output
+)spool dgehrd.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{dgehrd.help}
+====================================================================
+dgehrd examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine dgehrd (N, ILO, IHI, A, LDA, TAU, WORK, LWORK, INFO)
+ DGEHRD
+
+Function/Subroutine Documentation
+ subroutine dgehrd (integer N, integer ILO, integer IHI, double precision,
+ dimension( lda, * ) A, integer LDA, double precision, dimension( * )
+ TAU, double precision, dimension( * ) WORK, integer LWORK, integer
+ INFO)
+ DGEHRD
+
+Purpose:
+ DGEHRD reduces a real general matrix A to upper Hessenberg form H by
+ an orthogonal similarity transformation: Q**T * A * Q = H .
+
+Parameters:
+
+ N
+ N is INTEGER
+ The order of the matrix A. N >= 0.
+
+ ILO
+ ILO is INTEGER
+
+ IHI
+ IHI is INTEGER
+
+ It is assumed that A is already upper triangular in rows
+ and columns 1:ILO1 and IHI+1:N. ILO and IHI are normally
+ set by a previous call to DGEBAL; otherwise they should be
+ set to 1 and N respectively. See Further Details.
+ 1 <= ILO <= IHI <= N, if N > 0; ILO=1 and IHI=0, if N=0.
+
+ A
+ A is DOUBLE PRECISION array, dimension (LDA,N)
+ On entry, the NbyN general matrix to be reduced.
+ On exit, the upper triangle and the first subdiagonal of A
+ are overwritten with the upper Hessenberg matrix H, and the
+ elements below the first subdiagonal, with the array TAU,
+ represent the orthogonal matrix Q as a product of elementary
+ reflectors. See Further Details.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,N).
+
+ TAU
+ TAU is DOUBLE PRECISION array, dimension (N1)
+ The scalar factors of the elementary reflectors (see Further
+ Details). Elements 1:ILO1 and IHI:N1 of TAU are set to zero.
+
+ WORK
+ WORK is DOUBLE PRECISION array, dimension (LWORK)
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The length of the array WORK. LWORK >= max(1,N).
+ For good performance, LWORK should generally be larger.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value.
+
+Further Details:
+ The matrix Q is represented as a product of (ihiilo) elementary
+ reflectors
+
+ Q = H(ilo) H(ilo+1) . . . H(ihi1).
+
+ Each H(i) has the form
+
+ H(i) = I  tau * v * v**T
+
+ where tau is a real scalar, and v is a real vector with
+ v(1:i) = 0, v(i+1) = 1 and v(ihi+1:n) = 0; v(i+2:ihi) is stored on
+ exit in A(i+2:ihi,i), and tau in TAU(i).
+
+ The contents of A are illustrated by the following example, with
+ n = 7, ilo = 2 and ihi = 6:
+
+ on entry, on exit,
+
+ ( a a a a a a a ) ( a a h h h h a )
+ ( a a a a a a ) ( a h h h h a )
+ ( a a a a a a ) ( h h h h h h )
+ ( a a a a a a ) ( v2 h h h h h )
+ ( a a a a a a ) ( v2 v3 h h h h )
+ ( a a a a a a ) ( v2 v3 v4 h h h )
+ ( a ) ( a )
+
+ where a denotes an element of the original matrix A, h denotes a
+ modified element of the upper Hessenberg matrix H, and vi denotes an
+ element of the vector defining H(i).
+
+ This file is a slight modification of LAPACK3.0's DGEHRD
+ subroutine incorporating improvements proposed by QuintanaOrti and
+ Van de Geijn (2006). (See DLAHR2.)
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{dgehrd.f}
+\index{dgehrd.f}
+\begin{chunk}{dgehrd.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK dgehrd}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{dgelq2}
+\label{dgelq2}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{dgelq2.input}
+)set break resume
+)sys rm f dgelq2.output
+)spool dgelq2.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{dgelq2.help}
+====================================================================
+dgelq2 examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine dgelq2 (M, N, A, LDA, TAU, WORK, INFO)
+ DGELQ2 computes the LQ factorization of a general rectangular
+ matrix using an unblocked algorithm.
+
+Function/Subroutine Documentation
+ subroutine dgelq2 (integer M, integer N, double precision, dimension( lda,
+ * ) A, integer LDA, double precision, dimension( * ) TAU, double
+ precision, dimension( * ) WORK, integer INFO)
+ DGELQ2 computes the LQ factorization of a general rectangular matrix
+ using an unblocked algorithm.
+
+Purpose:
+ DGELQ2 computes an LQ factorization of a real m by n matrix A:
+ A = L * Q.
+
+Parameters:
+
+ M
+ M is INTEGER
+ The number of rows of the matrix A. M >= 0.
+
+ N
+ N is INTEGER
+ The number of columns of the matrix A. N >= 0.
+
+ A
+ A is DOUBLE PRECISION array, dimension (LDA,N)
+ On entry, the m by n matrix A.
+ On exit, the elements on and below the diagonal of the array
+ contain the m by min(m,n) lower trapezoidal matrix L (L is
+ lower triangular if m <= n); the elements above the diagonal,
+ with the array TAU, represent the orthogonal matrix Q as a
+ product of elementary reflectors (see Further Details).
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+
+ TAU
+ TAU is DOUBLE PRECISION array, dimension (min(M,N))
+ The scalar factors of the elementary reflectors (see Further Details).
+
+ WORK
+ WORK is DOUBLE PRECISION array, dimension (M)
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value
+
+Further Details:
+ The matrix Q is represented as a product of elementary reflectors
+
+ Q = H(k) . . . H(2) H(1), where k = min(m,n).
+
+ Each H(i) has the form
+
+ H(i) = I  tau * v * v**T
+
+ where tau is a real scalar, and v is a real vector with
+ v(1:i1) = 0 and v(i) = 1; v(i+1:n) is stored on exit in A(i,i+1:n),
+ and tau in TAU(i).
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{dgelq2.f}
+\index{dgelq2.f}
+\begin{chunk}{dgelq2.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK dgelq2}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{dgelqf}
+\label{dgelqf}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{dgelqf.input}
+)set break resume
+)sys rm f dgelqf.output
+)spool dgelqf.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{dgelqf.help}
+====================================================================
+dgelqf examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine dgelqf (M, N, A, LDA, TAU, WORK, LWORK, INFO)
+ DGELQF
+
+Function/Subroutine Documentation
+ subroutine dgelqf (integer M, integer N, double precision, dimension( lda,
+ * ) A, integer LDA, double precision, dimension( * ) TAU, double
+ precision, dimension( * ) WORK, integer LWORK, integer INFO)
+ DGELQF
+
+Purpose:
+ DGELQF computes an LQ factorization of a real MbyN matrix A: A = L * Q.
+
+Parameters:
+
+ M
+ M is INTEGER
+ The number of rows of the matrix A. M >= 0.
+
+ N
+ N is INTEGER
+ The number of columns of the matrix A. N >= 0.
+
+ A
+ A is DOUBLE PRECISION array, dimension (LDA,N)
+ On entry, the MbyN matrix A.
+ On exit, the elements on and below the diagonal of the array
+ contain the mbymin(m,n) lower trapezoidal matrix L (L is
+ lower triangular if m <= n); the elements above the diagonal,
+ with the array TAU, represent the orthogonal matrix Q as a
+ product of elementary reflectors (see Further Details).
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+
+ TAU
+ TAU is DOUBLE PRECISION array, dimension (min(M,N))
+ The scalar factors of the elementary reflectors (see Further Details).
+
+ WORK
+ WORK is DOUBLE PRECISION array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK. LWORK >= max(1,M).
+ For optimum performance LWORK >= M*NB, where NB is the
+ optimal blocksize.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value
+
+Further Details:
+ The matrix Q is represented as a product of elementary reflectors
+
+ Q = H(k) . . . H(2) H(1), where k = min(m,n).
+
+ Each H(i) has the form
+
+ H(i) = I  tau * v * v**T
+
+ where tau is a real scalar, and v is a real vector with
+ v(1:i1) = 0 and v(i) = 1; v(i+1:n) is stored on exit in A(i,i+1:n),
+ and tau in TAU(i).
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{dgelqf.f}
+\index{dgelqf.f}
+\begin{chunk}{dgelqf.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK dgelqf}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{dgemqrt}
+\label{dgemqrt}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{dgemqrt.input}
+)set break resume
+)sys rm f dgemqrt.output
+)spool dgemqrt.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{dgemqrt.help}
+====================================================================
+dgemqrt examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine dgemqrt (SIDE, TRANS, M, N, K, NB, V, LDV, T, LDT, C, LDC,
+ WORK, INFO)
+ DGEMQRT
+
+Function/Subroutine Documentation
+ subroutine dgemqrt (character SIDE, character TRANS, integer M, integer N,
+ integer K, integer NB, double precision, dimension( ldv, * ) V, integer
+ LDV, double precision, dimension( ldt, * ) T, integer LDT, double
+ precision, dimension( ldc, * ) C, integer LDC, double precision,
+ dimension( * ) WORK, integer INFO)
+ DGEMQRT
+
+Purpose:
+ DGEMQRT overwrites the general real MbyN matrix C with
+
+ SIDE = 'L' SIDE = 'R'
+ TRANS = 'N': Q C C Q
+ TRANS = 'T': Q**T C C Q**T
+
+ where Q is a real orthogonal matrix defined as the product of K
+ elementary reflectors:
+
+ Q = H(1) H(2) . . . H(K) = I  V T V**T
+
+ generated using the compact WY representation as returned by DGEQRT.
+
+ Q is of order M if SIDE = 'L' and of order N if SIDE = 'R'.
+
+Parameters:
+
+ SIDE
+ SIDE is CHARACTER*1
+ = 'L': apply Q or Q**T from the Left;
+ = 'R': apply Q or Q**T from the Right.
+
+ TRANS
+ TRANS is CHARACTER*1
+ = 'N': No transpose, apply Q;
+ = 'C': Transpose, apply Q**T.
+
+ M
+ M is INTEGER
+ The number of rows of the matrix C. M >= 0.
+
+ N
+ N is INTEGER
+ The number of columns of the matrix C. N >= 0.
+
+ K
+ K is INTEGER
+ The number of elementary reflectors whose product defines the matrix Q.
+ If SIDE = 'L', M >= K >= 0;
+ if SIDE = 'R', N >= K >= 0.
+
+ NB
+ NB is INTEGER
+ The block size used for the storage of T. K >= NB >= 1.
+ This must be the same value of NB used to generate T in CGEQRT.
+
+ V
+ V is DOUBLE PRECISION array, dimension (LDV,K)
+ The ith column must contain the vector which defines the
+ elementary reflector H(i), for i = 1,2,...,k, as returned by
+ CGEQRT in the first K columns of its array argument A.
+
+ LDV
+ LDV is INTEGER
+ The leading dimension of the array V.
+ If SIDE = 'L', LDA >= max(1,M);
+ if SIDE = 'R', LDA >= max(1,N).
+
+ T
+ T is DOUBLE PRECISION array, dimension (LDT,K)
+ The upper triangular factors of the block reflectors
+ as returned by CGEQRT, stored as a NBbyN matrix.
+
+ LDT
+ LDT is INTEGER
+ The leading dimension of the array T. LDT >= NB.
+
+ C
+ C is DOUBLE PRECISION array, dimension (LDC,N)
+ On entry, the MbyN matrix C.
+ On exit, C is overwritten by Q C, Q**T C, C Q**T or C Q.
+
+ LDC
+ LDC is INTEGER
+ The leading dimension of the array C. LDC >= max(1,M).
+
+ WORK
+ WORK is DOUBLE PRECISION array. The dimension of
+ WORK is N*NB if SIDE = 'L', or M*NB if SIDE = 'R'.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{dgemqrt.f}
+\index{dgemqrt.f}
+\begin{chunk}{dgemqrt.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK dgemqrt}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{dgeql2}
+\label{dgeql2}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{dgeql2.input}
+)set break resume
+)sys rm f dgeql2.output
+)spool dgeql2.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{dgeql2.help}
+====================================================================
+dgeql2 examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine dgeql2 (M, N, A, LDA, TAU, WORK, INFO)
+ DGEQL2 computes the QL factorization of a general rectangular
+ matrix using an unblocked algorithm.
+
+Function/Subroutine Documentation
+ subroutine dgeql2 (integer M, integer N, double precision, dimension( lda,
+ * ) A, integer LDA, double precision, dimension( * ) TAU, double
+ precision, dimension( * ) WORK, integer INFO)
+ DGEQL2 computes the QL factorization of a general rectangular matrix
+ using an unblocked algorithm.
+
+Purpose:
+ DGEQL2 computes a QL factorization of a real m by n matrix A: A = Q * L.
+
+Parameters:
+
+ M
+ M is INTEGER
+ The number of rows of the matrix A. M >= 0.
+
+ N
+ N is INTEGER
+ The number of columns of the matrix A. N >= 0.
+
+ A
+ A is DOUBLE PRECISION array, dimension (LDA,N)
+ On entry, the m by n matrix A.
+ On exit, if m >= n, the lower triangle of the subarray
+ A(mn+1:m,1:n) contains the n by n lower triangular matrix L;
+ if m <= n, the elements on and below the (nm)th
+ superdiagonal contain the m by n lower trapezoidal matrix L;
+ the remaining elements, with the array TAU, represent the
+ orthogonal matrix Q as a product of elementary reflectors
+ (see Further Details).
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+
+ TAU
+ TAU is DOUBLE PRECISION array, dimension (min(M,N))
+ The scalar factors of the elementary reflectors (see Further Details).
+
+ WORK
+ WORK is DOUBLE PRECISION array, dimension (N)
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value
+
+Further Details:
+ The matrix Q is represented as a product of elementary reflectors
+
+ Q = H(k) . . . H(2) H(1), where k = min(m,n).
+
+ Each H(i) has the form
+
+ H(i) = I  tau * v * v**T
+
+ where tau is a real scalar, and v is a real vector with
+ v(mk+i+1:m) = 0 and v(mk+i) = 1; v(1:mk+i1) is stored on exit in
+ A(1:mk+i1,nk+i), and tau in TAU(i).
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{dgeql2.f}
+\index{dgeql2.f}
+\begin{chunk}{dgeql2.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK dgeql2}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{dgeqlf}
+\label{dgeqlf}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{dgeqlf.input}
+)set break resume
+)sys rm f dgeqlf.output
+)spool dgeqlf.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{dgeqlf.help}
+====================================================================
+dgeqlf examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine dgeqlf (M, N, A, LDA, TAU, WORK, LWORK, INFO)
+ DGEQLF
+
+Function/Subroutine Documentation
+ subroutine dgeqlf (integer M, integer N, double precision, dimension( lda,
+ * ) A, integer LDA, double precision, dimension( * ) TAU, double
+ precision, dimension( * ) WORK, integer LWORK, integer INFO)
+ DGEQLF
+
+Purpose:
+ DGEQLF computes a QL factorization of a real MbyN matrix A: A = Q * L.
+
+Parameters:
+
+ M
+ M is INTEGER
+ The number of rows of the matrix A. M >= 0.
+
+ N
+ N is INTEGER
+ The number of columns of the matrix A. N >= 0.
+
+ A
+ A is DOUBLE PRECISION array, dimension (LDA,N)
+ On entry, the MbyN matrix A.
+ On exit,
+ if m >= n, the lower triangle of the subarray
+ A(mn+1:m,1:n) contains the NbyN lower triangular matrix L;
+ if m <= n, the elements on and below the (nm)th
+ superdiagonal contain the MbyN lower trapezoidal matrix L;
+ the remaining elements, with the array TAU, represent the
+ orthogonal matrix Q as a product of elementary reflectors
+ (see Further Details).
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+
+ TAU
+ TAU is DOUBLE PRECISION array, dimension (min(M,N))
+ The scalar factors of the elementary reflectors (see Further Details).
+
+ WORK
+ WORK is DOUBLE PRECISION array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK. LWORK >= max(1,N).
+ For optimum performance LWORK >= N*NB, where NB is the
+ optimal blocksize.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value
+
+Further Details:
+ The matrix Q is represented as a product of elementary reflectors
+
+ Q = H(k) . . . H(2) H(1), where k = min(m,n).
+
+ Each H(i) has the form
+
+ H(i) = I  tau * v * v**T
+
+ where tau is a real scalar, and v is a real vector with
+ v(mk+i+1:m) = 0 and v(mk+i) = 1; v(1:mk+i1) is stored on exit in
+ A(1:mk+i1,nk+i), and tau in TAU(i).
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{dgeqlf.f}
+\index{dgeqlf.f}
+\begin{chunk}{dgeqlf.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK dgeqlf}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{dgeqp3}
+\label{dgeqp3}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{dgeqp3.input}
+)set break resume
+)sys rm f dgeqp3.output
+)spool dgeqp3.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{dgeqp3.help}
+====================================================================
+dgeqp3 examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine dgeqp3 (M, N, A, LDA, JPVT, TAU, WORK, LWORK, INFO)
+ DGEQP3
+
+Function/Subroutine Documentation
+ subroutine dgeqp3 (integer M, integer N, double precision, dimension( lda,
+ * ) A, integer LDA, integer, dimension( * ) JPVT, double precision,
+ dimension( * ) TAU, double precision, dimension( * ) WORK, integer
+ LWORK, integer INFO)
+ DGEQP3
+
+Purpose:
+ DGEQP3 computes a QR factorization with column pivoting of a
+ matrix A: A*P = Q*R using Level 3 BLAS.
+
+Parameters:
+
+ M
+ M is INTEGER
+ The number of rows of the matrix A. M >= 0.
+
+ N
+ N is INTEGER
+ The number of columns of the matrix A. N >= 0.
+
+ A
+ A is DOUBLE PRECISION array, dimension (LDA,N)
+ On entry, the MbyN matrix A.
+ On exit, the upper triangle of the array contains the
+ min(M,N)byN upper trapezoidal matrix R; the elements below
+ the diagonal, together with the array TAU, represent the
+ orthogonal matrix Q as a product of min(M,N) elementary reflectors.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+
+ JPVT
+ JPVT is INTEGER array, dimension (N)
+ On entry, if JPVT(J).ne.0, the Jth column of A is permuted
+ to the front of A*P (a leading column); if JPVT(J)=0,
+ the Jth column of A is a free column.
+ On exit, if JPVT(J)=K, then the Jth column of A*P was the
+ the Kth column of A.
+
+ TAU
+ TAU is DOUBLE PRECISION array, dimension (min(M,N))
+ The scalar factors of the elementary reflectors.
+
+ WORK
+ WORK is DOUBLE PRECISION array, dimension (MAX(1,LWORK))
+ On exit, if INFO=0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK. LWORK >= 3*N+1.
+ For optimal performance LWORK >= 2*N+( N+1 )*NB, where NB
+ is the optimal blocksize.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit.
+ < 0: if INFO = i, the ith argument had an illegal value.
+
+Further Details:
+ The matrix Q is represented as a product of elementary reflectors
+
+ Q = H(1) H(2) . . . H(k), where k = min(m,n).
+
+ Each H(i) has the form
+
+ H(i) = I  tau * v * v**T
+
+ where tau is a real scalar, and v is a real/complex vector
+ with v(1:i1) = 0 and v(i) = 1; v(i+1:m) is stored on exit in
+ A(i+1:m,i), and tau in TAU(i).
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{dgeqp3.f}
+\index{dgeqp3.f}
+\begin{chunk}{dgeqp3.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK dgeqp3}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{dgeqpf  DEPRECATED use dgeqp3}
+\label{dgeqpf}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{dgeqr2}
+\label{dgeqr2}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{dgeqr2.input}
+)set break resume
+)sys rm f dgeqr2.output
+)spool dgeqr2.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{dgeqr2.help}
+====================================================================
+dgeqr2 examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine dgeqr2 (M, N, A, LDA, TAU, WORK, INFO)
+ DGEQR2 computes the QR factorization of a general rectangular
+ matrix using an unblocked algorithm.
+
+Function/Subroutine Documentation
+ subroutine dgeqr2 (integer M, integer N, double precision, dimension( lda,
+ * ) A, integer LDA, double precision, dimension( * ) TAU, double
+ precision, dimension( * ) WORK, integer INFO)
+ DGEQR2 computes the QR factorization of a general rectangular matrix
+ using an unblocked algorithm.
+
+Purpose:
+ DGEQR2 computes a QR factorization of a real m by n matrix A: A = Q * R.
+
+Parameters:
+
+ M
+ M is INTEGER
+ The number of rows of the matrix A. M >= 0.
+
+ N
+ N is INTEGER
+ The number of columns of the matrix A. N >= 0.
+
+ A
+ A is DOUBLE PRECISION array, dimension (LDA,N)
+ On entry, the m by n matrix A.
+ On exit, the elements on and above the diagonal of the array
+ contain the min(m,n) by n upper trapezoidal matrix R (R is
+ upper triangular if m >= n); the elements below the diagonal,
+ with the array TAU, represent the orthogonal matrix Q as a
+ product of elementary reflectors (see Further Details).
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+
+ TAU
+ TAU is DOUBLE PRECISION array, dimension (min(M,N))
+ The scalar factors of the elementary reflectors (see Further Details).
+
+ WORK
+ WORK is DOUBLE PRECISION array, dimension (N)
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value
+
+Further Details:
+ The matrix Q is represented as a product of elementary reflectors
+
+ Q = H(1) H(2) . . . H(k), where k = min(m,n).
+
+ Each H(i) has the form
+
+ H(i) = I  tau * v * v**T
+
+ where tau is a real scalar, and v is a real vector with
+ v(1:i1) = 0 and v(i) = 1; v(i+1:m) is stored on exit in A(i+1:m,i),
+ and tau in TAU(i).
+
+\end{chunk}
+
+\subsection{fortran code}
+From Elmroth and Gustavson \cite{Elmr00}:
+
+DGEQR2($m$,$n$,$A$,$\tau$)\\
+{\bf do} $j=1,n$\\
+\\hskip 0.25cm{\bf compute}
+Householder transform $Q(j)=I\tau{}uu^T$ such that\\
+\\hskip 0.25cm$ Q(j)^T A(j\colon{}m,j)=(x,0)^T$ via a call to DLARFG\\
+\\hskip 0.25cm{\bf if} ($j$ .LT. $n$) {\bf then}\\
+\\hskip 0.5cm{\bf apply}$ Q(j)^T$ to $A(j\colon{}m,j+1\colon{}n)$
+from the left by calling DLARF\\
+\\hskip 0.25cm{\bf endif}\\
+{\bf enddo}
+
+\label{dgeqr2.f}
+\index{dgeqr2.f}
+\begin{chunk}{dgeqr2.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK dgeqr2}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{dgeqr2p}
+\label{dgeqr2p}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{dgeqr2p.input}
+)set break resume
+)sys rm f dgeqr2p.output
+)spool dgeqr2p.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page \cite{Demm08}}
+\begin{chunk}{dgeqr2p.help}
+====================================================================
+dgeqr2p examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine dgeqr2p (M, N, A, LDA, TAU, WORK, INFO)
+ DGEQR2P computes the QR factorization of a general rectangular
+ matrix with nonnegative diagonal elements using an unblocked
+ algorithm.
+
+Function/Subroutine Documentation
+ subroutine dgeqr2p (integer M, integer N, double precision, dimension( lda,
+ * ) A, integer LDA, double precision, dimension( * ) TAU, double
+ precision, dimension( * ) WORK, integer INFO)
+ DGEQR2P computes the QR factorization of a general rectangular matrix
+ with nonnegative diagonal elements using an unblocked algorithm.
+
+Purpose:
+ DGEQR2 computes a QR factorization of a real m by n matrix A:
+ A = Q * R. The diagonal entries of R are nonnegative.
+
+Parameters:
+
+ M
+ M is INTEGER
+ The number of rows of the matrix A. M >= 0.
+
+ N
+ N is INTEGER
+ The number of columns of the matrix A. N >= 0.
+
+ A
+ A is DOUBLE PRECISION array, dimension (LDA,N)
+ On entry, the m by n matrix A.
+ On exit, the elements on and above the diagonal of the array
+ contain the min(m,n) by n upper trapezoidal matrix R (R is
+ upper triangular if m >= n). The diagonal entries of R are
+ nonnegative; the elements below the diagonal,
+ with the array TAU, represent the orthogonal matrix Q as a
+ product of elementary reflectors (see Further Details).
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+
+ TAU
+ TAU is DOUBLE PRECISION array, dimension (min(M,N))
+ The scalar factors of the elementary reflectors (see Further Details).
+
+ WORK
+ WORK is DOUBLE PRECISION array, dimension (N)
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value
+
+Further Details:
+ The matrix Q is represented as a product of elementary reflectors
+
+ Q = H(1) H(2) . . . H(k), where k = min(m,n).
+
+ Each H(i) has the form
+
+ H(i) = I  tau * v * v**T
+
+ where tau is a real scalar, and v is a real vector with
+ v(1:i1) = 0 and v(i) = 1; v(i+1:m) is stored on exit in A(i+1:m,i),
+ and tau in TAU(i).
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{dgeqr2p.f}
+\index{dgeqr2p.f}
+\begin{chunk}{dgeqr2p.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK dgeqr2p}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{dgeqrf}
+\label{dgeqrf}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{dgeqrf.input}
+)set break resume
+)sys rm f dgeqrf.output
+)spool dgeqrf.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{dgeqrf.help}
+====================================================================
+dgeqrf examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine dgeqrf (M, N, A, LDA, TAU, WORK, LWORK, INFO)
+ DGEQRF
+
+Function/Subroutine Documentation
+ subroutine dgeqrf (integer M, integer N, double precision, dimension( lda,
+ * ) A, integer LDA, double precision, dimension( * ) TAU, double
+ precision, dimension( * ) WORK, integer LWORK, integer INFO)
+ DGEQRF
+
+Purpose:
+ DGEQRF computes a QR factorization of a real MbyN matrix A: A = Q * R.
+
+Parameters:
+
+ M
+ M is INTEGER
+ The number of rows of the matrix A. M >= 0.
+
+ N
+ N is INTEGER
+ The number of columns of the matrix A. N >= 0.
+
+ A
+ A is DOUBLE PRECISION array, dimension (LDA,N)
+ On entry, the MbyN matrix A.
+ On exit, the elements on and above the diagonal of the array
+ contain the min(M,N)byN upper trapezoidal matrix R (R is
+ upper triangular if m >= n); the elements below the diagonal,
+ with the array TAU, represent the orthogonal matrix Q as a
+ product of min(m,n) elementary reflectors (see Further Details).
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+
+ TAU
+ TAU is DOUBLE PRECISION array, dimension (min(M,N))
+ The scalar factors of the elementary reflectors (see Further Details).
+
+ WORK
+ WORK is DOUBLE PRECISION array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK. LWORK >= max(1,N).
+ For optimum performance LWORK >= N*NB, where NB is
+ the optimal blocksize.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value
+
+Further Details:
+ The matrix Q is represented as a product of elementary reflectors
+
+ Q = H(1) H(2) . . . H(k), where k = min(m,n).
+
+ Each H(i) has the form
+
+ H(i) = I  tau * v * v**T
+
+ where tau is a real scalar, and v is a real vector with
+ v(1:i1) = 0 and v(i) = 1; v(i+1:m) is stored on exit in A(i+1:m,i),
+ and tau in TAU(i).
+
+\end{chunk}
+
+\subsection{fortran code}
+From Elmroth and Gustavson \cite{Elmr00}:
+
+DGEQRF($m$,$n$,$A$,$\tau$,$work$)\\
+{\bf do} $j=1,n,nb$\quad !$nb$ is the block size\\
+\\hskip 0.25cm$jb = {\rm min}(jj+1,nb)$\\
+\\hskip 0.25cm{\bf call} DGEQR2[$mj+1,jb,A(j,j),\tau(j)$]\\
+\\hskip 0.25cm{\bf if} ($j+jb$ .LE. $n$) {\bf then}\\
+\\hskip 0.5cm{\bf compute} $T(1\colon{}jb,1\colon{}jn)$
+in $work$ via a call to DLARFT\\
+\\hskip 0.5cm{\bf compute} $(IYT^TY^T)A(j\colon{}m,j+jb\colon{}n)$
+using $work$ and $T$\\
+\\hskip 0.5cmvia a call to DLARFB\\
+\\hskip 0.25cm{\bf endif}\\
+{\bf enddo}
+
+\label{dgeqrf.f}
+\index{dgeqrf.f}
+\begin{chunk}{dgeqrf.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK dgeqrf}
+
+\end{chunk}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{dgeqrfp}
+\label{dgeqrfp}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{dgeqrfp.input}
+)set break resume
+)sys rm f dgeqrfp.output
+)spool dgeqrfp.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page \cite{Demm08}}
+\begin{chunk}{dgeqrfp.help}
+====================================================================
+dgeqrfp examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine dgeqrfp (M, N, A, LDA, TAU, WORK, LWORK, INFO)
+ DGEQRFP
+
+Function/Subroutine Documentation
+ subroutine dgeqrfp (integer M, integer N, double precision, dimension( lda,
+ * ) A, integer LDA, double precision, dimension( * ) TAU, double
+ precision, dimension( * ) WORK, integer LWORK, integer INFO)
+ DGEQRFP
+
+Purpose:
+ DGEQRFP computes a QR factorization of a real MbyN matrix A:
+ A = Q * R. The diagonal entries of R are nonnegative.
+
+Parameters:
+
+ M
+ M is INTEGER
+ The number of rows of the matrix A. M >= 0.
+
+ N
+ N is INTEGER
+ The number of columns of the matrix A. N >= 0.
+
+ A
+ A is DOUBLE PRECISION array, dimension (LDA,N)
+ On entry, the MbyN matrix A.
+ On exit, the elements on and above the diagonal of the array
+ contain the min(M,N)byN upper trapezoidal matrix R (R is
+ upper triangular if m >= n). The diagonal entries of R
+ are nonnegative; the elements below the diagonal,
+ with the array TAU, represent the orthogonal matrix Q as a
+ product of min(m,n) elementary reflectors (see Further Details).
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+
+ TAU
+ TAU is DOUBLE PRECISION array, dimension (min(M,N))
+ The scalar factors of the elementary reflectors (see Further Details).
+
+ WORK
+ WORK is DOUBLE PRECISION array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK. LWORK >= max(1,N).
+ For optimum performance LWORK >= N*NB, where NB is
+ the optimal blocksize.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value
+
+Further Details:
+ The matrix Q is represented as a product of elementary reflectors
+
+ Q = H(1) H(2) . . . H(k), where k = min(m,n).
+
+ Each H(i) has the form
+
+ H(i) = I  tau * v * v**T
+
+ where tau is a real scalar, and v is a real vector with
+ v(1:i1) = 0 and v(i) = 1; v(i+1:m) is stored on exit in A(i+1:m,i),
+ and tau in TAU(i).
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{dgeqrfp.f}
+\index{dgeqrfp.f}
+\begin{chunk}{dgeqrfp.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK dgeqrfp}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{dgeqrt}
+\label{dgeqrt}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{dgeqrt.input}
+)set break resume
+)sys rm f dgeqrt.output
+)spool dgeqrt.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{dgeqrt.help}
+====================================================================
+dgeqrt examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine dgeqrt (M, N, NB, A, LDA, T, LDT, WORK, INFO)
+ DGEQRT
+
+Function/Subroutine Documentation
+ subroutine dgeqrt (integer M, integer N, integer NB, double precision,
+ dimension( lda, * ) A, integer LDA, double precision, dimension( ldt, *
+ ) T, integer LDT, double precision, dimension( * ) WORK, integer INFO)
+ DGEQRT
+
+Purpose:
+ DGEQRT computes a blocked QR factorization of a real MbyN matrix A
+ using the compact WY representation of Q.
+
+Parameters:
+
+ M
+ M is INTEGER
+ The number of rows of the matrix A. M >= 0.
+
+ N
+ N is INTEGER
+ The number of columns of the matrix A. N >= 0.
+
+ NB
+ NB is INTEGER
+ The block size to be used in the blocked QR. MIN(M,N) >= NB >= 1.
+
+ A
+ A is DOUBLE PRECISION array, dimension (LDA,N)
+ On entry, the MbyN matrix A.
+ On exit, the elements on and above the diagonal of the array
+ contain the min(M,N)byN upper trapezoidal matrix R (R is
+ upper triangular if M >= N); the elements below the diagonal
+ are the columns of V.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+
+ T
+ T is DOUBLE PRECISION array, dimension (LDT,MIN(M,N))
+ The upper triangular block reflectors stored in compact form
+ as a sequence of upper triangular blocks. See below for further details.
+
+ LDT
+ LDT is INTEGER
+ The leading dimension of the array T. LDT >= NB.
+
+ WORK
+ WORK is DOUBLE PRECISION array, dimension (NB*N)
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value
+
+Further Details:
+ The matrix V stores the elementary reflectors H(i) in the ith column
+ below the diagonal. For example, if M=5 and N=3, the matrix V is
+
+ V = ( 1 )
+ ( v1 1 )
+ ( v1 v2 1 )
+ ( v1 v2 v3 )
+ ( v1 v2 v3 )
+
+ where the vi's represent the vectors which define H(i), which are returned
+ in the matrix A. The 1's along the diagonal of V are not stored in A.
+
+ Let K=MIN(M,N). The number of blocks is B = ceiling(K/NB), where each
+ block is of order NB except for the last block, which is of order
+ IB = K  (B1)*NB. For each of the B blocks, a upper triangular block
+ reflector factor is computed: T1, T2, ..., TB. The NBbyNB (and IBbyIB
+ for the last block) T's are stored in the NBbyN matrix T as
+
+ T = (T1 T2 ... TB).
+\end{chunk}
+
+\subsection{fortran code}
+\label{dgeqrt.f}
+\index{dgeqrt.f}
+\begin{chunk}{dgeqrt.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK dgeqrt}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{dgeqrt2}
+\label{dgeqrt2}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{dgeqrt2.input}
+)set break resume
+)sys rm f dgeqrt2.output
+)spool dgeqrt2.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{dgeqrt2.help}
+====================================================================
+dgeqrt2 examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine dgeqrt2 (M, N, A, LDA, T, LDT, INFO)
+ DGEQRT2 computes a QR factorization of a general real or complex
+ matrix using the compact WY representation of Q.
+
+Function/Subroutine Documentation
+ subroutine dgeqrt2 (integer M, integer N, double precision, dimension( lda,
+ * ) A, integer LDA, double precision, dimension( ldt, * ) T, integer
+ LDT, integer INFO)
+ DGEQRT2 computes a QR factorization of a general real or complex matrix
+ using the compact WY representation of Q.
+
+Purpose:
+ DGEQRT2 computes a QR factorization of a real MbyN matrix A,
+ using the compact WY representation of Q.
+
+Parameters:
+
+ M
+ M is INTEGER
+ The number of rows of the matrix A. M >= N.
+
+ N
+ N is INTEGER
+ The number of columns of the matrix A. N >= 0.
+
+ A
+ A is DOUBLE PRECISION array, dimension (LDA,N)
+ On entry, the real MbyN matrix A. On exit, the elements on and
+ above the diagonal contain the NbyN upper triangular matrix R; the
+ elements below the diagonal are the columns of V. See below for
+ further details.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+
+ T
+ T is DOUBLE PRECISION array, dimension (LDT,N)
+ The NbyN upper triangular factor of the block reflector.
+ The elements on and above the diagonal contain the block
+ reflector T; the elements below the diagonal are not used.
+ See below for further details.
+
+ LDT
+ LDT is INTEGER
+ The leading dimension of the array T. LDT >= max(1,N).
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value
+
+Further Details:
+ The matrix V stores the elementary reflectors H(i) in the ith column
+ below the diagonal. For example, if M=5 and N=3, the matrix V is
+
+ V = ( 1 )
+ ( v1 1 )
+ ( v1 v2 1 )
+ ( v1 v2 v3 )
+ ( v1 v2 v3 )
+
+ where the vi's represent the vectors which define H(i), which are returned
+ in the matrix A. The 1's along the diagonal of V are not stored in A. The
+ block reflector H is then given by
+
+ H = I  V * T * V**T
+
+ where V**T is the transpose of V.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{dgeqrt2.f}
+\index{dgeqrt2.f}
+\begin{chunk}{dgeqrt2.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK dgeqrt2}
+
+\end{chunk}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{dgeqrt3}
+\label{dgeqrt3}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{dgeqrt3.input}
+)set break resume
+)sys rm f dgeqrt3.output
+)spool dgeqrt3.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page \cite{Elmr00}}
+\begin{chunk}{dgeqrt3.help}
+====================================================================
+dgeqrt3 examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ recursive subroutine dgeqrt3 (M, N, A, LDA, T, LDT, INFO)
+ DGEQRT3 recursively computes a QR factorization of a general real
+ or complex matrix using the compact WY representation of Q.
+
+Function/Subroutine Documentation
+ recursive subroutine dgeqrt3 (integer M, integer N, double precision,
+ dimension( lda, * ) A, integer LDA, double precision, dimension( ldt, *
+ ) T, integer LDT, integer INFO)
+ DGEQRT3 recursively computes a QR factorization of a general real or
+ complex matrix using the compact WY representation of Q.
+
+Purpose:
+ DGEQRT3 recursively computes a QR factorization of a real MbyN
+ matrix A, using the compact WY representation of Q.
+
+ Parameters:
+ M
+
+ M is INTEGER
+ The number of rows of the matrix A. M >= N.
+
+ N
+
+ N is INTEGER
+ The number of columns of the matrix A. N >= 0.
+
+ A
+
+ A is DOUBLE PRECISION array, dimension (LDA,N)
+ On entry, the real MbyN matrix A. On exit, the elements on and
+ above the diagonal contain the NbyN upper triangular matrix R; the
+ elements below the diagonal are the columns of V. See below for
+ further details.
+
+ LDA
+
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+
+ T
+
+ T is DOUBLE PRECISION array, dimension (LDT,N)
+ The NbyN upper triangular factor of the block reflector.
+ The elements on and above the diagonal contain the block
+ reflector T; the elements below the diagonal are not used.
+ See below for further details.
+
+ LDT
+
+ LDT is INTEGER
+ The leading dimension of the array T. LDT >= max(1,N).
+
+ INFO
+
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value
+
+ Author:
+ Univ. of Tennessee
+
+ Univ. of California Berkeley
+
+ Univ. of Colorado Denver
+
+ NAG Ltd.
+
+ Date:
+ September 2012
+
+ Further Details:
+
+
+ The matrix V stores the elementary reflectors H(i) in the ith column
+ below the diagonal. For example, if M=5 and N=3, the matrix V is
+
+ V = ( 1 )
+ ( v1 1 )
+ ( v1 v2 1 )
+ ( v1 v2 v3 )
+ ( v1 v2 v3 )
+
+ where the vi's represent the vectors which define H(i), which are returned
+ in the matrix A. The 1's along the diagonal of V are not stored in A. The
+ block reflector H is then given by
+
+ H = I  V * T * V**T
+
+ where V**T is the transpose of V.
+
+ For details of the algorithm, see Elmroth and Gustavson (cited above).
+
+Author
+ Generated automatically by Doxygen for LAPACK from the source code.
+
+
+
+Version 3.6.0 Mon Nov 16 2015 dgeqrt3.f(3)
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{dgeqrt3.f}
+\index{dgeqrt3.f}
+\begin{chunk}{dgeqrt3.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK dgeqrt3}
+
+\end{chunk}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{dgerfs}
+\label{dgerfs}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{dgerfs.input}
+)set break resume
+)sys rm f dgerfs.output
+)spool dgerfs.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{dgerfs.help}
+====================================================================
+dgerfs examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine dgerfs (TRANS, N, NRHS, A, LDA, AF, LDAF, IPIV, B, LDB, X,
+ LDX, FERR, BERR, WORK, IWORK, INFO)
+ DGERFS
+
+Function/Subroutine Documentation
+ subroutine dgerfs (character TRANS, integer N, integer NRHS, double
+ precision, dimension( lda, * ) A, integer LDA, double precision,
+ dimension( ldaf, * ) AF, integer LDAF, integer, dimension( * ) IPIV,
+ double precision, dimension( ldb, * ) B, integer LDB, double precision,
+ dimension( ldx, * ) X, integer LDX, double precision, dimension( * )
+ FERR, double precision, dimension( * ) BERR, double precision,
+ dimension( * ) WORK, integer, dimension( * ) IWORK, integer INFO)
+ DGERFS
+
+Purpose:
+ DGERFS improves the computed solution to a system of linear
+ equations and provides error bounds and backward error estimates for
+ the solution.
+
+Parameters:
+
+ TRANS
+ TRANS is CHARACTER*1
+ Specifies the form of the system of equations:
+ = 'N': A * X = B (No transpose)
+ = 'T': A**T * X = B (Transpose)
+ = 'C': A**H * X = B (Conjugate transpose = Transpose)
+
+ N
+ N is INTEGER
+ The order of the matrix A. N >= 0.
+
+ NRHS
+ NRHS is INTEGER
+ The number of right hand sides, i.e., the number of columns
+ of the matrices B and X. NRHS >= 0.
+
+ A
+ A is DOUBLE PRECISION array, dimension (LDA,N)
+ The original NbyN matrix A.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,N).
+
+ AF
+ AF is DOUBLE PRECISION array, dimension (LDAF,N)
+ The factors L and U from the factorization A = P*L*U
+ as computed by DGETRF.
+
+ LDAF
+ LDAF is INTEGER
+ The leading dimension of the array AF. LDAF >= max(1,N).
+
+ IPIV
+ IPIV is INTEGER array, dimension (N)
+ The pivot indices from DGETRF; for 1<=i<=N, row i of the
+ matrix was interchanged with row IPIV(i).
+
+ B
+ B is DOUBLE PRECISION array, dimension (LDB,NRHS)
+ The right hand side matrix B.
+
+ LDB
+ LDB is INTEGER
+ The leading dimension of the array B. LDB >= max(1,N).
+
+ X
+ X is DOUBLE PRECISION array, dimension (LDX,NRHS)
+ On entry, the solution matrix X, as computed by DGETRS.
+ On exit, the improved solution matrix X.
+
+ LDX
+ LDX is INTEGER
+ The leading dimension of the array X. LDX >= max(1,N).
+
+ FERR
+ FERR is DOUBLE PRECISION array, dimension (NRHS)
+ The estimated forward error bound for each solution vector
+ X(j) (the jth column of the solution matrix X).
+ If XTRUE is the true solution corresponding to X(j), FERR(j)
+ is an estimated upper bound for the magnitude of the largest
+ element in (X(j)  XTRUE) divided by the magnitude of the
+ largest element in X(j). The estimate is as reliable as
+ the estimate for RCOND, and is almost always a slight
+ overestimate of the true error.
+
+ BERR
+ BERR is DOUBLE PRECISION array, dimension (NRHS)
+ The componentwise relative backward error of each solution
+ vector X(j) (i.e., the smallest relative change in
+ any element of A or B that makes X(j) an exact solution).
+
+ WORK
+ WORK is DOUBLE PRECISION array, dimension (3*N)
+
+ IWORK
+ IWORK is INTEGER array, dimension (N)
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value
+
+Internal Parameters:
+
+ ITMAX is the maximum number of steps of iterative refinement.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{dgerfs.f}
+\index{dgerfs.f}
+\begin{chunk}{dgerfs.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK dgerfs}
+
+\end{chunk}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{dgerfsx}
+\label{dgerfsx}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{dgerfsx.input}
+)set break resume
+)sys rm f dgerfsx.output
+)spool dgerfsx.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page \cite{Demm05}}
+\begin{chunk}{dgerfsx.help}
+====================================================================
+dgerfsx examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine dgerfsx (TRANS, EQUED, N, NRHS, A, LDA, AF, LDAF, IPIV, R,
+ C, B, LDB, X, LDX, RCOND, BERR, N_ERR_BNDS, ERR_BNDS_NORM,
+ ERR_BNDS_COMP, NPARAMS, PARAMS, WORK, IWORK, INFO)
+ DGERFSX
+
+Function/Subroutine Documentation
+ subroutine dgerfsx (character TRANS, character EQUED, integer N, integer
+ NRHS, double precision, dimension( lda, * ) A, integer LDA, double
+ precision, dimension( ldaf, * ) AF, integer LDAF, integer, dimension( *
+ ) IPIV, double precision, dimension( * ) R, double precision,
+ dimension( * ) C, double precision, dimension( ldb, * ) B, integer LDB,
+ double precision, dimension( ldx , * ) X, integer LDX, double precision
+ RCOND, double precision, dimension( * ) BERR, integer N_ERR_BNDS,
+ double precision, dimension( nrhs, * ) ERR_BNDS_NORM, double precision,
+ dimension( nrhs, * ) ERR_BNDS_COMP, integer NPARAMS, double precision,
+ dimension( * ) PARAMS, double precision, dimension( * ) WORK, integer,
+ dimension( * ) IWORK, integer INFO)
+ DGERFSX
+
+Purpose:
+ DGERFSX improves the computed solution to a system of linear
+ equations and provides error bounds and backward error estimates
+ for the solution. In addition to normwise error bound, the code
+ provides maximum componentwise error bound if possible. See
+ comments for ERR_BNDS_NORM and ERR_BNDS_COMP for details of the
+ error bounds.
+
+ The original system of linear equations may have been equilibrated
+ before calling this routine, as described by arguments EQUED, R
+ and C below. In this case, the solution and error bounds returned
+ are for the original unequilibrated system.
+
+ Some optional parameters are bundled in the PARAMS array. These
+ settings determine how refinement is performed, but often the
+ defaults are acceptable. If the defaults are acceptable, users
+ can pass NPARAMS = 0 which prevents the source code from accessing
+ the PARAMS argument.
+
+Parameters:
+
+ TRANS
+ TRANS is CHARACTER*1
+ Specifies the form of the system of equations:
+ = 'N': A * X = B (No transpose)
+ = 'T': A**T * X = B (Transpose)
+ = 'C': A**H * X = B (Conjugate transpose = Transpose)
+
+ EQUED
+ EQUED is CHARACTER*1
+ Specifies the form of equilibration that was done to A
+ before calling this routine. This is needed to compute
+ the solution and error bounds correctly.
+ = 'N': No equilibration
+ = 'R': Row equilibration, i.e., A has been premultiplied by diag(R).
+ = 'C': Column equilibration, i.e., A has been postmultiplied by diag(C).
+ = 'B': Both row and column equilibration, i.e., A has been
+ replaced by diag(R) * A * diag(C).
+ The right hand side B has been changed accordingly.
+
+ N
+ N is INTEGER
+ The order of the matrix A. N >= 0.
+
+ NRHS
+ NRHS is INTEGER
+ The number of right hand sides, i.e., the number of columns
+ of the matrices B and X. NRHS >= 0.
+
+ A
+ A is DOUBLE PRECISION array, dimension (LDA,N)
+ The original NbyN matrix A.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,N).
+
+ AF
+ AF is DOUBLE PRECISION array, dimension (LDAF,N)
+ The factors L and U from the factorization A = P*L*U
+ as computed by DGETRF.
+
+ LDAF
+ LDAF is INTEGER
+ The leading dimension of the array AF. LDAF >= max(1,N).
+
+ IPIV
+ IPIV is INTEGER array, dimension (N)
+ The pivot indices from DGETRF; for 1<=i<=N, row i of the
+ matrix was interchanged with row IPIV(i).
+
+ R
+ R is DOUBLE PRECISION array, dimension (N)
+ The row scale factors for A. If EQUED = 'R' or 'B', A is
+ multiplied on the left by diag(R); if EQUED = 'N' or 'C', R
+ is not accessed.
+ If R is accessed, each element of R should be a power of the radix
+ to ensure a reliable solution and error estimates. Scaling by
+ powers of the radix does not cause rounding errors unless the
+ result underflows or overflows. Rounding errors during scaling
+ lead to refining with a matrix that is not equivalent to the
+ input matrix, producing error estimates that may not be reliable.
+
+ C
+ C is DOUBLE PRECISION array, dimension (N)
+ The column scale factors for A. If EQUED = 'C' or 'B', A is
+ multiplied on the right by diag(C); if EQUED = 'N' or 'R', C
+ is not accessed.
+ If C is accessed, each element of C should be a power of the radix
+ to ensure a reliable solution and error estimates. Scaling by
+ powers of the radix does not cause rounding errors unless the
+ result underflows or overflows. Rounding errors during scaling
+ lead to refining with a matrix that is not equivalent to the
+ input matrix, producing error estimates that may not be reliable.
+
+ B
+ B is DOUBLE PRECISION array, dimension (LDB,NRHS)
+ The right hand side matrix B.
+
+ LDB
+ LDB is INTEGER
+ The leading dimension of the array B. LDB >= max(1,N).
+
+ X
+ X is DOUBLE PRECISION array, dimension (LDX,NRHS)
+ On entry, the solution matrix X, as computed by DGETRS.
+ On exit, the improved solution matrix X.
+
+ LDX
+ LDX is INTEGER
+ The leading dimension of the array X. LDX >= max(1,N).
+
+ RCOND
+ RCOND is DOUBLE PRECISION
+ Reciprocal scaled condition number. This is an estimate of the
+ reciprocal Skeel condition number of the matrix A after
+ equilibration (if done). If this is less than the machine
+ precision (in particular, if it is zero), the matrix is singular
+ to working precision. Note that the error may still be small even
+ if this number is very small and the matrix appears illconditioned.
+
+ BERR
+ BERR is DOUBLE PRECISION array, dimension (NRHS)
+ Componentwise relative backward error. This is the
+ componentwise relative backward error of each solution vector X(j)
+ (i.e., the smallest relative change in any element of A or B that
+ makes X(j) an exact solution).
+
+ N_ERR_BNDS
+ N_ERR_BNDS is INTEGER
+ Number of error bounds to return for each right hand side
+ and each type (normwise or componentwise). See ERR_BNDS_NORM and
+ ERR_BNDS_COMP below.
+
+ ERR_BNDS_NORM
+ ERR_BNDS_NORM is DOUBLE PRECISION array, dimension (NRHS, N_ERR_BNDS)
+ For each righthand side, this array contains information about
+ various error bounds and condition numbers corresponding to the
+ normwise relative error, which is defined as follows:
+
+ Normwise relative error in the ith solution vector:
+ max_j (abs(XTRUE(j,i)  X(j,i)))
+ 
+ max_j abs(X(j,i))
+
+ The array is indexed by the type of error information as described
+ below. There currently are up to three pieces of information
+ returned.
+
+ The first index in ERR_BNDS_NORM(i,:) corresponds to the ith
+ righthand side.
+
+ The second index in ERR_BNDS_NORM(:,err) contains the following
+ three fields:
+ err = 1 "Trust/don't trust" boolean. Trust the answer if the
+ reciprocal condition number is less than the threshold
+ sqrt(n) * dlamch('Epsilon').
+
+ err = 2 "Guaranteed" error bound: The estimated forward error,
+ almost certainly within a factor of 10 of the true error
+ so long as the next entry is greater than the threshold
+ sqrt(n) * dlamch('Epsilon'). This error bound should only
+ be trusted if the previous boolean is true.
+
+ err = 3 Reciprocal condition number: Estimated normwise
+ reciprocal condition number. Compared with the threshold
+ sqrt(n) * dlamch('Epsilon') to determine if the error
+ estimate is "guaranteed". These reciprocal condition
+ numbers are 1 / (norm(Z^{1},inf) * norm(Z,inf)) for some
+ appropriately scaled matrix Z.
+ Let Z = S*A, where S scales each row by a power of the
+ radix so all absolute row sums of Z are approximately 1.
+
+ See Lapack Working Note 165 for further details and extra cautions.
+
+ ERR_BNDS_COMP
+ ERR_BNDS_COMP is DOUBLE PRECISION array, dimension (NRHS, N_ERR_BNDS)
+ For each righthand side, this array contains information about
+ various error bounds and condition numbers corresponding to the
+ componentwise relative error, which is defined as follows:
+
+ Componentwise relative error in the ith solution vector:
+ abs(XTRUE(j,i)  X(j,i))
+ max_j 
+ abs(X(j,i))
+
+ The array is indexed by the righthand side i (on which the
+ componentwise relative error depends), and the type of error
+ information as described below. There currently are up to three
+ pieces of information returned for each righthand side. If
+ componentwise accuracy is not requested (PARAMS(3) = 0.0), then
+ ERR_BNDS_COMP is not accessed. If N_ERR_BNDS .LT. 3, then at most
+ the first (:,N_ERR_BNDS) entries are returned.
+
+ The first index in ERR_BNDS_COMP(i,:) corresponds to the ith
+ righthand side.
+
+ The second index in ERR_BNDS_COMP(:,err) contains the following
+ three fields:
+ err = 1 "Trust/don't trust" boolean. Trust the answer if the
+ reciprocal condition number is less than the threshold
+ sqrt(n) * dlamch('Epsilon').
+
+ err = 2 "Guaranteed" error bound: The estimated forward error,
+ almost certainly within a factor of 10 of the true error
+ so long as the next entry is greater than the threshold
+ sqrt(n) * dlamch('Epsilon'). This error bound should only
+ be trusted if the previous boolean is true.
+
+ err = 3 Reciprocal condition number: Estimated componentwise
+ reciprocal condition number. Compared with the threshold
+ sqrt(n) * dlamch('Epsilon') to determine if the error
+ estimate is "guaranteed". These reciprocal condition
+ numbers are 1 / (norm(Z^{1},inf) * norm(Z,inf)) for some
+ appropriately scaled matrix Z.
+ Let Z = S*(A*diag(x)), where x is the solution for the
+ current righthand side and S scales each row of
+ A*diag(x) by a power of the radix so all absolute row
+ sums of Z are approximately 1.
+
+ See Lapack Working Note 165 for further details and extra cautions.
+
+ NPARAMS
+ NPARAMS is INTEGER
+ Specifies the number of parameters set in PARAMS. If .LE. 0, the
+ PARAMS array is never referenced and default values are used.
+
+ PARAMS
+ PARAMS is DOUBLE PRECISION array, dimension (NPARAMS)
+ Specifies algorithm parameters. If an entry is .LT. 0.0, then
+ that entry will be filled with default value used for that
+ parameter. Only positions up to NPARAMS are accessed; defaults
+ are used for highernumbered parameters.
+
+ PARAMS(LA_LINRX_ITREF_I = 1) : Whether to perform iterative
+ refinement or not.
+ Default: 1.0D+0
+ = 0.0 : No refinement is performed, and no error bounds are computed.
+ = 1.0 : Use the doubleprecision refinement algorithm,
+ possibly with doubledsingle computations if the
+ compilation environment does not support DOUBLE PRECISION.
+ (other values are reserved for future use)
+
+ PARAMS(LA_LINRX_ITHRESH_I = 2) : Maximum number of residual
+ computations allowed for refinement.
+ Default: 10
+ Aggressive: Set to 100 to permit convergence using approximate
+ factorizations or factorizations other than LU. If
+ the factorization uses a technique other than
+ Gaussian elimination, the guarantees in
+ err_bnds_norm and err_bnds_comp may no longer be trustworthy.
+
+ PARAMS(LA_LINRX_CWISE_I = 3) : Flag determining if the code
+ will attempt to find a solution with small componentwise
+ relative error in the doubleprecision algorithm. Positive
+ is true, 0.0 is false.
+ Default: 1.0 (attempt componentwise convergence)
+
+ WORK
+ WORK is DOUBLE PRECISION array, dimension (4*N)
+
+ IWORK
+ IWORK is INTEGER array, dimension (N)
+
+ INFO
+ INFO is INTEGER
+ = 0: Successful exit. The solution to every righthand side is guaranteed.
+ < 0: If INFO = i, the ith argument had an illegal value
+ > 0 and <= N: U(INFO,INFO) is exactly zero. The factorization
+ has been completed, but the factor U is exactly singular, so
+ the solution and error bounds could not be computed. RCOND = 0
+ is returned.
+ = N+J: The solution corresponding to the Jth righthand side is
+ not guaranteed. The solutions corresponding to other right
+ hand sides K with K > J may not be guaranteed as well, but
+ only the first such righthand side is reported. If a small
+ componentwise error is not requested (PARAMS(3) = 0.0) then
+ the Jth righthand side is the first with a normwise error
+ bound that is not guaranteed (the smallest J such
+ that ERR_BNDS_NORM(J,1) = 0.0). By default (PARAMS(3) = 1.0)
+ the Jth righthand side is the first with either a normwise or
+ componentwise error bound that is not guaranteed (the smallest
+ J such that either ERR_BNDS_NORM(J,1) = 0.0 or
+ ERR_BNDS_COMP(J,1) = 0.0). See the definition of
+ ERR_BNDS_NORM(:,1) and ERR_BNDS_COMP(:,1). To get information
+ about all of the righthand sides check ERR_BNDS_NORM or ERR_BNDS_COMP.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{dgerfsx.f}
+\index{dgerfsx.f}
+\begin{chunk}{dgerfsx.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK dgerfsx}
+
+\end{chunk}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{dgerq2}
+\label{dgerq2}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{dgerq2.input}
+)set break resume
+)sys rm f dgerq2.output
+)spool dgerq2.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{dgerq2.help}
+====================================================================
+dgerq2 examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine dgerq2 (M, N, A, LDA, TAU, WORK, INFO)
+ DGERQ2 computes the RQ factorization of a general rectangular
+ matrix using an unblocked algorithm.
+
+Function/Subroutine Documentation
+ subroutine dgerq2 (integer M, integer N, double precision, dimension( lda,
+ * ) A, integer LDA, double precision, dimension( * ) TAU, double
+ precision, dimension( * ) WORK, integer INFO)
+ DGERQ2 computes the RQ factorization of a general rectangular matrix
+ using an unblocked algorithm.
+
+Purpose:
+ DGERQ2 computes an RQ factorization of a real m by n matrix A: A = R * Q.
+
+Parameters:
+
+ M
+ M is INTEGER
+ The number of rows of the matrix A. M >= 0.
+
+ N
+ N is INTEGER
+ The number of columns of the matrix A. N >= 0.
+
+ A
+ A is DOUBLE PRECISION array, dimension (LDA,N)
+ On entry, the m by n matrix A.
+ On exit, if m <= n, the upper triangle of the subarray
+ A(1:m,nm+1:n) contains the m by m upper triangular matrix R;
+ if m >= n, the elements on and above the (mn)th subdiagonal
+ contain the m by n upper trapezoidal matrix R; the remaining
+ elements, with the array TAU, represent the orthogonal matrix
+ Q as a product of elementary reflectors (see Further Details).
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+
+ TAU
+ TAU is DOUBLE PRECISION array, dimension (min(M,N))
+ The scalar factors of the elementary reflectors (see Further Details).
+
+ WORK
+ WORK is DOUBLE PRECISION array, dimension (M)
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value
+
+Further Details:
+ The matrix Q is represented as a product of elementary reflectors
+
+ Q = H(1) H(2) . . . H(k), where k = min(m,n).
+
+ Each H(i) has the form
+
+ H(i) = I  tau * v * v**T
+
+ where tau is a real scalar, and v is a real vector with
+ v(nk+i+1:n) = 0 and v(nk+i) = 1; v(1:nk+i1) is stored on exit in
+ A(mk+i,1:nk+i1), and tau in TAU(i).
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{dgerq2.f}
+\index{dgerq2.f}
+\begin{chunk}{dgerq2.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK dgerq2}
+
+\end{chunk}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{dgerqf}
+\label{dgerqf}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{dgerqf.input}
+)set break resume
+)sys rm f dgerqf.output
+)spool dgerqf.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{dgerqf.help}
+====================================================================
+dgerqf examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine dgerqf (M, N, A, LDA, TAU, WORK, LWORK, INFO)
+ DGERQF
+
+Function/Subroutine Documentation
+ subroutine dgerqf (integer M, integer N, double precision, dimension( lda,
+ * ) A, integer LDA, double precision, dimension( * ) TAU, double
+ precision, dimension( * ) WORK, integer LWORK, integer INFO)
+ DGERQF
+
+Purpose:
+ DGERQF computes an RQ factorization of a real MbyN matrix A: A = R * Q.
+
+Parameters:
+
+ M
+ M is INTEGER
+ The number of rows of the matrix A. M >= 0.
+
+ N
+ N is INTEGER
+ The number of columns of the matrix A. N >= 0.
+
+ A
+ A is DOUBLE PRECISION array, dimension (LDA,N)
+ On entry, the MbyN matrix A.
+ On exit,
+ if m <= n, the upper triangle of the subarray
+ A(1:m,nm+1:n) contains the MbyM upper triangular matrix R;
+ if m >= n, the elements on and above the (mn)th subdiagonal
+ contain the MbyN upper trapezoidal matrix R;
+ the remaining elements, with the array TAU, represent the
+ orthogonal matrix Q as a product of min(m,n) elementary
+ reflectors (see Further Details).
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+
+ TAU
+ TAU is DOUBLE PRECISION array, dimension (min(M,N))
+ The scalar factors of the elementary reflectors (see Further Details).
+
+ WORK
+ WORK is DOUBLE PRECISION array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK. LWORK >= max(1,M).
+ For optimum performance LWORK >= M*NB, where NB is
+ the optimal blocksize.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value
+
+Further Details:
+ The matrix Q is represented as a product of elementary reflectors
+
+ Q = H(1) H(2) . . . H(k), where k = min(m,n).
+
+ Each H(i) has the form
+
+ H(i) = I  tau * v * v**T
+
+ where tau is a real scalar, and v is a real vector with
+ v(nk+i+1:n) = 0 and v(nk+i) = 1; v(1:nk+i1) is stored on exit in
+ A(mk+i,1:nk+i1), and tau in TAU(i).
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{dgerqf.f}
+\index{dgerqf.f}
+\begin{chunk}{dgerqf.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK dgerqf}
+
+\end{chunk}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{dgesvj}
+\label{dgesvj}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{dgesvj.input}
+)set break resume
+)sys rm f dgesvj.output
+)spool dgesvj.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{dgesvj.help}
+====================================================================
+dgesvj examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine dgesvj (JOBA, JOBU, JOBV, M, N, A, LDA, SVA, MV, V, LDV,
+ WORK, LWORK, INFO)
+ DGESVJ
+
+Function/Subroutine Documentation
+ subroutine dgesvj (character*1 JOBA, character*1 JOBU, character*1 JOBV,
+ integer M, integer N, double precision, dimension( lda, * ) A, integer
+ LDA, double precision, dimension( n ) SVA, integer MV, double
+ precision, dimension( ldv, * ) V, integer LDV, double precision,
+ dimension( lwork ) WORK, integer LWORK, integer INFO)
+ DGESVJ
+
+Purpose:
+ DGESVJ computes the singular value decomposition (SVD) of a real
+ MbyN matrix A, where M >= N. The SVD of A is written as
+ [++] [xx] [x0] [xx]
+ A = U * SIGMA * V^t, [++] = [xx] * [ox] * [xx]
+ [++] [xx]
+ where SIGMA is an NbyN diagonal matrix, U is an MbyN orthonormal
+ matrix, and V is an NbyN orthogonal matrix. The diagonal elements
+ of SIGMA are the singular values of A. The columns of U and V are the
+ left and the right singular vectors of A, respectively.
+ DGESVJ can sometimes compute tiny singular values and their singular
+ vectors much more accurately than other SVD routines,
+ see below under Further Details.
+
+Parameters:
+
+ JOBA
+ JOBA is CHARACTER* 1
+ Specifies the structure of A.
+ = 'L': The input matrix A is lower triangular;
+ = 'U': The input matrix A is upper triangular;
+ = 'G': The input matrix A is general MbyN matrix, M >= N.
+
+ JOBU
+ JOBU is CHARACTER*1
+ Specifies whether to compute the left singular vectors
+ (columns of U):
+ = 'U': The left singular vectors corresponding to the nonzero
+ singular values are computed and returned in the leading
+ columns of A. See more details in the description of A.
+ The default numerical orthogonality threshold is set to
+ approximately TOL=CTOL*EPS, CTOL=DSQRT(M), EPS=DLAMCH('E').
+ = 'C': Analogous to JOBU='U', except that user can control the
+ level of numerical orthogonality of the computed left
+ singular vectors. TOL can be set to TOL = CTOL*EPS, where
+ CTOL is given on input in the array WORK.
+ No CTOL smaller than ONE is allowed. CTOL greater
+ than 1 / EPS is meaningless. The option 'C'
+ can be used if M*EPS is satisfactory orthogonality
+ of the computed left singular vectors, so CTOL=M could
+ save few sweeps of Jacobi rotations.
+ See the descriptions of A and WORK(1).
+ = 'N': The matrix U is not computed. However, see the description of A.
+
+ JOBV
+ JOBV is CHARACTER*1
+ Specifies whether to compute the right singular vectors, that
+ is, the matrix V:
+ = 'V' : the matrix V is computed and returned in the array V
+ = 'A' : the Jacobi rotations are applied to the MVbyN
+ array V. In other words, the right singular vector
+ matrix V is not computed explicitly, instead it is
+ applied to an MVbyN matrix initially stored in the first MV rows of V.
+ = 'N' : the matrix V is not computed and the array V is not referenced
+
+ M
+ M is INTEGER
+ The number of rows of the input matrix A. 1/DLAMCH('E') > M >= 0.
+
+ N
+ N is INTEGER
+ The number of columns of the input matrix A.
+ M >= N >= 0.
+
+ A
+ A is DOUBLE PRECISION array, dimension (LDA,N)
+ On entry, the MbyN matrix A.
+ On exit :
+ If JOBU .EQ. 'U' .OR. JOBU .EQ. 'C' :
+ If INFO .EQ. 0 :
+ RANKA orthonormal columns of U are returned in the
+ leading RANKA columns of the array A. Here RANKA <= N
+ is the number of computed singular values of A that are
+ above the underflow threshold DLAMCH('S'). The singular
+ vectors corresponding to underflowed or zero singular
+ values are not computed. The value of RANKA is returned
+ in the array WORK as RANKA=NINT(WORK(2)). Also see the
+ descriptions of SVA and WORK. The computed columns of U
+ are mutually numerically orthogonal up to approximately
+ TOL=DSQRT(M)*EPS (default); or TOL=CTOL*EPS (JOBU.EQ.'C'),
+ see the description of JOBU.
+ If INFO .GT. 0 :
+ the procedure DGESVJ did not converge in the given number
+ of iterations (sweeps). In that case, the computed
+ columns of U may not be orthogonal up to TOL. The output
+ U (stored in A), SIGMA (given by the computed singular
+ values in SVA(1:N)) and V is still a decomposition of the
+ input matrix A in the sense that the residual
+ ASCALE*U*SIGMA*V^T_2 / A_2 is small.
+
+ If JOBU .EQ. 'N' :
+ If INFO .EQ. 0 :
+ Note that the left singular vectors are 'for free' in the
+ onesided Jacobi SVD algorithm. However, if only the
+ singular values are needed, the level of numerical
+ orthogonality of U is not an issue and iterations are
+ stopped when the columns of the iterated matrix are
+ numerically orthogonal up to approximately M*EPS. Thus,
+ on exit, A contains the columns of U scaled with the
+ corresponding singular values.
+ If INFO .GT. 0 :
+ the procedure DGESVJ did not converge in the given number
+ of iterations (sweeps).
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+
+ SVA
+ SVA is DOUBLE PRECISION array, dimension (N)
+ On exit :
+ If INFO .EQ. 0 :
+ depending on the value SCALE = WORK(1), we have:
+ If SCALE .EQ. ONE :
+ SVA(1:N) contains the computed singular values of A.
+ During the computation SVA contains the Euclidean column
+ norms of the iterated matrices in the array A.
+ If SCALE .NE. ONE :
+ The singular values of A are SCALE*SVA(1:N), and this
+ factored representation is due to the fact that some of the
+ singular values of A might underflow or overflow.
+ If INFO .GT. 0 :
+ the procedure DGESVJ did not converge in the given number of
+ iterations (sweeps) and SCALE*SVA(1:N) may not be accurate.
+
+ MV
+ MV is INTEGER
+ If JOBV .EQ. 'A', then the product of Jacobi rotations in DGESVJ
+ is applied to the first MV rows of V. See the description of JOBV.
+
+ V
+ V is DOUBLE PRECISION array, dimension (LDV,N)
+ If JOBV = 'V', then V contains on exit the NbyN matrix of
+ the right singular vectors;
+ If JOBV = 'A', then V contains the product of the computed right
+ singular vector matrix and the initial matrix in
+ the array V.
+ If JOBV = 'N', then V is not referenced.
+
+ LDV
+ LDV is INTEGER
+ The leading dimension of the array V, LDV .GE. 1.
+ If JOBV .EQ. 'V', then LDV .GE. max(1,N).
+ If JOBV .EQ. 'A', then LDV .GE. max(1,MV) .
+
+ WORK
+ WORK is DOUBLE PRECISION array, dimension max(4,M+N).
+ On entry :
+ If JOBU .EQ. 'C' :
+ WORK(1) = CTOL, where CTOL defines the threshold for convergence.
+ The process stops if all columns of A are mutually
+ orthogonal up to CTOL*EPS, EPS=DLAMCH('E').
+ It is required that CTOL >= ONE, i.e. it is not
+ allowed to force the routine to obtain orthogonality below EPS.
+ On exit :
+ WORK(1) = SCALE is the scaling factor such that SCALE*SVA(1:N)
+ are the computed singular values of A.
+ (See description of SVA().)
+ WORK(2) = NINT(WORK(2)) is the number of the computed nonzero
+ singular values.
+ WORK(3) = NINT(WORK(3)) is the number of the computed singular
+ values that are larger than the underflow threshold.
+ WORK(4) = NINT(WORK(4)) is the number of sweeps of Jacobi
+ rotations needed for numerical convergence.
+ WORK(5) = max_{i.NE.j} COS(A(:,i),A(:,j)) in the last sweep.
+ This is useful information in cases when DGESVJ did
+ not converge, as it can be used to estimate whether
+ the output is stil useful and for post festum analysis.
+ WORK(6) = the largest absolute value over all sines of the
+ Jacobi rotation angles in the last sweep. It can be
+ useful for a post festum analysis.
+
+ LWORK
+ LWORK is INTEGER
+ length of WORK, WORK >= MAX(6,M+N)
+
+ INFO
+ INFO is INTEGER
+ = 0 : successful exit.
+ < 0 : if INFO = i, then the ith argument had an illegal value
+ > 0 : DGESVJ did not converge in the maximal allowed number (30)
+ of sweeps. The output may still be useful. See the
+ description of WORK.
+
+Further Details:
+ The orthogonal NbyN matrix V is obtained as a product of Jacobi plane
+ rotations. The rotations are implemented as fast scaled rotations of
+ Anda and Park [1]. In the case of underflow of the Jacobi angle, a
+ modified Jacobi transformation of Drmac [4] is used. Pivot strategy uses
+ column interchanges of de Rijk [2]. The relative accuracy of the computed
+ singular values and the accuracy of the computed singular vectors (in
+ angle metric) is as guaranteed by the theory of Demmel and Veselic [3].
+ The condition number that determines the accuracy in the full rank case
+ is essentially min_{D=diag} kappa(A*D), where kappa(.) is the
+ spectral condition number. The best performance of this Jacobi SVD
+ procedure is achieved if used in an accelerated version of Drmac and
+ Veselic [5,6], and it is the kernel routine in the SIGMA library [7].
+ Some tunning parameters (marked with [TP]) are available for the
+ implementer.
+ The computational range for the nonzero singular values is the machine
+ number interval ( UNDERFLOW , OVERFLOW ). In extreme cases, even
+ denormalized singular values can be computed with the corresponding
+ gradual loss of accurate digits.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{dgesvj.f}
+\index{dgesvj.f}
+\begin{chunk}{dgesvj.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK dgesvj}
+
+\end{chunk}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{dgetf2}
+\label{dgetf2}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{dgetf2.input}
+)set break resume
+)sys rm f dgetf2.output
+)spool dgetf2.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{dgetf2.help}
+====================================================================
+dgetf2 examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine dgetf2 (M, N, A, LDA, IPIV, INFO)
+ DGETF2 computes the LU factorization of a general mbyn matrix
+ using partial pivoting with row interchanges (unblocked algorithm).
+
+Function/Subroutine Documentation
+ subroutine dgetf2 (integer M, integer N, double precision, dimension( lda,
+ * ) A, integer LDA, integer, dimension( * ) IPIV, integer INFO)
+ DGETF2 computes the LU factorization of a general mbyn matrix using
+ partial pivoting with row interchanges (unblocked algorithm).
+
+Purpose:
+ DGETF2 computes an LU factorization of a general mbyn matrix A
+ using partial pivoting with row interchanges.
+
+ The factorization has the form
+ A = P * L * U
+ where P is a permutation matrix, L is lower triangular with unit
+ diagonal elements (lower trapezoidal if m > n), and U is upper
+ triangular (upper trapezoidal if m < n).
+
+ This is the rightlooking Level 2 BLAS version of the algorithm.
+
+Parameters:
+
+ M
+ M is INTEGER
+ The number of rows of the matrix A. M >= 0.
+
+ N
+ N is INTEGER
+ The number of columns of the matrix A. N >= 0.
+
+ A
+ A is DOUBLE PRECISION array, dimension (LDA,N)
+ On entry, the m by n matrix to be factored.
+ On exit, the factors L and U from the factorization
+ A = P*L*U; the unit diagonal elements of L are not stored.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+
+ IPIV
+ IPIV is INTEGER array, dimension (min(M,N))
+ The pivot indices; for 1 <= i <= min(M,N), row i of the
+ matrix was interchanged with row IPIV(i).
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = k, the kth argument had an illegal value
+ > 0: if INFO = k, U(k,k) is exactly zero. The factorization
+ has been completed, but the factor U is exactly
+ singular, and division by zero will occur if it is used
+ to solve a system of equations.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{dgetf2.f}
+\index{dgetf2.f}
+\begin{chunk}{dgetf2.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK dgetf2}
+
+\end{chunk}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{dgetrf}
+\label{dgetrf}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{dgetrf.input}
+)set break resume
+)sys rm f dgetrf.output
+)spool dgetrf.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{dgetrf.help}
+====================================================================
+dgetrf examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine dgetrf (M, N, A, LDA, IPIV, INFO)
+ DGETRF
+
+Function/Subroutine Documentation
+ subroutine dgetrf (integer M, integer N, double precision, dimension( lda,
+ * ) A, integer LDA, integer, dimension( * ) IPIV, integer INFO)
+ DGETRF
+
+Purpose:
+ DGETRF computes an LU factorization of a general MbyN matrix A
+ using partial pivoting with row interchanges.
+
+ The factorization has the form
+ A = P * L * U
+ where P is a permutation matrix, L is lower triangular with unit
+ diagonal elements (lower trapezoidal if m > n), and U is upper
+ triangular (upper trapezoidal if m < n).
+
+ This is the rightlooking Level 3 BLAS version of the algorithm.
+
+Parameters:
+
+ M
+ M is INTEGER
+ The number of rows of the matrix A. M >= 0.
+
+ N
+ N is INTEGER
+ The number of columns of the matrix A. N >= 0.
+
+ A
+ A is DOUBLE PRECISION array, dimension (LDA,N)
+ On entry, the MbyN matrix to be factored.
+ On exit, the factors L and U from the factorization
+ A = P*L*U; the unit diagonal elements of L are not stored.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+
+ IPIV
+ IPIV is INTEGER array, dimension (min(M,N))
+ The pivot indices; for 1 <= i <= min(M,N), row i of the
+ matrix was interchanged with row IPIV(i).
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value
+ > 0: if INFO = i, U(i,i) is exactly zero. The factorization
+ has been completed, but the factor U is exactly
+ singular, and division by zero will occur if it is used
+ to solve a system of equations.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{dgetrf.f}
+\index{dgetrf.f}
+\begin{chunk}{dgetrf.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK dgetrf}
+
+\end{chunk}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{dgetrf2}
+\label{dgetrf2}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{dgetrf2.input}
+)set break resume
+)sys rm f dgetrf2.output
+)spool dgetrf2.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{dgetrf2.help}
+====================================================================
+dgetrf2 examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ recursive subroutine dgetrf2 (M, N, A, LDA, IPIV, INFO)
+ DGETRF2
+
+Function/Subroutine Documentation
+ recursive subroutine dgetrf2 (integer M, integer N, double precision,
+ dimension( lda, * ) A, integer LDA, integer, dimension( * ) IPIV,
+ integer INFO)
+ DGETRF2
+
+Purpose:
+ DGETRF2 computes an LU factorization of a general MbyN matrix A
+ using partial pivoting with row interchanges.
+
+ The factorization has the form
+ A = P * L * U
+ where P is a permutation matrix, L is lower triangular with unit
+ diagonal elements (lower trapezoidal if m > n), and U is upper
+ triangular (upper trapezoidal if m < n).
+
+ This is the recursive version of the algorithm. It divides
+ the matrix into four submatrices:
+
+ [ A11  A12 ] where A11 is n1 by n1 and A22 is n2 by n2
+ A = [  ] with n1 = min(m,n)
+ [ A21  A22 ] n2 = nn1
+
+ [ A11 ]
+ The subroutine calls itself to factor [  ],
+ [ A12 ]
+ [ A12 ]
+ do the swaps on [  ], solve A12, update A22,
+ [ A22 ]
+
+ then calls itself to factor A22 and do the swaps on A21.
+
+Parameters:
+
+ M
+ M is INTEGER
+ The number of rows of the matrix A. M >= 0.
+
+ N
+ N is INTEGER
+ The number of columns of the matrix A. N >= 0.
+
+ A
+ A is DOUBLE PRECISION array, dimension (LDA,N)
+ On entry, the MbyN matrix to be factored.
+ On exit, the factors L and U from the factorization
+ A = P*L*U; the unit diagonal elements of L are not stored.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+
+ IPIV
+ IPIV is INTEGER array, dimension (min(M,N))
+ The pivot indices; for 1 <= i <= min(M,N), row i of the
+ matrix was interchanged with row IPIV(i).
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value
+ > 0: if INFO = i, U(i,i) is exactly zero. The factorization
+ has been completed, but the factor U is exactly
+ singular, and division by zero will occur if it is used
+ to solve a system of equations.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{dgetrf2.f}
+\index{dgetrf2.f}
+\begin{chunk}{dgetrf2.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK dgetrf2}
+
+\end{chunk}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{dgetri}
+\label{dgetri}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{dgetri.input}
+)set break resume
+)sys rm f dgetri.output
+)spool dgetri.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{dgetri.help}
+====================================================================
+dgetri examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine dgetri (N, A, LDA, IPIV, WORK, LWORK, INFO)
+ DGETRI
+
+Function/Subroutine Documentation
+ subroutine dgetri (integer N, double precision, dimension( lda, * ) A,
+ integer LDA, integer, dimension( * ) IPIV, double precision, dimension(
+ * ) WORK, integer LWORK, integer INFO)
+ DGETRI
+
+Purpose:
+ DGETRI computes the inverse of a matrix using the LU factorization
+ computed by DGETRF.
+
+ This method inverts U and then computes inv(A) by solving the system
+ inv(A)*L = inv(U) for inv(A).
+
+Parameters:
+
+ N
+ N is INTEGER
+ The order of the matrix A. N >= 0.
+
+ A
+ A is DOUBLE PRECISION array, dimension (LDA,N)
+ On entry, the factors L and U from the factorization
+ A = P*L*U as computed by DGETRF.
+ On exit, if INFO = 0, the inverse of the original matrix A.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,N).
+
+ IPIV
+ IPIV is INTEGER array, dimension (N)
+ The pivot indices from DGETRF; for 1<=i<=N, row i of the
+ matrix was interchanged with row IPIV(i).
+
+ WORK
+ WORK is DOUBLE PRECISION array, dimension (MAX(1,LWORK))
+ On exit, if INFO=0, then WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK. LWORK >= max(1,N).
+ For optimal performance LWORK >= N*NB, where NB is
+ the optimal blocksize returned by ILAENV.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value
+ > 0: if INFO = i, U(i,i) is exactly zero; the matrix is
+ singular and its inverse could not be computed.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{dgetri.f}
+\index{dgetri.f}
+\begin{chunk}{dgetri.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK dgetri}
+
+\end{chunk}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{dgetrs}
+\label{dgetrs}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{dgetrs.input}
+)set break resume
+)sys rm f dgetrs.output
+)spool dgetrs.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{dgetrs.help}
+====================================================================
+dgetrs examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine dgetrs (TRANS, N, NRHS, A, LDA, IPIV, B, LDB, INFO)
+ DGETRS
+
+Function/Subroutine Documentation
+ subroutine dgetrs (character TRANS, integer N, integer NRHS, double
+ precision, dimension( lda, * ) A, integer LDA, integer, dimension( * )
+ IPIV, double precision, dimension( ldb, * ) B, integer LDB, integer
+ INFO)
+ DGETRS
+
+Purpose:
+ DGETRS solves a system of linear equations
+ A * X = B or A**T * X = B
+ with a general NbyN matrix A using the LU factorization computed
+ by DGETRF.
+
+Parameters:
+
+ TRANS
+ TRANS is CHARACTER*1
+ Specifies the form of the system of equations:
+ = 'N': A * X = B (No transpose)
+ = 'T': A**T* X = B (Transpose)
+ = 'C': A**T* X = B (Conjugate transpose = Transpose)
+
+ N
+ N is INTEGER
+ The order of the matrix A. N >= 0.
+
+ NRHS
+ NRHS is INTEGER
+ The number of right hand sides, i.e., the number of columns
+ of the matrix B. NRHS >= 0.
+
+ A
+ A is DOUBLE PRECISION array, dimension (LDA,N)
+ The factors L and U from the factorization A = P*L*U
+ as computed by DGETRF.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,N).
+
+ IPIV
+ IPIV is INTEGER array, dimension (N)
+ The pivot indices from DGETRF; for 1<=i<=N, row i of the
+ matrix was interchanged with row IPIV(i).
+
+ B
+ B is DOUBLE PRECISION array, dimension (LDB,NRHS)
+ On entry, the right hand side matrix B.
+ On exit, the solution matrix X.
+
+ LDB
+ LDB is INTEGER
+ The leading dimension of the array B. LDB >= max(1,N).
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{dgetrs.f}
+\index{dgetrs.f}
+\begin{chunk}{dgetrs.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK dgetrs}
+
+\end{chunk}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{dhgeqz}
+\label{dhgeqz}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{dhgeqz.input}
+)set break resume
+)sys rm f dhgeqz.output
+)spool dhgeqz.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page \cite{Mole71}}
+\begin{chunk}{dhgeqz.help}
+====================================================================
+dhgeqz examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine dhgeqz (JOB, COMPQ, COMPZ, N, ILO, IHI, H, LDH, T, LDT,
+ ALPHAR, ALPHAI, BETA, Q, LDQ, Z, LDZ, WORK, LWORK, INFO)
+ DHGEQZ
+
+Function/Subroutine Documentation
+ subroutine dhgeqz (character JOB, character COMPQ, character COMPZ, integer
+ N, integer ILO, integer IHI, double precision, dimension( ldh, * ) H,
+ integer LDH, double precision, dimension( ldt, * ) T, integer LDT,
+ double precision, dimension( * ) ALPHAR, double precision, dimension( *
+ ) ALPHAI, double precision, dimension( * ) BETA, double precision,
+ dimension( ldq, * ) Q, integer LDQ, double precision, dimension( ldz, *
+ ) Z, integer LDZ, double precision, dimension( * ) WORK, integer LWORK,
+ integer INFO)
+ DHGEQZ
+
+Purpose:
+ DHGEQZ computes the eigenvalues of a real matrix pair (H,T),
+ where H is an upper Hessenberg matrix and T is upper triangular,
+ using the doubleshift QZ method.
+ Matrix pairs of this type are produced by the reduction to
+ generalized upper Hessenberg form of a real matrix pair (A,B):
+
+ A = Q1*H*Z1**T, B = Q1*T*Z1**T,
+
+ as computed by DGGHRD.
+
+ If JOB='S', then the Hessenbergtriangular pair (H,T) is
+ also reduced to generalized Schur form,
+
+ H = Q*S*Z**T, T = Q*P*Z**T,
+
+ where Q and Z are orthogonal matrices, P is an upper triangular
+ matrix, and S is a quasitriangular matrix with 1by1 and 2by2
+ diagonal blocks.
+
+ The 1by1 blocks correspond to real eigenvalues of the matrix pair
+ (H,T) and the 2by2 blocks correspond to complex conjugate pairs of
+ eigenvalues.
+
+ Additionally, the 2by2 upper triangular diagonal blocks of P
+ corresponding to 2by2 blocks of S are reduced to positive diagonal
+ form, i.e., if S(j+1,j) is nonzero, then P(j+1,j) = P(j,j+1) = 0,
+ P(j,j) > 0, and P(j+1,j+1) > 0.
+
+ Optionally, the orthogonal matrix Q from the generalized Schur
+ factorization may be postmultiplied into an input matrix Q1, and the
+ orthogonal matrix Z may be postmultiplied into an input matrix Z1.
+ If Q1 and Z1 are the orthogonal matrices from DGGHRD that reduced
+ the matrix pair (A,B) to generalized upper Hessenberg form, then the
+ output matrices Q1*Q and Z1*Z are the orthogonal factors from the
+ generalized Schur factorization of (A,B):
+
+ A = (Q1*Q)*S*(Z1*Z)**T, B = (Q1*Q)*P*(Z1*Z)**T.
+
+ To avoid overflow, eigenvalues of the matrix pair (H,T) (equivalently,
+ of (A,B)) are computed as a pair of values (alpha,beta), where alpha is
+ complex and beta real.
+ If beta is nonzero, lambda = alpha / beta is an eigenvalue of the
+ generalized nonsymmetric eigenvalue problem (GNEP)
+ A*x = lambda*B*x
+ and if alpha is nonzero, mu = beta / alpha is an eigenvalue of the
+ alternate form of the GNEP
+ mu*A*y = B*y.
+ Real eigenvalues can be read directly from the generalized Schur
+ form:
+ alpha = S(i,i), beta = P(i,i).
+
+Parameters:
+
+ JOB
+ JOB is CHARACTER*1
+ = 'E': Compute eigenvalues only;
+ = 'S': Compute eigenvalues and the Schur form.
+
+ COMPQ
+ COMPQ is CHARACTER*1
+ = 'N': Left Schur vectors (Q) are not computed;
+ = 'I': Q is initialized to the unit matrix and the matrix Q
+ of left Schur vectors of (H,T) is returned;
+ = 'V': Q must contain an orthogonal matrix Q1 on entry and
+ the product Q1*Q is returned.
+
+ COMPZ
+ COMPZ is CHARACTER*1
+ = 'N': Right Schur vectors (Z) are not computed;
+ = 'I': Z is initialized to the unit matrix and the matrix Z
+ of right Schur vectors of (H,T) is returned;
+ = 'V': Z must contain an orthogonal matrix Z1 on entry and
+ the product Z1*Z is returned.
+
+ N
+ N is INTEGER
+ The order of the matrices H, T, Q, and Z. N >= 0.
+
+ ILO
+ ILO is INTEGER
+
+ IHI
+ IHI is INTEGER
+ ILO and IHI mark the rows and columns of H which are in
+ Hessenberg form. It is assumed that A is already upper
+ triangular in rows and columns 1:ILO1 and IHI+1:N.
+ If N > 0, 1 <= ILO <= IHI <= N; if N = 0, ILO=1 and IHI=0.
+
+ H
+ H is DOUBLE PRECISION array, dimension (LDH, N)
+ On entry, the NbyN upper Hessenberg matrix H.
+ On exit, if JOB = 'S', H contains the upper quasitriangular
+ matrix S from the generalized Schur factorization.
+ If JOB = 'E', the diagonal blocks of H match those of S, but
+ the rest of H is unspecified.
+
+ LDH
+ LDH is INTEGER
+ The leading dimension of the array H. LDH >= max( 1, N ).
+
+ T
+ T is DOUBLE PRECISION array, dimension (LDT, N)
+ On entry, the NbyN upper triangular matrix T.
+ On exit, if JOB = 'S', T contains the upper triangular
+ matrix P from the generalized Schur factorization;
+ 2by2 diagonal blocks of P corresponding to 2by2 blocks of S
+ are reduced to positive diagonal form, i.e., if H(j+1,j) is
+ nonzero, then T(j+1,j) = T(j,j+1) = 0, T(j,j) > 0, and
+ T(j+1,j+1) > 0.
+ If JOB = 'E', the diagonal blocks of T match those of P, but
+ the rest of T is unspecified.
+
+ LDT
+ LDT is INTEGER
+ The leading dimension of the array T. LDT >= max( 1, N ).
+
+ ALPHAR
+ ALPHAR is DOUBLE PRECISION array, dimension (N)
+ The real parts of each scalar alpha defining an eigenvalue of GNEP.
+
+ ALPHAI
+ ALPHAI is DOUBLE PRECISION array, dimension (N)
+ The imaginary parts of each scalar alpha defining an
+ eigenvalue of GNEP.
+ If ALPHAI(j) is zero, then the jth eigenvalue is real; if
+ positive, then the jth and (j+1)st eigenvalues are a
+ complex conjugate pair, with ALPHAI(j+1) = ALPHAI(j).
+
+ BETA
+ BETA is DOUBLE PRECISION array, dimension (N)
+ The scalars beta that define the eigenvalues of GNEP.
+ Together, the quantities alpha = (ALPHAR(j),ALPHAI(j)) and
+ beta = BETA(j) represent the jth eigenvalue of the matrix
+ pair (A,B), in one of the forms lambda = alpha/beta or
+ mu = beta/alpha. Since either lambda or mu may overflow,
+ they should not, in general, be computed.
+
+ Q
+ Q is DOUBLE PRECISION array, dimension (LDQ, N)
+ On entry, if COMPZ = 'V', the orthogonal matrix Q1 used in
+ the reduction of (A,B) to generalized Hessenberg form.
+ On exit, if COMPZ = 'I', the orthogonal matrix of left Schur
+ vectors of (H,T), and if COMPZ = 'V', the orthogonal matrix
+ of left Schur vectors of (A,B).
+ Not referenced if COMPZ = 'N'.
+
+ LDQ
+ LDQ is INTEGER
+ The leading dimension of the array Q. LDQ >= 1.
+ If COMPQ='V' or 'I', then LDQ >= N.
+
+ Z
+ Z is DOUBLE PRECISION array, dimension (LDZ, N)
+ On entry, if COMPZ = 'V', the orthogonal matrix Z1 used in
+ the reduction of (A,B) to generalized Hessenberg form.
+ On exit, if COMPZ = 'I', the orthogonal matrix of
+ right Schur vectors of (H,T), and if COMPZ = 'V', the
+ orthogonal matrix of right Schur vectors of (A,B).
+ Not referenced if COMPZ = 'N'.
+
+ LDZ
+ LDZ is INTEGER
+ The leading dimension of the array Z. LDZ >= 1.
+ If COMPZ='V' or 'I', then LDZ >= N.
+
+ WORK
+ WORK is DOUBLE PRECISION array, dimension (MAX(1,LWORK))
+ On exit, if INFO >= 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK. LWORK >= max(1,N).
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value
+ = 1,...,N: the QZ iteration did not converge. (H,T) is not
+ in Schur form, but ALPHAR(i), ALPHAI(i), and
+ BETA(i), i=INFO+1,...,N should be correct.
+ = N+1,...,2*N: the shift calculation failed. (H,T) is not
+ in Schur form, but ALPHAR(i), ALPHAI(i), and
+ BETA(i), i=INFON+1,...,N should be correct.
+
+Further Details:
+
+ Iteration counters:
+
+ JITER  counts iterations.
+ IITER  counts iterations run since ILAST was last
+ changed. This is therefore reset only when a 1by1 or
+ 2by2 block deflates off the bottom.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{dhgeqz.f}
+\index{dhgeqz.f}
+\begin{chunk}{dhgeqz.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK dhgeqz}
+
+\end{chunk}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{dla\uscore{}geamv}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{dla\uscore{}geamv.input}
+)set break resume
+)sys rm f dlageamv.output
+)spool dlageamv.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{dla\uscore{}geamv.help}
+====================================================================
+dla_geamv examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine dla_geamv (TRANS, M, N, ALPHA, A, LDA, X, INCX, BETA, Y,
+ INCY)
+ DLA_GEAMV computes a matrixvector product using a general matrix
+ to calculate error bounds.
+
+Function/Subroutine Documentation
+ subroutine dla_geamv (integer TRANS, integer M, integer N, double precision
+ ALPHA, double precision, dimension( lda, * ) A, integer LDA, double
+ precision, dimension( * ) X, integer INCX, double precision BETA,
+ double precision, dimension( * ) Y, integer INCY)
+ DLA_GEAMV computes a matrixvector product using a general matrix to
+ calculate error bounds.
+
+Purpose:
+ DLA_GEAMV performs one of the matrixvector operations
+
+ y := alpha*abs(A)*abs(x) + beta*abs(y),
+ or y := alpha*abs(A)**T*abs(x) + beta*abs(y),
+
+ where alpha and beta are scalars, x and y are vectors and A is an
+ m by n matrix.
+
+ This function is primarily used in calculating error bounds.
+ To protect against underflow during evaluation, components in
+ the resulting vector are perturbed away from zero by (N+1)
+ times the underflow threshold. To prevent unnecessarily large
+ errors for blockstructure embedded in general matrices,
+ "symbolically" zero components are not perturbed. A zero
+ entry is considered "symbolic" if all multiplications involved
+ in computing that entry have at least one zero multiplicand.
+
+Parameters:
+
+ TRANS
+ TRANS is INTEGER
+ On entry, TRANS specifies the operation to be performed as
+ follows:
+
+ BLAS_NO_TRANS y := alpha*abs(A)*abs(x) + beta*abs(y)
+ BLAS_TRANS y := alpha*abs(A**T)*abs(x) + beta*abs(y)
+ BLAS_CONJ_TRANS y := alpha*abs(A**T)*abs(x) + beta*abs(y)
+
+ Unchanged on exit.
+
+ M
+ M is INTEGER
+ On entry, M specifies the number of rows of the matrix A.
+ M must be at least zero.
+ Unchanged on exit.
+
+ N
+ N is INTEGER
+ On entry, N specifies the number of columns of the matrix A.
+ N must be at least zero.
+ Unchanged on exit.
+
+ ALPHA
+ ALPHA is DOUBLE PRECISION
+ On entry, ALPHA specifies the scalar alpha.
+ Unchanged on exit.
+
+ A
+ A is DOUBLE PRECISION array of DIMENSION ( LDA, n )
+ Before entry, the leading m by n part of the array A must
+ contain the matrix of coefficients.
+ Unchanged on exit.
+
+ LDA
+ LDA is INTEGER
+ On entry, LDA specifies the first dimension of A as declared
+ in the calling (sub) program. LDA must be at least
+ max( 1, m ).
+ Unchanged on exit.
+
+ X
+ X is DOUBLE PRECISION array, dimension
+ ( 1 + ( n  1 )*abs( INCX ) ) when TRANS = 'N' or 'n'
+ and at least
+ ( 1 + ( m  1 )*abs( INCX ) ) otherwise.
+ Before entry, the incremented array X must contain the
+ vector x.
+ Unchanged on exit.
+
+ INCX
+ INCX is INTEGER
+ On entry, INCX specifies the increment for the elements of
+ X. INCX must not be zero.
+ Unchanged on exit.
+
+ BETA
+ BETA is DOUBLE PRECISION
+ On entry, BETA specifies the scalar beta. When BETA is
+ supplied as zero then Y need not be set on input.
+ Unchanged on exit.
+
+ Y
+ Y is DOUBLE PRECISION
+ Array of DIMENSION at least
+ ( 1 + ( m  1 )*abs( INCY ) ) when TRANS = 'N' or 'n'
+ and at least
+ ( 1 + ( n  1 )*abs( INCY ) ) otherwise.
+ Before entry with BETA nonzero, the incremented array Y
+ must contain the vector y. On exit, Y is overwritten by the
+ updated vector y.
+
+ INCY
+ INCY is INTEGER
+ On entry, INCY specifies the increment for the elements of
+ Y. INCY must not be zero.
+ Unchanged on exit.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{dlageamv.f}
+\index{dla\uscore{}geamv.f}
+\begin{chunk}{dla\uscore{}geamv.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK dla\uscore{}geamv}
+
+\end{chunk}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{dla\_gercond}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{dlagercond.input}
+)set break resume
+)sys rm f dlagercond.output
+)spool dlagercond.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{dla\_gercond.help}
+====================================================================
+dla_gercond examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ double precision function dla_gercond (TRANS, N, A, LDA, AF, LDAF,
+ IPIV, CMODE, C, INFO, WORK, IWORK)
+ DLA_GERCOND estimates the Skeel condition number for a general
+ matrix.
+
+Function/Subroutine Documentation
+ double precision function dla_gercond (character TRANS, integer N, double
+ precision, dimension( lda, * ) A, integer LDA, double precision,
+ dimension( ldaf, * ) AF, integer LDAF, integer, dimension( * ) IPIV,
+ integer CMODE, double precision, dimension( * ) C, integer INFO, double
+ precision, dimension( * ) WORK, integer, dimension( * ) IWORK)
+ DLA_GERCOND estimates the Skeel condition number for a general matrix.
+
+Purpose:
+ DLA_GERCOND estimates the Skeel condition number of op(A) * op2(C)
+ where op2 is determined by CMODE as follows
+ CMODE = 1 op2(C) = C
+ CMODE = 0 op2(C) = I
+ CMODE = 1 op2(C) = inv(C)
+ The Skeel condition number cond(A) = norminf( inv(A)A )
+ is computed by computing scaling factors R such that
+ diag(R)*A*op2(C) is row equilibrated and computing the standard
+ infinitynorm condition number.
+
+Parameters:
+
+ TRANS
+ TRANS is CHARACTER*1
+ Specifies the form of the system of equations:
+ = 'N': A * X = B (No transpose)
+ = 'T': A**T * X = B (Transpose)
+ = 'C': A**H * X = B (Conjugate Transpose = Transpose)
+
+ N
+ N is INTEGER
+ The number of linear equations, i.e., the order of the
+ matrix A. N >= 0.
+
+ A
+ A is DOUBLE PRECISION array, dimension (LDA,N)
+ On entry, the NbyN matrix A.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,N).
+
+ AF
+ AF is DOUBLE PRECISION array, dimension (LDAF,N)
+ The factors L and U from the factorization
+ A = P*L*U as computed by DGETRF.
+
+ LDAF
+ LDAF is INTEGER
+ The leading dimension of the array AF. LDAF >= max(1,N).
+
+ IPIV
+ IPIV is INTEGER array, dimension (N)
+ The pivot indices from the factorization A = P*L*U
+ as computed by DGETRF; row i of the matrix was interchanged
+ with row IPIV(i).
+
+ CMODE
+ CMODE is INTEGER
+ Determines op2(C) in the formula op(A) * op2(C) as follows:
+ CMODE = 1 op2(C) = C
+ CMODE = 0 op2(C) = I
+ CMODE = 1 op2(C) = inv(C)
+
+ C
+ C is DOUBLE PRECISION array, dimension (N)
+ The vector C in the formula op(A) * op2(C).
+
+ INFO
+ INFO is INTEGER
+ = 0: Successful exit.
+ i > 0: The ith argument is invalid.
+
+ WORK
+ WORK is DOUBLE PRECISION array, dimension (3*N).
+ Workspace.
+
+ IWORK
+ IWORK is INTEGER array, dimension (N).
+ Workspace.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{dlagercond.f}
+\index{dla\_gercond.f}
+\begin{chunk}{dla\_gercond.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK dla\_gercond}
+
+\end{chunk}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{dla\_gerfsx\_extended}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{dlagerfsxextended.input}
+)set break resume
+)sys rm f dlagerfsxextended.output
+)spool dlagerfsxextended.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page \cite{Demm05}}
+\begin{chunk}{dla\_gerfsx\_extended.help}
+====================================================================
+dla_gerfsx_extended examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine dla_gerfsx_extended (PREC_TYPE, TRANS_TYPE, N, NRHS, A, LDA,
+ AF, LDAF, IPIV, COLEQU, C, B, LDB, Y, LDY, BERR_OUT, N_NORMS,
+ ERRS_N, ERRS_C, RES, AYB, DY, Y_TAIL, RCOND, ITHRESH, RTHRESH,
+ DZ_UB, IGNORE_CWISE, INFO)
+ DLA_GERFSX_EXTENDED improves the computed solution to a system of
+ linear equations for general matrices by performing extraprecise
+ iterative refinement and provides error bounds and backward error
+ estimates for the solution.
+
+Function/Subroutine Documentation
+ subroutine dla_gerfsx_extended (integer PREC_TYPE, integer TRANS_TYPE,
+ integer N, integer NRHS, double precision, dimension( lda, * ) A,
+ integer LDA, double precision, dimension( ldaf, * ) AF, integer LDAF,
+ integer, dimension( * ) IPIV, logical COLEQU, double precision,
+ dimension( * ) C, double precision, dimension( ldb, * ) B, integer LDB,
+ double precision, dimension( ldy, * ) Y, integer LDY, double precision,
+ dimension( * ) BERR_OUT, integer N_NORMS, double precision, dimension(
+ nrhs, * ) ERRS_N, double precision, dimension( nrhs, * ) ERRS_C, double
+ precision, dimension( * ) RES, double precision, dimension( * ) AYB,
+ double precision, dimension( * ) DY, double precision, dimension( * )
+ Y_TAIL, double precision RCOND, integer ITHRESH, double precision
+ RTHRESH, double precision DZ_UB, logical IGNORE_CWISE, integer INFO)
+ DLA_GERFSX_EXTENDED improves the computed solution to a system of
+ linear equations for general matrices by performing extraprecise
+ iterative refinement and provides error bounds and backward error
+ estimates for the solution.
+
+Purpose:
+ DLA_GERFSX_EXTENDED improves the computed solution to a system of
+ linear equations by performing extraprecise iterative refinement
+ and provides error bounds and backward error estimates for the solution.
+ This subroutine is called by DGERFSX to perform iterative refinement.
+ In addition to normwise error bound, the code provides maximum
+ componentwise error bound if possible. See comments for ERRS_N
+ and ERRS_C for details of the error bounds. Note that this
+ subroutine is only resonsible for setting the second fields of
+ ERRS_N and ERRS_C.
+
+Parameters:
+
+ PREC_TYPE
+ PREC_TYPE is INTEGER
+ Specifies the intermediate precision to be used in refinement.
+ The value is defined by ILAPREC(P) where P is a CHARACTER and
+ P = 'S': Single
+ = 'D': Double
+ = 'I': Indigenous
+ = 'X', 'E': Extra
+
+ TRANS_TYPE
+ TRANS_TYPE is INTEGER
+ Specifies the transposition operation on A.
+ The value is defined by ILATRANS(T) where T is a CHARACTER and
+ T = 'N': No transpose
+ = 'T': Transpose
+ = 'C': Conjugate transpose
+
+ N
+ N is INTEGER
+ The number of linear equations, i.e., the order of the matrix A. N >= 0.
+
+ NRHS
+ NRHS is INTEGER
+ The number of righthandsides, i.e., the number of columns of the
+ matrix B.
+
+ A
+ A is DOUBLE PRECISION array, dimension (LDA,N)
+ On entry, the NbyN matrix A.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,N).
+
+ AF
+ AF is DOUBLE PRECISION array, dimension (LDAF,N)
+ The factors L and U from the factorization
+ A = P*L*U as computed by DGETRF.
+
+ LDAF
+ LDAF is INTEGER
+ The leading dimension of the array AF. LDAF >= max(1,N).
+
+ IPIV
+ IPIV is INTEGER array, dimension (N)
+ The pivot indices from the factorization A = P*L*U
+ as computed by DGETRF; row i of the matrix was interchanged
+ with row IPIV(i).
+
+ COLEQU
+ COLEQU is LOGICAL
+ If .TRUE. then column equilibration was done to A before calling
+ this routine. This is needed to compute the solution and error
+ bounds correctly.
+
+ C
+ C is DOUBLE PRECISION array, dimension (N)
+ The column scale factors for A. If COLEQU = .FALSE., C
+ is not accessed. If C is input, each element of C should be a power
+ of the radix to ensure a reliable solution and error estimates.
+ Scaling by powers of the radix does not cause rounding errors unless
+ the result underflows or overflows. Rounding errors during scaling
+ lead to refining with a matrix that is not equivalent to the
+ input matrix, producing error estimates that may not be reliable.
+
+ B
+ B is DOUBLE PRECISION array, dimension (LDB,NRHS)
+ The righthandside matrix B.
+
+ LDB
+ LDB is INTEGER
+ The leading dimension of the array B. LDB >= max(1,N).
+
+ Y
+ Y is DOUBLE PRECISION array, dimension (LDY,NRHS)
+ On entry, the solution matrix X, as computed by DGETRS.
+ On exit, the improved solution matrix Y.
+
+ LDY
+ LDY is INTEGER
+ The leading dimension of the array Y. LDY >= max(1,N).
+
+ BERR_OUT
+ BERR_OUT is DOUBLE PRECISION array, dimension (NRHS)
+ On exit, BERR_OUT(j) contains the componentwise relative backward
+ error for righthandside j from the formula
+ max(i) ( abs(RES(i)) / ( abs(op(A_s))*abs(Y) + abs(B_s) )(i) )
+ where abs(Z) is the componentwise absolute value of the matrix
+ or vector Z. This is computed by DLA_LIN_BERR.
+
+ N_NORMS
+ N_NORMS is INTEGER
+ Determines which error bounds to return (see ERRS_N and ERRS_C).
+ If N_NORMS >= 1 return normwise error bounds.
+ If N_NORMS >= 2 return componentwise error bounds.
+
+ ERRS_N
+ ERRS_N is DOUBLE PRECISION array, dimension (NRHS, N_ERR_BNDS)
+ For each righthand side, this array contains information about
+ various error bounds and condition numbers corresponding to the
+ normwise relative error, which is defined as follows:
+
+ Normwise relative error in the ith solution vector:
+ max_j (abs(XTRUE(j,i)  X(j,i)))
+ 
+ max_j abs(X(j,i))
+
+ The array is indexed by the type of error information as described
+ below. There currently are up to three pieces of information
+ returned.
+
+ The first index in ERRS_N(i,:) corresponds to the ith
+ righthand side.
+
+ The second index in ERRS_N(:,err) contains the following
+ three fields:
+ err = 1 "Trust/don't trust" boolean. Trust the answer if the
+ reciprocal condition number is less than the threshold
+ sqrt(n) * slamch('Epsilon').
+
+ err = 2 "Guaranteed" error bound: The estimated forward error,
+ almost certainly within a factor of 10 of the true error
+ so long as the next entry is greater than the threshold
+ sqrt(n) * slamch('Epsilon'). This error bound should only
+ be trusted if the previous boolean is true.
+
+ err = 3 Reciprocal condition number: Estimated normwise
+ reciprocal condition number. Compared with the threshold
+ sqrt(n) * slamch('Epsilon') to determine if the error
+ estimate is "guaranteed". These reciprocal condition
+ numbers are 1 / (norm(Z^{1},inf) * norm(Z,inf)) for some
+ appropriately scaled matrix Z.
+ Let Z = S*A, where S scales each row by a power of the
+ radix so all absolute row sums of Z are approximately 1.
+
+ This subroutine is only responsible for setting the second field above.
+ See Lapack Working Note 165 for further details and extra cautions.
+
+ ERRS_C
+ ERRS_C is DOUBLE PRECISION array, dimension (NRHS, N_ERR_BNDS)
+ For each righthand side, this array contains information about
+ various error bounds and condition numbers corresponding to the
+ componentwise relative error, which is defined as follows:
+
+ Componentwise relative error in the ith solution vector:
+ abs(XTRUE(j,i)  X(j,i))
+ max_j 
+ abs(X(j,i))
+
+ The array is indexed by the righthand side i (on which the
+ componentwise relative error depends), and the type of error
+ information as described below. There currently are up to three
+ pieces of information returned for each righthand side. If
+ componentwise accuracy is not requested (PARAMS(3) = 0.0), then
+ ERRS_C is not accessed. If N_ERR_BNDS .LT. 3, then at most
+ the first (:,N_ERR_BNDS) entries are returned.
+
+ The first index in ERRS_C(i,:) corresponds to the ith
+ righthand side.
+
+ The second index in ERRS_C(:,err) contains the following
+ three fields:
+ err = 1 "Trust/don't trust" boolean. Trust the answer if the
+ reciprocal condition number is less than the threshold
+ sqrt(n) * slamch('Epsilon').
+
+ err = 2 "Guaranteed" error bound: The estimated forward error,
+ almost certainly within a factor of 10 of the true error
+ so long as the next entry is greater than the threshold
+ sqrt(n) * slamch('Epsilon'). This error bound should only
+ be trusted if the previous boolean is true.
+
+ err = 3 Reciprocal condition number: Estimated componentwise
+ reciprocal condition number. Compared with the threshold
+ sqrt(n) * slamch('Epsilon') to determine if the error
+ estimate is "guaranteed". These reciprocal condition
+ numbers are 1 / (norm(Z^{1},inf) * norm(Z,inf)) for some
+ appropriately scaled matrix Z.
+ Let Z = S*(A*diag(x)), where x is the solution for the
+ current righthand side and S scales each row of
+ A*diag(x) by a power of the radix so all absolute row
+ sums of Z are approximately 1.
+
+ This subroutine is only responsible for setting the second field above.
+ See Lapack Working Note 165 for further details and extra cautions.
+
+ RES
+ RES is DOUBLE PRECISION array, dimension (N)
+ Workspace to hold the intermediate residual.
+
+ AYB
+ AYB is DOUBLE PRECISION array, dimension (N)
+ Workspace. This can be the same workspace passed for Y_TAIL.
+
+ DY
+ DY is DOUBLE PRECISION array, dimension (N)
+ Workspace to hold the intermediate solution.
+
+ Y_TAIL
+ Y_TAIL is DOUBLE PRECISION array, dimension (N)
+ Workspace to hold the trailing bits of the intermediate solution.
+
+ RCOND
+ RCOND is DOUBLE PRECISION
+ Reciprocal scaled condition number. This is an estimate of the
+ reciprocal Skeel condition number of the matrix A after
+ equilibration (if done). If this is less than the machine
+ precision (in particular, if it is zero), the matrix is singular
+ to working precision. Note that the error may still be small even
+ if this number is very small and the matrix appears illconditioned.
+
+ ITHRESH
+ ITHRESH is INTEGER
+ The maximum number of residual computations allowed for
+ refinement. The default is 10. For 'aggressive' set to 100 to
+ permit convergence using approximate factorizations or
+ factorizations other than LU. If the factorization uses a
+ technique other than Gaussian elimination, the guarantees in
+ ERRS_N and ERRS_C may no longer be trustworthy.
+
+ RTHRESH
+ RTHRESH is DOUBLE PRECISION
+ Determines when to stop refinement if the error estimate stops
+ decreasing. Refinement will stop when the next solution no longer
+ satisfies norm(dx_{i+1}) < RTHRESH * norm(dx_i) where norm(Z) is
+ the infinity norm of Z. RTHRESH satisfies 0 < RTHRESH <= 1. The
+ default value is 0.5. For 'aggressive' set to 0.9 to permit
+ convergence on extremely illconditioned matrices. See LAWN 165
+ for more details.
+
+ DZ_UB
+ DZ_UB is DOUBLE PRECISION
+ Determines when to start considering componentwise convergence.
+ Componentwise convergence is only considered after each component
+ of the solution Y is stable, which we definte as the relative
+ change in each component being less than DZ_UB. The default value
+ is 0.25, requiring the first bit to be stable. See LAWN 165 for
+ more details.
+
+ IGNORE_CWISE
+ IGNORE_CWISE is LOGICAL
+ If .TRUE. then ignore componentwise convergence. Default value
+ is .FALSE..
+
+ INFO
+ INFO is INTEGER
+ = 0: Successful exit.
+ < 0: if INFO = i, the ith argument to DGETRS had an illegal value
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{dlagerfsxextended.f}
+\index{dla\_gerfsx\_extended.f}
+\begin{chunk}{dla\_gerfsx\_extended.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK dla\_gerfsx\_extended}
+
+\end{chunk}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{dla\_gerpvgrw}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{dlagerpvgrw.input}
+)set break resume
+)sys rm f dlagerpvgrw.output
+)spool dlagerpvgrw.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{dla\_gerpvgrw.help}
+====================================================================
+dla_gerpvgrw examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ double precision function dla_gerpvgrw (N, NCOLS, A, LDA, AF, LDAF)
+ DLA_GERPVGRW
+
+Function/Subroutine Documentation
+ double precision function dla_gerpvgrw (integer N, integer NCOLS, double
+ precision, dimension( lda, * ) A, integer LDA, double precision,
+ dimension( ldaf, * ) AF, integer LDAF)
+ DLA_GERPVGRW
+
+Purpose:
+ DLA_GERPVGRW computes the reciprocal pivot growth factor
+ norm(A)/norm(U). The "max absolute element" norm is used. If this is
+ much less than 1, the stability of the LU factorization of the
+ (equilibrated) matrix A could be poor. This also means that the
+ solution X, estimated condition numbers, and error bounds could be
+ unreliable.
+
+Parameters:
+
+ N
+ N is INTEGER
+ The number of linear equations, i.e., the order of the matrix A. N >= 0.
+
+ NCOLS
+ NCOLS is INTEGER
+ The number of columns of the matrix A. NCOLS >= 0.
+
+ A
+ A is DOUBLE PRECISION array, dimension (LDA,N)
+ On entry, the NbyN matrix A.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,N).
+
+ AF
+ AF is DOUBLE PRECISION array, dimension (LDAF,N)
+ The factors L and U from the factorization
+ A = P*L*U as computed by DGETRF.
+
+ LDAF
+ LDAF is INTEGER
+ The leading dimension of the array AF. LDAF >= max(1,N).
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{dlagerpvgrw.f}
+\index{dla\_gerpvgrw.f}
+\begin{chunk}{dla\_gerpvgrw.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK dla\_gerpvgrw}
+
+\end{chunk}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{dtgevc}
+\label{dtgevc}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{dtgevc.input}
+)set break resume
+)sys rm f dtgevc.output
+)spool dtgevc.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{dtgevc.help}
+====================================================================
+dtgevc examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine dtgevc (SIDE, HOWMNY, SELECT, N, S, LDS, P, LDP, VL, LDVL,
+ VR, LDVR, MM, M, WORK, INFO)
+ DTGEVC
+
+Function/Subroutine Documentation
+ subroutine dtgevc (character SIDE, character HOWMNY, logical, dimension( *
+ ) SELECT, integer N, double precision, dimension( lds, * ) S, integer
+ LDS, double precision, dimension( ldp, * ) P, integer LDP, double
+ precision, dimension( ldvl, * ) VL, integer LDVL, double precision,
+ dimension( ldvr, * ) VR, integer LDVR, integer MM, integer M, double
+ precision, dimension( * ) WORK, integer INFO)
+ DTGEVC
+
+Purpose:
+ DTGEVC computes some or all of the right and/or left eigenvectors of
+ a pair of real matrices (S,P), where S is a quasitriangular matrix
+ and P is upper triangular. Matrix pairs of this type are produced by
+ the generalized Schur factorization of a matrix pair (A,B):
+
+ A = Q*S*Z**T, B = Q*P*Z**T
+
+ as computed by DGGHRD + DHGEQZ.
+
+ The right eigenvector x and the left eigenvector y of (S,P)
+ corresponding to an eigenvalue w are defined by:
+
+ S*x = w*P*x, (y**H)*S = w*(y**H)*P,
+
+ where y**H denotes the conjugate tranpose of y.
+ The eigenvalues are not input to this routine, but are computed
+ directly from the diagonal blocks of S and P.
+
+ This routine returns the matrices X and/or Y of right and left
+ eigenvectors of (S,P), or the products Z*X and/or Q*Y,
+ where Z and Q are input matrices.
+ If Q and Z are the orthogonal factors from the generalized Schur
+ factorization of a matrix pair (A,B), then Z*X and Q*Y
+ are the matrices of right and left eigenvectors of (A,B).
+
+Parameters:
+
+ SIDE
+ SIDE is CHARACTER*1
+ = 'R': compute right eigenvectors only;
+ = 'L': compute left eigenvectors only;
+ = 'B': compute both right and left eigenvectors.
+
+ HOWMNY
+ HOWMNY is CHARACTER*1
+ = 'A': compute all right and/or left eigenvectors;
+ = 'B': compute all right and/or left eigenvectors,
+ backtransformed by the matrices in VR and/or VL;
+ = 'S': compute selected right and/or left eigenvectors,
+ specified by the logical array SELECT.
+
+ SELECT
+ SELECT is LOGICAL array, dimension (N)
+ If HOWMNY='S', SELECT specifies the eigenvectors to be
+ computed. If w(j) is a real eigenvalue, the corresponding
+ real eigenvector is computed if SELECT(j) is .TRUE..
+ If w(j) and w(j+1) are the real and imaginary parts of a
+ complex eigenvalue, the corresponding complex eigenvector
+ is computed if either SELECT(j) or SELECT(j+1) is .TRUE.,
+ and on exit SELECT(j) is set to .TRUE. and SELECT(j+1) is
+ set to .FALSE..
+ Not referenced if HOWMNY = 'A' or 'B'.
+
+ N
+ N is INTEGER
+ The order of the matrices S and P. N >= 0.
+
+ S
+ S is DOUBLE PRECISION array, dimension (LDS,N)
+ The upper quasitriangular matrix S from a generalized Schur
+ factorization, as computed by DHGEQZ.
+
+ LDS
+ LDS is INTEGER
+ The leading dimension of array S. LDS >= max(1,N).
+
+ P
+ P is DOUBLE PRECISION array, dimension (LDP,N)
+ The upper triangular matrix P from a generalized Schur
+ factorization, as computed by DHGEQZ.
+ 2by2 diagonal blocks of P corresponding to 2by2 blocks
+ of S must be in positive diagonal form.
+
+ LDP
+ LDP is INTEGER
+ The leading dimension of array P. LDP >= max(1,N).
+
+ VL
+ VL is DOUBLE PRECISION array, dimension (LDVL,MM)
+ On entry, if SIDE = 'L' or 'B' and HOWMNY = 'B', VL must
+ contain an NbyN matrix Q (usually the orthogonal matrix Q
+ of left Schur vectors returned by DHGEQZ).
+ On exit, if SIDE = 'L' or 'B', VL contains:
+ if HOWMNY = 'A', the matrix Y of left eigenvectors of (S,P);
+ if HOWMNY = 'B', the matrix Q*Y;
+ if HOWMNY = 'S', the left eigenvectors of (S,P) specified by
+ SELECT, stored consecutively in the columns of
+ VL, in the same order as their eigenvalues.
+
+ A complex eigenvector corresponding to a complex eigenvalue
+ is stored in two consecutive columns, the first holding the
+ real part, and the second the imaginary part.
+
+ Not referenced if SIDE = 'R'.
+
+ LDVL
+ LDVL is INTEGER
+ The leading dimension of array VL. LDVL >= 1, and if
+ SIDE = 'L' or 'B', LDVL >= N.
+
+ VR
+ VR is DOUBLE PRECISION array, dimension (LDVR,MM)
+ On entry, if SIDE = 'R' or 'B' and HOWMNY = 'B', VR must
+ contain an NbyN matrix Z (usually the orthogonal matrix Z
+ of right Schur vectors returned by DHGEQZ).
+
+ On exit, if SIDE = 'R' or 'B', VR contains:
+ if HOWMNY = 'A', the matrix X of right eigenvectors of (S,P);
+ if HOWMNY = 'B' or 'b', the matrix Z*X;
+ if HOWMNY = 'S' or 's', the right eigenvectors of (S,P)
+ specified by SELECT, stored consecutively in the
+ columns of VR, in the same order as their eigenvalues.
+
+ A complex eigenvector corresponding to a complex eigenvalue
+ is stored in two consecutive columns, the first holding the
+ real part and the second the imaginary part.
+
+ Not referenced if SIDE = 'L'.
+
+ LDVR
+ LDVR is INTEGER
+ The leading dimension of the array VR. LDVR >= 1, and if
+ SIDE = 'R' or 'B', LDVR >= N.
+
+ MM
+ MM is INTEGER
+ The number of columns in the arrays VL and/or VR. MM >= M.
+
+ M
+ M is INTEGER
+ The number of columns in the arrays VL and/or VR actually
+ used to store the eigenvectors. If HOWMNY = 'A' or 'B', M
+ is set to N. Each selected real eigenvector occupies one
+ column and each selected complex eigenvector occupies two columns.
+
+ WORK
+ WORK is DOUBLE PRECISION array, dimension (6*N)
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit.
+ < 0: if INFO = i, the ith argument had an illegal value.
+ > 0: the 2by2 block (INFO:INFO+1) does not have a complex eigenvalue.
+
+Further Details:
+
+ Allocation of workspace:
+   
+
+ WORK( j ) = 1norm of jth column of A, above the diagonal
+ WORK( N+j ) = 1norm of jth column of B, above the diagonal
+ WORK( 2*N+1:3*N ) = real part of eigenvector
+ WORK( 3*N+1:4*N ) = imaginary part of eigenvector
+ WORK( 4*N+1:5*N ) = real part of backtransformed eigenvector
+ WORK( 5*N+1:6*N ) = imaginary part of backtransformed eigenvector
+
+ Rowwise vs. columnwise solution methods:
+     
+
+ Finding a generalized eigenvector consists basically of solving the
+ singular triangular system
+
+ (A  w B) x = 0 (for right) or: (A  w B)**H y = 0 (for left)
+
+ Consider finding the ith right eigenvector (assume all eigenvalues
+ are real). The equation to be solved is:
+ n i
+ 0 = sum C(j,k) v(k) = sum C(j,k) v(k) for j = i,. . .,1
+ k=j k=j
+
+ where C = (A  w B) (The components v(i+1:n) are 0.)
+
+ The "rowwise" method is:
+
+ (1) v(i) := 1
+ for j = i1,. . .,1:
+ i
+ (2) compute s =  sum C(j,k) v(k) and
+ k=j+1
+
+ (3) v(j) := s / C(j,j)
+
+ Step 2 is sometimes called the "dot product" step, since it is an
+ inner product between the jth row and the portion of the eigenvector
+ that has been computed so far.
+
+ The "columnwise" method consists basically in doing the sums
+ for all the rows in parallel. As each v(j) is computed, the
+ contribution of v(j) times the jth column of C is added to the
+ partial sums. Since FORTRAN arrays are stored columnwise, this has
+ the advantage that at each step, the elements of C that are accessed
+ are adjacent to one another, whereas with the rowwise method, the
+ elements accessed at a step are spaced LDS (and LDP) words apart.
+
+ When finding left eigenvectors, the matrix in question is the
+ transpose of the one in storage, so the rowwise method then
+ actually accesses columns of A and B at each step, and so is the
+ preferred method.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{dtgevc.f}
+\index{dtgevc.f}
+\begin{chunk}{dtgevc.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK dtgevc}
+
+\end{chunk}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{dtgexc}
+\label{dtgexc}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{dtgexc.input}
+)set break resume
+)sys rm f dtgexc.output
+)spool dtgexc.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{dtgexc.help}
+====================================================================
+dtgexc examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine dtgexc (WANTQ, WANTZ, N, A, LDA, B, LDB, Q, LDQ, Z, LDZ,
+ IFST, ILST, WORK, LWORK, INFO)
+ DTGEXC
+
+Function/Subroutine Documentation
+ subroutine dtgexc (logical WANTQ, logical WANTZ, integer N, double
+ precision, dimension( lda, * ) A, integer LDA, double precision,
+ dimension( ldb, * ) B, integer LDB, double precision, dimension( ldq, *
+ ) Q, integer LDQ, double precision, dimension( ldz, * ) Z, integer LDZ,
+ integer IFST, integer ILST, double precision, dimension( * ) WORK,
+ integer LWORK, integer INFO)
+ DTGEXC
+
+Purpose:
+ DTGEXC reorders the generalized real Schur decomposition of a real
+ matrix pair (A,B) using an orthogonal equivalence transformation
+
+ (A, B) = Q * (A, B) * Z**T,
+
+ so that the diagonal block of (A, B) with row index IFST is moved
+ to row ILST.
+
+ (A, B) must be in generalized real Schur canonical form (as returned
+ by DGGES), i.e. A is block upper triangular with 1by1 and 2by2
+ diagonal blocks. B is upper triangular.
+
+ Optionally, the matrices Q and Z of generalized Schur vectors are
+ updated.
+
+ Q(in) * A(in) * Z(in)**T = Q(out) * A(out) * Z(out)**T
+ Q(in) * B(in) * Z(in)**T = Q(out) * B(out) * Z(out)**T
+
+Parameters:
+
+ WANTQ
+ WANTQ is LOGICAL
+ .TRUE. : update the left transformation matrix Q;
+ .FALSE.: do not update Q.
+
+ WANTZ
+ WANTZ is LOGICAL
+ .TRUE. : update the right transformation matrix Z;
+ .FALSE.: do not update Z.
+
+ N
+ N is INTEGER
+ The order of the matrices A and B. N >= 0.
+
+ A
+ A is DOUBLE PRECISION array, dimension (LDA,N)
+ On entry, the matrix A in generalized real Schur canonical form.
+ On exit, the updated matrix A, again in generalized
+ real Schur canonical form.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,N).
+
+ B
+ B is DOUBLE PRECISION array, dimension (LDB,N)
+ On entry, the matrix B in generalized real Schur canonical form (A,B).
+ On exit, the updated matrix B, again in generalized
+ real Schur canonical form (A,B).
+
+ LDB
+ LDB is INTEGER
+ The leading dimension of the array B. LDB >= max(1,N).
+
+ Q
+ Q is DOUBLE PRECISION array, dimension (LDQ,N)
+ On entry, if WANTQ = .TRUE., the orthogonal matrix Q.
+ On exit, the updated matrix Q.
+ If WANTQ = .FALSE., Q is not referenced.
+
+ LDQ
+ LDQ is INTEGER
+ The leading dimension of the array Q. LDQ >= 1.
+ If WANTQ = .TRUE., LDQ >= N.
+
+ Z
+ Z is DOUBLE PRECISION array, dimension (LDZ,N)
+ On entry, if WANTZ = .TRUE., the orthogonal matrix Z.
+ On exit, the updated matrix Z.
+ If WANTZ = .FALSE., Z is not referenced.
+
+ LDZ
+ LDZ is INTEGER
+ The leading dimension of the array Z. LDZ >= 1.
+ If WANTZ = .TRUE., LDZ >= N.
+
+ IFST
+ IFST is INTEGER
+
+ ILST
+ ILST is INTEGER
+ Specify the reordering of the diagonal blocks of (A, B).
+ The block with row index IFST is moved to row ILST, by a
+ sequence of swapping between adjacent blocks.
+ On exit, if IFST pointed on entry to the second row of
+ a 2by2 block, it is changed to point to the first row;
+ ILST always points to the first row of the block in its
+ final position (which may differ from its input value by
+ +1 or 1). 1 <= IFST, ILST <= N.
+
+ WORK
+ WORK is DOUBLE PRECISION array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK.
+ LWORK >= 1 when N <= 1, otherwise LWORK >= 4*N + 16.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ INFO
+ INFO is INTEGER
+ =0: successful exit.
+ <0: if INFO = i, the ith argument had an illegal value.
+ =1: The transformed matrix pair (A, B) would be too far
+ from generalized Schur form; the problem is ill
+ conditioned. (A, B) may have been partially reordered,
+ and ILST points to the first row of the current
+ position of the block being moved.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{dtgexc.f}
+\index{dtgexc.f}
+\begin{chunk}{dtgexc.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK dtgexc}
+
+\end{chunk}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{zgesvj}
+\label{zgesvj}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{zgesvj.input}
+)set break resume
+)sys rm f zgesvj.output
+)spool zgesvj.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{zgesvj.help}
+====================================================================
+zgesvj examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine zgesvj (JOBA, JOBU, JOBV, M, N, A, LDA, SVA, MV, V, LDV,
+ CWORK, LWORK, RWORK, LRWORK, INFO)
+ ZGESVJ
+
+Function/Subroutine Documentation
+ subroutine zgesvj (character*1 JOBA, character*1 JOBU, character*1 JOBV,
+ integer M, integer N, complex*16, dimension( lda, * ) A, integer LDA,
+ double precision, dimension( n ) SVA, integer MV, complex*16,
+ dimension( ldv, * ) V, integer LDV, complex*16, dimension( lwork )
+ CWORK, integer LWORK, double precision, dimension( lrwork ) RWORK,
+ integer LRWORK, integer INFO)
+ ZGESVJ
+
+Purpose:
+ ZGESVJ computes the singular value decomposition (SVD) of a complex
+ MbyN matrix A, where M >= N. The SVD of A is written as
+ [++] [xx] [x0] [xx]
+ A = U * SIGMA * V^*, [++] = [xx] * [ox] * [xx]
+ [++] [xx]
+ where SIGMA is an NbyN diagonal matrix, U is an MbyN orthonormal
+ matrix, and V is an NbyN unitary matrix. The diagonal elements
+ of SIGMA are the singular values of A. The columns of U and V are the
+ left and the right singular vectors of A, respectively.
+
+Parameters:
+
+ JOBA
+ JOBA is CHARACTER* 1
+ Specifies the structure of A.
+ = 'L': The input matrix A is lower triangular;
+ = 'U': The input matrix A is upper triangular;
+ = 'G': The input matrix A is general MbyN matrix, M >= N.
+
+ JOBU
+ JOBU is CHARACTER*1
+ Specifies whether to compute the left singular vectors
+ (columns of U):
+ = 'U': The left singular vectors corresponding to the nonzero
+ singular values are computed and returned in the leading
+ columns of A. See more details in the description of A.
+ The default numerical orthogonality threshold is set to
+ approximately TOL=CTOL*EPS, CTOL=DSQRT(M), EPS=DLAMCH('E').
+ = 'C': Analogous to JOBU='U', except that user can control the
+ level of numerical orthogonality of the computed left
+ singular vectors. TOL can be set to TOL = CTOL*EPS, where
+ CTOL is given on input in the array WORK.
+ No CTOL smaller than ONE is allowed. CTOL greater
+ than 1 / EPS is meaningless. The option 'C'
+ can be used if M*EPS is satisfactory orthogonality
+ of the computed left singular vectors, so CTOL=M could
+ save few sweeps of Jacobi rotations.
+ See the descriptions of A and WORK(1).
+ = 'N': The matrix U is not computed. However, see the
+ description of A.
+
+ JOBV
+ JOBV is CHARACTER*1
+ Specifies whether to compute the right singular vectors, that
+ is, the matrix V:
+ = 'V' : the matrix V is computed and returned in the array V
+ = 'A' : the Jacobi rotations are applied to the MVbyN
+ array V. In other words, the right singular vector
+ matrix V is not computed explicitly, instead it is
+ applied to an MVbyN matrix initially stored in the
+ first MV rows of V.
+ = 'N' : the matrix V is not computed and the array V is not referenced
+
+ M
+ M is INTEGER
+ The number of rows of the input matrix A. 1/DLAMCH('E') > M >= 0.
+
+ N
+ N is INTEGER
+ The number of columns of the input matrix A.
+ M >= N >= 0.
+
+ A
+ A is COMPLEX*16 array, dimension (LDA,N)
+ On entry, the MbyN matrix A.
+ On exit,
+ If JOBU .EQ. 'U' .OR. JOBU .EQ. 'C':
+ If INFO .EQ. 0 :
+ RANKA orthonormal columns of U are returned in the
+ leading RANKA columns of the array A. Here RANKA <= N
+ is the number of computed singular values of A that are
+ above the underflow threshold DLAMCH('S'). The singular
+ vectors corresponding to underflowed or zero singular
+ values are not computed. The value of RANKA is returned
+ in the array RWORK as RANKA=NINT(RWORK(2)). Also see the
+ descriptions of SVA and RWORK. The computed columns of U
+ are mutually numerically orthogonal up to approximately
+ TOL=SQRT(M)*EPS (default); or TOL=CTOL*EPS (JOBU.EQ.'C'),
+ see the description of JOBU.
+ If INFO .GT. 0,
+ the procedure ZGESVJ did not converge in the given number
+ of iterations (sweeps). In that case, the computed
+ columns of U may not be orthogonal up to TOL. The output
+ U (stored in A), SIGMA (given by the computed singular
+ values in SVA(1:N)) and V is still a decomposition of the
+ input matrix A in the sense that the residual
+  A  SCALE * U * SIGMA * V^* _2 / A_2 is small.
+ If JOBU .EQ. 'N':
+ If INFO .EQ. 0 :
+ Note that the left singular vectors are 'for free' in the
+ onesided Jacobi SVD algorithm. However, if only the
+ singular values are needed, the level of numerical
+ orthogonality of U is not an issue and iterations are
+ stopped when the columns of the iterated matrix are
+ numerically orthogonal up to approximately M*EPS. Thus,
+ on exit, A contains the columns of U scaled with the
+ corresponding singular values.
+ If INFO .GT. 0 :
+ the procedure ZGESVJ did not converge in the given number
+ of iterations (sweeps).
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+
+ SVA
+ SVA is DOUBLE PRECISION array, dimension (N)
+ On exit,
+ If INFO .EQ. 0 :
+ depending on the value SCALE = RWORK(1), we have:
+ If SCALE .EQ. ONE:
+ SVA(1:N) contains the computed singular values of A.
+ During the computation SVA contains the Euclidean column
+ norms of the iterated matrices in the array A.
+ If SCALE .NE. ONE:
+ The singular values of A are SCALE*SVA(1:N), and this
+ factored representation is due to the fact that some of the
+ singular values of A might underflow or overflow.
+
+ If INFO .GT. 0 :
+ the procedure ZGESVJ did not converge in the given number of
+ iterations (sweeps) and SCALE*SVA(1:N) may not be accurate.
+
+ MV
+ MV is INTEGER
+ If JOBV .EQ. 'A', then the product of Jacobi rotations in ZGESVJ
+ is applied to the first MV rows of V. See the description of JOBV.
+
+ V
+ V is COMPLEX*16 array, dimension (LDV,N)
+ If JOBV = 'V', then V contains on exit the NbyN matrix of
+ the right singular vectors;
+ If JOBV = 'A', then V contains the product of the computed right
+ singular vector matrix and the initial matrix in the array V.
+ If JOBV = 'N', then V is not referenced.
+
+ LDV
+ LDV is INTEGER
+ The leading dimension of the array V, LDV .GE. 1.
+ If JOBV .EQ. 'V', then LDV .GE. max(1,N).
+ If JOBV .EQ. 'A', then LDV .GE. max(1,MV) .
+
+ CWORK
+ CWORK is COMPLEX*16 array, dimension M+N.
+ Used as work space.
+
+ LWORK
+ LWORK is INTEGER.
+ Length of CWORK, LWORK >= M+N.
+
+ RWORK
+ RWORK is DOUBLE PRECISION array, dimension max(6,M+N).
+ On entry,
+ If JOBU .EQ. 'C' :
+ RWORK(1) = CTOL, where CTOL defines the threshold for convergence.
+ The process stops if all columns of A are mutually
+ orthogonal up to CTOL*EPS, EPS=DLAMCH('E').
+ It is required that CTOL >= ONE, i.e. it is not
+ allowed to force the routine to obtain orthogonality below EPSILON.
+ On exit,
+ RWORK(1) = SCALE is the scaling factor such that SCALE*SVA(1:N)
+ are the computed singular values of A. (See description of SVA().)
+ RWORK(2) = NINT(RWORK(2)) is the number of the computed nonzero
+ singular values.
+ RWORK(3) = NINT(RWORK(3)) is the number of the computed singular
+ values that are larger than the underflow threshold.
+ RWORK(4) = NINT(RWORK(4)) is the number of sweeps of Jacobi
+ rotations needed for numerical convergence.
+ RWORK(5) = max_{i.NE.j} COS(A(:,i),A(:,j)) in the last sweep.
+ This is useful information in cases when ZGESVJ did
+ not converge, as it can be used to estimate whether
+ the output is stil useful and for post festum analysis.
+ RWORK(6) = the largest absolute value over all sines of the
+ Jacobi rotation angles in the last sweep. It can be
+ useful for a post festum analysis.
+
+ LRWORK
+ LRWORK is INTEGER
+ Length of RWORK, LRWORK >= MAX(6,N).
+
+ INFO
+ INFO is INTEGER
+ = 0 : successful exit.
+ < 0 : if INFO = i, then the ith argument had an illegal value
+ > 0 : ZGESVJ did not converge in the maximal allowed number
+ (NSWEEP=30) of sweeps. The output may still be useful.
+ See the description of RWORK.
+
+Further Details:
+
+ The orthogonal NbyN matrix V is obtained as a product of Jacobi plane
+ rotations. In the case of underflow of the tangent of the Jacobi angle, a
+ modified Jacobi transformation of Drmac [3] is used. Pivot strategy uses
+ column interchanges of de Rijk [1]. The relative accuracy of the computed
+ singular values and the accuracy of the computed singular vectors (in
+ angle metric) is as guaranteed by the theory of Demmel and Veselic [2].
+ The condition number that determines the accuracy in the full rank case
+ is essentially min_{D=diag} kappa(A*D), where kappa(.) is the
+ spectral condition number. The best performance of this Jacobi SVD
+ procedure is achieved if used in an accelerated version of Drmac and
+ Veselic [4,5], and it is the kernel routine in the SIGMA library [6].
+ Some tunning parameters (marked with [TP]) are available for the
+ implementer.
+ The computational range for the nonzero singular values is the machine
+ number interval ( UNDERFLOW , OVERFLOW ). In extreme cases, even
+ denormalized singular values can be computed with the corresponding
+ gradual loss of accurate digits.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{zgesvj.f}
+\index{zgesvj.f}
+\begin{chunk}{zgesvj.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK zgesvj}
+
+\end{chunk}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\chapter{LAPACK  General Matrices, Comp. Routines, Real}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{sgebak}
+\label{sgebak}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{sgebak.input}
+)set break resume
+)sys rm f sgebak.output
+)spool sgebak.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{sgebak.help}
+====================================================================
+sgebak examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine sgebak (JOB, SIDE, N, ILO, IHI, SCALE, M, V, LDV, INFO)
+ SGEBAK
+
+Function/Subroutine Documentation
+ subroutine sgebak (character JOB, character SIDE, integer N, integer ILO,
+ integer IHI, real, dimension( * ) SCALE, integer M, real, dimension(
+ ldv, * ) V, integer LDV, integer INFO)
+ SGEBAK
+
+Purpose:
+ SGEBAK forms the right or left eigenvectors of a real general matrix
+ by backward transformation on the computed eigenvectors of the
+ balanced matrix output by SGEBAL.
+
+Parameters:
+
+ JOB
+ JOB is CHARACTER*1
+ Specifies the type of backward transformation required:
+ = 'N', do nothing, return immediately;
+ = 'P', do backward transformation for permutation only;
+ = 'S', do backward transformation for scaling only;
+ = 'B', do backward transformations for both permutation and scaling.
+ JOB must be the same as the argument JOB supplied to SGEBAL.
+
+ SIDE
+ SIDE is CHARACTER*1
+ = 'R': V contains right eigenvectors;
+ = 'L': V contains left eigenvectors.
+
+ N
+ N is INTEGER
+ The number of rows of the matrix V. N >= 0.
+
+ ILO
+ ILO is INTEGER
+
+ IHI
+ IHI is INTEGER
+ The integers ILO and IHI determined by SGEBAL.
+ 1 <= ILO <= IHI <= N, if N > 0; ILO=1 and IHI=0, if N=0.
+
+ SCALE
+ SCALE is REAL array, dimension (N)
+ Details of the permutation and scaling factors, as returned by SGEBAL.
+
+ M
+ M is INTEGER
+ The number of columns of the matrix V. M >= 0.
+
+ V
+ V is REAL array, dimension (LDV,M)
+ On entry, the matrix of right or left eigenvectors to be
+ transformed, as returned by SHSEIN or STREVC.
+ On exit, V is overwritten by the transformed eigenvectors.
+
+ LDV
+ LDV is INTEGER
+ The leading dimension of the array V. LDV >= max(1,N).
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{sgebak.f}
+\index{sgebak.f}
+\begin{chunk}{sgebak.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK sgebak}
+
+\end{chunk}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{sgebal}
+\label{sgebal}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{sgebal.input}
+)set break resume
+)sys rm f sgebal.output
+)spool sgebal.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{sgebal.help}
+====================================================================
+sgebal examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine sgebal (JOB, N, A, LDA, ILO, IHI, SCALE, INFO)
+ SGEBAL
+
+Function/Subroutine Documentation
+ subroutine sgebal (character JOB, integer N, real, dimension( lda, * ) A,
+ integer LDA, integer ILO, integer IHI, real, dimension( * ) SCALE,
+ integer INFO)
+ SGEBAL
+
+Purpose:
+ SGEBAL balances a general real matrix A. This involves, first,
+ permuting A by a similarity transformation to isolate eigenvalues
+ in the first 1 to ILO1 and last IHI+1 to N elements on the
+ diagonal; and second, applying a diagonal similarity transformation
+ to rows and columns ILO to IHI to make the rows and columns as
+ close in norm as possible. Both steps are optional.
+
+ Balancing may reduce the 1norm of the matrix, and improve the
+ accuracy of the computed eigenvalues and/or eigenvectors.
+
+Parameters:
+
+ JOB
+ JOB is CHARACTER*1
+ Specifies the operations to be performed on A:
+ = 'N': none: simply set ILO = 1, IHI = N, SCALE(I) = 1.0
+ for i = 1,...,N;
+ = 'P': permute only;
+ = 'S': scale only;
+ = 'B': both permute and scale.
+
+ N
+ N is INTEGER
+ The order of the matrix A. N >= 0.
+
+ A
+ A is REAL array, dimension (LDA,N)
+ On entry, the input matrix A.
+ On exit, A is overwritten by the balanced matrix.
+ If JOB = 'N', A is not referenced.
+ See Further Details.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,N).
+
+ ILO
+ ILO is INTEGER
+
+ IHI
+ IHI is INTEGER
+ ILO and IHI are set to integers such that on exit
+ A(i,j) = 0 if i > j and j = 1,...,ILO1 or I = IHI+1,...,N.
+ If JOB = 'N' or 'S', ILO = 1 and IHI = N.
+
+ SCALE
+ SCALE is REAL array, dimension (N)
+ Details of the permutations and scaling factors applied to
+ A. If P(j) is the index of the row and column interchanged
+ with row and column j and D(j) is the scaling factor
+ applied to row and column j, then
+ SCALE(j) = P(j) for j = 1,...,ILO1
+ = D(j) for j = ILO,...,IHI
+ = P(j) for j = IHI+1,...,N.
+ The order in which the interchanges are made is N to IHI+1,
+ then 1 to ILO1.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit.
+ < 0: if INFO = i, the ith argument had an illegal value.
+
+Further Details:
+
+ The permutations consist of row and column interchanges which put
+ the matrix in the form
+
+ ( T1 X Y )
+ P A P = ( 0 B Z )
+ ( 0 0 T2 )
+
+ where T1 and T2 are upper triangular matrices whose eigenvalues lie
+ along the diagonal. The column indices ILO and IHI mark the starting
+ and ending columns of the submatrix B. Balancing consists of applying
+ a diagonal similarity transformation inv(D) * B * D to make the
+ 1norms of each row of B and its corresponding column nearly equal.
+ The output matrix is
+
+ ( T1 X*D Y )
+ ( 0 inv(D)*B*D inv(D)*Z ).
+ ( 0 0 T2 )
+
+ Information about the permutations P and the diagonal matrix D is
+ returned in the vector SCALE.
+
+ This subroutine is based on the EISPACK routine BALANC.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{sgebal.f}
+\index{sgebal.f}
+\begin{chunk}{sgebal.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK sgebal}
+
+\end{chunk}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{sgebd2}
+\label{sgebd2}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{sgebd2.input}
+)set break resume
+)sys rm f sgebd2.output
+)spool sgebd2.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{sgebd2.help}
+====================================================================
+sgebd2 examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine sgebd2 (M, N, A, LDA, D, E, TAUQ, TAUP, WORK, INFO)
+ SGEBD2 reduces a general matrix to bidiagonal form using an
+ unblocked algorithm.
+
+Function/Subroutine Documentation
+ subroutine sgebd2 (integer M, integer N, real, dimension( lda, * ) A,
+ integer LDA, real, dimension( * ) D, real, dimension( * ) E, real,
+ dimension( * ) TAUQ, real, dimension( * ) TAUP, real, dimension( * )
+ WORK, integer INFO)
+ SGEBD2 reduces a general matrix to bidiagonal form using an unblocked
+ algorithm.
+
+Purpose:
+ SGEBD2 reduces a real general m by n matrix A to upper or lower
+ bidiagonal form B by an orthogonal transformation: Q**T * A * P = B.
+
+ If m >= n, B is upper bidiagonal; if m < n, B is lower bidiagonal.
+
+Parameters:
+
+ M
+ M is INTEGER
+ The number of rows in the matrix A. M >= 0.
+
+ N
+ N is INTEGER
+ The number of columns in the matrix A. N >= 0.
+
+ A
+ A is REAL array, dimension (LDA,N)
+ On entry, the m by n general matrix to be reduced.
+ On exit,
+ if m >= n, the diagonal and the first superdiagonal are
+ overwritten with the upper bidiagonal matrix B; the
+ elements below the diagonal, with the array TAUQ, represent
+ the orthogonal matrix Q as a product of elementary
+ reflectors, and the elements above the first superdiagonal,
+ with the array TAUP, represent the orthogonal matrix P as
+ a product of elementary reflectors;
+ if m < n, the diagonal and the first subdiagonal are
+ overwritten with the lower bidiagonal matrix B; the
+ elements below the first subdiagonal, with the array TAUQ,
+ represent the orthogonal matrix Q as a product of
+ elementary reflectors, and the elements above the diagonal,
+ with the array TAUP, represent the orthogonal matrix P as
+ a product of elementary reflectors.
+ See Further Details.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+
+ D
+ D is REAL array, dimension (min(M,N))
+ The diagonal elements of the bidiagonal matrix B: D(i) = A(i,i).
+
+ E
+ E is REAL array, dimension (min(M,N)1)
+ The offdiagonal elements of the bidiagonal matrix B:
+ if m >= n, E(i) = A(i,i+1) for i = 1,2,...,n1;
+ if m < n, E(i) = A(i+1,i) for i = 1,2,...,m1.
+
+ TAUQ
+ TAUQ is REAL array dimension (min(M,N))
+ The scalar factors of the elementary reflectors which
+ represent the orthogonal matrix Q. See Further Details.
+
+ TAUP
+ TAUP is REAL array, dimension (min(M,N))
+ The scalar factors of the elementary reflectors which
+ represent the orthogonal matrix P. See Further Details.
+
+ WORK
+ WORK is REAL array, dimension (max(M,N))
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit.
+ < 0: if INFO = i, the ith argument had an illegal value.
+
+Further Details:
+ The matrices Q and P are represented as products of elementary
+ reflectors:
+
+ If m >= n,
+
+ Q = H(1) H(2) . . . H(n) and P = G(1) G(2) . . . G(n1)
+
+ Each H(i) and G(i) has the form:
+
+ H(i) = I  tauq * v * v**T and G(i) = I  taup * u * u**T
+
+ where tauq and taup are real scalars, and v and u are real vectors;
+ v(1:i1) = 0, v(i) = 1, and v(i+1:m) is stored on exit in A(i+1:m,i);
+ u(1:i) = 0, u(i+1) = 1, and u(i+2:n) is stored on exit in A(i,i+2:n);
+ tauq is stored in TAUQ(i) and taup in TAUP(i).
+
+ If m < n,
+
+ Q = H(1) H(2) . . . H(m1) and P = G(1) G(2) . . . G(m)
+
+ Each H(i) and G(i) has the form:
+
+ H(i) = I  tauq * v * v**T and G(i) = I  taup * u * u**T
+
+ where tauq and taup are real scalars, and v and u are real vectors;
+ v(1:i) = 0, v(i+1) = 1, and v(i+2:m) is stored on exit in A(i+2:m,i);
+ u(1:i1) = 0, u(i) = 1, and u(i+1:n) is stored on exit in A(i,i+1:n);
+ tauq is stored in TAUQ(i) and taup in TAUP(i).
+
+ The contents of A on exit are illustrated by the following examples:
+
+ m = 6 and n = 5 (m > n): m = 5 and n = 6 (m < n):
+
+ ( d e u1 u1 u1 ) ( d u1 u1 u1 u1 u1 )
+ ( v1 d e u2 u2 ) ( e d u2 u2 u2 u2 )
+ ( v1 v2 d e u3 ) ( v1 e d u3 u3 u3 )
+ ( v1 v2 v3 d e ) ( v1 v2 e d u4 u4 )
+ ( v1 v2 v3 v4 d ) ( v1 v2 v3 e d u5 )
+ ( v1 v2 v3 v4 v5 )
+
+ where d and e denote diagonal and offdiagonal elements of B, vi
+ denotes an element of the vector defining H(i), and ui an element of
+ the vector defining G(i).
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{sgebd2.f}
+\index{sgebd2.f}
+\begin{chunk}{sgebd2.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK sgebd2}
+
+\end{chunk}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{sgebrd}
+\label{sgebrd}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{sgebrd.input}
+)set break resume
+)sys rm f sgebrd.output
+)spool sgebrd.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{sgebrd.help}
+====================================================================
+sgebrd examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine sgebrd (M, N, A, LDA, D, E, TAUQ, TAUP, WORK, LWORK, INFO)
+ SGEBRD
+
+Function/Subroutine Documentation
+ subroutine sgebrd (integer M, integer N, real, dimension( lda, * ) A,
+ integer LDA, real, dimension( * ) D, real, dimension( * ) E, real,
+ dimension( * ) TAUQ, real, dimension( * ) TAUP, real, dimension( * )
+ WORK, integer LWORK, integer INFO)
+ SGEBRD
+
+Purpose:
+ SGEBRD reduces a general real MbyN matrix A to upper or lower
+ bidiagonal form B by an orthogonal transformation: Q**T * A * P = B.
+
+ If m >= n, B is upper bidiagonal; if m < n, B is lower bidiagonal.
+
+Parameters:
+
+ M
+ M is INTEGER
+ The number of rows in the matrix A. M >= 0.
+
+ N
+ N is INTEGER
+ The number of columns in the matrix A. N >= 0.
+
+ A
+ A is REAL array, dimension (LDA,N)
+ On entry, the MbyN general matrix to be reduced.
+ On exit,
+ if m >= n, the diagonal and the first superdiagonal are
+ overwritten with the upper bidiagonal matrix B; the
+ elements below the diagonal, with the array TAUQ, represent
+ the orthogonal matrix Q as a product of elementary
+ reflectors, and the elements above the first superdiagonal,
+ with the array TAUP, represent the orthogonal matrix P as
+ a product of elementary reflectors;
+ if m < n, the diagonal and the first subdiagonal are
+ overwritten with the lower bidiagonal matrix B; the
+ elements below the first subdiagonal, with the array TAUQ,
+ represent the orthogonal matrix Q as a product of
+ elementary reflectors, and the elements above the diagonal,
+ with the array TAUP, represent the orthogonal matrix P as
+ a product of elementary reflectors.
+ See Further Details.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+
+ D
+ D is REAL array, dimension (min(M,N))
+ The diagonal elements of the bidiagonal matrix B: D(i) = A(i,i).
+
+ E
+ E is REAL array, dimension (min(M,N)1)
+ The offdiagonal elements of the bidiagonal matrix B:
+ if m >= n, E(i) = A(i,i+1) for i = 1,2,...,n1;
+ if m < n, E(i) = A(i+1,i) for i = 1,2,...,m1.
+
+ TAUQ
+ TAUQ is REAL array dimension (min(M,N))
+ The scalar factors of the elementary reflectors which
+ represent the orthogonal matrix Q. See Further Details.
+
+ TAUP
+ TAUP is REAL array, dimension (min(M,N))
+ The scalar factors of the elementary reflectors which
+ represent the orthogonal matrix P. See Further Details.
+
+ WORK
+ WORK is REAL array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The length of the array WORK. LWORK >= max(1,M,N).
+ For optimum performance LWORK >= (M+N)*NB, where NB
+ is the optimal blocksize.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value.
+
+Further Details:
+
+ The matrices Q and P are represented as products of elementary
+ reflectors:
+
+ If m >= n,
+
+ Q = H(1) H(2) . . . H(n) and P = G(1) G(2) . . . G(n1)
+
+ Each H(i) and G(i) has the form:
+
+ H(i) = I  tauq * v * v**T and G(i) = I  taup * u * u**T
+
+ where tauq and taup are real scalars, and v and u are real vectors;
+ v(1:i1) = 0, v(i) = 1, and v(i+1:m) is stored on exit in A(i+1:m,i);
+ u(1:i) = 0, u(i+1) = 1, and u(i+2:n) is stored on exit in A(i,i+2:n);
+ tauq is stored in TAUQ(i) and taup in TAUP(i).
+
+ If m < n,
+
+ Q = H(1) H(2) . . . H(m1) and P = G(1) G(2) . . . G(m)
+
+ Each H(i) and G(i) has the form:
+
+ H(i) = I  tauq * v * v**T and G(i) = I  taup * u * u**T
+
+ where tauq and taup are real scalars, and v and u are real vectors;
+ v(1:i) = 0, v(i+1) = 1, and v(i+2:m) is stored on exit in A(i+2:m,i);
+ u(1:i1) = 0, u(i) = 1, and u(i+1:n) is stored on exit in A(i,i+1:n);
+ tauq is stored in TAUQ(i) and taup in TAUP(i).
+
+ The contents of A on exit are illustrated by the following examples:
+
+ m = 6 and n = 5 (m > n): m = 5 and n = 6 (m < n):
+
+ ( d e u1 u1 u1 ) ( d u1 u1 u1 u1 u1 )
+ ( v1 d e u2 u2 ) ( e d u2 u2 u2 u2 )
+ ( v1 v2 d e u3 ) ( v1 e d u3 u3 u3 )
+ ( v1 v2 v3 d e ) ( v1 v2 e d u4 u4 )
+ ( v1 v2 v3 v4 d ) ( v1 v2 v3 e d u5 )
+ ( v1 v2 v3 v4 v5 )
+
+ where d and e denote diagonal and offdiagonal elements of B, vi
+ denotes an element of the vector defining H(i), and ui an element of
+ the vector defining G(i).
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{sgebrd.f}
+\index{sgebrd.f}
+\begin{chunk}{sgebrd.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK sgebrd}
+
+\end{chunk}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{sgecon}
+\label{sgecon}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{sgecon.input}
+)set break resume
+)sys rm f sgecon.output
+)spool sgecon.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{sgecon.help}
+====================================================================
+sgecon examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine sgecon (NORM, N, A, LDA, ANORM, RCOND, WORK, IWORK, INFO)
+ SGECON
+
+Function/Subroutine Documentation
+ subroutine sgecon (character NORM, integer N, real, dimension( lda, * ) A,
+ integer LDA, real ANORM, real RCOND, real, dimension( * ) WORK,
+ integer, dimension( * ) IWORK, integer INFO)
+ SGECON
+
+Purpose:
+ SGECON estimates the reciprocal of the condition number of a general
+ real matrix A, in either the 1norm or the infinitynorm, using
+ the LU factorization computed by SGETRF.
+
+ An estimate is obtained for norm(inv(A)), and the reciprocal of the
+ condition number is computed as
+ RCOND = 1 / ( norm(A) * norm(inv(A)) ).
+
+Parameters:
+
+ NORM
+ NORM is CHARACTER*1
+ Specifies whether the 1norm condition number or the
+ infinitynorm condition number is required:
+ = '1' or 'O': 1norm;
+ = 'I': Infinitynorm.
+
+ N
+ N is INTEGER
+ The order of the matrix A. N >= 0.
+
+ A
+ A is REAL array, dimension (LDA,N)
+ The factors L and U from the factorization A = P*L*U
+ as computed by SGETRF.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,N).
+
+ ANORM
+ ANORM is REAL
+ If NORM = '1' or 'O', the 1norm of the original matrix A.
+ If NORM = 'I', the infinitynorm of the original matrix A.
+
+ RCOND
+ RCOND is REAL
+ The reciprocal of the condition number of the matrix A,
+ computed as RCOND = 1/(norm(A) * norm(inv(A))).
+
+ WORK
+ WORK is REAL array, dimension (4*N)
+
+ IWORK
+ IWORK is INTEGER array, dimension (N)
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{sgecon.f}
+\index{sgecon.f}
+\begin{chunk}{sgecon.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK sgecon}
+
+\end{chunk}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{sgeequ}
+\label{sgeequ}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{sgeequ.input}
+)set break resume
+)sys rm f sgeequ.output
+)spool sgeequ.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{sgeequ.help}
+====================================================================
+sgeequ examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine sgeequ (M, N, A, LDA, R, C, ROWCND, COLCND, AMAX, INFO)
+ SGEEQU
+
+Function/Subroutine Documentation
+ subroutine sgeequ (integer M, integer N, real, dimension( lda, * ) A,
+ integer LDA, real, dimension( * ) R, real, dimension( * ) C, real
+ ROWCND, real COLCND, real AMAX, integer INFO)
+ SGEEQU
+
+Purpose:
+ SGEEQU computes row and column scalings intended to equilibrate an
+ MbyN matrix A and reduce its condition number. R returns the row
+ scale factors and C the column scale factors, chosen to try to make
+ the largest element in each row and column of the matrix B with
+ elements B(i,j)=R(i)*A(i,j)*C(j) have absolute value 1.
+
+ R(i) and C(j) are restricted to be between SMLNUM = smallest safe
+ number and BIGNUM = largest safe number. Use of these scaling
+ factors is not guaranteed to reduce the condition number of A but
+ works well in practice.
+
+Parameters:
+
+ M
+ M is INTEGER
+ The number of rows of the matrix A. M >= 0.
+
+ N
+ N is INTEGER
+ The number of columns of the matrix A. N >= 0.
+
+ A
+ A is REAL array, dimension (LDA,N)
+ The MbyN matrix whose equilibration factors are to be computed.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+
+ R
+ R is REAL array, dimension (M)
+ If INFO = 0 or INFO > M, R contains the row scale factors for A.
+
+ C
+ C is REAL array, dimension (N)
+ If INFO = 0, C contains the column scale factors for A.
+
+ ROWCND
+ ROWCND is REAL
+ If INFO = 0 or INFO > M, ROWCND contains the ratio of the
+ smallest R(i) to the largest R(i). If ROWCND >= 0.1 and
+ AMAX is neither too large nor too small, it is not worth scaling by R.
+
+ COLCND
+ COLCND is REAL
+ If INFO = 0, COLCND contains the ratio of the smallest
+ C(i) to the largest C(i). If COLCND >= 0.1, it is not worth scaling by C.
+
+ AMAX
+ AMAX is REAL
+ Absolute value of largest matrix element. If AMAX is very
+ close to overflow or very close to underflow, the matrix should be scaled.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value
+ > 0: if INFO = i, and i is
+ <= M: the ith row of A is exactly zero
+ > M: the (iM)th column of A is exactly zero
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{sgeequ.f}
+\index{sgeequ.f}
+\begin{chunk}{sgeequ.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK sgeequ}
+
+\end{chunk}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{sgeequb}
+\label{sgeequb}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{sgeequb.input}
+)set break resume
+)sys rm f sgeequb.output
+)spool sgeequb.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{sgeequb.help}
+====================================================================
+sgeequb examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine sgeequb (M, N, A, LDA, R, C, ROWCND, COLCND, AMAX, INFO)
+ SGEEQUB
+
+Function/Subroutine Documentation
+ subroutine sgeequb (integer M, integer N, real, dimension( lda, * ) A,
+ integer LDA, real, dimension( * ) R, real, dimension( * ) C, real
+ ROWCND, real COLCND, real AMAX, integer INFO)
+ SGEEQUB
+
+Purpose:
+ SGEEQUB computes row and column scalings intended to equilibrate an
+ MbyN matrix A and reduce its condition number. R returns the row
+ scale factors and C the column scale factors, chosen to try to make
+ the largest element in each row and column of the matrix B with
+ elements B(i,j)=R(i)*A(i,j)*C(j) have an absolute value of at most
+ the radix.
+
+ R(i) and C(j) are restricted to be a power of the radix between
+ SMLNUM = smallest safe number and BIGNUM = largest safe number. Use
+ of these scaling factors is not guaranteed to reduce the condition
+ number of A but works well in practice.
+
+ This routine differs from SGEEQU by restricting the scaling factors
+ to a power of the radix. Baring over and underflow, scaling by
+ these factors introduces no additional rounding errors. However, the
+ scaled entries' magnitured are no longer approximately 1 but lie
+ between sqrt(radix) and 1/sqrt(radix).
+
+Parameters:
+
+ M
+ M is INTEGER
+ The number of rows of the matrix A. M >= 0.
+
+ N
+ N is INTEGER
+ The number of columns of the matrix A. N >= 0.
+
+ A
+ A is REAL array, dimension (LDA,N)
+ The MbyN matrix whose equilibration factors are to be computed.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+
+ R
+ R is REAL array, dimension (M)
+ If INFO = 0 or INFO > M, R contains the row scale factors for A.
+
+ C
+ C is REAL array, dimension (N)
+ If INFO = 0, C contains the column scale factors for A.
+
+ ROWCND
+ ROWCND is REAL
+ If INFO = 0 or INFO > M, ROWCND contains the ratio of the
+ smallest R(i) to the largest R(i). If ROWCND >= 0.1 and
+ AMAX is neither too large nor too small, it is not worth scaling by R.
+
+ COLCND
+ COLCND is REAL
+ If INFO = 0, COLCND contains the ratio of the smallest
+ C(i) to the largest C(i). If COLCND >= 0.1, it is not worth scaling by C.
+
+ AMAX
+ AMAX is REAL
+ Absolute value of largest matrix element. If AMAX is very
+ close to overflow or very close to underflow, the matrix should be scaled.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value
+ > 0: if INFO = i, and i is
+ <= M: the ith row of A is exactly zero
+ > M: the (iM)th column of A is exactly zero
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{sgeequb.f}
+\index{sgeequb.f}
+\begin{chunk}{sgeequb.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK sgeequb}
+
+\end{chunk}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{sgehd2}
+\label{sgehd2}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{sgehd2.input}
+)set break resume
+)sys rm f sgehd2.output
+)spool sgehd2.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{sgehd2.help}
+====================================================================
+sgehd2 examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine sgehd2 (N, ILO, IHI, A, LDA, TAU, WORK, INFO)
+ SGEHD2 reduces a general square matrix to upper Hessenberg form
+ using an unblocked algorithm.
+
+Function/Subroutine Documentation
+ subroutine sgehd2 (integer N, integer ILO, integer IHI, real, dimension(
+ lda, * ) A, integer LDA, real, dimension( * ) TAU, real, dimension( * )
+ WORK, integer INFO)
+ SGEHD2 reduces a general square matrix to upper Hessenberg form using
+ an unblocked algorithm.
+
+Purpose:
+ SGEHD2 reduces a real general matrix A to upper Hessenberg form H by
+ an orthogonal similarity transformation: Q**T * A * Q = H .
+
+Parameters:
+
+ N
+ N is INTEGER
+ The order of the matrix A. N >= 0.
+
+ ILO
+ ILO is INTEGER
+
+ IHI
+ IHI is INTEGER
+
+ It is assumed that A is already upper triangular in rows
+ and columns 1:ILO1 and IHI+1:N. ILO and IHI are normally
+ set by a previous call to SGEBAL; otherwise they should be
+ set to 1 and N respectively. See Further Details.
+ 1 <= ILO <= IHI <= max(1,N).
+
+ A
+ A is REAL array, dimension (LDA,N)
+ On entry, the n by n general matrix to be reduced.
+ On exit, the upper triangle and the first subdiagonal of A
+ are overwritten with the upper Hessenberg matrix H, and the
+ elements below the first subdiagonal, with the array TAU,
+ represent the orthogonal matrix Q as a product of elementary
+ reflectors. See Further Details.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,N).
+
+ TAU
+ TAU is REAL array, dimension (N1)
+ The scalar factors of the elementary reflectors (see Further Details).
+
+ WORK
+ WORK is REAL array, dimension (N)
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit.
+ < 0: if INFO = i, the ith argument had an illegal value.
+
+ Further Details:
+
+ The matrix Q is represented as a product of (ihiilo) elementary
+ reflectors
+
+ Q = H(ilo) H(ilo+1) . . . H(ihi1).
+
+ Each H(i) has the form
+
+ H(i) = I  tau * v * v**T
+
+ where tau is a real scalar, and v is a real vector with
+ v(1:i) = 0, v(i+1) = 1 and v(ihi+1:n) = 0; v(i+2:ihi) is stored on
+ exit in A(i+2:ihi,i), and tau in TAU(i).
+
+ The contents of A are illustrated by the following example, with
+ n = 7, ilo = 2 and ihi = 6:
+
+ on entry, on exit,
+
+ ( a a a a a a a ) ( a a h h h h a )
+ ( a a a a a a ) ( a h h h h a )
+ ( a a a a a a ) ( h h h h h h )
+ ( a a a a a a ) ( v2 h h h h h )
+ ( a a a a a a ) ( v2 v3 h h h h )
+ ( a a a a a a ) ( v2 v3 v4 h h h )
+ ( a ) ( a )
+
+ where a denotes an element of the original matrix A, h denotes a
+ modified element of the upper Hessenberg matrix H, and vi denotes an
+ element of the vector defining H(i).
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{sgehd2.f}
+\index{sgehd2.f}
+\begin{chunk}{sgehd2.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK sgehd2}
+
+\end{chunk}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{sgehrd}
+\label{sgehrd}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{sgehrd.input}
+)set break resume
+)sys rm f sgehrd.output
+)spool sgehrd.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{sgehrd.help}
+====================================================================
+sgehrd examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine sgehrd (N, ILO, IHI, A, LDA, TAU, WORK, LWORK, INFO)
+ SGEHRD
+
+Function/Subroutine Documentation
+ subroutine sgehrd (integer N, integer ILO, integer IHI, real, dimension(
+ lda, * ) A, integer LDA, real, dimension( * ) TAU, real, dimension( * )
+ WORK, integer LWORK, integer INFO)
+ SGEHRD
+
+Purpose:
+ SGEHRD reduces a real general matrix A to upper Hessenberg form H by
+ an orthogonal similarity transformation: Q**T * A * Q = H .
+
+Parameters:
+
+ N
+ N is INTEGER
+ The order of the matrix A. N >= 0.
+
+ ILO
+ ILO is INTEGER
+
+ IHI
+ IHI is INTEGER
+
+ It is assumed that A is already upper triangular in rows
+ and columns 1:ILO1 and IHI+1:N. ILO and IHI are normally
+ set by a previous call to SGEBAL; otherwise they should be
+ set to 1 and N respectively. See Further Details.
+ 1 <= ILO <= IHI <= N, if N > 0; ILO=1 and IHI=0, if N=0.
+
+ A
+ A is REAL array, dimension (LDA,N)
+ On entry, the NbyN general matrix to be reduced.
+ On exit, the upper triangle and the first subdiagonal of A
+ are overwritten with the upper Hessenberg matrix H, and the
+ elements below the first subdiagonal, with the array TAU,
+ represent the orthogonal matrix Q as a product of elementary
+ reflectors. See Further Details.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,N).
+
+ TAU
+ TAU is REAL array, dimension (N1)
+ The scalar factors of the elementary reflectors (see Further
+ Details). Elements 1:ILO1 and IHI:N1 of TAU are set to
+ zero.
+
+ WORK
+ WORK is REAL array, dimension (LWORK)
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The length of the array WORK. LWORK >= max(1,N).
+ For good performance, LWORK should generally be larger.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value.
+
+Further Details:
+
+ The matrix Q is represented as a product of (ihiilo) elementary
+ reflectors
+
+ Q = H(ilo) H(ilo+1) . . . H(ihi1).
+
+ Each H(i) has the form
+
+ H(i) = I  tau * v * v**T
+
+ where tau is a real scalar, and v is a real vector with
+ v(1:i) = 0, v(i+1) = 1 and v(ihi+1:n) = 0; v(i+2:ihi) is stored on
+ exit in A(i+2:ihi,i), and tau in TAU(i).
+
+ The contents of A are illustrated by the following example, with
+ n = 7, ilo = 2 and ihi = 6:
+
+ on entry, on exit,
+
+ ( a a a a a a a ) ( a a h h h h a )
+ ( a a a a a a ) ( a h h h h a )
+ ( a a a a a a ) ( h h h h h h )
+ ( a a a a a a ) ( v2 h h h h h )
+ ( a a a a a a ) ( v2 v3 h h h h )
+ ( a a a a a a ) ( v2 v3 v4 h h h )
+ ( a ) ( a )
+
+ where a denotes an element of the original matrix A, h denotes a
+ modified element of the upper Hessenberg matrix H, and vi denotes an
+ element of the vector defining H(i).
+
+ This file is a slight modification of LAPACK3.0's DGEHRD
+ subroutine incorporating improvements proposed by QuintanaOrti and
+ Van de Geijn (2006). (See DLAHR2.)
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{sgehrd.f}
+\index{sgehrd.f}
+\begin{chunk}{sgehrd.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK sgehrd}
+
+\end{chunk}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{sgelq2}
+\label{sgelq2}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{sgelq2.input}
+)set break resume
+)sys rm f sgelq2.output
+)spool sgelq2.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{sgelq2.help}
+====================================================================
+sgelq2 examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine sgelq2 (M, N, A, LDA, TAU, WORK, INFO)
+ SGELQ2 computes the LQ factorization of a general rectangular
+ matrix using an unblocked algorithm.
+
+Function/Subroutine Documentation
+ subroutine sgelq2 (integer M, integer N, real, dimension( lda, * ) A,
+ integer LDA, real, dimension( * ) TAU, real, dimension( * ) WORK,
+ integer INFO)
+ SGELQ2 computes the LQ factorization of a general rectangular matrix
+ using an unblocked algorithm.
+
+Purpose:
+ SGELQ2 computes an LQ factorization of a real m by n matrix A: A = L * Q.
+
+Parameters:
+
+ M
+ M is INTEGER
+ The number of rows of the matrix A. M >= 0.
+
+ N
+ N is INTEGER
+ The number of columns of the matrix A. N >= 0.
+
+ A
+ A is REAL array, dimension (LDA,N)
+ On entry, the m by n matrix A.
+ On exit, the elements on and below the diagonal of the array
+ contain the m by min(m,n) lower trapezoidal matrix L (L is
+ lower triangular if m <= n); the elements above the diagonal,
+ with the array TAU, represent the orthogonal matrix Q as a
+ product of elementary reflectors (see Further Details).
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+
+ TAU
+ TAU is REAL array, dimension (min(M,N))
+ The scalar factors of the elementary reflectors (see Further Details).
+
+ WORK
+ WORK is REAL array, dimension (M)
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value
+
+Further Details:
+
+ The matrix Q is represented as a product of elementary reflectors
+
+ Q = H(k) . . . H(2) H(1), where k = min(m,n).
+
+ Each H(i) has the form
+
+ H(i) = I  tau * v * v**T
+
+ where tau is a real scalar, and v is a real vector with
+ v(1:i1) = 0 and v(i) = 1; v(i+1:n) is stored on exit in A(i,i+1:n),
+ and tau in TAU(i).
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{sgelq2.f}
+\index{sgelq2.f}
+\begin{chunk}{sgelq2.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK sgelq2}
+
+\end{chunk}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{sgelqf}
+\label{sgelqf}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{sgelqf.input}
+)set break resume
+)sys rm f sgelqf.output
+)spool sgelqf.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{sgelqf.help}
+====================================================================
+sgelqf examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine sgelqf (M, N, A, LDA, TAU, WORK, LWORK, INFO)
+ SGELQF
+
+Function/Subroutine Documentation
+ subroutine sgelqf (integer M, integer N, real, dimension( lda, * ) A,
+ integer LDA, real, dimension( * ) TAU, real, dimension( * ) WORK,
+ integer LWORK, integer INFO)
+ SGELQF
+
+Purpose:
+ SGELQF computes an LQ factorization of a real MbyN matrix A: A = L * Q.
+
+Parameters:
+
+ M
+ M is INTEGER
+ The number of rows of the matrix A. M >= 0.
+
+ N
+ N is INTEGER
+ The number of columns of the matrix A. N >= 0.
+
+ A
+ A is REAL array, dimension (LDA,N)
+ On entry, the MbyN matrix A.
+ On exit, the elements on and below the diagonal of the array
+ contain the mbymin(m,n) lower trapezoidal matrix L (L is
+ lower triangular if m <= n); the elements above the diagonal,
+ with the array TAU, represent the orthogonal matrix Q as a
+ product of elementary reflectors (see Further Details).
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+
+ TAU
+ TAU is REAL array, dimension (min(M,N))
+ The scalar factors of the elementary reflectors (see Further Details).
+
+ WORK
+ WORK is REAL array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK. LWORK >= max(1,M).
+ For optimum performance LWORK >= M*NB, where NB is the
+ optimal blocksize.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value
+
+Further Details:
+
+ The matrix Q is represented as a product of elementary reflectors
+
+ Q = H(k) . . . H(2) H(1), where k = min(m,n).
+
+ Each H(i) has the form
+
+ H(i) = I  tau * v * v**T
+
+ where tau is a real scalar, and v is a real vector with
+ v(1:i1) = 0 and v(i) = 1; v(i+1:n) is stored on exit in A(i,i+1:n),
+ and tau in TAU(i).
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{sgelqf.f}
+\index{sgelqf.f}
+\begin{chunk}{sgelqf.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK sgelqf}
+
+\end{chunk}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{sgemqrt}
+\label{sgemqrt}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{sgemqrt.input}
+)set break resume
+)sys rm f sgemqrt.output
+)spool sgemqrt.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{sgemqrt.help}
+====================================================================
+sgemqrt examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine sgemqrt (SIDE, TRANS, M, N, K, NB, V, LDV, T, LDT, C, LDC,
+ WORK, INFO)
+ SGEMQRT
+
+Function/Subroutine Documentation
+ subroutine sgemqrt (character SIDE, character TRANS, integer M, integer N,
+ integer K, integer NB, real, dimension( ldv, * ) V, integer LDV, real,
+ dimension( ldt, * ) T, integer LDT, real, dimension( ldc, * ) C,
+ integer LDC, real, dimension( * ) WORK, integer INFO)
+ SGEMQRT
+
+Purpose:
+ SGEMQRT overwrites the general real MbyN matrix C with
+
+ SIDE = 'L' SIDE = 'R'
+ TRANS = 'N': Q C C Q
+ TRANS = 'T': Q**T C C Q**T
+
+ where Q is a real orthogonal matrix defined as the product of K
+ elementary reflectors:
+
+ Q = H(1) H(2) . . . H(K) = I  V T V**T
+
+ generated using the compact WY representation as returned by SGEQRT.
+
+ Q is of order M if SIDE = 'L' and of order N if SIDE = 'R'.
+
+Parameters:
+
+ SIDE
+ SIDE is CHARACTER*1
+ = 'L': apply Q or Q**T from the Left;
+ = 'R': apply Q or Q**T from the Right.
+
+ TRANS
+ TRANS is CHARACTER*1
+ = 'N': No transpose, apply Q;
+ = 'T': Transpose, apply Q**T.
+
+ M
+ M is INTEGER
+ The number of rows of the matrix C. M >= 0.
+
+ N
+ N is INTEGER
+ The number of columns of the matrix C. N >= 0.
+
+ K
+ K is INTEGER
+ The number of elementary reflectors whose product defines the matrix Q.
+ If SIDE = 'L', M >= K >= 0;
+ if SIDE = 'R', N >= K >= 0.
+
+ NB
+ NB is INTEGER
+ The block size used for the storage of T. K >= NB >= 1.
+ This must be the same value of NB used to generate T in CGEQRT.
+
+ V
+ V is REAL array, dimension (LDV,K)
+ The ith column must contain the vector which defines the
+ elementary reflector H(i), for i = 1,2,...,k, as returned by
+ CGEQRT in the first K columns of its array argument A.
+
+ LDV
+ LDV is INTEGER
+ The leading dimension of the array V.
+ If SIDE = 'L', LDA >= max(1,M);
+ if SIDE = 'R', LDA >= max(1,N).
+
+ T
+ T is REAL array, dimension (LDT,K)
+ The upper triangular factors of the block reflectors
+ as returned by CGEQRT, stored as a NBbyN matrix.
+
+ LDT
+ LDT is INTEGER
+ The leading dimension of the array T. LDT >= NB.
+
+ C
+ C is REAL array, dimension (LDC,N)
+ On entry, the MbyN matrix C.
+ On exit, C is overwritten by Q C, Q**T C, C Q**T or C Q.
+
+ LDC
+ LDC is INTEGER
+ The leading dimension of the array C. LDC >= max(1,M).
+
+ WORK
+ WORK is REAL array. The dimension of WORK is
+ N*NB if SIDE = 'L', or M*NB if SIDE = 'R'.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{sgemqrt.f}
+\index{sgemqrt.f}
+\begin{chunk}{sgemqrt.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK sgemqrt}
+
+\end{chunk}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{sgeql2}
+\label{sgeql2}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{sgeql2.input}
+)set break resume
+)sys rm f sgeql2.output
+)spool sgeql2.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{sgeql2.help}
+====================================================================
+sgeql2 examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine sgeql2 (M, N, A, LDA, TAU, WORK, INFO)
+ SGEQL2 computes the QL factorization of a general rectangular
+ matrix using an unblocked algorithm.
+
+Function/Subroutine Documentation
+ subroutine sgeql2 (integer M, integer N, real, dimension( lda, * ) A,
+ integer LDA, real, dimension( * ) TAU, real, dimension( * ) WORK,
+ integer INFO)
+ SGEQL2 computes the QL factorization of a general rectangular matrix
+ using an unblocked algorithm.
+
+Purpose:
+ SGEQL2 computes a QL factorization of a real m by n matrix A: A = Q * L.
+
+Parameters:
+
+ M
+ M is INTEGER
+ The number of rows of the matrix A. M >= 0.
+
+ N
+ N is INTEGER
+ The number of columns of the matrix A. N >= 0.
+
+ A
+ A is REAL array, dimension (LDA,N)
+ On entry, the m by n matrix A.
+ On exit, if m >= n, the lower triangle of the subarray
+ A(mn+1:m,1:n) contains the n by n lower triangular matrix L;
+ if m <= n, the elements on and below the (nm)th
+ superdiagonal contain the m by n lower trapezoidal matrix L;
+ the remaining elements, with the array TAU, represent the
+ orthogonal matrix Q as a product of elementary reflectors
+ (see Further Details).
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+
+ TAU
+ TAU is REAL array, dimension (min(M,N))
+ The scalar factors of the elementary reflectors (see Further Details).
+
+ WORK
+ WORK is REAL array, dimension (N)
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value
+
+Further Details:
+
+ The matrix Q is represented as a product of elementary reflectors
+
+ Q = H(k) . . . H(2) H(1), where k = min(m,n).
+
+ Each H(i) has the form
+
+ H(i) = I  tau * v * v**T
+
+ where tau is a real scalar, and v is a real vector with
+ v(mk+i+1:m) = 0 and v(mk+i) = 1; v(1:mk+i1) is stored on exit in
+ A(1:mk+i1,nk+i), and tau in TAU(i).
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{sgeql2.f}
+\index{sgeql2.f}
+\begin{chunk}{sgeql2.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK sgeql2}
+
+\end{chunk}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{sgeqlf}
+\label{sgeqlf}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{sgeqlf.input}
+)set break resume
+)sys rm f sgeqlf.output
+)spool sgeqlf.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{sgeqlf.help}
+====================================================================
+sgeqlf examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine sgeqlf (M, N, A, LDA, TAU, WORK, LWORK, INFO)
+ SGEQLF
+
+Function/Subroutine Documentation
+ subroutine sgeqlf (integer M, integer N, real, dimension( lda, * ) A,
+ integer LDA, real, dimension( * ) TAU, real, dimension( * ) WORK,
+ integer LWORK, integer INFO)
+ SGEQLF
+
+Purpose:
+ SGEQLF computes a QL factorization of a real MbyN matrix A: A = Q * L.
+
+Parameters:
+
+ M
+ M is INTEGER
+ The number of rows of the matrix A. M >= 0.
+
+ N
+ N is INTEGER
+ The number of columns of the matrix A. N >= 0.
+
+ A
+ A is REAL array, dimension (LDA,N)
+ On entry, the MbyN matrix A.
+ On exit,
+ if m >= n, the lower triangle of the subarray
+ A(mn+1:m,1:n) contains the NbyN lower triangular matrix L;
+ if m <= n, the elements on and below the (nm)th
+ superdiagonal contain the MbyN lower trapezoidal matrix L;
+ the remaining elements, with the array TAU, represent the
+ orthogonal matrix Q as a product of elementary reflectors
+ (see Further Details).
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+
+ TAU
+ TAU is REAL array, dimension (min(M,N))
+ The scalar factors of the elementary reflectors (see Further Details).
+
+ WORK
+ WORK is REAL array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK. LWORK >= max(1,N).
+ For optimum performance LWORK >= N*NB, where NB is the
+ optimal blocksize.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value
+
+Further Details:
+
+ The matrix Q is represented as a product of elementary reflectors
+
+ Q = H(k) . . . H(2) H(1), where k = min(m,n).
+
+ Each H(i) has the form
+
+ H(i) = I  tau * v * v**T
+
+ where tau is a real scalar, and v is a real vector with
+ v(mk+i+1:m) = 0 and v(mk+i) = 1; v(1:mk+i1) is stored on exit in
+ A(1:mk+i1,nk+i), and tau in TAU(i).
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{sgeqlf.f}
+\index{sgeqlf.f}
+\begin{chunk}{sgeqlf.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK sgeqlf}
+
+\end{chunk}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{sgeqp3}
+\label{sgeqp3}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{sgeqp3.input}
+)set break resume
+)sys rm f sgeqp3.output
+)spool sgeqp3.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{sgeqp3.help}
+====================================================================
+sgeqp3 examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine sgeqp3 (M, N, A, LDA, JPVT, TAU, WORK, LWORK, INFO)
+ SGEQP3
+
+Function/Subroutine Documentation
+ subroutine sgeqp3 (integer M, integer N, real, dimension( lda, * ) A,
+ integer LDA, integer, dimension( * ) JPVT, real, dimension( * ) TAU,
+ real, dimension( * ) WORK, integer LWORK, integer INFO)
+ SGEQP3
+
+Purpose:
+ SGEQP3 computes a QR factorization with column pivoting of a
+ matrix A: A*P = Q*R using Level 3 BLAS.
+
+Parameters:
+
+ M
+ M is INTEGER
+ The number of rows of the matrix A. M >= 0.
+
+ N
+ N is INTEGER
+ The number of columns of the matrix A. N >= 0.
+
+ A
+ A is REAL array, dimension (LDA,N)
+ On entry, the MbyN matrix A.
+ On exit, the upper triangle of the array contains the
+ min(M,N)byN upper trapezoidal matrix R; the elements below
+ the diagonal, together with the array TAU, represent the
+ orthogonal matrix Q as a product of min(M,N) elementary reflectors.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+
+ JPVT
+ JPVT is INTEGER array, dimension (N)
+ On entry, if JPVT(J).ne.0, the Jth column of A is permuted
+ to the front of A*P (a leading column); if JPVT(J)=0,
+ the Jth column of A is a free column.
+ On exit, if JPVT(J)=K, then the Jth column of A*P was the
+ the Kth column of A.
+
+ TAU
+ TAU is REAL array, dimension (min(M,N))
+ The scalar factors of the elementary reflectors.
+
+ WORK
+ WORK is REAL array, dimension (MAX(1,LWORK))
+ On exit, if INFO=0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK. LWORK >= 3*N+1.
+ For optimal performance LWORK >= 2*N+( N+1 )*NB, where NB
+ is the optimal blocksize.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit.
+ < 0: if INFO = i, the ith argument had an illegal value.
+
+Further Details:
+
+ The matrix Q is represented as a product of elementary reflectors
+
+ Q = H(1) H(2) . . . H(k), where k = min(m,n).
+
+ Each H(i) has the form
+
+ H(i) = I  tau * v * v**T
+
+ where tau is a real scalar, and v is a real/complex vector
+ with v(1:i1) = 0 and v(i) = 1; v(i+1:m) is stored on exit in
+ A(i+1:m,i), and tau in TAU(i).
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{sgeqp3.f}
+\index{sgeqp3.f}
+\begin{chunk}{sgeqp3.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK sgeqp3}
+
+\end{chunk}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{sgeqpf  DEPRECATED use sgeqp3}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{sgeqr2}
+\label{sgeqr2}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{sgeqr2.input}
+)set break resume
+)sys rm f sgeqr2.output
+)spool sgeqr2.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{sgeqr2.help}
+====================================================================
+sgeqr2 examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine sgeqr2 (M, N, A, LDA, TAU, WORK, INFO)
+ SGEQR2 computes the QR factorization of a general rectangular
+ matrix using an unblocked algorithm.
+
+Function/Subroutine Documentation
+ subroutine sgeqr2 (integer M, integer N, real, dimension( lda, * ) A,
+ integer LDA, real, dimension( * ) TAU, real, dimension( * ) WORK,
+ integer INFO)
+ SGEQR2 computes the QR factorization of a general rectangular matrix
+ using an unblocked algorithm.
+
+Purpose:
+ SGEQR2 computes a QR factorization of a real m by n matrix A: A = Q * R.
+
+Parameters:
+
+ M
+ M is INTEGER
+ The number of rows of the matrix A. M >= 0.
+
+ N
+ N is INTEGER
+ The number of columns of the matrix A. N >= 0.
+
+ A
+ A is REAL array, dimension (LDA,N)
+ On entry, the m by n matrix A.
+ On exit, the elements on and above the diagonal of the array
+ contain the min(m,n) by n upper trapezoidal matrix R (R is
+ upper triangular if m >= n); the elements below the diagonal,
+ with the array TAU, represent the orthogonal matrix Q as a
+ product of elementary reflectors (see Further Details).
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+
+ TAU
+ TAU is REAL array, dimension (min(M,N))
+ The scalar factors of the elementary reflectors (see Further Details).
+
+ WORK
+ WORK is REAL array, dimension (N)
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value
+
+Further Details:
+
+ The matrix Q is represented as a product of elementary reflectors
+
+ Q = H(1) H(2) . . . H(k), where k = min(m,n).
+
+ Each H(i) has the form
+
+ H(i) = I  tau * v * v**T
+
+ where tau is a real scalar, and v is a real vector with
+ v(1:i1) = 0 and v(i) = 1; v(i+1:m) is stored on exit in A(i+1:m,i),
+ and tau in TAU(i).
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{sgeqr2.f}
+\index{sgeqr2.f}
+\begin{chunk}{sgeqr2.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK sgeqr2}
+
+\end{chunk}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{sgeqr2p}
+\label{sgeqr2p}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{sgeqr2p.input}
+)set break resume
+)sys rm f sgeqr2p.output
+)spool sgeqr2p.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page \cite{Demm08}}
+\begin{chunk}{sgeqr2p.help}
+====================================================================
+sgeqr2p examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine sgeqr2p (M, N, A, LDA, TAU, WORK, INFO)
+ SGEQR2P computes the QR factorization of a general rectangular
+ matrix with nonnegative diagonal elements using an unblocked
+ algorithm.
+
+Function/Subroutine Documentation
+ subroutine sgeqr2p (integer M, integer N, real, dimension( lda, * ) A,
+ integer LDA, real, dimension( * ) TAU, real, dimension( * ) WORK,
+ integer INFO)
+ SGEQR2P computes the QR factorization of a general rectangular matrix
+ with nonnegative diagonal elements using an unblocked algorithm.
+
+Purpose:
+ SGEQR2P computes a QR factorization of a real m by n matrix A:
+ A = Q * R. The diagonal entries of R are nonnegative.
+
+Parameters:
+
+ M
+ M is INTEGER
+ The number of rows of the matrix A. M >= 0.
+
+ N
+ N is INTEGER
+ The number of columns of the matrix A. N >= 0.
+
+ A
+ A is REAL array, dimension (LDA,N)
+ On entry, the m by n matrix A.
+ On exit, the elements on and above the diagonal of the array
+ contain the min(m,n) by n upper trapezoidal matrix R (R is
+ upper triangular if m >= n). The diagonal entries of R
+ are nonnegative; the elements below the diagonal,
+ with the array TAU, represent the orthogonal matrix Q as a
+ product of elementary reflectors (see Further Details).
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+
+ TAU
+ TAU is REAL array, dimension (min(M,N))
+ The scalar factors of the elementary reflectors (see Further Details).
+
+ WORK
+ WORK is REAL array, dimension (N)
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value
+
+Further Details:
+
+ The matrix Q is represented as a product of elementary reflectors
+
+ Q = H(1) H(2) . . . H(k), where k = min(m,n).
+
+ Each H(i) has the form
+
+ H(i) = I  tau * v * v**T
+
+ where tau is a real scalar, and v is a real vector with
+ v(1:i1) = 0 and v(i) = 1; v(i+1:m) is stored on exit in A(i+1:m,i),
+ and tau in TAU(i).
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{sgeqr2p.f}
+\index{sgeqr2p.f}
+\begin{chunk}{sgeqr2p.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK sgeqr2p}
+
+\end{chunk}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{sgeqrf}
+\label{sgeqrf}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{sgeqrf.input}
+)set break resume
+)sys rm f sgeqrf.output
+)spool sgeqrf.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{sgeqrf.help}
+====================================================================
+sgeqrf examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine sgeqrf (M, N, A, LDA, TAU, WORK, LWORK, INFO)
+ SGEQRF
+
+Function/Subroutine Documentation
+ subroutine sgeqrf (integer M, integer N, real, dimension( lda, * ) A,
+ integer LDA, real, dimension( * ) TAU, real, dimension( * ) WORK,
+ integer LWORK, integer INFO)
+ SGEQRF
+
+Purpose:
+ SGEQRF computes a QR factorization of a real MbyN matrix A: A = Q * R.
+
+Parameters:
+
+ M
+ M is INTEGER
+ The number of rows of the matrix A. M >= 0.
+
+ N
+ N is INTEGER
+ The number of columns of the matrix A. N >= 0.
+
+ A
+ A is REAL array, dimension (LDA,N)
+ On entry, the MbyN matrix A.
+ On exit, the elements on and above the diagonal of the array
+ contain the min(M,N)byN upper trapezoidal matrix R (R is
+ upper triangular if m >= n); the elements below the diagonal,
+ with the array TAU, represent the orthogonal matrix Q as a
+ product of min(m,n) elementary reflectors (see Further Details).
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+
+ TAU
+ TAU is REAL array, dimension (min(M,N))
+ The scalar factors of the elementary reflectors (see Further Details).
+
+ WORK
+ WORK is REAL array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK. LWORK >= max(1,N).
+ For optimum performance LWORK >= N*NB, where NB is
+ the optimal blocksize.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value
+
+Further Details:
+
+ The matrix Q is represented as a product of elementary reflectors
+
+ Q = H(1) H(2) . . . H(k), where k = min(m,n).
+
+ Each H(i) has the form
+
+ H(i) = I  tau * v * v**T
+
+ where tau is a real scalar, and v is a real vector with
+ v(1:i1) = 0 and v(i) = 1; v(i+1:m) is stored on exit in A(i+1:m,i),
+ and tau in TAU(i).
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{sgeqrf.f}
+\index{sgeqrf.f}
+\begin{chunk}{sgeqrf.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK sgeqrf}
+
+\end{chunk}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{sgeqrfp}
+\label{sgeqrfp}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{sgeqrfp.input}
+)set break resume
+)sys rm f sgeqrfp.output
+)spool sgeqrfp.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page \cite{Demm08}}
+\begin{chunk}{sgeqrfp.help}
+====================================================================
+sgeqrfp examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine sgeqrfp (M, N, A, LDA, TAU, WORK, LWORK, INFO)
+ SGEQRFP
+
+Function/Subroutine Documentation
+ subroutine sgeqrfp (integer M, integer N, real, dimension( lda, * ) A,
+ integer LDA, real, dimension( * ) TAU, real, dimension( * ) WORK,
+ integer LWORK, integer INFO)
+ SGEQRFP
+
+Purpose:
+ SGEQRFP computes a QR factorization of a real MbyN matrix A:
+ A = Q * R. The diagonal entries of R are nonnegative.
+
+Parameters:
+
+ M
+ M is INTEGER
+ The number of rows of the matrix A. M >= 0.
+
+ N
+ N is INTEGER
+ The number of columns of the matrix A. N >= 0.
+
+ A
+ A is REAL array, dimension (LDA,N)
+ On entry, the MbyN matrix A.
+ On exit, the elements on and above the diagonal of the array
+ contain the min(M,N)byN upper trapezoidal matrix R (R is
+ upper triangular if m >= n). The diagonal entries of R
+ are nonnegative; the elements below the diagonal,
+ with the array TAU, represent the orthogonal matrix Q as a
+ product of min(m,n) elementary reflectors (see Further Details).
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+
+ TAU
+ TAU is REAL array, dimension (min(M,N))
+ The scalar factors of the elementary reflectors (see Further Details).
+
+ WORK
+ WORK is REAL array, dimension (MAX(1,LWORK))
+ On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+
+ LWORK
+ LWORK is INTEGER
+ The dimension of the array WORK. LWORK >= max(1,N).
+ For optimum performance LWORK >= N*NB, where NB is
+ the optimal blocksize.
+
+ If LWORK = 1, then a workspace query is assumed; the routine
+ only calculates the optimal size of the WORK array, returns
+ this value as the first entry of the WORK array, and no error
+ message related to LWORK is issued by XERBLA.
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value
+
+Further Details:
+
+ The matrix Q is represented as a product of elementary reflectors
+
+ Q = H(1) H(2) . . . H(k), where k = min(m,n).
+
+ Each H(i) has the form
+
+ H(i) = I  tau * v * v**T
+
+ where tau is a real scalar, and v is a real vector with
+ v(1:i1) = 0 and v(i) = 1; v(i+1:m) is stored on exit in A(i+1:m,i),
+ and tau in TAU(i).
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{sgeqrfp.f}
+\index{sgeqrfp.f}
+\begin{chunk}{sgeqrfp.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK sgeqrfp}
+
+\end{chunk}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{sgeqrt}
+\label{sgeqrt}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{sgeqrt.input}
+)set break resume
+)sys rm f sgeqrt.output
+)spool sgeqrt.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{sgeqrt.help}
+====================================================================
+sgeqrt examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine sgeqrt (M, N, NB, A, LDA, T, LDT, WORK, INFO)
+ SGEQRT
+
+Function/Subroutine Documentation
+ subroutine sgeqrt (integer M, integer N, integer NB, real, dimension( lda,
+ * ) A, integer LDA, real, dimension( ldt, * ) T, integer LDT, real,
+ dimension( * ) WORK, integer INFO)
+ SGEQRT
+
+Purpose:
+ SGEQRT computes a blocked QR factorization of a real MbyN matrix A
+ using the compact WY representation of Q.
+
+Parameters:
+
+ M
+ M is INTEGER
+ The number of rows of the matrix A. M >= 0.
+
+ N
+ N is INTEGER
+ The number of columns of the matrix A. N >= 0.
+
+ NB
+ NB is INTEGER
+ The block size to be used in the blocked QR. MIN(M,N) >= NB >= 1.
+
+ A
+ A is REAL array, dimension (LDA,N)
+ On entry, the MbyN matrix A.
+ On exit, the elements on and above the diagonal of the array
+ contain the min(M,N)byN upper trapezoidal matrix R (R is
+ upper triangular if M >= N); the elements below the diagonal
+ are the columns of V.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+
+ T
+ T is REAL array, dimension (LDT,MIN(M,N))
+ The upper triangular block reflectors stored in compact form
+ as a sequence of upper triangular blocks. See below
+ for further details.
+
+ LDT
+ LDT is INTEGER
+ The leading dimension of the array T. LDT >= NB.
+
+ WORK
+ WORK is REAL array, dimension (NB*N)
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value
+
+Further Details:
+
+ The matrix V stores the elementary reflectors H(i) in the ith column
+ below the diagonal. For example, if M=5 and N=3, the matrix V is
+
+ V = ( 1 )
+ ( v1 1 )
+ ( v1 v2 1 )
+ ( v1 v2 v3 )
+ ( v1 v2 v3 )
+
+ where the vi's represent the vectors which define H(i), which are returned
+ in the matrix A. The 1's along the diagonal of V are not stored in A.
+
+ Let K=MIN(M,N). The number of blocks is B = ceiling(K/NB), where each
+ block is of order NB except for the last block, which is of order
+ IB = K  (B1)*NB. For each of the B blocks, a upper triangular block
+ reflector factor is computed: T1, T2, ..., TB. The NBbyNB (and IBbyIB
+ for the last block) T's are stored in the NBbyN matrix T as
+
+ T = (T1 T2 ... TB).
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{sgeqrt.f}
+\index{sgeqrt.f}
+\begin{chunk}{sgeqrt.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK sgeqrt}
+
+\end{chunk}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{sgeqrt2}
+\label{sgeqrt2}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{sgeqrt2.input}
+)set break resume
+)sys rm f sgeqrt2.output
+)spool sgeqrt2.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{sgeqrt2.help}
+====================================================================
+sgeqrt2 examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine sgeqrt2 (M, N, A, LDA, T, LDT, INFO)
+ SGEQRT2 computes a QR factorization of a general real or complex
+ matrix using the compact WY representation of Q.
+
+Function/Subroutine Documentation
+ subroutine sgeqrt2 (integer M, integer N, real, dimension( lda, * ) A,
+ integer LDA, real, dimension( ldt, * ) T, integer LDT, integer INFO)
+ SGEQRT2 computes a QR factorization of a general real or complex matrix
+ using the compact WY representation of Q.
+
+Purpose:
+ SGEQRT2 computes a QR factorization of a real MbyN matrix A,
+ using the compact WY representation of Q.
+
+Parameters:
+
+ M
+ M is INTEGER
+ The number of rows of the matrix A. M >= N.
+
+ N
+ N is INTEGER
+ The number of columns of the matrix A. N >= 0.
+
+ A
+ A is REAL array, dimension (LDA,N)
+ On entry, the real MbyN matrix A. On exit, the elements on and
+ above the diagonal contain the NbyN upper triangular matrix R; the
+ elements below the diagonal are the columns of V. See below for
+ further details.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+
+ T
+ T is REAL array, dimension (LDT,N)
+ The NbyN upper triangular factor of the block reflector.
+ The elements on and above the diagonal contain the block
+ reflector T; the elements below the diagonal are not used.
+ See below for further details.
+
+ LDT
+ LDT is INTEGER
+ The leading dimension of the array T. LDT >= max(1,N).
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value
+
+Further Details:
+
+ The matrix V stores the elementary reflectors H(i) in the ith column
+ below the diagonal. For example, if M=5 and N=3, the matrix V is
+
+ V = ( 1 )
+ ( v1 1 )
+ ( v1 v2 1 )
+ ( v1 v2 v3 )
+ ( v1 v2 v3 )
+
+ where the vi's represent the vectors which define H(i), which are returned
+ in the matrix A. The 1's along the diagonal of V are not stored in A. The
+ block reflector H is then given by
+
+ H = I  V * T * V**T
+
+ where V**T is the transpose of V.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{sgeqrt2.f}
+\index{sgeqrt2.f}
+\begin{chunk}{sgeqrt2.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK sgeqrt2}
+
+\end{chunk}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{sgeqrt3}
+\label{sgeqrt3}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{sgeqrt3.input}
+)set break resume
+)sys rm f sgeqrt3.output
+)spool sgeqrt3.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page \cite{Elmr00}}
+\begin{chunk}{sgeqrt3.help}
+====================================================================
+sgeqrt3 examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ recursive subroutine sgeqrt3 (M, N, A, LDA, T, LDT, INFO)
+ SGEQRT3 recursively computes a QR factorization of a general real
+ or complex matrix using the compact WY representation of Q.
+
+Function/Subroutine Documentation
+ recursive subroutine sgeqrt3 (integer M, integer N, real, dimension( lda, *
+ ) A, integer LDA, real, dimension( ldt, * ) T, integer LDT, integer
+ INFO)
+ SGEQRT3 recursively computes a QR factorization of a general real or
+ complex matrix using the compact WY representation of Q.
+
+Purpose:
+ SGEQRT3 recursively computes a QR factorization of a real MbyN
+ matrix A, using the compact WY representation of Q.
+
+Parameters:
+
+ M
+ M is INTEGER
+ The number of rows of the matrix A. M >= N.
+
+ N
+ N is INTEGER
+ The number of columns of the matrix A. N >= 0.
+
+ A
+ A is REAL array, dimension (LDA,N)
+ On entry, the real MbyN matrix A. On exit, the elements on and
+ above the diagonal contain the NbyN upper triangular matrix R; the
+ elements below the diagonal are the columns of V. See below for
+ further details.
+
+ LDA
+ LDA is INTEGER
+ The leading dimension of the array A. LDA >= max(1,M).
+
+ T
+ T is REAL array, dimension (LDT,N)
+ The NbyN upper triangular factor of the block reflector.
+ The elements on and above the diagonal contain the block
+ reflector T; the elements below the diagonal are not used.
+ See below for further details.
+
+ LDT
+ LDT is INTEGER
+ The leading dimension of the array T. LDT >= max(1,N).
+
+ INFO
+ INFO is INTEGER
+ = 0: successful exit
+ < 0: if INFO = i, the ith argument had an illegal value
+
+Further Details:
+
+ The matrix V stores the elementary reflectors H(i) in the ith column
+ below the diagonal. For example, if M=5 and N=3, the matrix V is
+
+ V = ( 1 )
+ ( v1 1 )
+ ( v1 v2 1 )
+ ( v1 v2 v3 )
+ ( v1 v2 v3 )
+
+ where the vi's represent the vectors which define H(i), which are returned
+ in the matrix A. The 1's along the diagonal of V are not stored in A. The
+ block reflector H is then given by
+
+ H = I  V * T * V**T
+
+ where V**T is the transpose of V.
+
+\end{chunk}
+
+\subsection{fortran code}
+\label{sgeqrt3.f}
+\index{sgeqrt3.f}
+\begin{chunk}{sgeqrt3.f}
+\end{chunk}
+
+\subsection{lisp code}
+\begin{chunk}{LAPACK sgeqrt3}
+
+\end{chunk}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{sgerfs}
+\label{sgerfs}
+
+\subsection{Axiom unit tests}
+\begin{chunk}{sgerfs.input}
+)set break resume
+)sys rm f sgerfs.output
+)spool sgerfs.output
+)set message test on
+)set message auto off
+)clear all
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\subsection{Axiom help page}
+\begin{chunk}{sgerfs.help}
+====================================================================
+sgerfs examples
+====================================================================
+
+====================================================================
+Man Page Details
+====================================================================
+
+SYNOPSIS
+ Functions/Subroutines
+ subroutine sgerfs (TRANS, N, NRHS, A, LDA, AF, LDAF, IPIV, B, LDB, X,
+ LDX, FERR, BERR, WORK, IWORK, INFO)
+ SGERFS
+
+Function/Subroutine Documentation
+ subroutine sgerfs (character TRANS, integer N, integer NRHS, real,
+ dimension( lda, * ) A, integer LDA, real, dimension( ldaf, * ) AF,
+ integer LDAF, integer, dimension( * ) IPIV, real, dimension( ldb, * )
+ B, integer LDB, real, dimension( ldx, * ) X, integer LDX, real,
+ dimension( * ) FERR, real, dimension( * ) BERR, real, dimension( * )
+ WORK, integer, dimension( * ) IWORK, integer INFO)
+ SGERFS
+
+Purpose:
+ SGERFS improves the computed solution to a system of linear
+ equations and provides error bounds and backward error estimates for
+ the solution.
+
+Parameters:
+
+ TRANS
+ TRANS is CHARACTER*1
+ Specifies the form of the system of equations:
+ = 'N': A * X = B (No transpose)
+ = 'T': A**T * X = B (Transpose)
+ = 'C': A**H * X = B (Conjugate transpose = Transpose)
+
+ N
+ N is INTEGER
+ The order of the matrix A. N >= 0.
+
+ NRHS
+ NRHS is INTEGER
+ The number of right hand sides, i.e., the number of columns
+ of the ma