lasr(3)
β¨ lasr β apply series of plane rotations β¨
okay so bestie, welcome to lasr(3), straight out of the Library Functions Manual π
this is the whole plane-rotation family β four subroutines, all iconic, all doing the most with a rectangular matrix. Let's get into it π
π¦ NAME
lasr β lasr: apply series of plane rotations
πΈ SYNOPSIS
π« Functions
subroutine clasr (side, pivot, direct, m, n, c, s, a, lda)β CLASR applies a sequence of plane rotations to a general rectangular matrix.subroutine dlasr (side, pivot, direct, m, n, c, s, a, lda)β DLASR applies a sequence of plane rotations to a general rectangular matrix.subroutine slasr (side, pivot, direct, m, n, c, s, a, lda)β SLASR applies a sequence of plane rotations to a general rectangular matrix.subroutine zlasr (side, pivot, direct, m, n, c, s, a, lda)β ZLASR applies a sequence of plane rotations to a general rectangular matrix.
π«Ά Detailed Description
(she's just a heading, no body text, living her best minimalist life π)
π Function Documentation
π§ clasr β the complex one, obviously
subroutine clasr (character side, character pivot, character direct, integer
m, integer n, real, dimension( * ) c, real, dimension( * ) s, complex,
dimension( lda, * ) a, integer lda)
CLASR applies a sequence of plane rotations to a general rectangular matrix.
π₯ Purpose
!>
!> CLASR applies a sequence of real plane rotations to a complex matrix
!> A, from either the left or the right.
!>
!> When SIDE = 'L', the transformation takes the form
!>
!> A := P*A
!>
!> and when SIDE = 'R', the transformation takes the form
!>
!> A := A*P**T
!>
!> where P is an orthogonal matrix consisting of a sequence of z plane
!> rotations, with z = M when SIDE = 'L' and z = N when SIDE = 'R',
!> and P**T is the transpose of P.
!>
!> When DIRECT = 'F' (Forward sequence), then
!>
!> P = P(z-1) * ... * P(2) * P(1)
!>
!> and when DIRECT = 'B' (Backward sequence), then
!>
!> P = P(1) * P(2) * ... * P(z-1)
!>
!> where P(k) is a plane rotation matrix defined by the 2-by-2 rotation
!>
!> R(k) = ( c(k) s(k) )
!> = ( -s(k) c(k) ).
!>
!> When PIVOT = 'V' (Variable pivot), the rotation is performed
!> for the plane (k,k+1), i.e., P(k) has the form
!>
!> P(k) = ( 1 )
!> ( ... )
!> ( 1 )
!> ( c(k) s(k) )
!> ( -s(k) c(k) )
!> ( 1 )
!> ( ... )
!> ( 1 )
!>
!> where R(k) appears as a rank-2 modification to the identity matrix in
!> rows and columns k and k+1.
!>
!> When PIVOT = 'T' (Top pivot), the rotation is performed for the
!> plane (1,k+1), so P(k) has the form
!>
!> P(k) = ( c(k) s(k) )
!> ( 1 )
!> ( ... )
!> ( 1 )
!> ( -s(k) c(k) )
!> ( 1 )
!> ( ... )
!> ( 1 )
!>
!> where R(k) appears in rows and columns 1 and k+1.
!>
!> Similarly, when PIVOT = 'B' (Bottom pivot), the rotation is
!> performed for the plane (k,z), giving P(k) the form
!>
!> P(k) = ( 1 )
!> ( ... )
!> ( 1 )
!> ( c(k) s(k) )
!> ( 1 )
!> ( ... )
!> ( 1 )
!> ( -s(k) c(k) )
!>
!> where R(k) appears in rows and columns k and z. The rotations are
!> performed without ever forming P(k) explicitly.
!>
π Parameters
SIDE
!> SIDE is CHARACTER*1
!> Specifies whether the plane rotation matrix P is applied to
!> A on the left or the right.
!> = 'L': Left, compute A := P*A
!> = 'R': Right, compute A:= A*P**T
!>
PIVOT
!> PIVOT is CHARACTER*1
!> Specifies the plane for which P(k) is a plane rotation
!> matrix.
!> = 'V': Variable pivot, the plane (k,k+1)
!> = 'T': Top pivot, the plane (1,k+1)
!> = 'B': Bottom pivot, the plane (k,z)
!>
DIRECT
!> DIRECT is CHARACTER*1
!> Specifies whether P is a forward or backward sequence of
!> plane rotations.
!> = 'F': Forward, P = P(z-1)*...*P(2)*P(1)
!> = 'B': Backward, P = P(1)*P(2)*...*P(z-1)
!>
M
!> M is INTEGER
!> The number of rows of the matrix A. If m <= 1, an immediate
!> return is effected.
!>
bestie if m <= 1 she's literally leaving immediately, no thoughts, no rotations, gone π
N
!> N is INTEGER
!> The number of columns of the matrix A. If n <= 1, an
!> immediate return is effected.
!>
C
!> C is REAL array, dimension
!> (M-1) if SIDE = 'L'
!> (N-1) if SIDE = 'R'
!> The cosines c(k) of the plane rotations.
!>
S
!> S is REAL array, dimension
!> (M-1) if SIDE = 'L'
!> (N-1) if SIDE = 'R'
!> The sines s(k) of the plane rotations. The 2-by-2 plane
!> rotation part of the matrix P(k), R(k), has the form
!> R(k) = ( c(k) s(k) )
!> ( -s(k) c(k) ).
!>
A
!> A is COMPLEX array, dimension (LDA,N)
!> The M-by-N matrix A. On exit, A is overwritten by P*A if
!> SIDE = 'R' or by A*P**T if SIDE = 'L'.
!>
π just copying what the page says, character for character β quote me, don't @ me
LDA
!> LDA is INTEGER
!> The leading dimension of the array A. LDA >= max(1,M).
!>
π Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Definition at line 199 of file clasr.f.
π¦ dlasr β double precision, double the slay
subroutine dlasr (character side, character pivot, character direct, integer
m, integer n, double precision, dimension( * ) c, double precision,
dimension( * ) s, double precision, dimension( lda, * ) a, integer lda)
DLASR applies a sequence of plane rotations to a general rectangular matrix.
π₯ Purpose
!>
!> DLASR applies a sequence of plane rotations to a real matrix A,
!> from either the left or the right.
!>
!> When SIDE = 'L', the transformation takes the form
!>
!> A := P*A
!>
!> and when SIDE = 'R', the transformation takes the form
!>
!> A := A*P**T
!>
!> where P is an orthogonal matrix consisting of a sequence of z plane
!> rotations, with z = M when SIDE = 'L' and z = N when SIDE = 'R',
!> and P**T is the transpose of P.
!>
!> When DIRECT = 'F' (Forward sequence), then
!>
!> P = P(z-1) * ... * P(2) * P(1)
!>
!> and when DIRECT = 'B' (Backward sequence), then
!>
!> P = P(1) * P(2) * ... * P(z-1)
!>
!> where P(k) is a plane rotation matrix defined by the 2-by-2 rotation
!>
!> R(k) = ( c(k) s(k) )
!> = ( -s(k) c(k) ).
!>
!> When PIVOT = 'V' (Variable pivot), the rotation is performed
!> for the plane (k,k+1), i.e., P(k) has the form
!>
!> P(k) = ( 1 )
!> ( ... )
!> ( 1 )
!> ( c(k) s(k) )
!> ( -s(k) c(k) )
!> ( 1 )
!> ( ... )
!> ( 1 )
!>
!> where R(k) appears as a rank-2 modification to the identity matrix in
!> rows and columns k and k+1.
!>
!> When PIVOT = 'T' (Top pivot), the rotation is performed for the
!> plane (1,k+1), so P(k) has the form
!>
!> P(k) = ( c(k) s(k) )
!> ( 1 )
!> ( ... )
!> ( 1 )
!> ( -s(k) c(k) )
!> ( 1 )
!> ( ... )
!> ( 1 )
!>
!> where R(k) appears in rows and columns 1 and k+1.
!>
!> Similarly, when PIVOT = 'B' (Bottom pivot), the rotation is
!> performed for the plane (k,z), giving P(k) the form
!>
!> P(k) = ( 1 )
!> ( ... )
!> ( 1 )
!> ( c(k) s(k) )
!> ( 1 )
!> ( ... )
!> ( 1 )
!> ( -s(k) c(k) )
!>
!> where R(k) appears in rows and columns k and z. The rotations are
!> performed without ever forming P(k) explicitly.
!>
π Parameters
SIDE
!> SIDE is CHARACTER*1
!> Specifies whether the plane rotation matrix P is applied to
!> A on the left or the right.
!> = 'L': Left, compute A := P*A
!> = 'R': Right, compute A:= A*P**T
!>
PIVOT
PIVOT is CHARACTER*1 and it's the one that picks the plane for which P(k) is a plane rotation matrix. Bestie, this is literally the shape of the whole thing. Pick one:
'V'β Variable pivot, the plane(k,k+1)π'T'β Top pivot, the plane(1,k+1)β¬οΈ'B'β Bottom pivot, the plane(k,z)β¬οΈ
DIRECT
DIRECT is CHARACTER*1 and it tells us whether P is a forward or a backward sequence of plane rotations. Direction matters, okay? β¨
M
M is INTEGER, the number of rows of the matrix A. Heads up: if m <= 1, an immediate return is effected. Like, it just leaves. No notes. π
N
N is INTEGER, the number of columns of the matrix A. Same energy: if n <= 1, an immediate return is effected. Bye bestie π
C
C is DOUBLE PRECISION array, dimension
(M-1) if SIDE = 'L'
(N-1) if SIDE = 'R'
These are the cosines c(k) of the plane rotations. So β¨cosineβ¨, not the letter C, keep up π«Ά
S
S is DOUBLE PRECISION array, dimension
(M-1) if SIDE = 'L'
(N-1) if SIDE = 'R'
These are the sines s(k) of the plane rotations. And the 2-by-2 plane rotation part of the matrix P(k), which is R(k), has the form
R(k) = ( c(k) s(k) )
( -s(k) c(k) ).
Note the minus sign lives on the bottom-left. That's not a typo, that's the rotation, iykyk π₯
A
A is DOUBLE PRECISION array, dimension (LDA,N) β the M-by-N matrix A. On exit, A is overwritten by P*A if SIDE = 'L' or by A*P**T if SIDE = 'R'. Overwritten, bestie β your original A is gone, so don't come crying to me π
LDA
LDA is INTEGER, the leading dimension of the array A. The rule is LDA >= max(1,M). Respect the leading dimension and it'll respect you πΈ
π Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Definition at line 198 of file dlasr.f.
π« subroutine slasr (character side, character pivot, character direct, integer m, integer n, real, dimension( * ) c, real, dimension( * ) s, real, dimension( lda, * ) a, integer lda)
SLASR applies a sequence of plane rotations to a general rectangular matrix. Yes, this is the REAL sibling of the previous one β same vibe, single precision, still iconic π
Purpose β¨
!>
!> SLASR applies a sequence of plane rotations to a real matrix A,
!> from either the left or the right.
!>
!> When SIDE = 'L', the transformation takes the form
!>
!> A := P*A
!>
!> and when SIDE = 'R', the transformation takes the form
!>
!> A := A*P**T
!>
!> where P is an orthogonal matrix consisting of a sequence of z plane
!> rotations, with z = M when SIDE = 'L' and z = N when SIDE = 'R',
!> and P**T is the transpose of P.
!>
!> When DIRECT = 'F' (Forward sequence), then
!>
!> P = P(z-1) * ... * P(2) * P(1)
!>
!> and when DIRECT = 'B' (Backward sequence), then
!>
!> P = P(1) * P(2) * ... * P(z-1)
!>
!> where P(k) is a plane rotation matrix defined by the 2-by-2 rotation
!>
!> R(k) = ( c(k) s(k) )
!> = ( -s(k) c(k) ).
!>
!> When PIVOT = 'V' (Variable pivot), the rotation is performed
!> for the plane (k,k+1), i.e., P(k) has the form
!>
!> P(k) = ( 1 )
!> ( ... )
!> ( 1 )
!> ( c(k) s(k) )
!> ( -s(k) c(k) )
!> ( 1 )
!> ( ... )
!> ( 1 )
!>
!> where R(k) appears as a rank-2 modification to the identity matrix in
!> rows and columns k and k+1.
!>
!> When PIVOT = 'T' (Top pivot), the rotation is performed for the
!> plane (1,k+1), so P(k) has the form
!>
!> P(k) = ( c(k) s(k) )
!> ( 1 )
!> ( ... )
!> ( 1 )
!> ( -s(k) c(k) )
!> ( 1 )
!> ( ... )
!> ( 1 )
!>
!> where R(k) appears in rows and columns 1 and k+1.
!>
!> Similarly, when PIVOT = 'B' (Bottom pivot), the rotation is
!> performed for the plane (k,z), giving P(k) the form
!>
!> P(k) = ( 1 )
!> ( ... )
!> ( 1 )
!> ( c(k) s(k) )
!> ( 1 )
!> ( ... )
!> ( 1 )
!> ( -s(k) c(k) )
!>
!> where R(k) appears in rows and columns k and z. The rotations are
!> performed without ever forming P(k) explicitly.
!>
Ok so the last line is the actual flex here: it never builds P(k) in memory. It just does the thing. Main character energy, no assembly required πβ¨
Parameters π
SIDE
SIDE is CHARACTER*1 β specifies whether the plane rotation matrix P is applied to A on the left or the right.
'L'β Left, computeA := P*Aβ¬ οΈ'R'β Right, computeA:= A*P**Tβ‘οΈ
PIVOT
PIVOT is CHARACTER*1 β specifies the plane for which P(k) is a plane rotation matrix.
'V'β Variable pivot, the plane(k,k+1)π'T'β Top pivot, the plane(1,k+1)β¬οΈ'B'β Bottom pivot, the plane(k,z)β¬οΈ
DIRECT
DIRECT is CHARACTER*1 β specifies whether P is a forward or backward sequence of plane rotations.
M
M is INTEGER β the number of rows of the matrix A. If m <= 1, an immediate return is effected. It said what it said π
N
N is INTEGER β the number of columns of the matrix A. If n <= 1, an immediate return is effected. Same energy, different letter π¦
C
C is REAL array, dimension
(M-1) if SIDE = 'L'
(N-1) if SIDE = 'R'
The cosines c(k) of the plane rotations β¨
S
S is REAL array, dimension
(M-1) if SIDE = 'L'
(N-1) if SIDE = 'R'
The sines s(k) of the plane rotations. The 2-by-2 plane rotation part of the matrix P(k), R(k), has the form
R(k) = ( c(k) s(k) )
( -s(k) c(k) ).
A
A is REAL array, dimension (LDA,N) β the M-by-N matrix A. On exit, A is overwritten by P*A if SIDE = 'R' or by A*P**T if SIDE = 'L'.
β οΈ Bestie, read that one twice. ForSLASRthe doc saysP*AwhenSIDE = 'R'andA*P**TwhenSIDE = 'L'β which is the opposite pairing from theDLASRpage up above. I'm not editing it, I'm just telling you it's written that way in the source doc. Screenshot it, ask your prof, don't @ me ππΈ
LDA
LDA is INTEGER β the leading dimension of the array A. LDA >= max(1,M), always, no exceptions, periodt πΈ
π Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Definition at line 198 of file slasr.f.
π¦ subroutine zlasr (character side, character pivot, character direct, integer m, integer n, double precision, dimension( * ) c, double precision, dimension( * ) s, complex*16, dimension( lda, * ) a, integer lda)
ZLASR applies a sequence of plane rotations to a general rectangular matrix. And yeah β this is the complex one. Literally complex π
π Comin' at you with DOUBLE PRECISION c and s but a COMPLEX*16 a, because that's just the life it chose.
Purpose β¨
π Parameters π
SIDEβSIDE is CHARACTER*1. It tells you whether the plane rotation matrixPis applied toAon the left or on the right, bestie.= 'L': Left side, computeA := P*A= 'R': Right side, computeA := A*P**T
PIVOTβPIVOT is CHARACTER*1. This picks the plane thatP(k)is a plane rotation matrix for. iykyk.= 'V': Variable pivot, the plane is(k,k+1)= 'T': Top pivot, the plane is(1,k+1)= 'B': Bottom pivot, the plane is(k,z)
DIRECTβDIRECT is CHARACTER*1. This says whetherPis a forward or backward sequence of plane rotations. slay.MβM is INTEGER. The number of rows of the matrixA. Ifm <= 1, an immediate return is effected. so if it's tiny, we're out πNβN is INTEGER. The number of columns of the matrixA. Ifn <= 1, an immediate return is effected. same energy, no cap.CβC is DOUBLE PRECISION array, dimension(M-1)ifSIDE = 'L', and(N-1)ifSIDE = 'R'. These are the cosinesc(k)of the plane rotations. iconic.SβS is DOUBLE PRECISION array, dimension(M-1)ifSIDE = 'L', and(N-1)ifSIDE = 'R'. These are the siness(k)of the plane rotations. The 2-by-2 plane rotation part of the matrixP(k),R(k), has the form:
R(k) = ( c(k) s(k) )
( -s(k) c(k) ).
literally the whole rotation vibe right there π
AβA is COMPLEX*16 array, dimension(LDA,N). This is theM-by-NmatrixA. On exit,Ais overwritten byP*AifSIDE = 'R'or byA*P**TifSIDE = 'L'. yes, that is exactly what the page says, bestie β write it down exactly like that πLDAβLDA is INTEGER. The leading dimension of the arrayA. It must satisfyLDA >= max(1,M). periodt.
π Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Definition
Definition at line 199 of file zlasr.f.
π Author π
Generated automatically by Doxygen for LAPACK from the source code.
and that's the whole page, bestie π this one is from LAPACK Version 3.12.0, page lasr(3) β mwah, go rotate something iconic β¨π
π¦ 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