![]() |
amino
Lightweight Robot Utility Library
|
Go to the source code of this file.
Functions | |
AA_API void | dgetri_ (const int *N, double *A, const int *LDA, const int *IPIV, double *WORK, const int *LWORK, int *INFO) |
type for operations More... | |
AA_API void | dgetrf_ (const int *M, const int *N, double *A, const int *LDA, int *IPIV, int *INFO) |
Computes an LU factorization of a general M-by-N matrix A using partial pivoting with row interchanges. More... | |
AA_API void | dgeqrf_ (const int *M, const int *N, double *A, const int *LDA, double *TAU, double *WORK, int *LWORK, int *INFO) |
DGEQRF computes a QR factorization of a real M-by-N matrix A: A = Q * R. More... | |
AA_API void | dorgqr_ (const int *M, const int *N, const int *K, double *A, const int *LDA, const double *TAU, double *WORK, const int *LWORK, int *INFO) |
Generates an M-by-N real matrix Q with orthonormal columns, which is defined as the first N columns of a product of K elementary reflectors of order M. More... | |
AA_API void | dposv_ (const char UPLO[1], const int *N, const int *NRHS, double *A, const int *LDA, double *B, const int *LDB, int *INFO) |
AA_API void | dgesvd_ (const char jobu[1], const char jobvt[1], const int *m, const int *n, double *A, const int *lda, double *S, double *U, const int *ldu, double *Vt, const int *ldvt, double *work, const int *lwork, int *info) |
Compute SVD. More... | |
AA_API void | dgesdd_ (const char *JOBZ, const int *M, const int *N, double *A, const int *LDA, double *S, double *U, const int *LDU, double *VT, const int *LDVT, double *WORK, const int *LWORK, int *IWORK, int *INFO) |
AA_API int | dgeev_ (const char *jobvl, const char *jobvr, int *n, double *a, int *lda, double *wr, double *wi, double *vl, int *ldvl, double *vr, int *ldvr, double *work, int *lwork, int *info) |
AA_API void | dgelsd_ (const int *M, const int *N, const int *NRHS, double *A, const int *LDA, double *B, const int *LDB, double *S, const double *RCOND, int *RANK, double *WORK, int *LWORK, int *IWORK, int *INFO) |
DGELSD computes the minimum-norm solution to a real linear least squares problem. More... | |
AA_API void | dgebal_ (const char JOB[1], int *N, double *A, const int *LDA, int *ILO, int *IHI, double *SCALE, int *INFO) |
Balances a general real matrix A. More... | |
AA_API void | dgees_ (const char JOBVS[1], const char SORT[1], int(*SELECT)(const double *, const double *), const int *N, double *A, const int *LDA, int *SDIM, double *WR, double *WI, double *VS, const int *LDVS, double *WORK, const int *LWORK, int *BWORK, int *INFO) |
Computes for an N-by-N real nonsymmetric matrix A, the eigenvalues, the real Schur form T, and, optionally, the matrix of Schur vectors Z. More... | |
AA_API void | dgels_ (const char TRANS[1], const int *M, const int *N, const int *NRHS, double *A, const int *LDA, double *B, const int *LDB, double *WORK, const int *LWORK, int *INFO) |
Solves overdetermined or underdetermined real linear systems involving an M-by-N matrix A, or its transpose, using a QR or LQ factorization of A. More... | |
AA_API void | dpotrf_ (const char UPLO[1], const int *N, double *A, const int *LDA, int *INFO) |
AA_API void | dpotrs_ (const char UPLO[1], const int *N, const int *nrhs, double *A, const int *LDA, double *B, const int *LDB, int *INFO) |
AA_API void | dlacpy_ (const char UPLO[1], const int *M, const int *N, const double *A, const int *LDA, double *B, const int *LDB) |
Copies all or part of a two-dimensional matrix A to another matrix B. More... | |
AA_API double | dlapy2_ (const double *x, const double *y) |
Returns sqrt(x**2+y**2), taking care not to cause unnecessary overflow. | |
AA_API double | dlapy3_ (const double *x, const double *y, const double *z) |
Returns sqrt(x**2+y**2+z**2), taking care not to cause unnecessary overflow. | |
AA_API void | dlaruv_ (int ISEED[4], const int *N, double *X) |
Returns a vector of n random real numbers from a uniform (0,1) distribution (n <= 128). More... | |
AA_API void | dlarnv_ (const int *IDIST, int ISEED[4], const int *N, double *X) |
Returns a vector of n random real numbers from a uniform or normal distribution. More... | |
AA_API void | dlascl_ (const char TYPE[1], const int *KL, const int *KU, const double *CFROM, const double *CTO, const int *M, const int *N, double *A, const int *LDA, int *INFO) |
Multiplies the M by N real matrix A by the real scalar CTO/CFROM. More... | |
AA_API void | dlaset_ (const char UPLO[1], const int *M, const int *N, const double *ALPHA, const double *BETA, double *A, const int *LDA) |
initializes an m-by-n matrix A to BETA on the diagonal and ALPHA on the offdiagonals. More... | |
AA_API void | dlag2s_ (const int *M, const int *N, double *A, const int *LDA, float *SA, const int *LDSA, const int *INFO) |
Converts a DOUBLE PRECISION matrix, SA, to a SINGLE PRECISION matrix, A. More... | |
AA_API void | slag2d_ (const int *M, const int *N, float *SA, const int *LDSA, double *A, const int *LDA, const int *INFO) |
Converts a SINGLE PRECISION matrix, SA, to a DOUBLE PRECISION matrix, A. More... | |
AA_API void | sgetri_ (const int *N, float *A, const int *LDA, const int *IPIV, float *WORK, const int *LWORK, int *INFO) |
type for operations More... | |
AA_API void | sgetrf_ (const int *M, const int *N, float *A, const int *LDA, int *IPIV, int *INFO) |
Computes an LU factorization of a general M-by-N matrix A using partial pivoting with row interchanges. More... | |
AA_API void | sgeqrf_ (const int *M, const int *N, float *A, const int *LDA, float *TAU, float *WORK, int *LWORK, int *INFO) |
DGEQRF computes a QR factorization of a real M-by-N matrix A: A = Q * R. More... | |
AA_API void | sorgqr_ (const int *M, const int *N, const int *K, float *A, const int *LDA, const float *TAU, float *WORK, const int *LWORK, int *INFO) |
Generates an M-by-N real matrix Q with orthonormal columns, which is defined as the first N columns of a product of K elementary reflectors of order M. More... | |
AA_API void | sposv_ (const char UPLO[1], const int *N, const int *NRHS, float *A, const int *LDA, float *B, const int *LDB, int *INFO) |
AA_API void | sgesvd_ (const char jobu[1], const char jobvt[1], const int *m, const int *n, float *A, const int *lda, float *S, float *U, const int *ldu, float *Vt, const int *ldvt, float *work, const int *lwork, int *info) |
Compute SVD. More... | |
AA_API void | sgesdd_ (const char *JOBZ, const int *M, const int *N, float *A, const int *LDA, float *S, float *U, const int *LDU, float *VT, const int *LDVT, float *WORK, const int *LWORK, int *IWORK, int *INFO) |
AA_API int | sgeev_ (const char *jobvl, const char *jobvr, int *n, float *a, int *lda, float *wr, float *wi, float *vl, int *ldvl, float *vr, int *ldvr, float *work, int *lwork, int *info) |
AA_API void | sgelsd_ (const int *M, const int *N, const int *NRHS, float *A, const int *LDA, float *B, const int *LDB, float *S, const float *RCOND, int *RANK, float *WORK, int *LWORK, int *IWORK, int *INFO) |
DGELSD computes the minimum-norm solution to a real linear least squares problem. More... | |
AA_API void | sgebal_ (const char JOB[1], int *N, float *A, const int *LDA, int *ILO, int *IHI, float *SCALE, int *INFO) |
Balances a general real matrix A. More... | |
AA_API void | sgees_ (const char JOBVS[1], const char SORT[1], int(*SELECT)(const float *, const float *), const int *N, float *A, const int *LDA, int *SDIM, float *WR, float *WI, float *VS, const int *LDVS, float *WORK, const int *LWORK, int *BWORK, int *INFO) |
Computes for an N-by-N real nonsymmetric matrix A, the eigenvalues, the real Schur form T, and, optionally, the matrix of Schur vectors Z. More... | |
AA_API void | sgels_ (const char TRANS[1], const int *M, const int *N, const int *NRHS, float *A, const int *LDA, float *B, const int *LDB, float *WORK, const int *LWORK, int *INFO) |
Solves overdetermined or underdetermined real linear systems involving an M-by-N matrix A, or its transpose, using a QR or LQ factorization of A. More... | |
AA_API void | spotrf_ (const char UPLO[1], const int *N, float *A, const int *LDA, int *INFO) |
AA_API void | spotrs_ (const char UPLO[1], const int *N, const int *nrhs, float *A, const int *LDA, float *B, const int *LDB, int *INFO) |
AA_API void | slacpy_ (const char UPLO[1], const int *M, const int *N, const float *A, const int *LDA, float *B, const int *LDB) |
Copies all or part of a two-dimensional matrix A to another matrix B. More... | |
AA_API float | slapy2_ (const float *x, const float *y) |
Returns sqrt(x**2+y**2), taking care not to cause unnecessary overflow. | |
AA_API float | slapy3_ (const float *x, const float *y, const float *z) |
Returns sqrt(x**2+y**2+z**2), taking care not to cause unnecessary overflow. | |
AA_API void | slaruv_ (int ISEED[4], const int *N, float *X) |
Returns a vector of n random real numbers from a uniform (0,1) distribution (n <= 128). More... | |
AA_API void | slarnv_ (const int *IDIST, int ISEED[4], const int *N, float *X) |
Returns a vector of n random real numbers from a uniform or normal distribution. More... | |
AA_API void | slascl_ (const char TYPE[1], const int *KL, const int *KU, const float *CFROM, const float *CTO, const int *M, const int *N, float *A, const int *LDA, int *INFO) |
Multiplies the M by N real matrix A by the real scalar CTO/CFROM. More... | |
AA_API void | slaset_ (const char UPLO[1], const int *M, const int *N, const float *ALPHA, const float *BETA, float *A, const int *LDA) |
initializes an m-by-n matrix A to BETA on the diagonal and ALPHA on the offdiagonals. More... | |
AA_API int | ilaenv_ (const int *ispec, const char *name, const char *opts, const int *n1, const int *n2, const int *n3, const int *n4, int name_length, int opts_length) |
ILAENV is called from the LAPACK routines to choose problem-dependent parameters for the local environment. More... | |
AA_API void dgebal_ | ( | const char | JOB[1], |
int * | N, | ||
double * | A, | ||
const int * | LDA, | ||
int * | ILO, | ||
int * | IHI, | ||
double * | SCALE, | ||
int * | INFO | ||
) |
Balances a general real matrix A.
This involves, first, permuting A by a similarity transformation to isolate eigenvalues in the first 1 to ILO-1 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 1-norm of the matrix, and improve the accuracy of the computed eigenvalues and/or eigenvectors.
[in] | JOB | Specifies the operations to be performed on A:
|
[in] | N | The order of the matrix A. N >= 0. |
[in,out] | A | 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. |
[in] | LDA | The leading dimension of the array A. LDA >= max(1,N). |
[out] | ILO | |
[out] | IHI | ILO and IHI are set to integers such that on exit A(i,j) = 0 if i > j and j = 1,...,ILO-1 or I = IHI+1,...,N. If JOB = 'N' or 'S', ILO = 1 and IHI = N. |
[out] | SCALE | 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,...,ILO-1 = 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 ILO-1. |
[out] | INFO |
|
AA_API void dgees_ | ( | const char | JOBVS[1], |
const char | SORT[1], | ||
int(*)(const double *, const double *) | SELECT, | ||
const int * | N, | ||
double * | A, | ||
const int * | LDA, | ||
int * | SDIM, | ||
double * | WR, | ||
double * | WI, | ||
double * | VS, | ||
const int * | LDVS, | ||
double * | WORK, | ||
const int * | LWORK, | ||
int * | BWORK, | ||
int * | INFO | ||
) |
Computes for an N-by-N 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 quasi-triangular with 1-by-1 and 2-by-2 blocks. 2-by-2 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).
[in] | JOBVS |
|
[in] | SORT | Specifies whether or not to order the eigenvalues on the diagonal of the Schur form.
|
[in] | SELECT | 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 ill-conditioned); in this case INFO is set to N+2 (see INFO below). |
[in] | N | The order of the matrix A. N >= 0. |
[in,out] | A | dimension (LDA,N) On entry, the N-by-N matrix A. On exit, A has been overwritten by its real Schur form T. |
[in] | LDA | The leading dimension of the array A. LDA >= max(1,N). |
[out] | SDIM |
|
[out] | WR | dimension (N) |
[out] | WI | 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. |
[out] | VS | dimension (LDVS,N)
|
[in] | LDVS | The leading dimension of the array VS. LDVS >= 1; if JOBVS = 'V', LDVS >= N. |
[out] | WORK | dimension (MAX(1,LWORK)) On exit, if INFO = 0, WORK(1) contains the optimal LWORK. |
[in] | LWORK | 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 | dimension (N) Not referenced if SORT = 'N'. | |
[out] | INFO |
|
AA_API void dgels_ | ( | const char | TRANS[1], |
const int * | M, | ||
const int * | N, | ||
const int * | NRHS, | ||
double * | A, | ||
const int * | LDA, | ||
double * | B, | ||
const int * | LDB, | ||
double * | WORK, | ||
const int * | LWORK, | ||
int * | INFO | ||
) |
Solves overdetermined or underdetermined real linear systems involving an M-by-N 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:
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 M-by-NRHS right hand side matrix B and the N-by-NRHS solution matrix X.
[in] | TRANS |
|
[in] | M | The number of rows of the matrix A. M >= 0. |
[in] | N | The number of columns of the matrix A. N >= 0. |
[in] | NRHS | The number of right hand sides, i.e., the number of columns of the matrices B and X. NRHS >=0. |
[in,out] | A | dimension (LDA,N) On entry, the M-by-N matrix A. On exit,
|
[in] | LDA | The leading dimension of the array A. LDA >= max(1,M). |
[in,out] | B | dimension (LDB,NRHS) On entry, the matrix B of right hand side vectors, stored columnwise; B is M-by-NRHS if TRANS = 'N', or N-by-NRHS
|
[in] | LDB | The leading dimension of the array B. LDB >= MAX(1,M,N). |
WORK | dimension (MAX(1,LWORK)) On exit, if INFO = 0, WORK(1) returns the optimal LWORK. | |
[in] | LWORK | 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. |
[out] | INFO |
|
AA_API void dgelsd_ | ( | const int * | M, |
const int * | N, | ||
const int * | NRHS, | ||
double * | A, | ||
const int * | LDA, | ||
double * | B, | ||
const int * | LDB, | ||
double * | S, | ||
const double * | RCOND, | ||
int * | RANK, | ||
double * | WORK, | ||
int * | LWORK, | ||
int * | IWORK, | ||
int * | INFO | ||
) |
DGELSD computes the minimum-norm solution to a real linear least squares problem.
Minimizes \(| b - A*x |\) using the singular value decomposition (SVD) of A. A is an M-by-N matrix which may be rank-deficient.
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 M-by-NRHS right hand side matrix B and the N-by-NRHS solution matrix X.
The problem is solved in three steps:
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 X-MP, Cray Y-MP, Cray C-90, or Cray-2. It could conceivably fail on hexadecimal or decimal machines without guard digits, but we know of none.
[in] | M | The number of rows of A. M >= 0. |
[in] | N | The number of columns of A. N >= 0. |
[in] | NRHS | The number of right hand sides, i.e., the number of columns of the matrices B and X. NRHS >= 0. |
[in] | A | dimension (LDA,N) On entry, the M-by-N matrix A. On exit, A has been destroyed. |
[in] | LDA | The leading dimension of the array A. LDA >= max(1,M). |
[in,out] | B | dimension (LDB,NRHS) On entry, the M-by-NRHS right hand side matrix B. On exit, B is overwritten by the N-by-NRHS solution matrix X. If m >= n and RANK = n, the residual sum-of-squares for the solution in the i-th column is given by the sum of squares of elements n+1:m in that column. |
[in] | LDB | The leading dimension of the array B. LDB >= max(1,max(M,N)). |
[out] | S | dimension (min(M,N)) The singular values of A in decreasing order. The condition number of A in the 2-norm = S(1)/S(min(m,n)). |
[in] | RCOND | 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. |
[out] | RANK | The effective rank of A, i.e., the number of singular values which are greater than RCOND*S(1). |
[out] | WORK | dimension (MAX(1,LWORK)) On exit, if INFO = 0, WORK(1) returns the optimal LWORK. |
[in] | LWORK | 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. |
[out] | IWORK | 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. |
[out] | INFO |
|
AA_API void dgeqrf_ | ( | const int * | M, |
const int * | N, | ||
double * | A, | ||
const int * | LDA, | ||
double * | TAU, | ||
double * | WORK, | ||
int * | LWORK, | ||
int * | INFO | ||
) |
DGEQRF computes a QR factorization of a real M-by-N matrix A: A = Q * R.
[in] | M | The number of rows of the matrix A. M >= 0. |
[in] | N | The number of columns of the matrix A. N >= 0. |
[in,out] | A | 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 min(m,n) elementary reflectors (see Further Details). |
[in] | LDA | The leading dimension of the array A. LDA >= max(1,M). |
[out] | TAU | dimension (min(M,N)) The scalar factors of the elementary reflectors (see Further Details). |
[out] | WORK | dimension (MAX(1,LWORK)) On exit, if INFO = 0, WORK(1) returns the optimal LWORK. |
[in] | LWORK | 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.
[out] | INFO | = 0: successful exit |
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'
where tau is a real scalar, and v is a real vector with v(1:i-1) = 0 and v(i) = 1; v(i+1:m) is stored on exit in A(i+1:m,i), and tau in TAU(i).
AA_API void dgesvd_ | ( | const char | jobu[1], |
const char | jobvt[1], | ||
const int * | m, | ||
const int * | n, | ||
double * | A, | ||
const int * | lda, | ||
double * | S, | ||
double * | U, | ||
const int * | ldu, | ||
double * | Vt, | ||
const int * | ldvt, | ||
double * | work, | ||
const int * | lwork, | ||
int * | info | ||
) |
Compute SVD.
[in] | jobu | Specifies options for computing all or part of the matrix U:
|
[in] | jobvt | Specifies options for computing all or part of the matrix V**T:
|
[in] | m | The number of rows of the input matrix A. M >= 0. |
[in] | n | The number of columns of the input matrix A. N >= 0. |
[in,out] | A | On entry, the M-by-N matrix A. On exit,
|
[in] | lda | The leading dimension of the array A. LDA >= max(1,M). |
[out] | S | The singular values of A, sorted so that S(i) >= S(i+1). dimension (min(M,N)) |
[out] | U | dimension (LDU,UCOL) (LDU,M) if JOBU = 'A' or (LDU,min(M,N)) if JOBU = 'S'.
|
[in] | ldu | The leading dimension of the array U. LDU >= 1; if JOBU = 'S' or 'A', LDU >= M. |
[out] | Vt | dimension (LDVT,N)
|
[in] | ldvt | The leading dimension of the array VT. LDVT >= 1; if JOBVT = 'A', LDVT >= N; if JOBVT = 'S', LDVT >= min(M,N). |
[out] | work | 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. |
[in] | lwork | The dimension of the array WORK. LWORK >= MAX(1,3*MIN(M,N)+MAX(M,N),5*MIN(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. |
[out] | info |
|
AA_API void dgetrf_ | ( | const int * | M, |
const int * | N, | ||
double * | A, | ||
const int * | LDA, | ||
int * | IPIV, | ||
int * | INFO | ||
) |
Computes an LU factorization of a general M-by-N 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 right-looking Level 3 BLAS version of the algorithm.
[in] | M | The number of rows of the matrix A. M >= 0. |
[in] | N | The number of columns of the matrix A. N >= 0. |
[in,out] | A | 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. |
[in] | LDA | The leading dimension of the array A. LDA >= max(1,M). |
[out] | IPIV | 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). |
[out] | INFO |
|
AA_API void dgetri_ | ( | const int * | N, |
double * | A, | ||
const int * | LDA, | ||
const int * | IPIV, | ||
double * | WORK, | ||
const int * | LWORK, | ||
int * | INFO | ||
) |
type for operations
Inverse of matrix using LU factorization by *getrf.
You must call *getrf before you call *getri.
[in] | N | Order of the matrix A |
[in,out] | A | on entry the L and U factors from *getrf, on exit the inverse of the original A |
[in] | LDA | number of rows in A |
[in] | IPIV | pivot indices from sgetrf |
WORK | workspace array | |
[in] | LWORK | length of work, optimally > n*nb where nb is the optimal blocksize return by ilaenv_ |
[out] | INFO | output. info==0 for success, info<zero for illegal argument, info > 0 for singular matrix |
AA_API void dlacpy_ | ( | const char | UPLO[1], |
const int * | M, | ||
const int * | N, | ||
const double * | A, | ||
const int * | LDA, | ||
double * | B, | ||
const int * | LDB | ||
) |
Copies all or part of a two-dimensional matrix A to another matrix B.
[in] | UPLO | Specifies the part of the matrix A to be copied to B.
|
[in] | M | The number of rows of the matrix A. M >= 0. |
[in] | N | The number of columns of the matrix A. N >= 0. |
[in] | A | dimension (LDA,N) The m by n matrix A. If UPLO = 'U', only the upper triangle or trapezoid is accessed; if UPLO = 'L', only the lower triangle or trapezoid is accessed. |
[in] | LDA | The leading dimension of the array A. LDA >= max(1,M). |
[out] | B | dimension (LDB,N) On exit, B = A in the locations specified by UPLO. |
[in] | LDB | The leading dimension of the array B. LDB >= max(1,M). |
AA_API void dlag2s_ | ( | const int * | M, |
const int * | N, | ||
double * | A, | ||
const int * | LDA, | ||
float * | SA, | ||
const int * | LDSA, | ||
const int * | INFO | ||
) |
Converts a DOUBLE PRECISION matrix, SA, to a SINGLE PRECISION matrix, A.
This is a helper routine so there is no argument checking.
[in] | M | The number of lines of the matrix A. M >= 0. |
[in] | N | The number of columns of the matrix A. N >= 0. |
[in] | A | On entry, the M-by-N coefficient matrix A. |
[in] | LDA | The leading dimension of the array A. LDA >= max(1,M). |
[out] | SA | On exit, if INFO=0, the M-by-N coefficient matrix SA. |
[in] | LDSA | The leading dimension of the array SA. LDSA >= max(1,M). |
[out] | INFO |
|
AA_API void dlarnv_ | ( | const int * | IDIST, |
int | ISEED[4], | ||
const int * | N, | ||
double * | X | ||
) |
Returns a vector of n random real numbers from a uniform or normal distribution.
[in] | IDIST | Specifies the distribution of the random numbers:
|
[in,out] | ISEED | On entry, the seed of the random number generator; the array elements must be between 0 and 4095, and ISEED(4) must be odd. On exit, the seed is updated. |
[in] | N | The number of random numbers to be generated. |
[out] | X | The generated random numbers. |
This routine calls the auxiliary routine DLARUV to generate random real numbers from a uniform (0,1) distribution, in batches of up to 128 using vectorisable code. The Box-Muller method is used to transform numbers from a uniform to a normal distribution.
AA_API void dlaruv_ | ( | int | ISEED[4], |
const int * | N, | ||
double * | X | ||
) |
Returns a vector of n random real numbers from a uniform (0,1) distribution (n <= 128).
This is an auxiliary routine called by DLARNV and ZLARNV.
[in,out] | ISEED | ISEED is INTEGER array, dimension (4) On entry, the seed of the random number generator; the array elements must be between 0 and 4095, and ISEED(4) must be odd. On exit, the seed is updated. |
[in] | N | N is INTEGER The number of random numbers to be generated. N <= 128. |
[out] | X | X is AA_TYPE PRECISION array, dimension (N) The generated random numbers. |
This routine uses a multiplicative congruential method with modulus 2**48 and multiplier 33952834046453 (see G.S.Fishman, 'Multiplicative congruential random number generators with modulus 2**b: an exhaustive analysis for b = 32 and a partial analysis for b = 48', Math. Comp. 189, pp 331-344, 1990).
48-bit integers are stored in 4 integer array elements with 12 bits per element. Hence the routine is portable across machines with integers of 32 bits or more.
AA_API void dlascl_ | ( | const char | TYPE[1], |
const int * | KL, | ||
const int * | KU, | ||
const double * | CFROM, | ||
const double * | CTO, | ||
const int * | M, | ||
const int * | N, | ||
double * | A, | ||
const int * | LDA, | ||
int * | INFO | ||
) |
Multiplies the M by N real matrix A by the real scalar CTO/CFROM.
k This is done without over/underflow as long as the final result CTO*A(I,J)/CFROM does not over/underflow. TYPE specifies that A may be full, upper triangular, lower triangular, upper Hessenberg, or banded.
[in] | TYPE | TYPE indices the storage type of the input matrix.
|
[in] | KL | The lower bandwidth of A. Referenced only if TYPE = 'B', 'Q' or 'Z'. |
[in] | KU | The upper bandwidth of A. Referenced only if TYPE = 'B', 'Q' or 'Z'. |
[in] | CFROM | |
[in] | CTO | The matrix A is multiplied by CTO/CFROM. A(I,J) is computed without over/underflow if the final result CTO*A(I,J)/CFROM can be represented without over/underflow. CFROM must be nonzero. |
[in] | M | The number of rows of the matrix A. M >= 0. |
[in] | N | The number of columns of the matrix A. N >= 0. |
[in,out] | A | The matrix to be multiplied by CTO/CFROM. See TYPE for the storage type. |
[in] | LDA | The leading dimension of the array A. LDA >= max(1,M). |
[out] | INFO | (output) INTEGER
|
AA_API void dlaset_ | ( | const char | UPLO[1], |
const int * | M, | ||
const int * | N, | ||
const double * | ALPHA, | ||
const double * | BETA, | ||
double * | A, | ||
const int * | LDA | ||
) |
initializes an m-by-n matrix A to BETA on the diagonal and ALPHA on the offdiagonals.
[in] | UPLO | UPLO is CHARACTER*1. Specifies the part of the matrix A to be set.
|
[in] | M | M is INTEGER. The number of rows of the matrix A. M >= 0. |
[in] | N | N is INTEGER. The number of columns of the matrix A. N >= 0. |
[in] | ALPHA | ALPHA is DOUBLE PRECISION. The constant to which the offdiagonal elements are to be set. |
[in] | BETA | BETA is DOUBLE PRECISION. The constant to which the diagonal elements are to be set. |
[in,out] | A | A is DOUBLE PRECISION array, dimension (LDA,N). On exit, the leading m-by-n submatrix of A is set as follows:
|
[in] | LDA | LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,M). |
AA_API void dorgqr_ | ( | const int * | M, |
const int * | N, | ||
const int * | K, | ||
double * | A, | ||
const int * | LDA, | ||
const double * | TAU, | ||
double * | WORK, | ||
const int * | LWORK, | ||
int * | INFO | ||
) |
Generates an M-by-N real matrix Q with orthonormal columns, which is defined as the first N columns of a product of K elementary reflectors of order M.
Q = H(1) H(2) . . . H(k)
as returned by xGEQRF.
[in] | M | The number of rows of the matrix Q. M >= 0. |
[in] | N | The number of columns of the matrix Q. M >= N >= 0. |
[in] | K | The number of elementary reflectors whose product defines the matrix Q. N >= K >= 0. |
[in,out] | A | dimension (LDA,N) On entry, the i-th column must contain the vector which defines the elementary reflector H(i), for i = 1,2,...,k, as returned by DGEQRF in the first k columns of its array argument A. On exit, the M-by-N matrix Q. |
[in] | LDA | The first dimension of the array A. LDA >= max(1,M). |
[in] | TAU | dimension (K) TAU(i) must contain the scalar factor of the elementary reflector H(i), as returned by DGEQRF. |
[out] | WORK | dimension (MAX(1,LWORK)) On exit, if INFO = 0, WORK(1) returns the optimal LWORK. |
[in] | LWORK | 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.
[out] | INFO | = 0: successful exit < 0: if INFO = -i, the i-th argument has an illegal value |
AA_API int ilaenv_ | ( | const int * | ispec, |
const char * | name, | ||
const char * | opts, | ||
const int * | n1, | ||
const int * | n2, | ||
const int * | n3, | ||
const int * | n4, | ||
int | name_length, | ||
int | opts_length | ||
) |
ILAENV is called from the LAPACK routines to choose problem-dependent parameters for the local environment.
ispec | Specifies the parameter to be returned as the value of ILAENV.
|
name | The name of the calling subroutine, in either upper case or lower case. |
opts | The character options to the subroutine NAME, concatenated into a single character string. For example, UPLO = 'U', TRANS = 'T', and DIAG = 'N' for a triangular routine would be specified as OPTS = 'UTN'. |
n1 | (input) INTEGER |
n2 | (input) INTEGER |
n3 | (input) INTEGER |
n4 | (input) INTEGER Problem dimensions for the subroutine NAME; these may not all be required. |
name_length | fortran string brain damage, length of name |
opts_length | fortran string brain damage, length of opts |
AA_API void sgebal_ | ( | const char | JOB[1], |
int * | N, | ||
float * | A, | ||
const int * | LDA, | ||
int * | ILO, | ||
int * | IHI, | ||
float * | SCALE, | ||
int * | INFO | ||
) |
Balances a general real matrix A.
This involves, first, permuting A by a similarity transformation to isolate eigenvalues in the first 1 to ILO-1 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 1-norm of the matrix, and improve the accuracy of the computed eigenvalues and/or eigenvectors.
[in] | JOB | Specifies the operations to be performed on A:
|
[in] | N | The order of the matrix A. N >= 0. |
[in,out] | A | 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. |
[in] | LDA | The leading dimension of the array A. LDA >= max(1,N). |
[out] | ILO | |
[out] | IHI | ILO and IHI are set to integers such that on exit A(i,j) = 0 if i > j and j = 1,...,ILO-1 or I = IHI+1,...,N. If JOB = 'N' or 'S', ILO = 1 and IHI = N. |
[out] | SCALE | 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,...,ILO-1 = 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 ILO-1. |
[out] | INFO |
|
AA_API void sgees_ | ( | const char | JOBVS[1], |
const char | SORT[1], | ||
int(*)(const float *, const float *) | SELECT, | ||
const int * | N, | ||
float * | A, | ||
const int * | LDA, | ||
int * | SDIM, | ||
float * | WR, | ||
float * | WI, | ||
float * | VS, | ||
const int * | LDVS, | ||
float * | WORK, | ||
const int * | LWORK, | ||
int * | BWORK, | ||
int * | INFO | ||
) |
Computes for an N-by-N 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 quasi-triangular with 1-by-1 and 2-by-2 blocks. 2-by-2 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).
[in] | JOBVS |
|
[in] | SORT | Specifies whether or not to order the eigenvalues on the diagonal of the Schur form.
|
[in] | SELECT | 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 ill-conditioned); in this case INFO is set to N+2 (see INFO below). |
[in] | N | The order of the matrix A. N >= 0. |
[in,out] | A | dimension (LDA,N) On entry, the N-by-N matrix A. On exit, A has been overwritten by its real Schur form T. |
[in] | LDA | The leading dimension of the array A. LDA >= max(1,N). |
[out] | SDIM |
|
[out] | WR | dimension (N) |
[out] | WI | 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. |
[out] | VS | dimension (LDVS,N)
|
[in] | LDVS | The leading dimension of the array VS. LDVS >= 1; if JOBVS = 'V', LDVS >= N. |
[out] | WORK | dimension (MAX(1,LWORK)) On exit, if INFO = 0, WORK(1) contains the optimal LWORK. |
[in] | LWORK | 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 | dimension (N) Not referenced if SORT = 'N'. | |
[out] | INFO |
|
AA_API void sgels_ | ( | const char | TRANS[1], |
const int * | M, | ||
const int * | N, | ||
const int * | NRHS, | ||
float * | A, | ||
const int * | LDA, | ||
float * | B, | ||
const int * | LDB, | ||
float * | WORK, | ||
const int * | LWORK, | ||
int * | INFO | ||
) |
Solves overdetermined or underdetermined real linear systems involving an M-by-N 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:
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 M-by-NRHS right hand side matrix B and the N-by-NRHS solution matrix X.
[in] | TRANS |
|
[in] | M | The number of rows of the matrix A. M >= 0. |
[in] | N | The number of columns of the matrix A. N >= 0. |
[in] | NRHS | The number of right hand sides, i.e., the number of columns of the matrices B and X. NRHS >=0. |
[in,out] | A | dimension (LDA,N) On entry, the M-by-N matrix A. On exit,
|
[in] | LDA | The leading dimension of the array A. LDA >= max(1,M). |
[in,out] | B | dimension (LDB,NRHS) On entry, the matrix B of right hand side vectors, stored columnwise; B is M-by-NRHS if TRANS = 'N', or N-by-NRHS
|
[in] | LDB | The leading dimension of the array B. LDB >= MAX(1,M,N). |
WORK | dimension (MAX(1,LWORK)) On exit, if INFO = 0, WORK(1) returns the optimal LWORK. | |
[in] | LWORK | 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. |
[out] | INFO |
|
AA_API void sgelsd_ | ( | const int * | M, |
const int * | N, | ||
const int * | NRHS, | ||
float * | A, | ||
const int * | LDA, | ||
float * | B, | ||
const int * | LDB, | ||
float * | S, | ||
const float * | RCOND, | ||
int * | RANK, | ||
float * | WORK, | ||
int * | LWORK, | ||
int * | IWORK, | ||
int * | INFO | ||
) |
DGELSD computes the minimum-norm solution to a real linear least squares problem.
Minimizes \(| b - A*x |\) using the singular value decomposition (SVD) of A. A is an M-by-N matrix which may be rank-deficient.
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 M-by-NRHS right hand side matrix B and the N-by-NRHS solution matrix X.
The problem is solved in three steps:
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 X-MP, Cray Y-MP, Cray C-90, or Cray-2. It could conceivably fail on hexadecimal or decimal machines without guard digits, but we know of none.
[in] | M | The number of rows of A. M >= 0. |
[in] | N | The number of columns of A. N >= 0. |
[in] | NRHS | The number of right hand sides, i.e., the number of columns of the matrices B and X. NRHS >= 0. |
[in] | A | dimension (LDA,N) On entry, the M-by-N matrix A. On exit, A has been destroyed. |
[in] | LDA | The leading dimension of the array A. LDA >= max(1,M). |
[in,out] | B | dimension (LDB,NRHS) On entry, the M-by-NRHS right hand side matrix B. On exit, B is overwritten by the N-by-NRHS solution matrix X. If m >= n and RANK = n, the residual sum-of-squares for the solution in the i-th column is given by the sum of squares of elements n+1:m in that column. |
[in] | LDB | The leading dimension of the array B. LDB >= max(1,max(M,N)). |
[out] | S | dimension (min(M,N)) The singular values of A in decreasing order. The condition number of A in the 2-norm = S(1)/S(min(m,n)). |
[in] | RCOND | 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. |
[out] | RANK | The effective rank of A, i.e., the number of singular values which are greater than RCOND*S(1). |
[out] | WORK | dimension (MAX(1,LWORK)) On exit, if INFO = 0, WORK(1) returns the optimal LWORK. |
[in] | LWORK | 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. |
[out] | IWORK | 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. |
[out] | INFO |
|
AA_API void sgeqrf_ | ( | const int * | M, |
const int * | N, | ||
float * | A, | ||
const int * | LDA, | ||
float * | TAU, | ||
float * | WORK, | ||
int * | LWORK, | ||
int * | INFO | ||
) |
DGEQRF computes a QR factorization of a real M-by-N matrix A: A = Q * R.
[in] | M | The number of rows of the matrix A. M >= 0. |
[in] | N | The number of columns of the matrix A. N >= 0. |
[in,out] | A | 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 min(m,n) elementary reflectors (see Further Details). |
[in] | LDA | The leading dimension of the array A. LDA >= max(1,M). |
[out] | TAU | dimension (min(M,N)) The scalar factors of the elementary reflectors (see Further Details). |
[out] | WORK | dimension (MAX(1,LWORK)) On exit, if INFO = 0, WORK(1) returns the optimal LWORK. |
[in] | LWORK | 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.
[out] | INFO | = 0: successful exit |
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'
where tau is a real scalar, and v is a real vector with v(1:i-1) = 0 and v(i) = 1; v(i+1:m) is stored on exit in A(i+1:m,i), and tau in TAU(i).
AA_API void sgesvd_ | ( | const char | jobu[1], |
const char | jobvt[1], | ||
const int * | m, | ||
const int * | n, | ||
float * | A, | ||
const int * | lda, | ||
float * | S, | ||
float * | U, | ||
const int * | ldu, | ||
float * | Vt, | ||
const int * | ldvt, | ||
float * | work, | ||
const int * | lwork, | ||
int * | info | ||
) |
Compute SVD.
[in] | jobu | Specifies options for computing all or part of the matrix U:
|
[in] | jobvt | Specifies options for computing all or part of the matrix V**T:
|
[in] | m | The number of rows of the input matrix A. M >= 0. |
[in] | n | The number of columns of the input matrix A. N >= 0. |
[in,out] | A | On entry, the M-by-N matrix A. On exit,
|
[in] | lda | The leading dimension of the array A. LDA >= max(1,M). |
[out] | S | The singular values of A, sorted so that S(i) >= S(i+1). dimension (min(M,N)) |
[out] | U | dimension (LDU,UCOL) (LDU,M) if JOBU = 'A' or (LDU,min(M,N)) if JOBU = 'S'.
|
[in] | ldu | The leading dimension of the array U. LDU >= 1; if JOBU = 'S' or 'A', LDU >= M. |
[out] | Vt | dimension (LDVT,N)
|
[in] | ldvt | The leading dimension of the array VT. LDVT >= 1; if JOBVT = 'A', LDVT >= N; if JOBVT = 'S', LDVT >= min(M,N). |
[out] | work | 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. |
[in] | lwork | The dimension of the array WORK. LWORK >= MAX(1,3*MIN(M,N)+MAX(M,N),5*MIN(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. |
[out] | info |
|
AA_API void sgetrf_ | ( | const int * | M, |
const int * | N, | ||
float * | A, | ||
const int * | LDA, | ||
int * | IPIV, | ||
int * | INFO | ||
) |
Computes an LU factorization of a general M-by-N 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 right-looking Level 3 BLAS version of the algorithm.
[in] | M | The number of rows of the matrix A. M >= 0. |
[in] | N | The number of columns of the matrix A. N >= 0. |
[in,out] | A | 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. |
[in] | LDA | The leading dimension of the array A. LDA >= max(1,M). |
[out] | IPIV | 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). |
[out] | INFO |
|
AA_API void sgetri_ | ( | const int * | N, |
float * | A, | ||
const int * | LDA, | ||
const int * | IPIV, | ||
float * | WORK, | ||
const int * | LWORK, | ||
int * | INFO | ||
) |
type for operations
Inverse of matrix using LU factorization by *getrf.
You must call *getrf before you call *getri.
[in] | N | Order of the matrix A |
[in,out] | A | on entry the L and U factors from *getrf, on exit the inverse of the original A |
[in] | LDA | number of rows in A |
[in] | IPIV | pivot indices from sgetrf |
WORK | workspace array | |
[in] | LWORK | length of work, optimally > n*nb where nb is the optimal blocksize return by ilaenv_ |
[out] | INFO | output. info==0 for success, info<zero for illegal argument, info > 0 for singular matrix |
AA_API void slacpy_ | ( | const char | UPLO[1], |
const int * | M, | ||
const int * | N, | ||
const float * | A, | ||
const int * | LDA, | ||
float * | B, | ||
const int * | LDB | ||
) |
Copies all or part of a two-dimensional matrix A to another matrix B.
[in] | UPLO | Specifies the part of the matrix A to be copied to B.
|
[in] | M | The number of rows of the matrix A. M >= 0. |
[in] | N | The number of columns of the matrix A. N >= 0. |
[in] | A | dimension (LDA,N) The m by n matrix A. If UPLO = 'U', only the upper triangle or trapezoid is accessed; if UPLO = 'L', only the lower triangle or trapezoid is accessed. |
[in] | LDA | The leading dimension of the array A. LDA >= max(1,M). |
[out] | B | dimension (LDB,N) On exit, B = A in the locations specified by UPLO. |
[in] | LDB | The leading dimension of the array B. LDB >= max(1,M). |
AA_API void slag2d_ | ( | const int * | M, |
const int * | N, | ||
float * | SA, | ||
const int * | LDSA, | ||
double * | A, | ||
const int * | LDA, | ||
const int * | INFO | ||
) |
Converts a SINGLE PRECISION matrix, SA, to a DOUBLE PRECISION matrix, A.
RMAX is the overflow for the SINGLE PRECISION arithmetic DLAG2S checks that all the entries of A are between -RMAX and RMAX. If not the convertion is aborted and a flag is raised.
This is a helper routine so there is no argument checking.
[in] | M | The number of lines of the matrix A. M >= 0. |
[in] | N | The number of columns of the matrix A. N >= 0. |
[out] | A | On exit, if INFO=0, the M-by-N coefficient matrix A. |
[in] | LDA | The leading dimension of the array A. LDA >= max(1,M). |
[in] | SA | On entry, the M-by-N coefficient matrix SA. |
[in] | LDSA | The leading dimension of the array SA. LDSA >= max(1,M). |
[out] | INFO |
|
AA_API void slarnv_ | ( | const int * | IDIST, |
int | ISEED[4], | ||
const int * | N, | ||
float * | X | ||
) |
Returns a vector of n random real numbers from a uniform or normal distribution.
[in] | IDIST | Specifies the distribution of the random numbers:
|
[in,out] | ISEED | On entry, the seed of the random number generator; the array elements must be between 0 and 4095, and ISEED(4) must be odd. On exit, the seed is updated. |
[in] | N | The number of random numbers to be generated. |
[out] | X | The generated random numbers. |
This routine calls the auxiliary routine DLARUV to generate random real numbers from a uniform (0,1) distribution, in batches of up to 128 using vectorisable code. The Box-Muller method is used to transform numbers from a uniform to a normal distribution.
AA_API void slaruv_ | ( | int | ISEED[4], |
const int * | N, | ||
float * | X | ||
) |
Returns a vector of n random real numbers from a uniform (0,1) distribution (n <= 128).
This is an auxiliary routine called by DLARNV and ZLARNV.
[in,out] | ISEED | ISEED is INTEGER array, dimension (4) On entry, the seed of the random number generator; the array elements must be between 0 and 4095, and ISEED(4) must be odd. On exit, the seed is updated. |
[in] | N | N is INTEGER The number of random numbers to be generated. N <= 128. |
[out] | X | X is AA_TYPE PRECISION array, dimension (N) The generated random numbers. |
This routine uses a multiplicative congruential method with modulus 2**48 and multiplier 33952834046453 (see G.S.Fishman, 'Multiplicative congruential random number generators with modulus 2**b: an exhaustive analysis for b = 32 and a partial analysis for b = 48', Math. Comp. 189, pp 331-344, 1990).
48-bit integers are stored in 4 integer array elements with 12 bits per element. Hence the routine is portable across machines with integers of 32 bits or more.
AA_API void slascl_ | ( | const char | TYPE[1], |
const int * | KL, | ||
const int * | KU, | ||
const float * | CFROM, | ||
const float * | CTO, | ||
const int * | M, | ||
const int * | N, | ||
float * | A, | ||
const int * | LDA, | ||
int * | INFO | ||
) |
Multiplies the M by N real matrix A by the real scalar CTO/CFROM.
k This is done without over/underflow as long as the final result CTO*A(I,J)/CFROM does not over/underflow. TYPE specifies that A may be full, upper triangular, lower triangular, upper Hessenberg, or banded.
[in] | TYPE | TYPE indices the storage type of the input matrix.
|
[in] | KL | The lower bandwidth of A. Referenced only if TYPE = 'B', 'Q' or 'Z'. |
[in] | KU | The upper bandwidth of A. Referenced only if TYPE = 'B', 'Q' or 'Z'. |
[in] | CFROM | |
[in] | CTO | The matrix A is multiplied by CTO/CFROM. A(I,J) is computed without over/underflow if the final result CTO*A(I,J)/CFROM can be represented without over/underflow. CFROM must be nonzero. |
[in] | M | The number of rows of the matrix A. M >= 0. |
[in] | N | The number of columns of the matrix A. N >= 0. |
[in,out] | A | The matrix to be multiplied by CTO/CFROM. See TYPE for the storage type. |
[in] | LDA | The leading dimension of the array A. LDA >= max(1,M). |
[out] | INFO | (output) INTEGER
|
AA_API void slaset_ | ( | const char | UPLO[1], |
const int * | M, | ||
const int * | N, | ||
const float * | ALPHA, | ||
const float * | BETA, | ||
float * | A, | ||
const int * | LDA | ||
) |
initializes an m-by-n matrix A to BETA on the diagonal and ALPHA on the offdiagonals.
[in] | UPLO | UPLO is CHARACTER*1. Specifies the part of the matrix A to be set.
|
[in] | M | M is INTEGER. The number of rows of the matrix A. M >= 0. |
[in] | N | N is INTEGER. The number of columns of the matrix A. N >= 0. |
[in] | ALPHA | ALPHA is DOUBLE PRECISION. The constant to which the offdiagonal elements are to be set. |
[in] | BETA | BETA is DOUBLE PRECISION. The constant to which the diagonal elements are to be set. |
[in,out] | A | A is DOUBLE PRECISION array, dimension (LDA,N). On exit, the leading m-by-n submatrix of A is set as follows:
|
[in] | LDA | LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,M). |
AA_API void sorgqr_ | ( | const int * | M, |
const int * | N, | ||
const int * | K, | ||
float * | A, | ||
const int * | LDA, | ||
const float * | TAU, | ||
float * | WORK, | ||
const int * | LWORK, | ||
int * | INFO | ||
) |
Generates an M-by-N real matrix Q with orthonormal columns, which is defined as the first N columns of a product of K elementary reflectors of order M.
Q = H(1) H(2) . . . H(k)
as returned by xGEQRF.
[in] | M | The number of rows of the matrix Q. M >= 0. |
[in] | N | The number of columns of the matrix Q. M >= N >= 0. |
[in] | K | The number of elementary reflectors whose product defines the matrix Q. N >= K >= 0. |
[in,out] | A | dimension (LDA,N) On entry, the i-th column must contain the vector which defines the elementary reflector H(i), for i = 1,2,...,k, as returned by DGEQRF in the first k columns of its array argument A. On exit, the M-by-N matrix Q. |
[in] | LDA | The first dimension of the array A. LDA >= max(1,M). |
[in] | TAU | dimension (K) TAU(i) must contain the scalar factor of the elementary reflector H(i), as returned by DGEQRF. |
[out] | WORK | dimension (MAX(1,LWORK)) On exit, if INFO = 0, WORK(1) returns the optimal LWORK. |
[in] | LWORK | 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.
[out] | INFO | = 0: successful exit < 0: if INFO = -i, the i-th argument has an illegal value |