gebrd(3)
π gebrd(3) β reduction to bidiagonal π
ok so you've landed on gebrd from the Library Functions Manual, section 3, and honestly bestie you're in the right place. grab a boba, we're reducing matrices to bidiagonal form and it's gonna be a whole thing π
πΈ NAME πΈ
gebrd β reduction to bidiagonal. that's it, that's the name. she's concise, she's iconic, no notes β¨
β¨ SYNOPSIS β¨
π¦ Functions
subroutine cgebrd (m, n, a, lda, d, e, tauq, taup, work, lwork, info)β CGEBRD, the complex one πsubroutine dgebrd (m, n, a, lda, d, e, tauq, taup, work, lwork, info)β DGEBRD, the double precision one π«Άsubroutine sgebrd (m, n, a, lda, d, e, tauq, taup, work, lwork, info)β SGEBRD, the single precision one πΈsubroutine zgebrd (m, n, a, lda, d, e, tauq, taup, work, lwork, info)β ZGEBRD, the double complex one π
like, yes, they all have the same argument list. that's the vibe. the letter at the front tells you which flavor of numbers you're working with, iykyk π
π§ Detailed Description π§
so this section is literally empty in the original. no extra lore, no bonus commentary, nothing. we respect a minimalist queen ig π
π Function Documentation π
π subroutine cgebrd (integer m, integer n, complex, dimension( lda, * ) a, integer lda, real, dimension( * ) d, real, dimension( * ) e, complex, dimension( * ) tauq, complex, dimension( * ) taup, complex, dimension( * ) work, integer lwork, integer info)
CGEBRD
β Purpose:
!>
!> CGEBRD reduces a general complex M-by-N matrix A to upper or lower
!> bidiagonal form B by a unitary transformation: Q**H * A * P = B.
!>
!> If m >= n, B is upper bidiagonal; if m < n, B is lower bidiagonal.
!>
so real talk: you hand her a general complex M-by-N matrix, and she hands you back a bidiagonal one. the transformation is unitary, and the relation is Q**H * A * P = B. if m >= n you get an upper bidiagonal B; if m < n you get a lower bidiagonal B. that's the whole deal, no cap π«Ά
πΈ Parameters
MβMisINTEGER. the number of rows in the matrixA. must satisfyM >= 0β¨NβNisINTEGER. the number of columns in the matrixA. must satisfyN >= 0β¨AβAisCOMPLEXarray, dimension(LDA,N).
On entry, this is the M-by-N general matrix that's about to get reduced. On exit, it's giving two completely different personalities depending on the shape:
- if
m >= n: the diagonal and the first superdiagonal are overwritten with the upper bidiagonal matrixB; the elements below the diagonal, with the arrayTAUQ, represent the unitary matrixQas a product of elementary reflectors; and the elements above the first superdiagonal, with the arrayTAUP, represent the unitary matrixPas a product of elementary reflectors π - if
m < n: the diagonal and the first subdiagonal are overwritten with the lower bidiagonal matrixB; the elements below the first subdiagonal, with the arrayTAUQ, represent the unitary matrixQas a product of elementary reflectors; and the elements above the diagonal, with the arrayTAUP, represent the unitary matrixPas a product of elementary reflectors π
See Further Details (scroll down bestie, it's the good part) π¦
LDAβLDAisINTEGER. the leading dimension of the arrayA. must satisfyLDA >= max(1,M)πDβDisREALarray, dimension(min(M,N)). the diagonal elements of the bidiagonal matrixB, whereD(i) = A(i,i)β¨EβEisREALarray, dimension(min(M,N)-1). the off-diagonal elements of the bidiagonal matrixB:- if
m >= n:E(i) = A(i,i+1)fori = 1,2,...,n-1 - if
m < n:E(i) = A(i+1,i)fori = 1,2,...,m-1πΈ
- if
TAUQβTAUQisCOMPLEXarray, dimension(min(M,N)). the scalar factors of the elementary reflectors which represent the unitary matrixQ. See Further Details πTAUPβTAUPisCOMPLEXarray, dimension(min(M,N)). the scalar factors of the elementary reflectors which represent the unitary matrixP. See Further Details πWORKβWORKisCOMPLEXarray, dimension(MAX(1,LWORK)). on exit, ifINFO = 0, thenWORK(1)returns the optimalLWORKπ«ΆLWORKβLWORKisINTEGER. the length of the arrayWORK.LWORK >= 1, ifMIN(M,N) = 0, andLWORK >= MAX(M,N), otherwise.- for optimum performance
LWORK >= (M+N)*NB, whereNBis the optimal blocksize π₯ - if
LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of theWORKarray, returns this value as the first entry of theWORKarray, and no error message related toLWORKis issued byXERBLAπ
INFOβINFOisINTEGER.= 0: successful exit.< 0: ifINFO = -i, thei-th argument had an illegal value. π¨
π Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π§ Further Details:
!>
!> The matrices Q and P are represented as products of elementary
!> reflectors:
!>
!> If m >= n,
!>
!> Q = H(1) H(2) . . . H(n) and P = G(1) G(2) . . . G(n-1)
!>
!> Each H(i) and G(i) has the form:
!>
!> H(i) = I - tauq * v * v**H and G(i) = I - taup * u * u**H
!>
!> where tauq and taup are complex scalars, and v and u are complex
!> vectors; v(1:i-1) = 0, v(i) = 1, and v(i+1:m) is stored on exit in
!> A(i+1:m,i); u(1:i) = 0, u(i+1) = 1, and u(i+2:n) is stored on exit in
!> A(i,i+2:n); tauq is stored in TAUQ(i) and taup in TAUP(i).
!>
!> If m < n,
!>
!> Q = H(1) H(2) . . . H(m-1) and P = G(1) G(2) . . . G(m)
!>
!> Each H(i) and G(i) has the form:
!>
!> H(i) = I - tauq * v * v**H and G(i) = I - taup * u * u**H
!>
!> where tauq and taup are complex scalars, and v and u are complex
!> vectors; v(1:i) = 0, v(i+1) = 1, and v(i+2:m) is stored on exit in
!> A(i+2:m,i); u(1:i-1) = 0, u(i) = 1, and u(i+1:n) is stored on exit in
!> A(i,i+1:n); tauq is stored in TAUQ(i) and taup in TAUP(i).
!>
!> The contents of A on exit are illustrated by the following examples:
!>
!> m = 6 and n = 5 (m > n): m = 5 and n = 6 (m < n):
!>
!> ( d e u1 u1 u1 ) ( d u1 u1 u1 u1 u1 )
!> ( v1 d e u2 u2 ) ( e d u2 u2 u2 u2 )
!> ( v1 v2 d e u3 ) ( v1 e d u3 u3 u3 )
!> ( v1 v2 v3 d e ) ( v1 v2 e d u4 u4 )
!> ( v1 v2 v3 v4 d ) ( v1 v2 v3 e d u5 )
!> ( v1 v2 v3 v4 v5 )
!>
!> where d and e denote diagonal and off-diagonal elements of B, vi
!> denotes an element of the vector defining H(i), and ui an element of
!> the vector defining G(i).
!>
so Q and P are built out of elementary reflectors, and each one is a rank-one-ish update of the identity: H(i) = I - tauq * v * v**H and G(i) = I - taup * u * u**H, where tauq and taup are complex scalars and v and u are complex vectors. the vector tails get stashed inside A on exit and the scalars go into TAUQ(i) and TAUP(i) β see the diagram above for exactly which entries go where. it's giving organized chaos and honestly? we stan π
Definition at line 205 of file cgebrd.f.
π subroutine dgebrd (integer m, integer n, double precision, dimension( lda, * ) a, integer lda, double precision, dimension( * ) d, double precision, dimension( * ) e, double precision, dimension( * ) tauq, double precision, dimension( * ) taup, double precision, dimension( * ) work, integer lwork, integer info)
DGEBRD
β Purpose:
!>
!> DGEBRD reduces a general real M-by-N matrix A to upper or lower
!> bidiagonal form B by an orthogonal transformation: Q**T * A * P = B.
!>
!> If m >= n, B is upper bidiagonal; if m < n, B is lower bidiagonal.
!>
same energy, real numbers this time. you give her a general real M-by-N matrix A, she gives you upper or lower bidiagonal B via an orthogonal transformation: Q**T * A * P = B. note it's Q**T here, not Q**H β because everything's real, bestie π. m >= n means upper bidiagonal, m < n means lower bidiagonal π¦
πΈ Parameters
MβMisINTEGER. the number of rows in the matrixA. must satisfyM >= 0β¨NβNisINTEGER. the number of columns in the matrixA. must satisfyN >= 0β¨AβAisDOUBLE PRECISIONarray, dimension(LDA,N).
On entry, the M-by-N general matrix to be reduced. On exit:
- if
m >= n: the diagonal and the first superdiagonal are overwritten with the upper bidiagonal matrixB; the elements below the diagonal, with the arrayTAUQ, represent the orthogonal matrixQas a product of elementary reflectors; and the elements above the first superdiagonal, with the arrayTAUP, represent the orthogonal matrixPas a product of elementary reflectors π - if
m < n: the diagonal and the first subdiagonal are overwritten with the lower bidiagonal matrixB; the elements below the first subdiagonal, with the arrayTAUQ, represent the orthogonal matrixQas a product of elementary reflectors; and the elements above the diagonal, with the arrayTAUP, represent the orthogonal matrixPas a product of elementary reflectors π
See Further Details π¦
LDAβLDAisINTEGER. the leading dimension of the arrayA. must satisfyLDA >= max(1,M)πDβDisDOUBLE PRECISIONarray, dimension(min(M,N)). the diagonal elements of the bidiagonal matrixB, whereD(i) = A(i,i)β¨EβEisDOUBLE PRECISIONarray, dimension(min(M,N)-1). the off-diagonal elements of the bidiagonal matrixB:- if
m >= n:E(i) = A(i,i+1)fori = 1,2,...,n-1 - if
m < n:E(i) = A(i+1,i)fori = 1,2,...,m-1πΈ
- if
TAUQβTAUQisDOUBLE PRECISIONarray, dimension(min(M,N)). the scalar factors of the elementary reflectors which represent the orthogonal matrixQ. See Further Details πTAUPβTAUPisDOUBLE PRECISIONarray, dimension(min(M,N)). the scalar factors of the elementary reflectors which represent the orthogonal matrixP. See Further Details πWORKβWORKisDOUBLE PRECISIONarray, dimension(MAX(1,LWORK)). on exit, ifINFO = 0, thenWORK(1)returns the optimalLWORKπ«ΆLWORKβLWORKisINTEGER. the length of the arrayWORK.LWORK >= 1, ifMIN(M,N) = 0, andLWORK >= MAX(M,N), otherwise.- for optimum performance
LWORK >= (M+N)*NB, whereNBis the optimal blocksize π₯ - if
LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of theWORKarray, returns this value as the first entry of theWORKarray, and no error message related toLWORKis issued byXERBLAπ
INFOβINFOisINTEGER.= 0: successful exit< 0: ifINFO = -i, thei-th argument had an illegal value. π¨
part 1 of 3, bestie β don't go anywhere, the rest is right behind this π«Ά
π Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π Further Details
okay bestie, so the matrices Q and P are literally represented as products of elementary reflectors β no cap:
If m >= n,
Q = H(1) H(2) . . . H(n) and P = G(1) G(2) . . . G(n-1)
Each H(i) and G(i) has the form:
H(i) = I - tauq * v * v**T and G(i) = I - taup * u * u**T
where tauq and taup are real scalars, and v and u are real vectors;
v(1:i-1) = 0, v(i) = 1, and v(i+1:m) is stored on exit in A(i+1:m,i);
u(1:i) = 0, u(i+1) = 1, and u(i+2:n) is stored on exit in A(i,i+2:n);
tauq is stored in TAUQ(i) and taup in TAUP(i).
If m < n,
Q = H(1) H(2) . . . H(m-1) and P = G(1) G(2) . . . G(m)
Each H(i) and G(i) has the form:
H(i) = I - tauq * v * v**T and G(i) = I - taup * u * u**T
where tauq and taup are real scalars, and v and u are real vectors;
v(1:i) = 0, v(i+1) = 1, and v(i+2:m) is stored on exit in A(i+2:m,i);
u(1:i-1) = 0, u(i) = 1, and u(i+1:n) is stored on exit in A(i,i+1:n);
tauq is stored in TAUQ(i) and taup in TAUP(i).
The contents of A on exit are illustrated by the following examples β yes, theyβre iconic:
m = 6 and n = 5 (m > n): m = 5 and n = 6 (m < n):
( d e u1 u1 u1 ) ( d u1 u1 u1 u1 u1 )
( v1 d e u2 u2 ) ( e d u2 u2 u2 u2 )
( v1 v2 d e u3 ) ( v1 e d u3 u3 u3 )
( v1 v2 v3 d e ) ( v1 v2 e d u4 u4 )
( v1 v2 v3 v4 d ) ( v1 v2 v3 e d u5 )
( v1 v2 v3 v4 v5 )
where d and e denote diagonal and off-diagonal elements of B, vi denotes an element of the vector defining H(i), and ui an element of the vector defining G(i).
π Definition at line 204 of file dgebrd.f.
πΈ SGEBRD β real bidiagonal reduction, slay
subroutine sgebrd (integer m, integer n, real, dimension( lda, * ) a,
integer lda, real, dimension( * ) d, real, dimension( * ) e, real,
dimension( * ) tauq, real, dimension( * ) taup, real, dimension( * )
work, integer lwork, integer info)
SGEBRD
β¨ Purpose
SGEBRD reduces a general real M-by-N matrix A to upper or lower bidiagonal form B by an orthogonal transformation: Q**T * A * P = B.
If m >= n, B is upper bidiagonal; if m < n, B is lower bidiagonal. periodt.
π Parameters
MβM is INTEGER; the number of rows in the matrixA.M >= 0.NβN is INTEGER; the number of columns in the matrixA.N >= 0.AβA is REAL array, dimension (LDA,N). On entry, theM-by-Ngeneral matrix to be reduced. On exit:- if
m >= n, the diagonal and the first superdiagonal are overwritten with the upper bidiagonal matrixB; the elements below the diagonal, with the arrayTAUQ, represent the orthogonal matrixQas a product of elementary reflectors, and the elements above the first superdiagonal, with the arrayTAUP, represent the orthogonal matrixPas a product of elementary reflectors; - if
m < n, the diagonal and the first subdiagonal are overwritten with the lower bidiagonal matrixB; the elements below the first subdiagonal, with the arrayTAUQ, represent the orthogonal matrixQas a product of elementary reflectors, and the elements above the diagonal, with the arrayTAUP, represent the orthogonal matrixPas a product of elementary reflectors. See Further Details.
- if
LDAβLDA is INTEGER; the leading dimension of the arrayA.LDA >= max(1,M).DβD is REAL array, dimension (min(M,N)); the diagonal elements of the bidiagonal matrixB:D(i) = A(i,i).EβE is REAL array, dimension (min(M,N)-1); the off-diagonal elements of the bidiagonal matrixB: ifm >= n,E(i) = A(i,i+1)fori = 1,2,...,n-1; ifm < n,E(i) = A(i+1,i)fori = 1,2,...,m-1.TAUQβTAUQ is REAL array, dimension (min(M,N)); the scalar factors of the elementary reflectors which represent the orthogonal matrixQ. See Further Details.TAUPβTAUP is REAL array, dimension (min(M,N)); the scalar factors of the elementary reflectors which represent the orthogonal matrixP. See Further Details.WORKβWORK is REAL array, dimension (MAX(1,LWORK)); on exit, ifINFO = 0,WORK(1)returns the optimalLWORK.LWORKβLWORK is INTEGER; the length of the arrayWORK.LWORK >= 1, if MIN(M,N) = 0, and LWORK >= MAX(M,N), otherwise.For optimum performanceLWORK >= (M+N)*NB, whereNBis the optimal blocksize. IfLWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of theWORKarray, returns this value as the first entry of theWORKarray, and no error message related toLWORKis issued byXERBLA.INFOβINFO is INTEGER;= 0: successful exit;< 0: if INFO = -i, the i-th argument had an illegal value.
π Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π Further Details
okay so the matrices Q and P are represented as products of elementary reflectors β same energy as above, bestie:
If m >= n,
Q = H(1) H(2) . . . H(n) and P = G(1) G(2) . . . G(n-1)
Each H(i) and G(i) has the form:
H(i) = I - tauq * v * v**T and G(i) = I - taup * u * u**T
where tauq and taup are real scalars, and v and u are real vectors;
v(1:i-1) = 0, v(i) = 1, and v(i+1:m) is stored on exit in A(i+1:m,i);
u(1:i) = 0, u(i+1) = 1, and u(i+2:n) is stored on exit in A(i,i+2:n);
tauq is stored in TAUQ(i) and taup in TAUP(i).
If m < n,
Q = H(1) H(2) . . . H(m-1) and P = G(1) G(2) . . . G(m)
Each H(i) and G(i) has the form:
H(i) = I - tauq * v * v**T and G(i) = I - taup * u * u**T
where tauq and taup are real scalars, and v and u are real vectors;
v(1:i) = 0, v(i+1) = 1, and v(i+2:m) is stored on exit in A(i+2:m,i);
u(1:i-1) = 0, u(i) = 1, and u(i+1:n) is stored on exit in A(i,i+1:n);
tauq is stored in TAUQ(i) and taup in TAUP(i).
The contents of A on exit are illustrated by the following examples:
m = 6 and n = 5 (m > n): m = 5 and n = 6 (m < n):
( d e u1 u1 u1 ) ( d u1 u1 u1 u1 u1 )
( v1 d e u2 u2 ) ( e d u2 u2 u2 u2 )
( v1 v2 d e u3 ) ( v1 e d u3 u3 u3 )
( v1 v2 v3 d e ) ( v1 v2 e d u4 u4 )
( v1 v2 v3 v4 d ) ( v1 v2 v3 e d u5 )
( v1 v2 v3 v4 v5 )
where d and e denote diagonal and off-diagonal elements of B, vi denotes an element of the vector defining H(i), and ui an element of the vector defining G(i).
π Definition at line 204 of file sgebrd.f.
π¦ ZGEBRD β complex bidiagonal reduction, main character energy
subroutine zgebrd (integer m, integer n, complex*16, dimension( lda, * ) a,
integer lda, double precision, dimension( * ) d, double precision,
dimension( * ) e, complex*16, dimension( * ) tauq, complex*16,
dimension( * ) taup, complex*16, dimension( * ) work, integer lwork,
integer info)
ZGEBRD
β¨ Purpose
ZGEBRD reduces a general complex M-by-N matrix A to upper or lower bidiagonal form B by a unitary transformation: Q**H * A * P = B.
If m >= n, B is upper bidiagonal; if m < n, B is lower bidiagonal.
π Parameters
MβM is INTEGER; the number of rows in the matrixA.M >= 0.NβN is INTEGER; the number of columns in the matrixA.N >= 0.AβA is COMPLEX*16 array, dimension (LDA,N). On entry, theM-by-Ngeneral matrix to be reduced. On exit:- if
m >= n, the diagonal and the first superdiagonal are overwritten with the upper bidiagonal matrixB; the elements below the diagonal, with the arrayTAUQ, represent the unitary matrixQas a product of elementary reflectors, and the elements above the first superdiagonal, with the arrayTAUP, represent the unitary matrixPas a product of elementary reflectors; - if
m < n, the diagonal and the first subdiagonal are overwritten with the lower bidiagonal matrixB; the elements below the first subdiagonal, with the arrayTAUQ, represent the unitary matrixQas a product of elementary reflectors, and the elements above the diagonal, with the arrayTAUP, represent the unitary matrixPas a product of elementary reflectors. See Further Details.
- if
LDAβLDA is INTEGER; the leading dimension of the arrayA.LDA >= max(1,M).DβD is DOUBLE PRECISION array, dimension (min(M,N)); the diagonal elements of the bidiagonal matrixB:D(i) = A(i,i).EβEβDOUBLE PRECISION array, dimension (min(M,N)-1). These are the off-diagonal elements of the bidiagonal matrixB, bestie: ifm >= n, thenE(i) = A(i,i+1)fori = 1,2,...,n-1; ifm < n, thenE(i) = A(i+1,i)fori = 1,2,...,m-1. πTAUQβCOMPLEX*16 array, dimension (min(M,N)). The scalar factors of the elementary reflectors that represent the unitary matrixQ. See Further Details. β¨TAUPβCOMPLEX*16 array, dimension (min(M,N)). The scalar factors of the elementary reflectors that represent the unitary matrixP. See Further Details. πWORKβCOMPLEX*16 array, dimension (MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the optimalLWORK. π¦LWORKβINTEGER. The length of the arrayWORK.LWORK >= 1, ifMIN(M,N) = 0, andLWORK >= MAX(M,N), otherwise. For optimum performanceLWORK >= (M+N)*NB, whereNBis the optimal blocksize. IfLWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of theWORKarray, returns this value as the first entry of theWORKarray, and no error message related toLWORKis issued byXERBLA. π₯INFOβINTEGER.= 0: successful exit.< 0: ifINFO = -i, thei-th argument had an illegal value. π
π Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π Further Details:
The matrices Q and P are represented as products of elementary reflectors:
If m >= n,
Q = H(1) H(2) . . . H(n) and P = G(1) G(2) . . . G(n-1)
Each H(i) and G(i) has the form:
H(i) = I - tauq * v * v**H and G(i) = I - taup * u * u**H
where tauq and taup are complex scalars, and v and u are complex vectors; v(1:i-1) = 0, v(i) = 1, and v(i+1:m) is stored on exit in A(i+1:m,i); u(1:i) = 0, u(i+1) = 1, and u(i+2:n) is stored on exit in A(i,i+2:n); tauq is stored in TAUQ(i) and taup in TAUP(i). π§
If m < n,
Q = H(1) H(2) . . . H(m-1) and P = G(1) G(2) . . . G(m)
Each H(i) and G(i) has the form:
H(i) = I - tauq * v * v**H and G(i) = I - taup * u * u**H
where tauq and taup are complex scalars, and v and u are complex vectors; v(1:i) = 0, v(i+1) = 1, and v(i+2:m) is stored on exit in A(i+2:m,i); u(1:i-1) = 0, u(i) = 1, and u(i+1:n) is stored on exit in A(i,i+1:n); tauq is stored in TAUQ(i) and taup in TAUP(i). π
The contents of A on exit are illustrated by the following examples:
m = 6 and n = 5 (m > n): m = 5 and n = 6 (m < n):
( d e u1 u1 u1 ) ( d u1 u1 u1 u1 u1 )
( v1 d e u2 u2 ) ( e d u2 u2 u2 u2 )
( v1 v2 d e u3 ) ( v1 e d u3 u3 u3 )
( v1 v2 v3 d e ) ( v1 v2 e d u4 u4 )
( v1 v2 v3 v4 d ) ( v1 v2 v3 e d u5 )
( v1 v2 v3 v4 v5 )
where d and e denote diagonal and off-diagonal elements of B, vi denotes an element of the vector defining H(i), and ui an element of the vector defining G(i). π
Definition at line 204 of file zgebrd.f. π
π Author
Generated automatically by Doxygen for LAPACK from the source code. π«Ά
That's the footer, bestie: source is LAPACK, version 3.12.0, and the page is gebrd(3) β date isn't listed in this footer. π
π¦ where this page comes from
- arch rolling: lapack-doc 3.12.1-2 Β· custom
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms