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? ✨

  • '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. 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, 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. 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. For SLASR the doc says P*A when SIDE = 'R' and A*P**T when SIDE = 'L' β€” which is the opposite pairing from the DLASR page 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 matrix P is applied to A on the left or on the right, bestie.
    • = 'L': Left side, compute A := P*A
    • = 'R': Right side, compute A := A*P**T
  • PIVOT β€” PIVOT is CHARACTER*1. This picks the plane that P(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 whether P is a forward or backward sequence of plane rotations. slay.
    • = '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. so if it's tiny, we're out πŸ’…
  • N β€” N is INTEGER. The number of columns of the matrix A. If n <= 1, an immediate return is effected. same energy, no cap.
  • C β€” C is DOUBLE PRECISION array, dimension (M-1) if SIDE = 'L', and (N-1) if SIDE = 'R'. These are the cosines c(k) of the plane rotations. iconic.
  • S β€” S is DOUBLE PRECISION array, dimension (M-1) if SIDE = 'L', and (N-1) if SIDE = 'R'. These are 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) ).

literally the whole rotation vibe right there πŸŒ€

  • A β€” A is COMPLEX*16 array, dimension (LDA,N). This is 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'. yes, that is exactly what the page says, bestie β€” write it down exactly like that πŸ“
  • LDA β€” LDA is INTEGER. The leading dimension of the array A. It must satisfy LDA >= 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