SRC/slaset.f(3)

πŸŽ€ SRC/slaset.f(3) πŸŽ€

okay so this is a page from the Library Functions Manual β€” literally the LAPACK girlies' documentation, and today's main character is slaset. bestie, it's a matrix-filling baddie. let's get into it πŸ’…


✨ NAME ✨

SRC/slaset.f β€” no cap, that's the whole name. the file. the legend. the source. 🫢


🌸 SYNOPSIS 🌸

Functions/Subroutines

  • subroutine slaset (uplo, m, n, alpha, beta, a, lda) β€” SLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values. that's it, that's the job, and she does it flawlessly ✨

πŸ’– Function/Subroutine Documentation πŸ’–

subroutine slaset (character uplo, integer m, integer n, real alpha, real beta, real, dimension( lda, * ) a, integer lda)

SLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values. like, she's not doing math, she's doing vibes assignment. 😌

πŸ¦‹ Purpose:

!>
!> SLASET initializes an m-by-n matrix A to BETA on the diagonal and
!> ALPHA on the offdiagonals.
!>

so: diagonal gets BETA, everything off the diagonal gets ALPHA. two constants, one matrix, zero drama. iconic. πŸ”₯


πŸ“ Parameters

UPLO

!>          UPLO is CHARACTER*1
!>          Specifies the part of the matrix A to be set.
!>          = 'U':      Upper triangular part is set; the strictly lower
!>                      triangular part of A is not changed.
!>          = 'L':      Lower triangular part is set; the strictly upper
!>                      triangular part of A is not changed.
!>          Otherwise:  All of the matrix A is set.
!>

so UPLO is a CHARACTER*1 that tells her which part of the matrix to touch:

  • 'U' β†’ the upper triangular part gets set, and the strictly lower triangular part of A is not changed (hands off, respectfully πŸ™ˆ)
  • 'L' β†’ the lower triangular part gets set, and the strictly upper triangular part of A is not changed
  • anything else β†’ the whole matrix A gets set. all of it. every last element. main character energy πŸ‘‘

M

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

M is an INTEGER, it's the number of rows of A, and it's got one rule: M >= 0. πŸ’œ

N

!>          N is INTEGER
!>          The number of columns of the matrix A.  N >= 0.
!>

N is an INTEGER, the number of columns of A, and same deal: N >= 0. πŸŽ€

ALPHA

!>          ALPHA is REAL
!>          The constant to which the offdiagonal elements are to be set.
!>

ALPHA is REAL and it's the constant the offdiagonal elements get set to. she's the off-diagonal constant. that's her whole personality and honestly? slay. ✨

BETA

!>          BETA is REAL
!>          The constant to which the diagonal elements are to be set.
!>

BETA is REAL and it's the constant the diagonal elements get set to. the diagonal's own personal constant. πŸŽ€

A

!>          A is REAL array, dimension (LDA,N)
!>          On exit, the leading m-by-n submatrix of A is set as follows:
!>
!>          if UPLO = 'U', A(i,j) = ALPHA, 1<=i<=j-1, 1<=j<=n,
!>          if UPLO = 'L', A(i,j) = ALPHA, j+1<=i<=m, 1<=j<=n,
!>          otherwise,     A(i,j) = ALPHA, 1<=i<=m, 1<=j<=n, i.ne.j,
!>
!>          and, for all UPLO, A(i,i) = BETA, 1<=i<=min(m,n).
!>

A is a REAL array, dimension (LDA,N). on exit, the leading m-by-n submatrix of A is set like this:

  • if UPLO = 'U', A(i,j) = ALPHA, 1<=i<=j-1, 1<=j<=n
  • if UPLO = 'L', A(i,j) = ALPHA, j+1<=i<=m, 1<=j<=n
  • otherwise, A(i,j) = ALPHA, 1<=i<=m, 1<=j<=n, i.ne.j

and, for all UPLO, A(i,i) = BETA, 1<=i<=min(m,n). the diagonal always gets BETA, no exceptions, periodt. πŸ’…

LDA

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

LDA is an INTEGER, the leading dimension of the array A, and the vibe check is LDA >= max(1,M). 🫢


πŸ‘‘ Author

  • Univ. of Tennessee
  • Univ. of California Berkeley
  • Univ. of Colorado Denver
  • NAG Ltd.
Definition at line 109 of file slaset.f. πŸ“

🌈 Author

Generated automatically by Doxygen for LAPACK from the source code. not me being generated automatically, that's just how the pipeline works 😭


k that's the whole page, bestie. go set some matrices. 🧚

LAPACK Version 3.12.0 β€” SRC/slaset.f(3) πŸ’–β­πŸŒΈ

πŸ“¦ where this page comes from