/home/abui...RC/drscl.f(3)
πΈ 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
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms