dblgelyap(3)

πŸ“¦
version 1.1.2 Β· 3 versions
, in fedora 43

🌸 dblgelyap(3) β€” MEPACK πŸ’–

okay bestie, sit down, hydrate, and let me tell you about dblgelyap from the MEPACK manual. It's a C-flavoured page (it's the 3 section, iykyk) and it is double precision everything.


✨ NAME ✨

dblgelyap β€” Double Precision

  • Double precision solvers for standard Lyapunov and Stein equations with general coefficient matrices.

That's the whole vibe: standard Lyapunov + Stein equations, and the coefficient matrices are general (not triangular, not diagonal, just out here living their life).


πŸŽ€ SYNOPSIS πŸŽ€

Functions πŸ¦‹

This page is the mothership for four Fortran subroutines. Here they are, signatures copied exactly, no edits, no cap:

subroutine dla_gelyap (fact, trans, m, a, lda, q, ldq, x, ldx, scale,
    work, ldwork, info)
    Frontend for the solution of Standard Lyapunov Equations.
subroutine dla_gestein (fact, trans, m, a, lda, q, ldq, x, ldx, scale,
    work, ldwork, info)
    Frontend for the solution of Standard Stein Equations.
subroutine dla_gelyap_refine (trans, guess, m, a, lda, x, ldx, y, ldy,
    as, ldas, q, ldq, maxit, tau, convlog, work, ldwork, info)
    Iterative Refinement for the Standard Lyapunov Equation.
subroutine dla_gestein_refine (trans, guess, m, a, lda, x, ldx, y, ldy,
    as, ldas, q, ldq, maxit, tau, convlog, work, ldwork, info)
    Iterative Refinement for the Standard Stein Equations.

πŸ’œ Detailed Description πŸ’œ

Double precision solvers for standard Lyapunov and Stein equations with general coefficient matrices.

(Yes, it's the same sentence as the NAME section. It's consistent, we love that for it. πŸ’…)


πŸ‘‘ Function Documentation πŸ‘‘

subroutine dla_gelyap 🧚

subroutine dla_gelyap (character, dimension(1) fact, character, dimension(1)
    trans, integer m, double precision, dimension(lda,*) a, integer lda,
    double precision, dimension(ldq, *) q, integer ldq, double precision,
    dimension(ldx, *) x, integer ldx, double precision scale, double
    precision, dimension(*) work, integer ldwork, integer info)

Frontend for the solution of Standard Lyapunov Equations.

Purpose πŸ”₯

okay so, DLA_GELYAP solves a Lyapunov equation of the following forms

!> DLA_GELYAP solves a Lyapunov equation of the following forms
!>
!>    A  * X  +  X * A**T = SCALE * Y                              (1)
!>
!> or
!>
!>    A ** T * X  +  X * A = SCALE * Y                              (2)
!>
!> where A is a M-by-M general matrix or a matrix in upper Hessenberg form.
!> The right hand side Y and the solution X are M-by-M matrices.
!> The general matrix A can be supplied factorized in terms of its
!> Schur decomposition.
!>
!>

So A can come in as a general matrix, or already Hessenberg-ed, or fully pre-factored through its Schur decomposition. Your call, bestie. πŸ¦‹

Parameters 🌸

FACT

!>          FACT is CHARACTER
!>          Specifies how the matrix A is given.
!>          == 'N':  The matrix A is given as a general matrix and its Schur decomposition
!>                  A = Q*S*Q**T will be computed.
!>          == 'F':  The matrix A is given as its Schur decomposition in terms of S and Q
!>                  form A = Q*S*Q**T
!>          == 'H':  The matrix A is given in upper Hessenberg form and its Schur decomposition
!>                  A = Q*S*Q**T will be computed
!>

TRANS

!>          TRANS is CHARACTER
!>          Specifies the form of the system of equations with respect to A:
!>          == 'N':  Equation (1) is solved.
!>          == 'T':  Equation (2) is solved.
!>

M

!>          M is INTEGER
!>          The order of the matrix A.  M >= 0.
!>

A

!>          A is DOUBLE PRECISION array, dimension (LDA,M)
!>          If FACT == , the matrix A is a general matrix and it is overwritten with its
!>          schur decomposition S.
!>          If FACT == , the matrix A is an upper Hessenberg matrix and it is overwritten
!>          with its schur decomposition S.
!>          If FACT == , the matrix A contains its (quasi-) upper triangular matrix S being the
!>          Schur decomposition of A.
!>
ngl the FACT == bits are left blank in the source, so I'm not filling them in. No inventing options on this blog. πŸ’€

LDA

!>          LDA is INTEGER
!>          The leading dimension of the array A.  LDA >= max(1,M).
!>

Q

!>          Q is DOUBLE PRECISION array, dimension (LDQ,M)
!>          If FACT == , the matrix Q is an empty M-by-M matrix on input and contains the
!>          Schur vectors of A on output.
!>          If FACT == , the matrix Q is an empty M-by-M matrix on input and contains the
!>          Schur vectors of A on output.
!>          If FACT == , the matrix Q contains the Schur vectors of A.
!>

LDQ

!>          LDQ is INTEGER
!>          The leading dimension of the array Q.  LDQ >= max(1,M).
!>

X

!>          X is DOUBLE PRECISION array, dimension (LDX,N)
!>          On input, the matrix X contains the right hand side Y.
!>          On output, the matrix X contains the solution of Equation (1) or (2)
!>          Right hand side Y and the solution X are symmetric M-by-M matrices.
!>

LDX

!>          LDX is INTEGER
!>          The leading dimension of the array X.  LDB >= max(1,M).
!>

(Yes, it says LDB in there. That's what the source says. I'm not touching it. πŸ™ˆ)

SCALE

!>          SCALE is DOUBLE PRECISION
!>          SCALE is a scaling factor to prevent the overflow in the result.
!>          If INFO == 0 then SCALE is 1.0D0 otherwise if one of the inner systems
!>          could not be solved correctly, 0 < SCALE <= 1 holds true.
!>

WORK

!>          WORK is DOUBLE PRECISION array, dimension (MAX(1,LDWORK))
!>          Workspace for the algorithm. The optmimal workspace is given either by \ref mepack_memory_frontend
!>          or a previous call to the this routine with LDWORK === -1.
!>

LDWORK

!>          LDWORK is INTEGER
!>          Size of the workspace for the algorithm. This can be determined by a call \ref mepack_memory_frontend .
!>          Alternatively, if LDWORK == -1 on input the subroutine will return the required size of the workspace in LDWORK again
!>          without performing any computations.
!>

INFO

!>          INFO is INTEGER
!>          == 0:  successful exit
!>          = 1:  DHGEES failed
!>          = 2:  DLA_SORT_EV failed
!>          = 3:  Internal solver failed
!>          < 0:  if INFO = -i, the i-th argument had an illegal value
!>

See also πŸ”

  • DLA_TRLYAP_L3
  • DLA_TRLYAP_L3_2S
  • DLA_TRLYAP_DAG
  • DLA_TRLYAP_L2
  • DLA_TRLYAP_RECURSIVE

Author 🫢

Martin Koehler, MPI Magdeburg

Date ⭐

October 2025

Definition at line 175 of file dla_gelyap.f90.


subroutine dla_gelyap_refine πŸ’–

subroutine dla_gelyap_refine (character, dimension(1) trans, character,
    dimension(1) guess, integer m, double precision, dimension(lda, *) a,
    integer lda, double precision, dimension( ldx, *) x, integer ldx, double
    precision, dimension(ldy, *) y, integer ldy, double precision,
    dimension(ldas, *) as, integer ldas, double precision, dimension(ldq, *)
    q, integer ldq, integer maxit, double precision tau, double precision,
    dimension(*) convlog, double precision, dimension(*) work, integer
    ldwork, integer info)

Iterative Refinement for the Standard Lyapunov Equation.

Purpose πŸ”₯

!> DLA_GELYAP_REFINE solves a standard Lyapunov equation of the following forms
!>
!>    A * X  +  X * A^T = SCALE * Y                                              (1)
!>
!> or
!>
!>    A^T * X  +  X * A =  SCALE * Y                                             (2)
!>
!> where A is a M-by-M matrix using iterative refinement.
!> The right hand side Y and the solution X are M-by-M matrices.
!> The matrix A needs to be provided as the original data
!> as well as in Schur decomposition since both are required in the
!> iterative refinement process.
!>
!>

So yeah, this one is the glow-up routine: it takes your A twice β€” once raw, once Schur'd β€” because the refinement loop genuinely needs both. Give it both or it's not gonna work. 😭

Parameters 🌈

TRANS

!>          TRANS is CHARACTER
!>          Specifies the form of the system of equations with respect to A :
!>          == 'N':  Equation (1) is solved
!>          == 'T':  Equation (2) is solved
!>

GUESS

!>          GUESS is CHARACTER
!>          Specifies whether X contains an initial guess or nor not.
!>          =  'I': X contains an initial guess
!>          =  'N': No initial guess, X is set to zero at the begin of the iteration.
!>

M

!>          M is INTEGER
!>          The order of the matrix A.  M >= 0.
!>

A

!>          A is DOUBLE PRECISION array, dimension (LDA,M)
!>          The array A contains the original matrix A defining the eqaution.
!>

LDA

!>          LDA is INTEGER
!>          The leading dimension of the array A.  LDA >= max(1,M).
!>

X

!>          X is DOUBLE PRECISION array, dimension (LDX,M)
!>          On input, the array X contains the initial guess, if GUESS = 'I'.
!>          On output, the array X contains the solution X.
!>

LDX

!>          LDX is INTEGER
!>          The leading dimension of the array X.  LDX >= max(1,M).
!>

Y

!>          Y is DOUBLE PRECISION array, dimension (LDY,M)
!>          On input, the array Y contains the right hand side Y.
!>          The array stays unchanged during the iteration.
!>

LDY

!>          LDY is INTEGER
!>          The leading dimension of the array Y.  LDY >= max(1,M).
!>

AS

!>          AS is DOUBLE PRECISION array, dimension (LDAS,M)
!>          The array AS contains the Schur decomposition of A.
!>

LDAS

!>          LDAS is INTEGER
!>          The leading dimension of the array AS.  LDAS >= max(1,M).
!>

Q

!>          Q is DOUBLE PRECISION array, dimension (LDQ,M)
!>          The array Q contains the Schur vectors for A as returned by DGEES.
!>

LDQ

!>          LDQ is INTEGER
!>          The leading dimension of the array Q.  LDQ >= max(1,M).
!>

MAXIT

!>          MAXIT is INTEGER
!>          On input, MAXIT contains the maximum number of iteration that are performed, 2 <= MAXIT <= 100
!>          On exit, MAXIT contains the number of iteration steps taken by the algorithm.
!>

TAU

!>          TAU is DOUBLE PRECISION
!>          On input, TAU contains the additional security factor for the stopping criterion, typical values are 0.1
!>          On exit, TAU contains the last relative residual when the stopping criterion got valid.
!>

CONVLOG

!>          CONVLOG is DOUBLE PRECISION array, dimension (MAXIT)
!>          The CONVLOG array contains the convergence history of the iterative refinement. CONVLOG(I) contains the maximum
!>          relative residual before it is solved for the I-th time.
!>

WORK

  • WORK β€” WORK is DOUBLE PRECISION array, dimension (MAX(1,LDWORK)). It's the lil scratchpad the algorithm does its thing in. Fun fact bestie: if you set LDWORK == -1 on input, the optimal workspace size comes back to you in LDWORK instead, and in that case literally no computations happen. Zero. None. It's just a vibes check for memory. πŸ’…
  • LDWORK β€” LDWORK is INTEGER. And listen: if LDWORK == -1, the subroutine just hands you back the required workspace size in LDWORK on exit. No computations performed, and none of the arrays are even referenced. So you can ask before you commit. Iconic behaviour honestly. πŸ‘‘
  • INFO β€” INFO is INTEGER, and it's the one that tells you how it went:
    • == 0: Success ✨
    • > 0: Iteration failed in step INFO 😭
    • < 0: if INFO = -i, the i-th argument had an illegal value πŸ™ˆ
    • = -50: Some of the internal settings like NB,... are incorrect. πŸ’€

See also: DLA_TRLYAP_L3, DLA_TRLYAP_L2, DLA_TRLYAP_L3_2S, DLA_TRLYAP_DAG, DLA_TRLYAP_RECURSIVE

Author: Martin Koehler, MPI Magdeburg

Date: October 2025

Definition at line 201 of file dla_gelyap_refine.f90.


🌸 dla_gestein β€” the Stein equation frontend, she's the moment 🌸

subroutine dla_gestein (character, dimension(1) fact, character,
    dimension(1) trans, integer m, double precision, dimension(lda,*) a,
    integer lda, double precision, dimension(ldq, *) q, integer ldq, double
    precision, dimension(ldx, *) x, integer ldx, double precision scale,
    double precision, dimension(*) work, integer ldwork, integer info)

Frontend for the solution of Standard Stein Equations. πŸ¦‹

Purpose:

!> DLA_GESTEIN solves a standard Stein equation of the following forms
!>
!>    A * X * A^T - X  = SCALE * Y                                              (2)
!>
!> or
!>
!>    A^T * X * A - X  =  SCALE * Y                                             (1)
!>
!> where A is a M-by-M general matrix or a matrix in upper Hessenberg form.
!> The right hand side Y and the solution X are M-by-M matrices.
!> The general matrix A can be supplied factorized in terms of its
!> Schur decomposition.

So basically: A is either a general matrix or a Hessenberg one, and you can hand her the Schur decomposition already done if you've got it. No pressure either way bestie, she'll do it herself. ✨

Parameters:

  • FACT β€” FACT is CHARACTER. It specifies how the matrix A is given:
    • == 'N': The matrix A is given as a general matrix and its Schur decomposition A = Q*S*Q**T will be computed. 🧚
    • == 'F': The matrix A is given as its Schur decomposition in terms of S and Q form A = Q*S*Q**T. You already did the work, respect. πŸ’…
    • == 'H': The matrix A is given in upper Hessenberg form and its Schur decomposition A = Q*S*Q**T will be computed.
  • TRANS β€” TRANS is CHARACTER. It picks the form of the system of equations with respect to A:
    • == 'N': Equation (1) is solved.
    • == 'T': Equation (2) is solved.
  • M β€” M is INTEGER. The order of the matrices A and C. M >= 0. (yes she said C, we're all just living our truth 😌)
  • A β€” A is DOUBLE PRECISION array, dimension (LDA,M). Here's the tea:
    • If FACT == , the matrix A is a general matrix and it is overwritten with its schur decomposition S.
    • If FACT == , the matrix A contains its (quasi-) upper triangular matrix S being the Schur decomposition of A.
    • If FACT == , the matrix A is an upper Hessenberg matrix and it is overwritten with its schur decomposition S.
  • LDA β€” LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,M). 🫢
  • Q β€” Q is DOUBLE PRECISION array, dimension (LDA,M). And she's flexible:
    • If FACT == , the matrix Q is an empty M-by-M matrix on input and contains the Schur vectors of A on output.
    • If FACT == , the matrix Q contains the Schur vectors of A.
    • If FACT == , the matrix Q is an empty M-by-M matrix on input and contains the Schur vectors of A on output.
  • LDQ β€” LDQ is INTEGER. The leading dimension of the array Q. LDQ >= max(1,M). πŸ’œ
  • X β€” X is DOUBLE PRECISION array, dimension (LDX,N). On input, the matrix X contains the right hand side Y. On output, the matrix X contains the solution of Equation (1) or (2). Right hand side Y and the solution X are symmetric M-by-M matrices. She goes in as one thing and comes out as another β€” main character transformation arc. 🌈
  • LDX β€” LDX is INTEGER. The leading dimension of the array X. LDB >= max(1,M). (fr fr, that's what it says β€” LDB. Not me, not you, the manual. πŸ™ˆ)
  • SCALE β€” SCALE is DOUBLE PRECISION. It's the scaling factor keeping the result from overflowing, because we do not do infinity here. If INFO == 0 then SCALE is 1.0D0, otherwise if one of the inner systems could not be solved correctly, 0 < SCALE <= 1 holds true. πŸ“
  • WORK β€” WORK is DOUBLE PRECISION array, dimension (MAX(1,LDWORK)). Workspace for the algorithm. The optimal workspace is given either by \ref mepack_memory_frontend or a previous call to this routine with LDWORK === -1.
  • LDWORK β€” LDWORK is INTEGER. Size of the workspace for the algorithm. This can be determined by a call \ref mepack_memory_frontend. Alternatively, if LDWORK == -1 on input the subroutine will return the required size of the workspace in LDWORK again without performing any computations. ✨
  • INFO β€” INFO is INTEGER:
    • == 0: successful exit πŸŽ‰
    • = 1: DHGEES failed 😭
    • = 2: DLA_SORT_EV failed πŸ’€
    • = 3: Inner solver failed 🫠
    • < 0: if INFO = -i, the i-th argument had an illegal value πŸ™ˆ

See also: DLA_TRSTEIN_L3, DLA_TRSTEIN_L3_2S, DLA_TRSTEIN_DAG, DLA_TRSTEIN_L2, DLA_TRSTEIN_RECURSIVE

Author: Martin Koehler, MPI Magdeburg

Date: October 2025

Definition at line 175 of file dla_gestein.f90.


πŸ¦‹ dla_gestein_refine β€” iterative refinement, glow-up edition πŸ¦‹

subroutine dla_gestein_refine (character, dimension(1) trans, character,
    dimension(1) guess, integer m, double precision, dimension(lda, *) a,
    integer lda, double precision, dimension( ldx, *) x, integer ldx, double
    precision, dimension(ldy, *) y, integer ldy, double precision,
    dimension(ldas, *) as, integer ldas, double precision, dimension(ldq, *)
    q, integer ldq, integer maxit, double precision tau, double precision,
    dimension(*) convlog, double precision, dimension(*) work, integer
    ldwork, integer info)

Iterative Refinement for the Standard Stein Equations. πŸ’–

Purpose:

!> DLA_GESTEIN_REFINE solves a standard Stein equation of the following forms
!>
!>    A * X * A^T  -  X  = SCALE * Y                                              (1)
!>
!> or
!>
!>    A^T * X * A  -  X  = SCALE * Y                                             (2)
!>
!> where A is a M-by-M matrix using iterative refinement.
!> The right hand side Y and the solution X are M-by-M matrices.
!> The matrix A needs to be provided as the original data
!> as well as in Schur decomposition since both are required in the
!> iterative refinement process.

Okay so here's the situation: she needs A twice β€” the original data and the Schur decomposition β€” because the refinement process genuinely uses both. Come prepared bestie, she's not asking twice. πŸ‘‘

Parameters:

  • TRANS β€” TRANS is CHARACTER. Specifies the form of the system of equations with respect to A:
    • == 'N': Equation (1) is solved
    • == 'T': Equation (2) is solved
  • GUESS β€” GUESS is CHARACTER. Tells her whether X already contains an initial guess or not:
    • = 'I': X contains an initial guess
    • = 'N': No initial guess, X is set to zero at the begin of the iteration. Starting from scratch, we love a fresh slate. 🌸
  • M β€” M is INTEGER. The order of the matrices A and B. M >= 0. 🫢
  • A β€” A is DOUBLE PRECISION array, dimension (LDA,M). The array A contains the original matrix A defining the eqaution. (the "eqaution" stays, I don't make the rules πŸ’…)
  • LDA β€” LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,M).
  • X β€” X is DOUBLE PRECISION array, dimension (LDX,M). On input, the array X contains the initial guess, if GUESS = 'I'. On output, the array X contains the solution X. ✨
  • LDX β€” LDX is INTEGER. The leading dimension of the array X. LDX >= max(1,M).
  • Y β€” Y is DOUBLE PRECISION array, dimension (LDY,M). On input, the array Y contains the right hand side Y. The array stays unchanged during the iteration. She does not touch it, that's a promise. πŸŽ€
  • LDY β€” LDY is INTEGER. The leading dimension of the array Y. LDY >= max(1,M).
  • AS β€” AS is DOUBLE PRECISION array, dimension (LDAS,M). The array AS contains the Schur decomposition of A. 🌟
  • LDAS β€” LDAS is INTEGER. The leading dimension of the array AS. LDAS >= max(1,M).
  • Q β€” Q is DOUBLE PRECISION array, dimension (LDQ,M). The array Q contains the Schur vectors for A as returned by DGEES. πŸ‘‘
  • LDQ β€” LDQ is INTEGER. The leading dimension of the array Q. LDQ >= max(1,M).
  • MAXIT β€” MAXIT is INTEGER. On input, MAXIT contains the maximum number of iteration that are performed, 2 <= MAXIT <= 100. On exit, MAXIT contains the number of iteration steps taken by the algorithm. She reports back, obviously. πŸ’…
  • TAU β€” TAU is DOUBLE PRECISION. On input, TAU contains the additional security factor for the stopping criterion, typical values are 0.1. On exit, TAU contains the last relative residual when the stopping criterion got valid. Safety factor and receipts, she does both. 🫢
  • CONVLOG β€” CONVLOG is DOUBLE PRECISION array, dimension (MAXIT). The CONVLOG array contains the convergence history of the iterative refinement. CONVLOG(I) contains the maximum relative residual before it is solved for the I-th time. It's literally a little diary of the whole journey. πŸ““βœ¨
  • WORK β€”
  • WORK β€” ngl bestie, this is a DOUBLE PRECISION array, dimension (MAX(1,LDWORK)). It's the workspace for the algorithm πŸ’… and the optimal workspace gets handed back to you in LDWORK if LDWORK == -1 on input. In that case literally no computations are performed, it's just vibing and telling you how much room it needs 🫢
  • LDWORK β€” this one is an INTEGER. If LDWORK == -1 the subroutine will return the required size of the workspace in LDWORK on exit. No computations are performed and none of the arrays are referenced ✨ (a total no-touch situation, we love that for us).
  • INFO β€” INFO is an INTEGER, and here's the vibe check on what it's telling you:
    • == 0: Success πŸ‘‘ periodt
    • > 0: Iteration failed in step INFO πŸ’€
    • < 0: if INFO = -i, the i-th argument had an illegal value πŸ™ˆ
    • = -50: Some of the internal settings like NB,... are incorrect. 😭

🌈 See also 🌈

  • DLA_TRSTEIN_L3
  • DLA_TRSTEIN_L2
  • DLA_TRSTEIN_L3_2S
  • DLA_TRSTEIN_DAG
  • DLA_TRSTEIN_RECURSIVE

πŸŽ€ Author πŸŽ€

Martin Koehler, MPI Magdeburg πŸ’–


🌸 Date 🌸

October 2025


πŸ¦‹ Definition πŸ¦‹

Definition at line 202 of file dla_gestein_refine.f90.


✨ Author (of this whole page, not the code) ✨

Generated automatically by Doxygen for MEPACK from the source code. Yes bestie, a robot wrote this, and honestly? It ate πŸ€–πŸ’…


okay that's the whole page!! you made it to the end, main character energy fr fr 🫢

This was MEPACK, Version 1.1.2, dated Thu Oct 9 2025 00:00:00, and the page itself is dblgelyap(3) β€” go forth and slay your linear algebra, bestie πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from