MAGMA  2.3.0 Matrix Algebra for GPU and Multicore Architectures
gels: Least squares solves Ax = b using QR factorization (driver)

## Functions

magma_int_t magma_cgels (magma_trans_t trans, magma_int_t m, magma_int_t n, magma_int_t nrhs, magmaFloatComplex_ptr A, magma_int_t lda, magmaFloatComplex_ptr B, magma_int_t ldb, magmaFloatComplex *hwork, magma_int_t lwork, magma_int_t *info)
CGELS solves the overdetermined, least squares problem min || A*X - C || using the QR factorization A. More...

magma_int_t magma_cgels3_gpu (magma_trans_t trans, magma_int_t m, magma_int_t n, magma_int_t nrhs, magmaFloatComplex_ptr dA, magma_int_t ldda, magmaFloatComplex_ptr dB, magma_int_t lddb, magmaFloatComplex *hwork, magma_int_t lwork, magma_int_t *info)
CGELS solves the overdetermined, least squares problem min || A*X - C || using the QR factorization A. More...

magma_int_t magma_cgels_gpu (magma_trans_t trans, magma_int_t m, magma_int_t n, magma_int_t nrhs, magmaFloatComplex_ptr dA, magma_int_t ldda, magmaFloatComplex_ptr dB, magma_int_t lddb, magmaFloatComplex *hwork, magma_int_t lwork, magma_int_t *info)
CGELS solves the overdetermined, least squares problem min || A*X - C || using the QR factorization A. More...

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_sgels (magma_trans_t trans, magma_int_t m, magma_int_t n, magma_int_t nrhs, magmaFloat_ptr A, magma_int_t lda, magmaFloat_ptr B, magma_int_t ldb, float *hwork, magma_int_t lwork, magma_int_t *info)
SGELS solves the overdetermined, least squares problem min || A*X - C || using the QR factorization A. More...

magma_int_t magma_sgels3_gpu (magma_trans_t trans, magma_int_t m, magma_int_t n, magma_int_t nrhs, magmaFloat_ptr dA, magma_int_t ldda, magmaFloat_ptr dB, magma_int_t lddb, float *hwork, magma_int_t lwork, magma_int_t *info)
SGELS solves the overdetermined, least squares problem min || A*X - C || using the QR factorization A. More...

magma_int_t magma_sgels_gpu (magma_trans_t trans, magma_int_t m, magma_int_t n, magma_int_t nrhs, magmaFloat_ptr dA, magma_int_t ldda, magmaFloat_ptr dB, magma_int_t lddb, float *hwork, magma_int_t lwork, magma_int_t *info)
SGELS solves the overdetermined, least squares problem min || A*X - C || using the QR factorization A. More...

magma_int_t magma_zgels (magma_trans_t trans, magma_int_t m, magma_int_t n, magma_int_t nrhs, magmaDoubleComplex_ptr A, magma_int_t lda, magmaDoubleComplex_ptr B, magma_int_t ldb, magmaDoubleComplex *hwork, magma_int_t lwork, magma_int_t *info)
ZGELS solves the overdetermined, least squares problem min || A*X - C || using the QR factorization A. More...

magma_int_t magma_zgels3_gpu (magma_trans_t trans, magma_int_t m, magma_int_t n, magma_int_t nrhs, magmaDoubleComplex_ptr dA, magma_int_t ldda, magmaDoubleComplex_ptr dB, magma_int_t lddb, magmaDoubleComplex *hwork, magma_int_t lwork, magma_int_t *info)
ZGELS solves the overdetermined, least squares problem min || A*X - C || using the QR factorization A. More...

magma_int_t magma_zgels_gpu (magma_trans_t trans, magma_int_t m, magma_int_t n, magma_int_t nrhs, magmaDoubleComplex_ptr dA, magma_int_t ldda, magmaDoubleComplex_ptr dB, magma_int_t lddb, magmaDoubleComplex *hwork, magma_int_t lwork, magma_int_t *info)
ZGELS solves the overdetermined, least squares problem min || A*X - C || using the QR factorization A. More...

## Function Documentation

 magma_int_t magma_cgels ( magma_trans_t trans, magma_int_t m, magma_int_t n, magma_int_t nrhs, magmaFloatComplex_ptr A, magma_int_t lda, magmaFloatComplex_ptr B, magma_int_t ldb, magmaFloatComplex * hwork, magma_int_t lwork, magma_int_t * info )

CGELS 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] trans magma_trans_t = MagmaNoTrans: the linear system involves A. Only TRANS=MagmaNoTrans is currently handled. [in] m INTEGER The number of rows of the matrix A. M >= 0. [in] n INTEGER The number of columns of the matrix A. M >= N >= 0. [in] nrhs INTEGER The number of columns of the matrix C. NRHS >= 0. [in,out] A COMPLEX 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 CGEQRF. [in] lda INTEGER The leading dimension of the array A, LDA >= M. [in,out] B COMPLEX array, dimension (LDDB,NRHS) On entry, the M-by-NRHS matrix C. On exit, the N-by-NRHS solution matrix X. [in] ldb INTEGER The leading dimension of the array B. LDB >= M. [out] hwork (workspace) COMPLEX array, dimension MAX(1,LWORK). On exit, if INFO = 0, HWORK[0] returns the optimal LWORK. [in] lwork INTEGER The dimension of the array HWORK, LWORK >= max( N*NB, 2*NB*NB ), where NB is the blocksize given by magma_get_cgeqrf_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] info INTEGER = 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value
 magma_int_t magma_cgels3_gpu ( magma_trans_t trans, magma_int_t m, magma_int_t n, magma_int_t nrhs, magmaFloatComplex_ptr dA, magma_int_t ldda, magmaFloatComplex_ptr dB, magma_int_t lddb, magmaFloatComplex * hwork, magma_int_t lwork, magma_int_t * info )

CGELS 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] trans magma_trans_t = MagmaNoTrans: the linear system involves A. Only TRANS=MagmaNoTrans is currently handled. [in] m INTEGER The number of rows of the matrix A. M >= 0. [in] n INTEGER The number of columns of the matrix A. M >= N >= 0. [in] nrhs INTEGER The number of columns of the matrix C. NRHS >= 0. [in,out] dA COMPLEX array, dimension (LDDA,N) On entry, the M-by-N matrix A. On exit, A is overwritten by details of its QR factorization as returned by CGEQRF3. [in] ldda INTEGER The leading dimension of the array A, LDDA >= M. [in,out] dB COMPLEX 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] lddb INTEGER The leading dimension of the array dB. LDDB >= M. [out] hwork (workspace) COMPLEX array, dimension MAX(1,LWORK). On exit, if INFO = 0, HWORK[0] returns the optimal LWORK. [in] lwork INTEGER The dimension of the array HWORK, LWORK >= (M - N + NB)*(NRHS + NB) + NRHS*NB, where NB is the blocksize given by magma_get_cgeqrf_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] info INTEGER = 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value
 magma_int_t magma_cgels_gpu ( magma_trans_t trans, magma_int_t m, magma_int_t n, magma_int_t nrhs, magmaFloatComplex_ptr dA, magma_int_t ldda, magmaFloatComplex_ptr dB, magma_int_t lddb, magmaFloatComplex * hwork, magma_int_t lwork, magma_int_t * info )

CGELS 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] trans magma_trans_t = MagmaNoTrans: the linear system involves A. Only TRANS=MagmaNoTrans is currently handled. [in] m INTEGER The number of rows of the matrix A. M >= 0. [in] n INTEGER The number of columns of the matrix A. M >= N >= 0. [in] nrhs INTEGER The number of columns of the matrix C. NRHS >= 0. [in,out] dA COMPLEX array on the GPU, dimension (LDDA,N) On entry, the M-by-N matrix A. On exit, A is overwritten by details of its QR factorization as returned by CGEQRF. [in] ldda INTEGER The leading dimension of the array A, LDDA >= M. [in,out] dB COMPLEX 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] lddb INTEGER The leading dimension of the array dB. LDDB >= M. [out] hwork (workspace) COMPLEX array, dimension MAX(1,LWORK). On exit, if INFO = 0, HWORK[0] returns the optimal LWORK. [in] lwork INTEGER The dimension of the array HWORK, LWORK >= (M - N + NB)*(NRHS + NB) + NRHS*NB, where NB is the blocksize given by magma_get_cgeqrf_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] info INTEGER = 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value
 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] trans magma_trans_t = MagmaNoTrans: the linear system involves A. Only TRANS=MagmaNoTrans is currently handled. [in] m INTEGER The number of rows of the matrix A. M >= 0. [in] n INTEGER The number of columns of the matrix A. M >= N >= 0. [in] nrhs INTEGER The number of columns of the matrix C. NRHS >= 0. [in,out] A DOUBLE 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] lda INTEGER The leading dimension of the array A, LDA >= M. [in,out] B DOUBLE PRECISION array, dimension (LDDB,NRHS) On entry, the M-by-NRHS matrix C. On exit, the N-by-NRHS solution matrix X. [in] ldb INTEGER 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] lwork INTEGER 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] info INTEGER = 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] trans magma_trans_t = MagmaNoTrans: the linear system involves A. Only TRANS=MagmaNoTrans is currently handled. [in] m INTEGER The number of rows of the matrix A. M >= 0. [in] n INTEGER The number of columns of the matrix A. M >= N >= 0. [in] nrhs INTEGER The number of columns of the matrix C. NRHS >= 0. [in,out] dA DOUBLE PRECISION array, dimension (LDDA,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] ldda INTEGER The leading dimension of the array A, LDDA >= M. [in,out] dB DOUBLE 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] lddb INTEGER 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] lwork INTEGER 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] info INTEGER = 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] trans magma_trans_t = MagmaNoTrans: the linear system involves A. Only TRANS=MagmaNoTrans is currently handled. [in] m INTEGER The number of rows of the matrix A. M >= 0. [in] n INTEGER The number of columns of the matrix A. M >= N >= 0. [in] nrhs INTEGER The number of columns of the matrix C. NRHS >= 0. [in,out] dA DOUBLE PRECISION array on the GPU, dimension (LDDA,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] ldda INTEGER The leading dimension of the array A, LDDA >= M. [in,out] dB DOUBLE 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] lddb INTEGER 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] lwork INTEGER 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] info INTEGER = 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value
 magma_int_t magma_sgels ( magma_trans_t trans, magma_int_t m, magma_int_t n, magma_int_t nrhs, magmaFloat_ptr A, magma_int_t lda, magmaFloat_ptr B, magma_int_t ldb, float * hwork, magma_int_t lwork, magma_int_t * info )

SGELS 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] trans magma_trans_t = MagmaNoTrans: the linear system involves A. Only TRANS=MagmaNoTrans is currently handled. [in] m INTEGER The number of rows of the matrix A. M >= 0. [in] n INTEGER The number of columns of the matrix A. M >= N >= 0. [in] nrhs INTEGER The number of columns of the matrix C. NRHS >= 0. [in,out] A REAL 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 SGEQRF. [in] lda INTEGER The leading dimension of the array A, LDA >= M. [in,out] B REAL array, dimension (LDDB,NRHS) On entry, the M-by-NRHS matrix C. On exit, the N-by-NRHS solution matrix X. [in] ldb INTEGER The leading dimension of the array B. LDB >= M. [out] hwork (workspace) REAL array, dimension MAX(1,LWORK). On exit, if INFO = 0, HWORK[0] returns the optimal LWORK. [in] lwork INTEGER The dimension of the array HWORK, LWORK >= max( N*NB, 2*NB*NB ), where NB is the blocksize given by magma_get_sgeqrf_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] info INTEGER = 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value
 magma_int_t magma_sgels3_gpu ( magma_trans_t trans, magma_int_t m, magma_int_t n, magma_int_t nrhs, magmaFloat_ptr dA, magma_int_t ldda, magmaFloat_ptr dB, magma_int_t lddb, float * hwork, magma_int_t lwork, magma_int_t * info )

SGELS 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] trans magma_trans_t = MagmaNoTrans: the linear system involves A. Only TRANS=MagmaNoTrans is currently handled. [in] m INTEGER The number of rows of the matrix A. M >= 0. [in] n INTEGER The number of columns of the matrix A. M >= N >= 0. [in] nrhs INTEGER The number of columns of the matrix C. NRHS >= 0. [in,out] dA REAL array, dimension (LDDA,N) On entry, the M-by-N matrix A. On exit, A is overwritten by details of its QR factorization as returned by SGEQRF3. [in] ldda INTEGER The leading dimension of the array A, LDDA >= M. [in,out] dB REAL 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] lddb INTEGER The leading dimension of the array dB. LDDB >= M. [out] hwork (workspace) REAL array, dimension MAX(1,LWORK). On exit, if INFO = 0, HWORK[0] returns the optimal LWORK. [in] lwork INTEGER The dimension of the array HWORK, LWORK >= (M - N + NB)*(NRHS + NB) + NRHS*NB, where NB is the blocksize given by magma_get_sgeqrf_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] info INTEGER = 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value
 magma_int_t magma_sgels_gpu ( magma_trans_t trans, magma_int_t m, magma_int_t n, magma_int_t nrhs, magmaFloat_ptr dA, magma_int_t ldda, magmaFloat_ptr dB, magma_int_t lddb, float * hwork, magma_int_t lwork, magma_int_t * info )

SGELS 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] trans magma_trans_t = MagmaNoTrans: the linear system involves A. Only TRANS=MagmaNoTrans is currently handled. [in] m INTEGER The number of rows of the matrix A. M >= 0. [in] n INTEGER The number of columns of the matrix A. M >= N >= 0. [in] nrhs INTEGER The number of columns of the matrix C. NRHS >= 0. [in,out] dA REAL array on the GPU, dimension (LDDA,N) On entry, the M-by-N matrix A. On exit, A is overwritten by details of its QR factorization as returned by SGEQRF. [in] ldda INTEGER The leading dimension of the array A, LDDA >= M. [in,out] dB REAL 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] lddb INTEGER The leading dimension of the array dB. LDDB >= M. [out] hwork (workspace) REAL array, dimension MAX(1,LWORK). On exit, if INFO = 0, HWORK[0] returns the optimal LWORK. [in] lwork INTEGER The dimension of the array HWORK, LWORK >= (M - N + NB)*(NRHS + NB) + NRHS*NB, where NB is the blocksize given by magma_get_sgeqrf_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] info INTEGER = 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value
 magma_int_t magma_zgels ( magma_trans_t trans, magma_int_t m, magma_int_t n, magma_int_t nrhs, magmaDoubleComplex_ptr A, magma_int_t lda, magmaDoubleComplex_ptr B, magma_int_t ldb, magmaDoubleComplex * hwork, magma_int_t lwork, magma_int_t * info )

ZGELS 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] trans magma_trans_t = MagmaNoTrans: the linear system involves A. Only TRANS=MagmaNoTrans is currently handled. [in] m INTEGER The number of rows of the matrix A. M >= 0. [in] n INTEGER The number of columns of the matrix A. M >= N >= 0. [in] nrhs INTEGER The number of columns of the matrix C. NRHS >= 0. [in,out] A COMPLEX_16 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 ZGEQRF. [in] lda INTEGER The leading dimension of the array A, LDA >= M. [in,out] B COMPLEX_16 array, dimension (LDDB,NRHS) On entry, the M-by-NRHS matrix C. On exit, the N-by-NRHS solution matrix X. [in] ldb INTEGER The leading dimension of the array B. LDB >= M. [out] hwork (workspace) COMPLEX_16 array, dimension MAX(1,LWORK). On exit, if INFO = 0, HWORK[0] returns the optimal LWORK. [in] lwork INTEGER The dimension of the array HWORK, LWORK >= max( N*NB, 2*NB*NB ), where NB is the blocksize given by magma_get_zgeqrf_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] info INTEGER = 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value
 magma_int_t magma_zgels3_gpu ( magma_trans_t trans, magma_int_t m, magma_int_t n, magma_int_t nrhs, magmaDoubleComplex_ptr dA, magma_int_t ldda, magmaDoubleComplex_ptr dB, magma_int_t lddb, magmaDoubleComplex * hwork, magma_int_t lwork, magma_int_t * info )

ZGELS 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] trans magma_trans_t = MagmaNoTrans: the linear system involves A. Only TRANS=MagmaNoTrans is currently handled. [in] m INTEGER The number of rows of the matrix A. M >= 0. [in] n INTEGER The number of columns of the matrix A. M >= N >= 0. [in] nrhs INTEGER The number of columns of the matrix C. NRHS >= 0. [in,out] dA COMPLEX_16 array, dimension (LDDA,N) On entry, the M-by-N matrix A. On exit, A is overwritten by details of its QR factorization as returned by ZGEQRF3. [in] ldda INTEGER The leading dimension of the array A, LDDA >= M. [in,out] dB COMPLEX_16 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] lddb INTEGER The leading dimension of the array dB. LDDB >= M. [out] hwork (workspace) COMPLEX_16 array, dimension MAX(1,LWORK). On exit, if INFO = 0, HWORK[0] returns the optimal LWORK. [in] lwork INTEGER The dimension of the array HWORK, LWORK >= (M - N + NB)*(NRHS + NB) + NRHS*NB, where NB is the blocksize given by magma_get_zgeqrf_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] info INTEGER = 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value
 magma_int_t magma_zgels_gpu ( magma_trans_t trans, magma_int_t m, magma_int_t n, magma_int_t nrhs, magmaDoubleComplex_ptr dA, magma_int_t ldda, magmaDoubleComplex_ptr dB, magma_int_t lddb, magmaDoubleComplex * hwork, magma_int_t lwork, magma_int_t * info )

ZGELS 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] trans magma_trans_t = MagmaNoTrans: the linear system involves A. Only TRANS=MagmaNoTrans is currently handled. [in] m INTEGER The number of rows of the matrix A. M >= 0. [in] n INTEGER The number of columns of the matrix A. M >= N >= 0. [in] nrhs INTEGER The number of columns of the matrix C. NRHS >= 0. [in,out] dA COMPLEX_16 array on the GPU, dimension (LDDA,N) On entry, the M-by-N matrix A. On exit, A is overwritten by details of its QR factorization as returned by ZGEQRF. [in] ldda INTEGER The leading dimension of the array A, LDDA >= M. [in,out] dB COMPLEX_16 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] lddb INTEGER The leading dimension of the array dB. LDDB >= M. [out] hwork (workspace) COMPLEX_16 array, dimension MAX(1,LWORK). On exit, if INFO = 0, HWORK[0] returns the optimal LWORK. [in] lwork INTEGER The dimension of the array HWORK, LWORK >= (M - N + NB)*(NRHS + NB) + NRHS*NB, where NB is the blocksize given by magma_get_zgeqrf_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] info INTEGER = 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value