DLASSQ(3)
π DLASSQ(3) β like, the scaled-sum-of-squares glow-up β¨
okay bestie, so this is a page out of the Library Functions Manual for dlassq.f90(3) β yes the whole NAME is literally just the path /home/abuild/rpmbuild/BUILD/lapack-static-3.12.0-build/lapack-3.12.0/SRC/dlassq.f90 π that's the actual name, we don't make the rules, we just slay within them.
β¨ SYNOPSIS β¨
Functions/Subroutines β the whole vibe in one line:
subroutine DLASSQ (n, x, incx, scale, sumsq)
DLASSQ updates a sum of squares represented in scaled form. π«Ά
π Function/Subroutine Documentation π
Here's the full signature, character for character, no edits, periodt:
subroutine DLASSQ (integer n, real(wp), dimension(*) x, integer incx,
real(wp) scale, real(wp) sumsq)
DLASSQ updates a sum of squares represented in scaled form. (yes it says it twice, it's confident, let it live π )
πΈ Purpose πΈ
okay so here's what it actually does, and it's giving main character energy:
!>
!> DLASSQ returns the values scale_out and sumsq_out such that
!>
!> (scale_out**2)*sumsq_out = x( 1 )**2 +...+ x( n )**2 + (scale**2)*sumsq,
!>
!> where x( i ) = X( 1 + ( i - 1 )*INCX ). The value of sumsq is
!> assumed to be non-negative.
!>
!> scale and sumsq must be supplied in SCALE and SUMSQ and
!> scale_out and sumsq_out are overwritten on SCALE and SUMSQ respectively.
!>
!>
like, it does NOT allocate anything for you, it just overwrites SCALE and SUMSQ in place β so don't come crying when your inputs are gone, that's the whole bit π
π Parameters π
NβN is INTEGER, the number of elements to be used from the vector x.
!> N is INTEGER
!> The number of elements to be used from the vector x.
!>
XβX is DOUBLE PRECISION array, dimension (1+(N-1)*abs(INCX)). This is the vector whose scaled sum of squares gets computed π¦
!> X is DOUBLE PRECISION array, dimension (1+(N-1)*abs(INCX))
!> The vector for which a scaled sum of squares is computed.
!> x( i ) = X( 1 + ( i - 1 )*INCX ), 1 <= i <= n.
!>
INCXβINCX is INTEGER, the step between successive values of the vector x. Read this carefully bestie, all three cases matter π
!> INCX is INTEGER
!> The increment between successive values of the vector x.
!> If INCX > 0, X(1+(i-1)*INCX) = x(i) for 1 <= i <= n
!> If INCX < 0, X(1-(n-i)*INCX) = x(i) for 1 <= i <= n
!> If INCX = 0, x isn't a vector so there is no need to call
!> this subroutine. If you call it anyway, it will count x(1)
!> in the vector norm N times.
!>
nglINCX = 0is a trap π if you pass it,x(1)gets counted in the vector normNwhole times. The docs literally say "there is no need to call this subroutine" β that's them being polite, lowkey.
SCALEβSCALE is DOUBLE PRECISION. On entry it's thescalefrom the equation above; on exit it's been overwritten byscale_out, the scaling factor for the sum of squares β¨
!> SCALE is DOUBLE PRECISION
!> On entry, the value scale in the equation above.
!> On exit, SCALE is overwritten by scale_out, the scaling factor
!> for the sum of squares.
!>
SUMSQβSUMSQ is DOUBLE PRECISION. On entry, thesumsqfrom the equation above; on exit, overwritten bysumsq_out, the basic sum of squares thatscale_outhas been factored out of π§
!> SUMSQ is DOUBLE PRECISION
!> On entry, the value sumsq in the equation above.
!> On exit, SUMSQ is overwritten by sumsq_out, the basic sum of
!> squares from which scale_out has been factored out.
!>
β Author β
Edward Anderson, Lockheed Martin π
π Contributors π
Weslley Pereira, University of Colorado Denver, USA Nick Papior, Technical University of Denmark, DK
(we stan a credited collab, fr fr π«Ά)
π₯ Further Details π₯
the receipts, in full, because citations are iconic:
!>
!> Anderson E. (2017)
!> Algorithm 978: Safe Scaling in the Level 1 BLAS
!> ACM Trans Math Softw 44:1--28
!> https://doi.org/10.1145/3061665
!>
!> Blue, James L. (1978)
!> A Portable Fortran Program to Find the Euclidean Norm of a Vector
!> ACM Trans Math Softw 4:15--23
!> https://doi.org/10.1145/355769.355771
!>
!>
Definition at line 123 of file dlassq.f90. π
π Author π
Generated automatically by Doxygen for LAPACK from the source code. (not a human, just a robot doing its little robot thing π€β¨)
aaand that's the page, bestie π β brought to you by LAPACK, Version 3.12.0, dated /home/abui.../dlassq.f90(3) β mwah, go scale something 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