posv_mixed(3)

✨ posv_mixed ✨

okay so bestie, this is posv_mixed(3) from the Library Functions Manual and it's literally the glow-up era of posv β€” factor and solve, but with mixed precision energy πŸ’… no cap, it's giving "why do double the work when single precision ate the first time?"


πŸ¦‹ NAME πŸ¦‹

posv_mixed β€” posv: factor and solve, mixed precision. that's the whole vibe. factor it, solve it, mix the precision, periodt πŸ’–


🌸 SYNOPSIS 🌸

✨ Functions ✨

  • subroutine dsposv β€” DSPOSV computes the solution to system of linear equations A * X = B for PO matrices
  • subroutine zcposv β€” ZCPOSV computes the solution to system of linear equations A * X = B for PO matrices

and here's the actual signatures, character for character, because I would never mess with your arguments 🫢

subroutine dsposv (uplo, n, nrhs, a, lda, b, ldb, x, ldx, work, swork,
    iter, info)
subroutine zcposv (uplo, n, nrhs, a, lda, b, ldb, x, ldx, work, swork,
    rwork, iter, info)

🌈 Detailed Description 🌈

so like… the detailed description section is lowkey just vibes and heading energy here β€” the real tea all lives down in Function Documentation, where each subroutine spills its whole Purpose and every single Parameter. keep scrolling bestie, it's all there πŸ‘‘


πŸŽ€ Function Documentation πŸŽ€

⭐ subroutine dsposv ⭐

subroutine dsposv (character uplo, integer n, integer nrhs, double
    precision, dimension( lda, * ) a, integer lda, double precision,
    dimension( ldb, * ) b, integer ldb, double precision, dimension( ldx, *
    ) x, integer ldx, double precision, dimension( n, * ) work, real,
    dimension( * ) swork, integer iter, integer info)

DSPOSV computes the solution to system of linear equations A * X = B for PO matrices. iconic. πŸ¦‹

Purpose πŸ’–

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 SINGLE PRECISION and use this factorization within an iterative refinement procedure to produce a solution with DOUBLE PRECISION normwise backward error quality (see below, bestie). If the approach fails, the method switches to a DOUBLE PRECISION factorization and solve.

the iterative refinement is not going to be a winning strategy if the ratio of SINGLE PRECISION performance over 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 β€” always, no questions, no vibe check πŸ™ˆ

The iterative refinement process is stopped if

ITER > ITERMAX

or for all the RHS we have:

RNRM < SQRT(N)*XNRM*ANRM*EPS*BWDMAX

where

  • ITER is the number of the current iteration in the iterative refinement process
  • RNRM is the infinity-norm of the residual
  • XNRM is the infinity-norm of the solution
  • ANRM is the infinity-operator-norm of the matrix A
  • EPS is the machine epsilon returned by DLAMCH('Epsilon')

The value ITERMAX and BWDMAX are fixed to 30 and 1.0D+00 respectively. locked in, fr fr πŸ’…

Parameters 🌸

  • UPLO β€” UPLO is CHARACTER*1
    • = 'U': upper triangle of A is stored;
    • = 'L': lower triangle of A is stored.
  • N β€” N is INTEGER. the number of linear equations, i.e., the order of the matrix A. N >= 0.
  • NRHS β€” NRHS is INTEGER. the number of right hand sides, i.e., the number of columns of the matrix B. NRHS >= 0.
  • A β€” A is DOUBLE PRECISION array, dimension (LDA,N). On entry, the symmetric matrix A. If UPLO = 'U', 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 = 'L', 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 = 0 and ITER >= 0, see description below), then A is unchanged, if double precision factorization has been used (INFO = 0 and ITER < 0, see description below), then the array A contains the factor U or L from the Cholesky factorization A = U**T*U or A = L*L**T.
  • LDA β€” LDA is INTEGER. the leading dimension of the array A. LDA >= max(1,N).
  • B β€” B is DOUBLE PRECISION array, dimension (LDB,NRHS). the N-by-NRHS right hand side matrix B.
  • LDB β€” LDB is INTEGER. the leading dimension of the array B. LDB >= max(1,N).
  • X β€” X is DOUBLE PRECISION array, dimension (LDX,NRHS). if INFO = 0, the N-by-NRHS solution matrix X. πŸŽ€
  • LDX β€” LDX is INTEGER. the leading dimension of the array X. LDX >= max(1,N).
  • WORK β€” WORK is DOUBLE PRECISION array, dimension (N,NRHS). this array is used to hold the residual vectors.
  • SWORK β€” SWORK is REAL array, dimension (N*(N+NRHS)). this array is used to use the single precision matrix and the right-hand sides or solutions in single precision.
  • ITER β€” ITER is 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 iterations > 0: iterative refinement has been successfully used. Returns the number of iterations ✨
  • INFO β€” INFO is INTEGER.
    • = 0: successful exit
    • < 0: if INFO = -i, the i-th argument had an illegal value
    • > 0: if INFO = i, the leading principal minor of order i of (DOUBLE PRECISION) A is not positive, so the factorization could not be completed, and the solution has not been computed. 😭 that one's a whole mood ruiner ngl

Author πŸ‘‘

  • Univ. of Tennessee
  • Univ. of California Berkeley
  • Univ. of Colorado Denver
  • NAG Ltd.

Definition at line 197 of file dsposv.f.


πŸ’œ subroutine zcposv πŸ’œ

subroutine zcposv (character uplo, integer n, integer nrhs, complex*16,
    dimension( lda, * ) a, integer lda, complex*16, dimension( ldb, * ) b,
    integer ldb, complex*16, dimension( ldx, * ) x, integer ldx, complex*16,
    dimension( n, * ) work, complex, dimension( * ) swork, double precision,
    dimension( * ) rwork, integer iter, integer info)

ZCPOSV computes the solution to system of linear equations A * X = B for PO matrices. yes, the complex one. she's that girl 🧚

Purpose πŸ’–

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 and use this factorization within an iterative refinement procedure to produce a solution with COMPLEX*16 normwise backward error quality (see below, bestie). If the approach fails, the method switches to a COMPLEX*16 factorization and solve.

the iterative refinement is not going to be a winning strategy if the ratio of COMPLEX performance over COMPLEX*16 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. same energy, different precision, iykyk 🫢

The iterative refinement process is stopped if

ITER > ITERMAX

or for all the RHS we have:

RNRM < SQRT(N)*XNRM*ANRM*EPS*BWDMAX

where

  • ITER is the number of the current iteration in the iterative refinement process
  • RNRM is the infinity-norm of the residual
  • XNRM is the infinity-norm of the solution
  • ANRM is the infinity-operator-norm of the matrix A
  • EPS is the machine epsilon returned by DLAMCH('Epsilon')

The value ITERMAX and BWDMAX are fixed to 30 and 1.0D+00 respectively. same constants, same slay 🌟

Parameters 🌸

  • UPLO β€” UPLO is CHARACTER*1
    • = 'U': upper triangle of A is stored;
    • = 'L': lower triangle of A is stored.
  • N β€” N is INTEGER. the number of linear equations, i.e., the order of the matrix A. N >= 0.
  • NRHS β€” NRHS is INTEGER. the number of right hand sides, i.e., the number of columns of the matrix B. NRHS >= 0.
  • A β€” A is COMPLEX*16 array, dimension (LDA,N). On entry, the Hermitian matrix A. If UPLO = 'U', 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 = 'L', 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.

Note that the imaginary parts of the diagonal elements need not be set and are assumed to be zero. πŸ‘€ zero. assumed. don't come at her with imaginary diagonals.

On exit, if iterative refinement has been successfully used (INFO = 0 and ITER >= 0, see description below), then A is unchanged, if double precision factorization has been used (INFO = 0 and ITER < 0, see description below), then the array A contains the factor U or L from the Cholesky factorization A = U**H*U or A = L*L**H.

  • LDA β€” LDA is INTEGER. the leading dimension of the array A. LDA >= max(1,N).
  • B β€” B is COMPLEX*16 array, dimension (LDB,NRHS). the N-by-NRHS right hand side matrix B.
  • LDB β€” LDB is INTEGER… and bestie, that's exactly where this part of the page runs out, so hold that thought, the rest is coming in part 2 πŸ’–πŸŽ€
  • LDB β€” LDB is INTEGER, and it’s the leading dimension of the array B. The rule is LDB >= max(1,N). Respect the leading dimension, bestie πŸ’…
  • X β€” X is a COMPLEX*16 array with dimension (LDX,NRHS). If INFO = 0, this is the N-by-NRHS solution matrix X. That’s the payoff, periodt ✨
  • LDX β€” LDX is INTEGER. It’s the leading dimension of the array X, and LDX >= max(1,N). Keep it legal or the vibes are off πŸŽ€
  • WORK β€” WORK is a COMPLEX*16 array with dimension (N,NRHS). This array is used to hold the residual vectors. Residuals are just the drama in math form 😭
  • SWORK β€” SWORK is a COMPLEX array with dimension (N*(N+NRHS)). This array is used to use the single precision matrix and the right-hand sides or solutions in single precision. Single precision said β€œlet me help” πŸ¦‹
  • RWORK β€” RWORK is a DOUBLE PRECISION array with dimension (N). That’s it, that’s the whole vibe 🌸
  • ITER β€” ITER is INTEGER. Here’s the tea:
    • < 0: iterative refinement has failed, and COMPLEX*16 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, and the routine fell back to full precision.
      • -3: failure of CPOTRF.
      • -31: stop the iterative refinement after the 30th iterations.
    • > 0: iterative refinement has been successfully used. Returns the number of iterations. Slay, it converged πŸ”₯
  • INFO β€” INFO is INTEGER.
    • = 0: successful exit.
    • < 0: if INFO = -i, the i-th argument had an illegal value.
    • > 0: if INFO = i, the leading principal minor of order i of (COMPLEX*16) A is not positive, so the factorization could not be completed, and the solution has not been computed. That’s a no-solution situation, no cap πŸ’€

🫢 Author

  • Univ. of Tennessee
  • Univ. of California Berkeley
  • Univ. of Colorado Denver
  • NAG Ltd.

Definition at line 207 of file zcposv.f.

πŸͺ„ Author

Generated automatically by Doxygen for LAPACK from the source code.

This page came from LAPACK Version 3.12.0 and it’s the posv_mixed(3) manual page β€” go forth and refine iteratively, bestie πŸ’–βœ¨

πŸ“¦ where this page comes from