GURLS++  2.0.00
C++ Implementation of GURLS Matlab Toolbox
blas_lapack.h File Reference

Contains prototypes for BLAS level 1, 2, 3 and Lapack routines. More...

Include dependency graph for blas_lapack.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  gurls::BlasUtils
 BlasUtils is a convenience class to interface with Blas. More...

Namespaces

namespace  gurls
 

The main namespace of GURLS++.


Enumerations

enum  gurls::CBLAS_DIAG { CblasNonUnit = 5, CblasUnit = 6 }
 Diagonal options (unit, non unit)
enum  gurls::CBLAS_ORDER { CblasRowMajor = 9, CblasColMajor = 10 }
 Matrix Order (row major or column major)
enum  gurls::CBLAS_SIDE { CblasLeft = 7, CblasRight = 8 }
 Side options (left, right)
enum  gurls::CBLAS_TRANSPOSE { CblasNoTrans = 0, CblasTrans = 1, CblasConjTrans = 2 }
 Transposition options (no transpose, transpose, conjugate transpose)
enum  gurls::CBLAS_UPLO { CblasUpper = 3, CblasLower = 4 }
 Upper/lower options (upper, lower)

Functions

void daxpy_ (int *n, double *alpha, double *x, int *incx, double *y, int *incy)
 Prototype for Blas DAXPY.
void dcopy_ (int *n, double *x, int *incx, double *y, int *incy)
 Prototype for Blas DCOPY.
double ddot_ (int *n, double *x, int *incx, double *y, int *incy)
 Prototype for Blas DDOT.
int dgeev_ (char *jobvl, 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)
 Prototype for Lapack DGEEV.
int dgelss_ (int *m, int *n, int *nrhs, double *a, int *lda, double *b, int *ldb, double *s, double *rcond, int *rank, double *work, int *lwork, int *info)
 Prototype for Lapack DGELSS.
void dgemm_ (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)
 Prototype for Blas DGEMM.
void dgemv_ (char *trans, int *m, int *n, double *alpha, double *a, int *lda, double *x, int *incx, double *beta, double *y, int *incy)
 Prototype for Blas DGEMV.
void dgeqp3_ (int *m, int *n, double *A, int *lda, int *jpvt, double *tau, double *work, int *lwork, int *info)
 Prototype for Lapack DGEQP3.
int dgesvd_ (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)
 Prototype for Lapack DGESVD.
double dnrm2_ (int *n, double *x, int *incx)
 Prototype for Blas DNRM2.
void dorgqr_ (int *m, int *n, int *k, double *a, int *lda, double *tau, double *work, int *lwork, int *info)
 Prototype for Lapack DORGQR.
int dpotrf_ (char *UPLO, int *n, double *a, int *lda, int *info)
 Prototype for Lapack DPOTRF.
void dscal_ (int *n, double *a, double *x, int *incx)
 Prototype for Blas DSCAL.
void dswap_ (int *n, double *sx, int *incx, double *sy, int *incy)
 Prototype for Blas DSWAP.
int dsyev_ (char *jobz, char *uplo, int *n, double *a, int *lda, double *w, double *work, int *lwork, int *info)
 Prototype for Lapack DSYEV.
void dtrsm_ (char *side, char *uplo, char *transa, char *diag, int *m, int *n, double *alpha, double *a, int *lda, double *b, int *ldb)
 Prototype for Blas DTRSM.
void saxpy_ (int *n, float *alpha, float *x, int *incx, float *y, int *incy)
 Prototype for Blas SAXPY.
void scopy_ (int *n, float *x, int *incx, float *y, int *incy)
 Prototype for Blas SCOPY.
float sdot_ (int *n, float *x, int *incx, float *y, int *incy)
 Prototype for Blas SDOT.
int sgeev_ (char *jobvl, 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)
 Prototype for Lapack SGEEV.
int sgelss_ (int *m, int *n, int *nrhs, float *a, int *lda, float *b, int *ldb, float *s, float *rcond, int *rank, float *work, int *lwork, int *info)
 Prototype for Lapack SGELSS.
void sgemm_ (char *transa, char *transb, int *m, int *n, int *k, float *alpha, float *a, int *lda, float *b, int *ldb, float *beta, float *c, int *ldc)
 Prototype for Blas SGEMM.
void sgemv_ (char *trans, int *m, int *n, float *alpha, float *a, int *lda, float *x, int *incx, float *beta, float *y, int *incy)
 Prototype for Blas SGEMV.
void sgeqp3_ (int *m, int *n, float *A, int *lda, int *jpvt, float *tau, float *work, int *lwork, int *info)
 Prototype for Lapack SGEQP3.
int sgesvd_ (char *jobu, char *jobvt, int *m, int *n, float *a, int *lda, float *s, float *u, int *ldu, float *vt, int *ldvt, float *work, int *lwork, int *info)
 Prototype for Lapack SGESVD.
int sgetrf_ (int *m, int *n, float *a, int *lda, int *ipiv, int *info)
 Prototype for Lapack SGETRF.
int sgetri_ (int *n, float *a, int *lda, int *ipiv, float *work, int *lwork, int *info)
 Prototype for Lapack SGETRI.
float snrm2_ (int *n, float *x, int *incx)
 Prototype for Blas SNRM2.
void sorgqr_ (int *m, int *n, int *k, float *a, int *lda, float *tau, float *work, int *lwork, int *info)
 Prototype for Lapack SORGQR.
int spotrf_ (char *UPLO, int *n, float *a, int *lda, int *info)
 Prototype for Lapack SPOTRF.
void sscal_ (int *n, float *a, float *x, int *incx)
 Prototype for Blas SSCAL.
void sswap_ (int *n, float *sx, int *incx, float *sy, int *incy)
 Prototype for Blas SSWAP.
int ssyev_ (char *jobz, char *uplo, int *n, float *a, int *lda, float *w, float *work, int *lwork, int *info)
 Prototype for Lapack SSYEV.
void strsm_ (char *side, char *uplo, char *transa, char *diag, int *m, int *n, float *alpha, float *a, int *lda, float *b, int *ldb)
 Prototype for Blas STRSM.

Detailed Description

Definition in file blas_lapack.h.


Function Documentation

void daxpy_ ( int *  n,
double *  alpha,
double *  x,
int *  incx,
double *  y,
int *  incy 
)

Constant times a vector plus a vector

void dcopy_ ( int *  n,
double *  x,
int *  incx,
double *  y,
int *  incy 
)

Copies a vector x to a vector y

double ddot_ ( int *  n,
double *  x,
int *  incx,
double *  y,
int *  incy 
)

Dot product of two double precision vectors

int dgeev_ ( char *  jobvl,
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 
)

Computes for an N-by-N 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)^T A = \lambda (j) u(j)^T\]

where $u(j)^T$ denotes the transpose of $u(j)$. The computed eigenvectors are normalized to have Euclidean norm equal to 1 and largest component real.

int dgelss_ ( int *  m,
int *  n,
int *  nrhs,
double *  a,
int *  lda,
double *  b,
int *  ldb,
double *  s,
double *  rcond,
int *  rank,
double *  work,
int *  lwork,
int *  info 
)

Computes the minimum norm solution to a real linear least squares problem:

Minimize $||(| b - Ax |)||_2$.

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 effective rank of $A$ is determined by treating as zero those singular values which are less than RCOND times the largest singular value.

void dgemm_ ( 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 
)

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$, $\alpha$ and $\beta$ are scalars, and $A$, $B$ and $C$ are matrices, with $op(A)$ an m by k matrix, $op(B)$ a k by n matrix and $C$ an m by n matrix

void dgemv_ ( char *  trans,
int *  m,
int *  n,
double *  alpha,
double *  a,
int *  lda,
double *  x,
int *  incx,
double *  beta,
double *  y,
int *  incy 
)

Performs one of the matrix-vector operations

\[y = \alpha A x + \beta y\]

or

\[y = \alpha A^T x + \beta y\]

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

void dgeqp3_ ( int *  m,
int *  n,
double *  A,
int *  lda,
int *  jpvt,
double *  tau,
double *  work,
int *  lwork,
int *  info 
)

Computes a QR factorization with column pivoting of a matrix $A$: $A P = Q R$ using Level 3 BLAS.

int dgesvd_ ( 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 
)

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$.

double dnrm2_ ( int *  n,
double *  x,
int *  incx 
)

Returns the euclidean norm of a vector via the function name, so that $ SNRM2 = \sqrt{(x^T x)} $

void dorgqr_ ( int *  m,
int *  n,
int *  k,
double *  a,
int *  lda,
double *  tau,
double *  work,
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 SGEQRF.

int dpotrf_ ( char *  UPLO,
int *  n,
double *  a,
int *  lda,
int *  info 
)

Computes the Cholesky factorization of a real symmetric positive definite matrix A.

The factorization has the form

\[A = U^T U\]

, if UPLO = 'U', or

\[A = L L^T\]

, if UPLO = 'L', where $U$ is an upper triangular matrix and $L$ is lower triangular

void dscal_ ( int *  n,
double *  a,
double *  x,
int *  incx 
)

Scales a vector by a constant

void dswap_ ( int *  n,
double *  sx,
int *  incx,
double *  sy,
int *  incy 
)

Interchanges two vectors. Uses unrolled loops for increments equal to 1.

int dsyev_ ( char *  jobz,
char *  uplo,
int *  n,
double *  a,
int *  lda,
double *  w,
double *  work,
int *  lwork,
int *  info 
)

Computes all eigenvalues and, optionally, eigenvectors of a real symmetric matrix A.

void dtrsm_ ( char *  side,
char *  uplo,
char *  transa,
char *  diag,
int *  m,
int *  n,
double *  alpha,
double *  a,
int *  lda,
double *  b,
int *  ldb 
)

Solves one of the matrix equations

\[op(A) X = \alpha B\]

or

\[X op(A) = \alpha B\]

, where $\alpha$ is a scalar, $X$ and $B$ are m by n matrices, $A$ is a unit, or non-unit, upper or lower triangular matrix and $op(A)$ is one of $ op(A) = A$ or $op(A) = A^T$. The matrix $X$ is overwritten on $B$.

void saxpy_ ( int *  n,
float *  alpha,
float *  x,
int *  incx,
float *  y,
int *  incy 
)

Constant times a vector plus a vector

void scopy_ ( int *  n,
float *  x,
int *  incx,
float *  y,
int *  incy 
)

Copies a vector x to a vector y

float sdot_ ( int *  n,
float *  x,
int *  incx,
float *  y,
int *  incy 
)

Dot product of two single precision vectors

int sgeev_ ( char *  jobvl,
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 
)

Computes for an N-by-N 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)^T A = \lambda (j) u(j)^T\]

where $u(j)^T$ denotes the transpose of $u(j)$. The computed eigenvectors are normalized to have Euclidean norm equal to 1 and largest component real.

int sgelss_ ( int *  m,
int *  n,
int *  nrhs,
float *  a,
int *  lda,
float *  b,
int *  ldb,
float *  s,
float *  rcond,
int *  rank,
float *  work,
int *  lwork,
int *  info 
)

Computes the minimum norm solution to a real linear least squares problem:

Minimize $||(| b - Ax |)||_2$.

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 effective rank of $A$ is determined by treating as zero those singular values which are less than RCOND times the largest singular value.

void sgemm_ ( char *  transa,
char *  transb,
int *  m,
int *  n,
int *  k,
float *  alpha,
float *  a,
int *  lda,
float *  b,
int *  ldb,
float *  beta,
float *  c,
int *  ldc 
)

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$, $\alpha$ and $\beta$ are scalars, and $A$, $B$ and $C$ are matrices, with $op(A)$ an m by k matrix, $op(B)$ a k by n matrix and $C$ an m by n matrix

void sgemv_ ( char *  trans,
int *  m,
int *  n,
float *  alpha,
float *  a,
int *  lda,
float *  x,
int *  incx,
float *  beta,
float *  y,
int *  incy 
)

Performs one of the matrix-vector operations

\[y = \alpha A x + \beta y\]

or

\[y = \alpha A^T x + \beta y\]

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

void sgeqp3_ ( int *  m,
int *  n,
float *  A,
int *  lda,
int *  jpvt,
float *  tau,
float *  work,
int *  lwork,
int *  info 
)

Computes a QR factorization with column pivoting of a matrix $A$: $A P = Q R$ using Level 3 BLAS.

int sgesvd_ ( char *  jobu,
char *  jobvt,
int *  m,
int *  n,
float *  a,
int *  lda,
float *  s,
float *  u,
int *  ldu,
float *  vt,
int *  ldvt,
float *  work,
int *  lwork,
int *  info 
)

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$.

int sgetrf_ ( int *  m,
int *  n,
float *  a,
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)

int sgetri_ ( int *  n,
float *  a,
int *  lda,
int *  ipiv,
float *  work,
int *  lwork,
int *  info 
)

Computes the inverse of a matrix using the LU factorization computed by SGETRF.

This method inverts $U$ and then computes $A^{-1}$ by solving the system $A^{-1} L = U^{-1}$ for $A^{-1}$.

float snrm2_ ( int *  n,
float *  x,
int *  incx 
)

Returns the euclidean norm of a vector via the function name, so that $ SNRM2 = \sqrt{(x^T x)} $

void sorgqr_ ( int *  m,
int *  n,
int *  k,
float *  a,
int *  lda,
float *  tau,
float *  work,
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 SGEQRF.

int spotrf_ ( char *  UPLO,
int *  n,
float *  a,
int *  lda,
int *  info 
)

Computes the Cholesky factorization of a real symmetric positive definite matrix A.

The factorization has the form

\[A = U^T U\]

, if UPLO = 'U', or

\[A = L L^T\]

, if UPLO = 'L', where $U$ is an upper triangular matrix and $L$ is lower triangular

void sscal_ ( int *  n,
float *  a,
float *  x,
int *  incx 
)

Scales a vector by a constant

void sswap_ ( int *  n,
float *  sx,
int *  incx,
float *  sy,
int *  incy 
)

Interchanges two vectors. Uses unrolled loops for increments equal to 1.

int ssyev_ ( char *  jobz,
char *  uplo,
int *  n,
float *  a,
int *  lda,
float *  w,
float *  work,
int *  lwork,
int *  info 
)

Computes all eigenvalues and, optionally, eigenvectors of a real symmetric matrix A.

void strsm_ ( char *  side,
char *  uplo,
char *  transa,
char *  diag,
int *  m,
int *  n,
float *  alpha,
float *  a,
int *  lda,
float *  b,
int *  ldb 
)

Solves one of the matrix equations

\[op(A) X = \alpha B\]

or

\[X op(A) = \alpha B\]

, where $\alpha$ is a scalar, $X$ and $B$ are m by n matrices, $A$ is a unit, or non-unit, upper or lower triangular matrix and $op(A)$ is one of $ op(A) = A$ or $op(A) = A^T$. The matrix $X$ is overwritten on $B$.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends