MAGMA  2.0.0
Matrix Algebra for GPU and Multicore Architectures
 All Classes Files Functions Friends Groups Pages

Functions

magma_int_t magma_dgels (magma_trans_t trans, magma_int_t m, magma_int_t n, magma_int_t nrhs, magmaDouble_ptr A, magma_int_t lda, magmaDouble_ptr B, magma_int_t ldb, double *hwork, magma_int_t lwork, magma_int_t *info)
 DGELS solves the overdetermined, least squares problem min || A*X - C || using the QR factorization A. More...
 
magma_int_t magma_dgels3_gpu (magma_trans_t trans, magma_int_t m, magma_int_t n, magma_int_t nrhs, magmaDouble_ptr dA, magma_int_t ldda, magmaDouble_ptr dB, magma_int_t lddb, double *hwork, magma_int_t lwork, magma_int_t *info)
 DGELS solves the overdetermined, least squares problem min || A*X - C || using the QR factorization A. More...
 
magma_int_t magma_dgels_gpu (magma_trans_t trans, magma_int_t m, magma_int_t n, magma_int_t nrhs, magmaDouble_ptr dA, magma_int_t ldda, magmaDouble_ptr dB, magma_int_t lddb, double *hwork, magma_int_t lwork, magma_int_t *info)
 DGELS solves the overdetermined, least squares problem min || A*X - C || using the QR factorization A. More...
 
magma_int_t magma_dsgeqrsv_gpu (magma_int_t m, magma_int_t n, magma_int_t nrhs, magmaDouble_ptr dA, magma_int_t ldda, magmaDouble_ptr dB, magma_int_t lddb, magmaDouble_ptr dX, magma_int_t lddx, magma_int_t *iter, magma_int_t *info)
 DSGEQRSV solves the least squares problem min || A*X - B ||, where A is an M-by-N matrix and X and B are M-by-NRHS matrices. More...
 

Detailed Description

Function Documentation

magma_int_t magma_dgels ( magma_trans_t  trans,
magma_int_t  m,
magma_int_t  n,
magma_int_t  nrhs,
magmaDouble_ptr  A,
magma_int_t  lda,
magmaDouble_ptr  B,
magma_int_t  ldb,
double *  hwork,
magma_int_t  lwork,
magma_int_t *  info 
)

DGELS solves the overdetermined, least squares problem min || A*X - C || using the QR factorization A.

The underdetermined problem (m < n) is not currently handled.

Parameters
[in]transmagma_trans_t
  • = MagmaNoTrans: the linear system involves A. Only TRANS=MagmaNoTrans is currently handled.
[in]mINTEGER The number of rows of the matrix A. M >= 0.
[in]nINTEGER The number of columns of the matrix A. M >= N >= 0.
[in]nrhsINTEGER The number of columns of the matrix C. NRHS >= 0.
[in,out]ADOUBLE_PRECISION array, dimension (LDA,N) On entry, the M-by-N matrix A. On exit, A is overwritten by details of its QR factorization as returned by DGEQRF.
[in]ldaINTEGER The leading dimension of the array A, LDA >= M.
[in,out]BDOUBLE_PRECISION array, dimension (LDDB,NRHS) On entry, the M-by-NRHS matrix C. On exit, the N-by-NRHS solution matrix X.
[in]ldbINTEGER The leading dimension of the array B. LDB >= M.
[out]hwork(workspace) DOUBLE_PRECISION array, dimension MAX(1,LWORK). On exit, if INFO = 0, HWORK[0] returns the optimal LWORK.
[in]lworkINTEGER The dimension of the array HWORK, LWORK >= max( N*NB, 2*NB*NB ), where NB is the blocksize given by magma_get_dgeqrf_nb( M, N ).
If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the HWORK array, returns this value as the first entry of the HWORK array.
[out]infoINTEGER
  • = 0: successful exit
  • < 0: if INFO = -i, the i-th argument had an illegal value
magma_int_t magma_dgels3_gpu ( magma_trans_t  trans,
magma_int_t  m,
magma_int_t  n,
magma_int_t  nrhs,
magmaDouble_ptr  dA,
magma_int_t  ldda,
magmaDouble_ptr  dB,
magma_int_t  lddb,
double *  hwork,
magma_int_t  lwork,
magma_int_t *  info 
)

DGELS solves the overdetermined, least squares problem min || A*X - C || using the QR factorization A.

The underdetermined problem (m < n) is not currently handled.

Parameters
[in]transmagma_trans_t
  • = MagmaNoTrans: the linear system involves A. Only TRANS=MagmaNoTrans is currently handled.
[in]mINTEGER The number of rows of the matrix A. M >= 0.
[in]nINTEGER The number of columns of the matrix A. M >= N >= 0.
[in]nrhsINTEGER The number of columns of the matrix C. NRHS >= 0.
[in,out]dADOUBLE_PRECISION array, dimension (LDA,N) On entry, the M-by-N matrix A. On exit, A is overwritten by details of its QR factorization as returned by DGEQRF3.
[in]lddaINTEGER The leading dimension of the array A, LDDA >= M.
[in,out]dBDOUBLE_PRECISION array on the GPU, dimension (LDDB,NRHS) On entry, the M-by-NRHS matrix C. On exit, the N-by-NRHS solution matrix X.
[in]lddbINTEGER The leading dimension of the array dB. LDDB >= M.
[out]hwork(workspace) DOUBLE_PRECISION array, dimension MAX(1,LWORK). On exit, if INFO = 0, HWORK[0] returns the optimal LWORK.
[in]lworkINTEGER The dimension of the array HWORK, LWORK >= (M - N + NB)*(NRHS + NB) + NRHS*NB, where NB is the blocksize given by magma_get_dgeqrf_nb( M, N ).
If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the HWORK array, returns this value as the first entry of the HWORK array.
[out]infoINTEGER
  • = 0: successful exit
  • < 0: if INFO = -i, the i-th argument had an illegal value
magma_int_t magma_dgels_gpu ( magma_trans_t  trans,
magma_int_t  m,
magma_int_t  n,
magma_int_t  nrhs,
magmaDouble_ptr  dA,
magma_int_t  ldda,
magmaDouble_ptr  dB,
magma_int_t  lddb,
double *  hwork,
magma_int_t  lwork,
magma_int_t *  info 
)

DGELS solves the overdetermined, least squares problem min || A*X - C || using the QR factorization A.

The underdetermined problem (m < n) is not currently handled.

Parameters
[in]transmagma_trans_t
  • = MagmaNoTrans: the linear system involves A. Only TRANS=MagmaNoTrans is currently handled.
[in]mINTEGER The number of rows of the matrix A. M >= 0.
[in]nINTEGER The number of columns of the matrix A. M >= N >= 0.
[in]nrhsINTEGER The number of columns of the matrix C. NRHS >= 0.
[in,out]dADOUBLE_PRECISION array on the GPU, dimension (LDA,N) On entry, the M-by-N matrix A. On exit, A is overwritten by details of its QR factorization as returned by DGEQRF.
[in]lddaINTEGER The leading dimension of the array A, LDDA >= M.
[in,out]dBDOUBLE_PRECISION array on the GPU, dimension (LDDB,NRHS) On entry, the M-by-NRHS matrix C. On exit, the N-by-NRHS solution matrix X.
[in]lddbINTEGER The leading dimension of the array dB. LDDB >= M.
[out]hwork(workspace) DOUBLE_PRECISION array, dimension MAX(1,LWORK). On exit, if INFO = 0, HWORK[0] returns the optimal LWORK.
[in]lworkINTEGER The dimension of the array HWORK, LWORK >= (M - N + NB)*(NRHS + NB) + NRHS*NB, where NB is the blocksize given by magma_get_dgeqrf_nb( M, N ).
If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the HWORK array, returns this value as the first entry of the HWORK array.
[out]infoINTEGER
  • = 0: successful exit
  • < 0: if INFO = -i, the i-th argument had an illegal value
magma_int_t magma_dsgeqrsv_gpu ( magma_int_t  m,
magma_int_t  n,
magma_int_t  nrhs,
magmaDouble_ptr  dA,
magma_int_t  ldda,
magmaDouble_ptr  dB,
magma_int_t  lddb,
magmaDouble_ptr  dX,
magma_int_t  lddx,
magma_int_t *  iter,
magma_int_t *  info 
)

DSGEQRSV solves the least squares problem min || A*X - B ||, where A is an M-by-N matrix and X and B are M-by-NRHS matrices.

DSGEQRSV first attempts to factorize the matrix in real SINGLE PRECISION and use this factorization within an iterative refinement procedure to produce a solution with real DOUBLE PRECISION norm-wise backward error quality (see below). If the approach fails the method switches to a real DOUBLE PRECISION factorization and solve.

The iterative refinement is not going to be a winning strategy if the ratio real SINGLE PRECISION performance over real DOUBLE PRECISION performance is too small. A reasonable strategy should take the number of right-hand sides and the size of the matrix into account. This might be done with a call to ILAENV in the future. Up to now, we always try iterative refinement.

The iterative refinement process is stopped if ITER > ITERMAX or for all the RHS we have: RNRM < SQRT(N)*XNRM*ANRM*EPS*BWDMAX where o ITER is the number of the current iteration in the iterative refinement process o RNRM is the infinity-norm of the residual o XNRM is the infinity-norm of the solution o ANRM is the infinity-operator-norm of the matrix A o EPS is the machine epsilon returned by DLAMCH('Epsilon') The value ITERMAX and BWDMAX are fixed to 30 and 1.0D+00 respectively.

Parameters
[in]mINTEGER The number of rows of the matrix A. M >= 0.
[in]nINTEGER The number of columns of the matrix A. M >= N >= 0.
[in]nrhsINTEGER The number of right hand sides, i.e., the number of columns of the matrix B. NRHS >= 0.
[in,out]dADOUBLE PRECISION array on the GPU, dimension (LDDA,N) On entry, the M-by-N coefficient matrix A. On exit, if iterative refinement has been successfully used (info.EQ.0 and ITER.GE.0, see description below), A is unchanged. If double precision factorization has been used (info.EQ.0 and ITER.LT.0, see description below), then the array dA contains the QR factorization of A as returned by function DGEQRF_GPU.
[in]lddaINTEGER The leading dimension of the array dA. LDDA >= max(1,M).
[in,out]dBDOUBLE PRECISION array on the GPU, dimension (LDDB,NRHS) The M-by-NRHS right hand side matrix B. May be overwritten (e.g., if refinement fails).
[in]lddbINTEGER The leading dimension of the array dB. LDDB >= max(1,M).
[out]dXDOUBLE PRECISION array on the GPU, dimension (LDDX,NRHS) If info = 0, the N-by-NRHS solution matrix X.
[in]lddxINTEGER The leading dimension of the array dX. LDDX >= max(1,N).
[out]iterINTEGER
  • < 0: iterative refinement has failed, double precision factorization has been performed
    • -1 : the routine fell back to full precision for implementation- or machine-specific reasons
    • -2 : narrowing the precision induced an overflow, the routine fell back to full precision
    • -3 : failure of SGEQRF
    • -31: stop the iterative refinement after the 30th iteration
  • > 0: iterative refinement has been successfully used. Returns the number of iterations
[out]infoINTEGER
  • = 0: successful exit
  • < 0: if info = -i, the i-th argument had an illegal value