Loading...
Searching...
No Matches
posv: Solves Ax = b using Cholesky factorization (driver)
Dense LA » Linear system solvers » Symmetric/Hermitian positive definite: Cholesky

## Functions

magma_int_t | magma_cposv (magma_uplo_t uplo, magma_int_t n, magma_int_t nrhs, magmaFloatComplex *A, magma_int_t lda, magmaFloatComplex *B, magma_int_t ldb, magma_int_t *info)
| CPOSV computes the solution to a complex system of linear equations A * X = B, where A is an N-by-N Hermitian positive definite matrix and X and B are N-by-NRHS matrices.
magma_int_t | magma_cposv_gpu (magma_uplo_t uplo, magma_int_t n, magma_int_t nrhs, magmaFloatComplex_ptr dA, magma_int_t ldda, magmaFloatComplex_ptr dB, magma_int_t lddb, magma_int_t *info)
| CPOSV computes the solution to a complex system of linear equations A * X = B, where A is an N-by-N Hermitian positive definite matrix and X and B are N-by-NRHS matrices.
magma_int_t | magma_dposv (magma_uplo_t uplo, magma_int_t n, magma_int_t nrhs, double *A, magma_int_t lda, double *B, magma_int_t ldb, magma_int_t *info)
| DPOSV computes the solution to a real system of linear equations A * X = B, where A is an N-by-N symmetric positive definite matrix and X and B are N-by-NRHS matrices.
magma_int_t | magma_dposv_gpu (magma_uplo_t uplo, magma_int_t n, magma_int_t nrhs, magmaDouble_ptr dA, magma_int_t ldda, magmaDouble_ptr dB, magma_int_t lddb, magma_int_t *info)
| DPOSV computes the solution to a real system of linear equations A * X = B, where A is an N-by-N symmetric positive definite matrix and X and B are N-by-NRHS matrices.
magma_int_t | magma_dshposv_gpu_expert (magma_uplo_t uplo, 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, magmaDouble_ptr dworkd, magmaFloat_ptr dworks, magma_int_t *iter, magma_mode_t mode, magma_int_t use_gmres, magma_int_t preprocess, float cn, float theta, magma_int_t *info)
| DSHPOSV computes the solution to a real system of linear equations A * X = B, where A is an N-by-N symmetric positive definite matrix and X and B are N-by-NRHS matrices.
magma_int_t | magma_dsposv_gpu (magma_uplo_t uplo, 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, magmaDouble_ptr dworkd, magmaFloat_ptr dworks, magma_int_t *iter, magma_int_t *info)
| DSPOSV computes the solution to a real system of linear equations A * X = B, where A is an N-by-N symmetric positive definite matrix and X and B are N-by-NRHS matrices.
magma_int_t | magma_sposv (magma_uplo_t uplo, magma_int_t n, magma_int_t nrhs, float *A, magma_int_t lda, float *B, magma_int_t ldb, magma_int_t *info)
| SPOSV computes the solution to a real system of linear equations A * X = B, where A is an N-by-N symmetric positive definite matrix and X and B are N-by-NRHS matrices.
magma_int_t | magma_sposv_gpu (magma_uplo_t uplo, magma_int_t n, magma_int_t nrhs, magmaFloat_ptr dA, magma_int_t ldda, magmaFloat_ptr dB, magma_int_t lddb, magma_int_t *info)
| SPOSV computes the solution to a real system of linear equations A * X = B, where A is an N-by-N symmetric positive definite matrix and X and B are N-by-NRHS matrices.
magma_int_t | magma_zcposv_gpu (magma_uplo_t uplo, magma_int_t n, magma_int_t nrhs, magmaDoubleComplex_ptr dA, magma_int_t ldda, magmaDoubleComplex_ptr dB, magma_int_t lddb, magmaDoubleComplex_ptr dX, magma_int_t lddx, magmaDoubleComplex_ptr dworkd, magmaFloatComplex_ptr dworks, magma_int_t *iter, magma_int_t *info)
| ZCPOSV computes the solution to a complex system of linear equations A * X = B, where A is an N-by-N Hermitian positive definite matrix and X and B are N-by-NRHS matrices.
magma_int_t | magma_zposv (magma_uplo_t uplo, magma_int_t n, magma_int_t nrhs, magmaDoubleComplex *A, magma_int_t lda, magmaDoubleComplex *B, magma_int_t ldb, magma_int_t *info)
| ZPOSV computes the solution to a complex system of linear equations A * X = B, where A is an N-by-N Hermitian positive definite matrix and X and B are N-by-NRHS matrices.
magma_int_t | magma_zposv_gpu (magma_uplo_t uplo, magma_int_t n, magma_int_t nrhs, magmaDoubleComplex_ptr dA, magma_int_t ldda, magmaDoubleComplex_ptr dB, magma_int_t lddb, magma_int_t *info)
| ZPOSV computes the solution to a complex system of linear equations A * X = B, where A is an N-by-N Hermitian positive definite matrix and X and B are N-by-NRHS matrices.

## Detailed Description

## Function Documentation

## magma_cposv()

magma_int_t magma_cposv | ( | magma_uplo_t | uplo,
|  | magma_int_t | n,
|  | magma_int_t | nrhs,
|  | magmaFloatComplex * | A,
|  | magma_int_t | lda,
|  | magmaFloatComplex * | B,
|  | magma_int_t | ldb,
|  | magma_int_t * | info )

CPOSV computes the solution to a complex system of linear equations A * X = B, where A is an N-by-N Hermitian positive definite matrix and X and B are N-by-NRHS matrices.

The Cholesky decomposition is used to factor A as A = U**H * U, if UPLO = MagmaUpper, or A = L * L**H, if UPLO = MagmaLower, where U is an upper triangular matrix and L is a lower triangular matrix. The factored form of A is then used to solve the system of equations A * X = B.

Parameters

  [in]

  uplo

  magma_uplo_t
  - = MagmaUpper: Upper triangle of A is stored;
  - = MagmaLower: Lower triangle of A is stored.

  [in] | n | INTEGER The order of the matrix A. N >= 0.
  [in] | nrhs | INTEGER The number of right hand sides, i.e., the number of columns of the matrix B. NRHS >= 0.

  [in,out]

  A

  COMPLEX array, dimension (LDA,N) On entry, the Hermitian matrix A. If UPLO = MagmaUpper, the leading N-by-N upper triangular part of A contains the upper triangular part of the matrix A, and the strictly lower triangular part of A is not referenced. If UPLO = MagmaLower, the leading N-by-N lower triangular part of A contains the lower triangular part of the matrix A, and the strictly upper triangular part of A is not referenced.
  On exit, if INFO = 0, the factor U or L from the Cholesky factorization A = U**H*U or A = L*L**H.

  [in] | lda | INTEGER The leading dimension of the array A. LDA >= max(1,N).
  [in,out] | B | COMPLEX array, dimension (LDB,NRHS) On entry, the right hand side matrix B. On exit, the solution matrix X.
  [in] | ldb | INTEGER The leading dimension of the array B. LDB >= max(1,N).

  [out]

  info

  INTEGER
  - = 0: successful exit
  - < 0: if INFO = -i, the i-th argument had an illegal value

## magma_cposv_gpu()

magma_int_t magma_cposv_gpu | ( | magma_uplo_t | uplo,
|  | magma_int_t | n,
|  | magma_int_t | nrhs,
|  | magmaFloatComplex_ptr | dA,
|  | magma_int_t | ldda,
|  | magmaFloatComplex_ptr | dB,
|  | magma_int_t | lddb,
|  | magma_int_t * | info )

CPOSV computes the solution to a complex system of linear equations A * X = B, where A is an N-by-N Hermitian positive definite matrix and X and B are N-by-NRHS matrices.

The Cholesky decomposition is used to factor A as A = U**H * U, if UPLO = MagmaUpper, or A = L * L**H, if UPLO = MagmaLower, where U is an upper triangular matrix and L is a lower triangular matrix. The factored form of A is then used to solve the system of equations A * X = B.

Parameters

  [in]

  uplo

  magma_uplo_t
  - = MagmaUpper: Upper triangle of A is stored;
  - = MagmaLower: Lower triangle of A is stored.

  [in] | n | INTEGER The order of the matrix A. N >= 0.
  [in] | nrhs | INTEGER The number of right hand sides, i.e., the number of columns of the matrix B. NRHS >= 0.

  [in,out]

  dA

  COMPLEX array on the GPU, dimension (LDDA,N) On entry, the Hermitian matrix dA. If UPLO = MagmaUpper, the leading N-by-N upper triangular part of dA contains the upper triangular part of the matrix dA, and the strictly lower triangular part of dA is not referenced. If UPLO = MagmaLower, the leading N-by-N lower triangular part of dA contains the lower triangular part of the matrix dA, and the strictly upper triangular part of dA is not referenced.
  On exit, if INFO = 0, the factor U or L from the Cholesky factorization dA = U**H*U or dA = L*L**H.

  [in] | ldda | INTEGER The leading dimension of the array A. LDDA >= max(1,N).
  [in,out] | dB | COMPLEX array on the GPU, dimension (LDDB,NRHS) On entry, the right hand side matrix B. On exit, the solution matrix X.
  [in] | lddb | INTEGER The leading dimension of the array B. LDDB >= max(1,N).

  [out]

  info

  INTEGER
  - = 0: successful exit
  - < 0: if INFO = -i, the i-th argument had an illegal value

## magma_dposv()

magma_int_t magma_dposv | ( | magma_uplo_t | uplo,
|  | magma_int_t | n,
|  | magma_int_t | nrhs,
|  | double * | A,
|  | magma_int_t | lda,
|  | double * | B,
|  | magma_int_t | ldb,
|  | magma_int_t * | info )

DPOSV computes the solution to a real system of linear equations A * X = B, where A is an N-by-N symmetric positive definite matrix and X and B are N-by-NRHS matrices.

The Cholesky decomposition is used to factor A as A = U**H * U, if UPLO = MagmaUpper, or A = L * L**H, if UPLO = MagmaLower, where U is an upper triangular matrix and L is a lower triangular matrix. The factored form of A is then used to solve the system of equations A * X = B.

Parameters

  [in]

  uplo

  magma_uplo_t
  - = MagmaUpper: Upper triangle of A is stored;
  - = MagmaLower: Lower triangle of A is stored.

  [in] | n | INTEGER The order of the matrix A. N >= 0.
  [in] | nrhs | INTEGER The number of right hand sides, i.e., the number of columns of the matrix B. NRHS >= 0.

  [in,out]

  A

  DOUBLE PRECISION array, dimension (LDA,N) On entry, the symmetric matrix A. If UPLO = MagmaUpper, the leading N-by-N upper triangular part of A contains the upper triangular part of the matrix A, and the strictly lower triangular part of A is not referenced. If UPLO = MagmaLower, the leading N-by-N lower triangular part of A contains the lower triangular part of the matrix A, and the strictly upper triangular part of A is not referenced.
  On exit, if INFO = 0, the factor U or L from the Cholesky factorization A = U**H*U or A = L*L**H.

  [in] | lda | INTEGER The leading dimension of the array A. LDA >= max(1,N).
  [in,out] | B | DOUBLE PRECISION array, dimension (LDB,NRHS) On entry, the right hand side matrix B. On exit, the solution matrix X.
  [in] | ldb | INTEGER The leading dimension of the array B. LDB >= max(1,N).

  [out]

  info

  INTEGER
  - = 0: successful exit
  - < 0: if INFO = -i, the i-th argument had an illegal value

## magma_dposv_gpu()

magma_int_t magma_dposv_gpu | ( | magma_uplo_t | uplo,
|  | magma_int_t | n,
|  | magma_int_t | nrhs,
|  | magmaDouble_ptr | dA,
|  | magma_int_t | ldda,
|  | magmaDouble_ptr | dB,
|  | magma_int_t | lddb,
|  | magma_int_t * | info )

DPOSV computes the solution to a real system of linear equations A * X = B, where A is an N-by-N symmetric positive definite matrix and X and B are N-by-NRHS matrices.

The Cholesky decomposition is used to factor A as A = U**H * U, if UPLO = MagmaUpper, or A = L * L**H, if UPLO = MagmaLower, where U is an upper triangular matrix and L is a lower triangular matrix. The factored form of A is then used to solve the system of equations A * X = B.

Parameters

  [in]

  uplo

  magma_uplo_t
  - = MagmaUpper: Upper triangle of A is stored;
  - = MagmaLower: Lower triangle of A is stored.

  [in] | n | INTEGER The order of the matrix A. N >= 0.
  [in] | nrhs | INTEGER The number of right hand sides, i.e., the number of columns of the matrix B. NRHS >= 0.

  [in,out]

  dA

  DOUBLE PRECISION array on the GPU, dimension (LDDA,N) On entry, the symmetric matrix dA. If UPLO = MagmaUpper, the leading N-by-N upper triangular part of dA contains the upper triangular part of the matrix dA, and the strictly lower triangular part of dA is not referenced. If UPLO = MagmaLower, the leading N-by-N lower triangular part of dA contains the lower triangular part of the matrix dA, and the strictly upper triangular part of dA is not referenced.
  On exit, if INFO = 0, the factor U or L from the Cholesky factorization dA = U**H*U or dA = L*L**H.

  [in] | ldda | INTEGER The leading dimension of the array A. LDDA >= max(1,N).
  [in,out] | dB | DOUBLE PRECISION array on the GPU, dimension (LDDB,NRHS) On entry, the right hand side matrix B. On exit, the solution matrix X.
  [in] | lddb | INTEGER The leading dimension of the array B. LDDB >= max(1,N).

  [out]

  info

  INTEGER
  - = 0: successful exit
  - < 0: if INFO = -i, the i-th argument had an illegal value

## magma_dshposv_gpu_expert()

magma_int_t magma_dshposv_gpu_expert | ( | magma_uplo_t | uplo,
|  | 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,
|  | magmaDouble_ptr | dworkd,
|  | magmaFloat_ptr | dworks,
|  | magma_int_t * | iter,
|  | magma_mode_t | mode,
|  | magma_int_t | use_gmres,
|  | magma_int_t | preprocess,
|  | float | cn,
|  | float | theta,
|  | magma_int_t * | info )

DSHPOSV computes the solution to a real system of linear equations A * X = B, where A is an N-by-N symmetric positive definite matrix and X and B are N-by-NRHS matrices.

DSHPOSV first attempts to factorize the matrix in real SINGLE PRECISION, but uses a mixed precision matrix multiplication to perform the trailing matrix updates (e.g. A_fp16 x B_fp16 ==> C_fp32). The routine uses this factorization within an iterative refinement (IR) procedure to produce a solution with real DOUBLE PRECISION norm-wise backward error quality (see below). The IR procedure has an option to use a GMRES solver to solve for the correction vector (Ac = r) instead of a direct solve (r is the residual vector, while c is the correction vector).

Please see for more details: "Exploiting Lower Precision Arithmetic in Solving Symmetric Positive Definite Linear Systems and Least Squares Problems", by Higham et al. http://eprints.maths.manchester.ac.uk/2771/

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]

  uplo

  magma_uplo_t
  - = MagmaUpper: Upper triangle of A is stored;
  - = MagmaLower: Lower triangle of A is stored.

  [in] | n | INTEGER The number of linear equations, i.e., the order of the matrix A. N >= 0.
  [in] | nrhs | INTEGER The number of right hand sides, i.e., the number of columns of the matrix B. NRHS >= 0.

  [in,out]

  dA

  DOUBLE PRECISION array on the GPU, dimension (LDDA,N) On entry, the symmetric matrix A. If UPLO = MagmaUpper, the leading N-by-N upper triangular part of A contains the upper triangular part of the matrix A, and the strictly lower triangular part of A is not referenced. If UPLO = MagmaLower, the leading N-by-N lower triangular part of A contains the lower triangular part of the matrix A, and the strictly upper triangular part of A is not referenced. On exit, if iterative refinement has been successfully used (INFO.EQ.0 and ITER.GE.0, see description below), then A is unchanged, if double factorization has been used (INFO.EQ.0 and ITER.LT.0, see description below), then the array dA contains the factor U or L from the Cholesky factorization A = U**T*U or A = L*L**T.

  [in] | ldda | INTEGER The leading dimension of the array dA. LDDA >= max(1,N).
  [in] | dB | DOUBLE PRECISION array on the GPU, dimension (LDDB,NRHS) The N-by-NRHS right hand side matrix B.
  [in] | lddb | INTEGER The leading dimension of the array dB. LDDB >= max(1,N).
  [out] | dX | DOUBLE PRECISION array on the GPU, dimension (LDDX,NRHS) If INFO = 0, the N-by-NRHS solution matrix X.
  [in] | lddx | INTEGER The leading dimension of the array dX. LDDX >= max(1,N).
  | dworkd | (workspace) DOUBLE PRECISION array on the GPU, dimension (N*NRHS) This array is used to hold the residual vectors.
  | dworks | (workspace) SINGLE PRECISION array on the GPU, dimension N*(N+nrhs) + N This array is used to store the real single precision matrix and the right-hand sides or solutions in single precision.

  [out]

  iter

  INTEGER
  - < 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 SPOTRF
  - -31: stop the iterative refinement after the 30th iteration
  - > 0: iterative refinement has been successfully used. Returns the number of iterations

  [in] | mode | magma_mode_t The mode of the factorization. If mode = MagmaHybrid, then a CPU-GPU factorization is used. If mode = MagmaNative, then a GPU-only factorization is used.
  [in] | use_gmres | INTEGER The solver uses GMRES during iterative refinement if use_gmres > 0. Otherwise, classical IR is used.
  [in] | preprocess | INTEGER If > 0, the input matrix is scaled/shifted according to: http://eprints.maths.manchester.ac.uk/2771/
  [in] | cn | REAL A constant that controls the diagonal shift of the matrix (if preprocessing is enabled). The diagonal shift is cn * eps_h, where eps_h is the FP16 unit roundoff.
  [in] | theta | REAL A constant that controls the scaling of A to avoid overflow and reduce the chances of underflow

  [out]

  info

  INTEGER
  - = 0: successful exit
  - < 0: if INFO = -i, the i-th argument had an illegal value
  - > 0: if INFO = i, the leading minor of order i of (DOUBLE PRECISION) A is not positive definite, so the factorization could not be completed, and the solution has not been computed.

## magma_dsposv_gpu()

magma_int_t magma_dsposv_gpu | ( | magma_uplo_t | uplo,
|  | 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,
|  | magmaDouble_ptr | dworkd,
|  | magmaFloat_ptr | dworks,
|  | magma_int_t * | iter,
|  | magma_int_t * | info )

DSPOSV computes the solution to a real system of linear equations A * X = B, where A is an N-by-N symmetric positive definite matrix and X and B are N-by-NRHS matrices.

DSPOSV 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]

  uplo

  magma_uplo_t
  - = MagmaUpper: Upper triangle of A is stored;
  - = MagmaLower: Lower triangle of A is stored.

  [in] | n | INTEGER The number of linear equations, i.e., the order of the matrix A. N >= 0.
  [in] | nrhs | INTEGER The number of right hand sides, i.e., the number of columns of the matrix B. NRHS >= 0.

  [in,out]

  dA

  DOUBLE PRECISION array on the GPU, dimension (LDDA,N) On entry, the symmetric matrix A. If UPLO = MagmaUpper, the leading N-by-N upper triangular part of A contains the upper triangular part of the matrix A, and the strictly lower triangular part of A is not referenced. If UPLO = MagmaLower, the leading N-by-N lower triangular part of A contains the lower triangular part of the matrix A, and the strictly upper triangular part of A is not referenced. On exit, if iterative refinement has been successfully used (INFO.EQ.0 and ITER.GE.0, see description below), then A is unchanged, if double factorization has been used (INFO.EQ.0 and ITER.LT.0, see description below), then the array dA contains the factor U or L from the Cholesky factorization A = U**T*U or A = L*L**T.

  [in] | ldda | INTEGER The leading dimension of the array dA. LDDA >= max(1,N).
  [in] | dB | DOUBLE PRECISION array on the GPU, dimension (LDDB,NRHS) The N-by-NRHS right hand side matrix B.
  [in] | lddb | INTEGER The leading dimension of the array dB. LDDB >= max(1,N).
  [out] | dX | DOUBLE PRECISION array on the GPU, dimension (LDDX,NRHS) If INFO = 0, the N-by-NRHS solution matrix X.
  [in] | lddx | INTEGER The leading dimension of the array dX. LDDX >= max(1,N).
  | dworkd | (workspace) DOUBLE PRECISION array on the GPU, dimension (N*NRHS) This array is used to hold the residual vectors.
  | dworks | (workspace) SINGLE PRECISION array on the GPU, dimension (N*(N+NRHS)) This array is used to store the real single precision matrix and the right-hand sides or solutions in single precision.

  [out]

  iter

  INTEGER
  - < 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 SPOTRF
    - -31: stop the iterative refinement after the 30th iteration
  - > 0: iterative refinement has been successfully used. Returns the number of iterations

  [out]

  info

  INTEGER
  - = 0: successful exit
  - < 0: if INFO = -i, the i-th argument had an illegal value
  - > 0: if INFO = i, the leading minor of order i of (DOUBLE PRECISION) A is not positive definite, so the factorization could not be completed, and the solution has not been computed.

## magma_sposv()

magma_int_t magma_sposv | ( | magma_uplo_t | uplo,
|  | magma_int_t | n,
|  | magma_int_t | nrhs,
|  | float * | A,
|  | magma_int_t | lda,
|  | float * | B,
|  | magma_int_t | ldb,
|  | magma_int_t * | info )

SPOSV computes the solution to a real system of linear equations A * X = B, where A is an N-by-N symmetric positive definite matrix and X and B are N-by-NRHS matrices.

The Cholesky decomposition is used to factor A as A = U**H * U, if UPLO = MagmaUpper, or A = L * L**H, if UPLO = MagmaLower, where U is an upper triangular matrix and L is a lower triangular matrix. The factored form of A is then used to solve the system of equations A * X = B.

Parameters

  [in]

  uplo

  magma_uplo_t
  - = MagmaUpper: Upper triangle of A is stored;
  - = MagmaLower: Lower triangle of A is stored.

  [in] | n | INTEGER The order of the matrix A. N >= 0.
  [in] | nrhs | INTEGER The number of right hand sides, i.e., the number of columns of the matrix B. NRHS >= 0.

  [in,out]

  A

  REAL array, dimension (LDA,N) On entry, the symmetric matrix A. If UPLO = MagmaUpper, the leading N-by-N upper triangular part of A contains the upper triangular part of the matrix A, and the strictly lower triangular part of A is not referenced. If UPLO = MagmaLower, the leading N-by-N lower triangular part of A contains the lower triangular part of the matrix A, and the strictly upper triangular part of A is not referenced.
  On exit, if INFO = 0, the factor U or L from the Cholesky factorization A = U**H*U or A = L*L**H.

  [in] | lda | INTEGER The leading dimension of the array A. LDA >= max(1,N).
  [in,out] | B | REAL array, dimension (LDB,NRHS) On entry, the right hand side matrix B. On exit, the solution matrix X.
  [in] | ldb | INTEGER The leading dimension of the array B. LDB >= max(1,N).

  [out]

  info

  INTEGER
  - = 0: successful exit
  - < 0: if INFO = -i, the i-th argument had an illegal value

## magma_sposv_gpu()

magma_int_t magma_sposv_gpu | ( | magma_uplo_t | uplo,
|  | magma_int_t | n,
|  | magma_int_t | nrhs,
|  | magmaFloat_ptr | dA,
|  | magma_int_t | ldda,
|  | magmaFloat_ptr | dB,
|  | magma_int_t | lddb,
|  | magma_int_t * | info )

SPOSV computes the solution to a real system of linear equations A * X = B, where A is an N-by-N symmetric positive definite matrix and X and B are N-by-NRHS matrices.

The Cholesky decomposition is used to factor A as A = U**H * U, if UPLO = MagmaUpper, or A = L * L**H, if UPLO = MagmaLower, where U is an upper triangular matrix and L is a lower triangular matrix. The factored form of A is then used to solve the system of equations A * X = B.

Parameters

  [in]

  uplo

  magma_uplo_t
  - = MagmaUpper: Upper triangle of A is stored;
  - = MagmaLower: Lower triangle of A is stored.

  [in] | n | INTEGER The order of the matrix A. N >= 0.
  [in] | nrhs | INTEGER The number of right hand sides, i.e., the number of columns of the matrix B. NRHS >= 0.

  [in,out]

  dA

  REAL array on the GPU, dimension (LDDA,N) On entry, the symmetric matrix dA. If UPLO = MagmaUpper, the leading N-by-N upper triangular part of dA contains the upper triangular part of the matrix dA, and the strictly lower triangular part of dA is not referenced. If UPLO = MagmaLower, the leading N-by-N lower triangular part of dA contains the lower triangular part of the matrix dA, and the strictly upper triangular part of dA is not referenced.
  On exit, if INFO = 0, the factor U or L from the Cholesky factorization dA = U**H*U or dA = L*L**H.

  [in] | ldda | INTEGER The leading dimension of the array A. LDDA >= max(1,N).
  [in,out] | dB | REAL array on the GPU, dimension (LDDB,NRHS) On entry, the right hand side matrix B. On exit, the solution matrix X.
  [in] | lddb | INTEGER The leading dimension of the array B. LDDB >= max(1,N).

  [out]

  info

  INTEGER
  - = 0: successful exit
  - < 0: if INFO = -i, the i-th argument had an illegal value

## magma_zcposv_gpu()

magma_int_t magma_zcposv_gpu | ( | magma_uplo_t | uplo,
|  | magma_int_t | n,
|  | magma_int_t | nrhs,
|  | magmaDoubleComplex_ptr | dA,
|  | magma_int_t | ldda,
|  | magmaDoubleComplex_ptr | dB,
|  | magma_int_t | lddb,
|  | magmaDoubleComplex_ptr | dX,
|  | magma_int_t | lddx,
|  | magmaDoubleComplex_ptr | dworkd,
|  | magmaFloatComplex_ptr | dworks,
|  | magma_int_t * | iter,
|  | magma_int_t * | info )

ZCPOSV computes the solution to a complex system of linear equations A * X = B, where A is an N-by-N Hermitian positive definite matrix and X and B are N-by-NRHS matrices.

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

The iterative refinement is not going to be a winning strategy if the ratio complex SINGLE PRECISION performance over complex 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]

  uplo

  magma_uplo_t
  - = MagmaUpper: Upper triangle of A is stored;
  - = MagmaLower: Lower triangle of A is stored.

  [in] | n | INTEGER The number of linear equations, i.e., the order of the matrix A. N >= 0.
  [in] | nrhs | INTEGER The number of right hand sides, i.e., the number of columns of the matrix B. NRHS >= 0.

  [in,out]

  dA

  COMPLEX_16 array on the GPU, dimension (LDDA,N) On entry, the Hermitian matrix A. If UPLO = MagmaUpper, the leading N-by-N upper triangular part of A contains the upper triangular part of the matrix A, and the strictly lower triangular part of A is not referenced. If UPLO = MagmaLower, the leading N-by-N lower triangular part of A contains the lower triangular part of the matrix A, and the strictly upper triangular part of A is not referenced. On exit, if iterative refinement has been successfully used (INFO.EQ.0 and ITER.GE.0, see description below), then A is unchanged, if double factorization has been used (INFO.EQ.0 and ITER.LT.0, see description below), then the array dA contains the factor U or L from the Cholesky factorization A = U**T*U or A = L*L**T.

  [in] | ldda | INTEGER The leading dimension of the array dA. LDDA >= max(1,N).
  [in] | dB | COMPLEX_16 array on the GPU, dimension (LDDB,NRHS) The N-by-NRHS right hand side matrix B.
  [in] | lddb | INTEGER The leading dimension of the array dB. LDDB >= max(1,N).
  [out] | dX | COMPLEX_16 array on the GPU, dimension (LDDX,NRHS) If INFO = 0, the N-by-NRHS solution matrix X.
  [in] | lddx | INTEGER The leading dimension of the array dX. LDDX >= max(1,N).
  | dworkd | (workspace) COMPLEX_16 array on the GPU, dimension (N*NRHS) This array is used to hold the residual vectors.
  | dworks | (workspace) COMPLEX array on the GPU, dimension (N*(N+NRHS)) This array is used to store the complex single precision matrix and the right-hand sides or solutions in single precision.

  [out]

  iter

  INTEGER
  - < 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 SPOTRF
    - -31: stop the iterative refinement after the 30th iteration
  - > 0: iterative refinement has been successfully used. Returns the number of iterations

  [out]

  info

  INTEGER
  - = 0: successful exit
  - < 0: if INFO = -i, the i-th argument had an illegal value
  - > 0: if INFO = i, the leading minor of order i of (DOUBLE PRECISION) A is not positive definite, so the factorization could not be completed, and the solution has not been computed.

## magma_zposv()

magma_int_t magma_zposv | ( | magma_uplo_t | uplo,
|  | magma_int_t | n,
|  | magma_int_t | nrhs,
|  | magmaDoubleComplex * | A,
|  | magma_int_t | lda,
|  | magmaDoubleComplex * | B,
|  | magma_int_t | ldb,
|  | magma_int_t * | info )

ZPOSV computes the solution to a complex system of linear equations A * X = B, where A is an N-by-N Hermitian positive definite matrix and X and B are N-by-NRHS matrices.

The Cholesky decomposition is used to factor A as A = U**H * U, if UPLO = MagmaUpper, or A = L * L**H, if UPLO = MagmaLower, where U is an upper triangular matrix and L is a lower triangular matrix. The factored form of A is then used to solve the system of equations A * X = B.

Parameters

  [in]

  uplo

  magma_uplo_t
  - = MagmaUpper: Upper triangle of A is stored;
  - = MagmaLower: Lower triangle of A is stored.

  [in] | n | INTEGER The order of the matrix A. N >= 0.
  [in] | nrhs | INTEGER The number of right hand sides, i.e., the number of columns of the matrix B. NRHS >= 0.

  [in,out]

  A

  COMPLEX_16 array, dimension (LDA,N) On entry, the Hermitian matrix A. If UPLO = MagmaUpper, the leading N-by-N upper triangular part of A contains the upper triangular part of the matrix A, and the strictly lower triangular part of A is not referenced. If UPLO = MagmaLower, the leading N-by-N lower triangular part of A contains the lower triangular part of the matrix A, and the strictly upper triangular part of A is not referenced.
  On exit, if INFO = 0, the factor U or L from the Cholesky factorization A = U**H*U or A = L*L**H.

  [in] | lda | INTEGER The leading dimension of the array A. LDA >= max(1,N).
  [in,out] | B | COMPLEX_16 array, dimension (LDB,NRHS) On entry, the right hand side matrix B. On exit, the solution matrix X.
  [in] | ldb | INTEGER The leading dimension of the array B. LDB >= max(1,N).

  [out]

  info

  INTEGER
  - = 0: successful exit
  - < 0: if INFO = -i, the i-th argument had an illegal value

## magma_zposv_gpu()

magma_int_t magma_zposv_gpu | ( | magma_uplo_t | uplo,
|  | magma_int_t | n,
|  | magma_int_t | nrhs,
|  | magmaDoubleComplex_ptr | dA,
|  | magma_int_t | ldda,
|  | magmaDoubleComplex_ptr | dB,
|  | magma_int_t | lddb,
|  | magma_int_t * | info )

ZPOSV computes the solution to a complex system of linear equations A * X = B, where A is an N-by-N Hermitian positive definite matrix and X and B are N-by-NRHS matrices.

The Cholesky decomposition is used to factor A as A = U**H * U, if UPLO = MagmaUpper, or A = L * L**H, if UPLO = MagmaLower, where U is an upper triangular matrix and L is a lower triangular matrix. The factored form of A is then used to solve the system of equations A * X = B.

Parameters

  [in]

  uplo

  magma_uplo_t
  - = MagmaUpper: Upper triangle of A is stored;
  - = MagmaLower: Lower triangle of A is stored.

  [in] | n | INTEGER The order of the matrix A. N >= 0.
  [in] | nrhs | INTEGER The number of right hand sides, i.e., the number of columns of the matrix B. NRHS >= 0.

  [in,out]

  dA

  COMPLEX_16 array on the GPU, dimension (LDDA,N) On entry, the Hermitian matrix dA. If UPLO = MagmaUpper, the leading N-by-N upper triangular part of dA contains the upper triangular part of the matrix dA, and the strictly lower triangular part of dA is not referenced. If UPLO = MagmaLower, the leading N-by-N lower triangular part of dA contains the lower triangular part of the matrix dA, and the strictly upper triangular part of dA is not referenced.
  On exit, if INFO = 0, the factor U or L from the Cholesky factorization dA = U**H*U or dA = L*L**H.

  [in] | ldda | INTEGER The leading dimension of the array A. LDDA >= max(1,N).
  [in,out] | dB | COMPLEX_16 array on the GPU, dimension (LDDB,NRHS) On entry, the right hand side matrix B. On exit, the solution matrix X.
  [in] | lddb | INTEGER The leading dimension of the array B. LDDB >= max(1,N).

  [out]

  info

  INTEGER
  - = 0: successful exit
  - < 0: if INFO = -i, the i-th argument had an illegal value