/home/abui...RC/drscl.f(3)

πŸ“¦ version 3.12.0, in opensuse-leap 16.0

🌸 DRSCL β€” the "divide a whole vector by one scalar without freaking out" era 🌸

okay so before we even start β€” this page is from the manual /home/abui...RC/drscl.f(3), and it's literally the glow-up doc for one tiny iconic Fortran subroutine. it lives in the LAPACK library, it's got main character energy, and it has exactly one job. let's get into it πŸ’…


✨ NAME ✨

/home/abuild/rpmbuild/BUILD/lapack-static-3.12.0-build/lapack-3.12.0/SRC/drscl.f

yes bestie, the NAME is literally the whole file path. that's the vibe. it's the source file for DRSCL and it's not sorry about it πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

Functions/Subroutines

  • subroutine DRSCL (n, sa, sx, incx) β€” DRSCL multiplies a vector by the reciprocal of a real scalar. that's it. that's the whole personality 🫢

πŸ‘‘ Function/Subroutine Documentation πŸ‘‘

subroutine DRSCL (integer n, double precision sa, double precision, dimension( * ) sx, integer incx)

DRSCL multiplies a vector by the reciprocal of a real scalar. say it with me: it multiplies a vector by the reciprocal of a real scalar πŸ”₯

🧚 Purpose

!>
!> DRSCL multiplies an n-element real vector x by the real scalar 1/a.
!> This is done without overflow or underflow as long as
!> the final result x/a does not overflow or underflow.
!>

so like β€” the whole point is that it's built carefully so the intermediate steps don't blow up or vanish into underflow. the one caveat, no cap: if the final result x/a itself overflows or underflows, then all bets are off. that part is on you, bestie 😭

πŸ’– Parameters

N

!>          N is INTEGER
!>          The number of components of the vector x.
!>

how many components the vector x has. simple. clean. slay ✨

SA

!>          SA is DOUBLE PRECISION
!>          The scalar a which is used to divide each component of x.
!>          SA must be >= 0, or the subroutine will divide by zero.
!>

the scalar a that every component of x gets divided by. and okay listen β€” SA must be >= 0, otherwise the subroutine will divide by zero. that's not a cute little quirk, that's the whole thing falling apart. don't do it πŸ™ˆ

SX

!>          SX is DOUBLE PRECISION array, dimension
!>                         (1+(N-1)*abs(INCX))
!>          The n-element vector x.
!>

this is the actual n-element vector x itself β€” the one getting divided. note the dimension, it's (1+(N-1)*abs(INCX)), so the length depends on the increment like the icon it is πŸ’œ

INCX

!>          INCX is INTEGER
!>          The increment between successive values of the vector SX.
!>          > 0:  SX(1) = X(1) and SX(1+(i-1)*INCX) = x(i),     1< i<= n
!>

the stride, basically β€” the gap between successive values of SX. when INCX is > 0 you get SX(1) = X(1) and SX(1+(i-1)*INCX) = x(i) for 1< i<= n. so it can skip through the array, it's not always gonna be 1 πŸ¦‹

πŸŽ€ Author

  • Univ. of Tennessee
  • Univ. of California Berkeley
  • Univ. of Colorado Denver
  • NAG Ltd.

these four. the founding mothers of this whole situation. credits where credits are due πŸ‘‘

⭐ Definition at line 83 of file drscl.f.

if you wanna go read it in the wild, line 83, file drscl.f. go off, go read, iykyk πŸ“–


🌈 Author 🌈

Generated automatically by Doxygen for LAPACK from the source code.

so yeah β€” nobody hand-wrote this page, Doxygen just did its little autogenerated thing straight from the source. still ate, ngl πŸ’€


and that's the whole page!! πŸ’– thanks for coming to my TED talk about dividing vectors carefully.

LAPACK β€” Version 3.12.0 β€” /home/abui...RC/drscl.f(3) πŸŽ€ bye bestie, go divide responsibly 🫢✨

πŸ“¦ where this page comes from