Sandia Home Sandia Home
Main Page | Publications | Downloads | Configuration | Running the Code | Solver Parameters | FAQ | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

APPSPACK_LAPACK_Wrappers.hpp File Reference


Detailed Description

No classes - Declare wrappers for the LAPACK functions.

Definition in file APPSPACK_LAPACK_Wrappers.hpp.

#include "APPSPACK_Common.hpp"

Include dependency graph for APPSPACK_LAPACK_Wrappers.hpp:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Namespaces

namespace  APPSPACK

Defines

#define DGELQF_F77   F77_FUNC(dgelqf,DGELQF)
 Name of LAPACK dqelfq function.
#define DGGLSE_F77   F77_FUNC(dgglse,DGGLSE)
 Name of LAPACK dgglse function.
#define DGESVD_F77   F77_FUNC(dgesvd,DGESVD)
 Name of LAPACK dgesvd function.
#define DGEMM_F77   F77_FUNC(dgemm,DGEMM)
 Name of LAPACK dgemm function.
#define DGEMM_F77   F77_FUNC(dgemm,DGEMM)
 Name of LAPACK dgemm function.
#define DGEMV_F77   F77_FUNC(dgemv,DGEMV)
 Name of BLAS dgemm function.
#define DDOT_F77   F77_FUNC(ddot,DDOT)
 Name of BLAS ddot function.

Functions

void DGELQF_F77 (int *M, int *N, double A[], int *LDA, double TAU[], double WORK[], int *LWORK, int *INFO)
 DGELQF computes an LQ factorization of a real M-by-N matrix A: A = L * Q.
void DGGLSE_F77 (int *M, int *N, int *P, double B[], int *LDB, double A[], int *LDA, double C[], double D[], double X[], double WORK[], int *LWORK, int *INFO)
 Solves the linear equality-constrained least squares problem min || c - Ax || subject to Bx = d.
void DGESVD_F77 (char *JOBU, char *JOBVT, int *M, int *N, double A[], int *LDA, double S[], double U[], int *LDU, double VT[], int *LDVT, double WORK[], int *LWORK, int *INFO)
 DGESVD computes the singular value decomposition (SVD) of a real M-by-N matrix A, optionally computing the left and/or right singular vectors. The SVD is written

\[ A = U \Sigma V^T \]

where $\Sigma$ is an M-by-N matrix which is zero except for its min(m,n) diagonal elements, U is an M-by-M orthogonal matrix, and V is an N-by-N orthogonal matrix. The diagonal elements of $\Sigma$ are the singular values of A; they are real and non-negative, 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.

void DGEMM_F77 (char *TRANSA, char *TRANSB, int *M, int *N, int *K, double *ALPHA, double A[], int *LDA, double B[], int *LDB, double *BETA, double C[], int *LDC)
 DGEMM performs one of the matrix-matrix operations

\[ C := \alpha *op( A ) *op( B ) + \beta* C, \]

where $ op( X )$ is one of $ op( X ) = X$ or $ op( X ) = X^T $, and $\alpha$ and $ \beta$ are scalars, and $A$, $B$ and $C$ are matrices, with $ op(A)$ an $ m \times k$ matrix, $ op(B)$ a $ k \times n$ matrix and $ C $ an $m \times n$ matrix.

void DGEMV_F77 (char *TRANS, int *M, int *N, double *ALPHA, double A[], int *LDA, double X[], int *INCX, double *BETA, double Y[], int *INCY)
 DGEMV performs one of the matrix-vector operations

\[ y := \alpha A x + \beta y, \;{\rm or }\; y := \alpha A' x + \beta y, \]

where $\alpha$ and $beta$ are scalars, $x$ and $y$ are vectors and $A$ is an $m$ by $n$ matrix.

double DDOT_F77 (int *n, double dx[], int *incx, double dy[], int *incy)
 Forms the dot product of two vectors. Uses unrolled loops for increments equal to one.


Define Documentation

#define DGELQF_F77   F77_FUNC(dgelqf,DGELQF)
 

Name of LAPACK dqelfq function.

Definition at line 48 of file APPSPACK_LAPACK_Wrappers.hpp.

#define DGGLSE_F77   F77_FUNC(dgglse,DGGLSE)
 

Name of LAPACK dgglse function.

Definition at line 51 of file APPSPACK_LAPACK_Wrappers.hpp.

#define DGESVD_F77   F77_FUNC(dgesvd,DGESVD)
 

Name of LAPACK dgesvd function.

Definition at line 54 of file APPSPACK_LAPACK_Wrappers.hpp.

#define DGEMM_F77   F77_FUNC(dgemm,DGEMM)
 

Name of LAPACK dgemm function.

Definition at line 60 of file APPSPACK_LAPACK_Wrappers.hpp.

#define DGEMM_F77   F77_FUNC(dgemm,DGEMM)
 

Name of LAPACK dgemm function.

Definition at line 60 of file APPSPACK_LAPACK_Wrappers.hpp.

#define DGEMV_F77   F77_FUNC(dgemv,DGEMV)
 

Name of BLAS dgemm function.

Definition at line 63 of file APPSPACK_LAPACK_Wrappers.hpp.

#define DDOT_F77   F77_FUNC(ddot,DDOT)
 

Name of BLAS ddot function.

Definition at line 66 of file APPSPACK_LAPACK_Wrappers.hpp.


Function Documentation

void DGELQF_F77 int *  M,
int *  N,
double  A[],
int *  LDA,
double  TAU[],
double  WORK[],
int *  LWORK,
int *  INFO
 

DGELQF computes an LQ factorization of a real M-by-N matrix A: A = L * Q.

Parameters:
M (input) INTEGER The number of rows of the matrix A. M >= 0.
N (input) INTEGER The number of columns of the matrix A. N >= 0.
A (input/output) 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 (input) INTEGER The leading dimension of the array A. LDA >= max(1,M).
TAU (output) DOUBLE PRECISION array, dimension (min(M,N)) The scalar factors of the elementary reflectors (see Further Details).
WORK (workspace/output) DOUBLE PRECISION array, dimension (LWORK) On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
LWORK (input) 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 (output) INTEGER = 0: successful exit < 0: if INFO = -i, the i-th 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'

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:n) is stored on exit in A(i,i+1:n), and tau in TAU(i).

Referenced by APPSPACK::Matrix::pruneDependentRows().

void DGGLSE_F77 int *  M,
int *  N,
int *  P,
double  B[],
int *  LDB,
double  A[],
int *  LDA,
double  C[],
double  D[],
double  X[],
double  WORK[],
int *  LWORK,
int *  INFO
 

Solves the linear equality-constrained least squares problem min || c - Ax || subject to Bx = d.

DGGLSE solves the linear equality-constrained least squares (LSE) problem:

\[ \mbox{minimize } \| c - Ax \|_2 \mbox{ subject to } Bx = d \]

where A is an M-by-N matrix, B is a P-by-N matrix, c is a given M-vector, and d is a given P-vector. It is assumed that P <= N <= M+P, and

\[ \mbox{rank}(B) = P \mbox{ and } \mbox{rank} \left( \begin{array}{c} A \\ B \end{array} \right) = N. \]

These conditions ensure that the LSE problem has a unique solution, which is obtained using a GRQ factorization of the matrices B and A.

Parameters:
M (input) INTEGER The number of rows of the matrix A. M >= 0.
N (input) INTEGER The number of columns of the matrices A and B. N >= 0.
P (input) INTEGER The number of rows of the matrix B. 0 <= P <= N <= M+P.
A (input/output) DOUBLE PRECISION array, dimension (LDA,N) On entry, the M-by-N matrix A. On exit, A is destroyed.
LDA (input) INTEGER The leading dimension of the array A. LDA >= max(1,M).
B (input/output) DOUBLE PRECISION array, dimension (LDB,N) On entry, the P-by-N matrix B. On exit, B is destroyed.
LDB (input) INTEGER The leading dimension of the array B. LDB >= max(1,P).
C (input/output) DOUBLE PRECISION array, dimension (M) On entry, C contains the right hand side vector for the least squares part of the LSE problem. On exit, the residual sum of squares for the solution is given by the sum of squares of elements N-P+1 to M of vector C.
D (input/output) DOUBLE PRECISION array, dimension (P) On entry, D contains the right hand side vector for the constrained equation. On exit, D is destroyed.
X (output) DOUBLE PRECISION array, dimension (N) On exit, X is the solution of the LSE problem.
WORK (workspace/output) DOUBLE PRECISION array, dimension (LWORK) On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
LWORK (input) INTEGER The dimension of the array WORK. LWORK >= max(1,M+N+P). For optimum performance LWORK >= P+min(M,N)+max(M,N)*NB, where NB is an upper bound for the optimal blocksizes for DGEQRF, SGERQF, DORMQR and SORMRQ. 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 (output) INTEGER = 0: successful exit. < 0: if INFO = -i, the i-th argument had an illegal value.

Referenced by APPSPACK::Matrix::constrainedLSQR().

void DGESVD_F77 char *  JOBU,
char *  JOBVT,
int *  M,
int *  N,
double  A[],
int *  LDA,
double  S[],
double  U[],
int *  LDU,
double  VT[],
int *  LDVT,
double  WORK[],
int *  LWORK,
int *  INFO
 

DGESVD computes the singular value decomposition (SVD) of a real M-by-N matrix A, optionally computing the left and/or right singular vectors. The SVD is written

\[ A = U \Sigma V^T \]

where $\Sigma$ is an M-by-N matrix which is zero except for its min(m,n) diagonal elements, U is an M-by-M orthogonal matrix, and V is an N-by-N orthogonal matrix. The diagonal elements of $\Sigma$ are the singular values of A; they are real and non-negative, 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 (input) 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 (input) 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 (input) INTEGER The number of rows of the input matrix A. M >= 0.
N (input) INTEGER The number of columns of the input matrix A. N >= 0.
A (input/output) DOUBLE PRECISION array, dimension (LDA,N). On entry, the M-by-N 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 (input) INTEGER The leading dimension of the array A. LDA >= max(1,M).
S (output) DOUBLE PRECISION array, dimension (min(M,N)). The singular values of A, sorted so that S(i) >= S(i+1).
U (output) 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 M-by-M 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 (input) INTEGER The leading dimension of the array U. LDU >= 1; if JOBU = 'S' or 'A', LDU >= M.
VT (output) DOUBLE PRECISION array, dimension (LDVT,N)
  • If JOBVT = 'A', VT contains the N-by-N 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 (input) INTEGER The leading dimension of the array VT. LDVT >= 1;
  • if JOBVT = 'A', LDVT >= N;
  • if JOBVT = 'S', LDVT >= min(M,N).
WORK (workspace/output) DOUBLE PRECISION array, dimension (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 (input) INTEGER The dimension of the array WORK. LWORK >= 1. LWORK >= MAX(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.
INFO (output) INTEGER
  • = 0: successful exit.
  • < 0: if INFO = -i, the i-th 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.

Referenced by APPSPACK::Matrix::svd().

void DGEMM_F77 char *  TRANSA,
char *  TRANSB,
int *  M,
int *  N,
int *  K,
double *  ALPHA,
double  A[],
int *  LDA,
double  B[],
int *  LDB,
double *  BETA,
double  C[],
int *  LDC
 

DGEMM performs one of the matrix-matrix operations

\[ C := \alpha *op( A ) *op( B ) + \beta* C, \]

where $ op( X )$ is one of $ op( X ) = X$ or $ op( X ) = X^T $, and $\alpha$ and $ \beta$ are scalars, and $A$, $B$ and $C$ are matrices, with $ op(A)$ an $ m \times k$ matrix, $ op(B)$ a $ k \times n$ matrix and $ C $ an $m \times n$ matrix.

Parameters:
TRANSA - CHARACTER1*. On entry, TRANSA specifies the form of op(A) to be used in the matrix multiplication as follows:
  • TRANSA = 'N' or 'n', $op(A) = A$.
  • TRANSA = 'T' or 't', $op(A) = A^T$.
  • TRANSA = 'C' or 'c', $op(A) = A^T$.
  • Unchanged on exit.
TRANSB - CHARACTER*1. On entry, TRANSB specifies the form of op(B) to be used in the matrix multiplication as follows:
  • TRANSB = 'N' or 'n', $op(B) = B$.
  • TRANSB = 'T' or 't', $op(B) = B^T$.
  • TRANSB = 'C' or 'c', $op(B) = B^T$.
  • Unchanged on exit.
M - INTEGER. On entry, M specifies the number of rows of the matrix op(A) and of the matrix C. M must be at least zero. Unchanged on exit.
N - INTEGER. On entry, N specifies the number of columns of the matrix op(B) and the number of columns of the matrix C. N must be at least zero. Unchanged on exit.
K - INTEGER. On entry, K specifies the number of columns of the matrix op(A) and the number of rows of the matrix op(B). K must be at least zero. Unchanged on exit.
ALPHA - DOUBLE PRECISION. On entry, ALPHA specifies the scalar alpha. Unchanged on exit.
A - DOUBLE PRECISION array of DIMENSION (LDA, ka), where ka is k when TRANSA = 'N' or 'n', and is m otherwise. Before entry with TRANSA = 'N' or 'n', the leading $m\times k$ part of the array A must contain the matrix A, otherwise the leading $ k \times m$ part of the array A must contain the matrix A. Unchanged on exit.
LDA - INTEGER. On entry, LDA specifies the first dimension of A as declared in the calling (sub) program. When TRANSA = 'N' or 'n' then LDA must be at least $\max(1,m)$, otherwise LDA must be at least $\max(1,k)$. Unchanged on exit.
B - DOUBLE PRECISION array of DIMENSION (LDB, kb), where kb is n when TRANSB = 'N' or 'n', and is k otherwise. Before entry with TRANSB = 'N' or 'n', the leading $k \times n $ part of the array B must contain the matrix B, otherwise the leading $ n \times k $ part of the array B must contain the matrix B. Unchanged on exit.
LDB - INTEGER. On entry, LDB specifies the first dimension of B as declared in the calling (sub) program. When TRANSB = 'N' or 'n' then LDB must be at least $\max(1,k)$, otherwise LDB must be at least $\max(1,n)$. Unchanged on exit.
BETA - DOUBLE PRECISION. On entry, BETA specifies the scalar beta. When BETA is supplied as zero then C need not be set on input. Unchanged on exit.
C - DOUBLE PRECISION array of DIMENSION (LDC, n). Before entry, the leading $m\times n$ part of the array C must contain the matrix C, except when beta is zero, in which case C need not be set on entry. On exit, the array C is overwritten by the $m\times n$ matrix $ \left(\alpha * op(A) * op(B) + \beta*C \right)$.
LDC - INTEGER. On entry, LDC specifies the first dimension of C as declared in the calling (sub) program. LDC must be at least $\max(1,m)$. Unchanged on exit.
DGEMM is a level 3 Blas routine.

Referenced by APPSPACK::Matrix::multMatWithBlas().

void DGEMV_F77 char *  TRANS,
int *  M,
int *  N,
double *  ALPHA,
double  A[],
int *  LDA,
double  X[],
int *  INCX,
double *  BETA,
double  Y[],
int *  INCY
 

DGEMV performs one of the matrix-vector operations

\[ y := \alpha A x + \beta y, \;{\rm or }\; y := \alpha A' x + \beta y, \]

where $\alpha$ and $beta$ are scalars, $x$ and $y$ are vectors and $A$ is an $m$ by $n$ matrix.

Parameters:
TRANS CHARACTER*1. On entry, TRANS specifies the operation to be performed as follows:
  • TRANS = 'N' or 'n' $ y := \alpha A x + \beta y $
  • TRANS = 'T' or 't' $ y := \alpha A' x + \beta y, $
  • TRANS = 'C' or 'c' $ y := \alpha A' x + \beta y, $ Unchanged on exit.
M INTEGER. On entry, M specifies the number of rows of the matrix A. M must be at least zero. Unchanged on exit.
N INTEGER. On entry, N specifies the number of columns of the matrix A. N must be at least zero. Unchanged on exit.
ALPHA DOUBLE PRECISION. On entry, ALPHA specifies the scalar alpha. Unchanged on exit.
A 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 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 DOUBLE PRECISION array of DIMENSION at least
  • ( 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 INTEGER. On entry, INCX specifies the increment for the elements of X. INCX must not be zero. Unchanged on exit.
BETA 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 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 non-zero, the incremented array Y must contain the vector y. On exit, Y is overwritten by the updated vector y.
INCY INTEGER. On entry, INCY specifies the increment for the elements of Y. INCY must not be zero. Unchanged on exit.
Level 2 Blas routine.

-- Written on 22-October-1986.

  • Jack Dongarra, Argonne National Lab.
  • Jeremy Du Croz, Nag Central Office.
  • Sven Hammarling, Nag Central Office.
  • Richard Hanson, Sandia National Labs.

Referenced by APPSPACK::Matrix::multVecWithBlas().

double DDOT_F77 int *  n,
double  dx[],
int *  incx,
double  dy[],
int *  incy
 

Forms the dot product of two vectors. Uses unrolled loops for increments equal to one.

Parameters:
n Length of dx and dy.
dx Input vector.
incx Increments to move along dx by.
dy Input vector.
incy Increments to move along dy by.
  • jack dongarra, linpack, 3/11/78.
  • modified 12/3/93, array(1) declarations changed to array(*)

Referenced by APPSPACK::Vector::dot().

 

© Sandia Corporation | Site Contact | Privacy and Security

Generated on Fri Feb 16 10:33:35 2007 for APPSPACK 5.0.1 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2002