zlassq.f(3)
π NAME π
okay so bestie, welcome to zlassq.f β that's the file you're looking at right now, and also literally the whole name section, that's it, that's the name π
β¨ SYNOPSIS β¨
π¦ Functions/Subroutines π¦
subroutine zlassq (N, X, INCX, SCALE, SUMSQ)β ZLASSQ updates a sum of squares represented in scaled form. that's the whole vibe, no cap π
π§ Function/Subroutine Documentation π§
subroutine zlassq (integer N, complex*16, dimension( * ) X, integer INCX,
double precision SCALE, double precision SUMSQ)
ZLASSQ updates a sum of squares represented in scaled form. like, it's the scaled-form glow-up of a sum of squares, and honestly it ate π₯
πΈ Purpose πΈ
okay so ZLASSQ hands you back the values scl and ssq such that:
( scl**2 )*ssq = x( 1 )**2 +...+ x( n )**2 + ( scale**2 )*sumsq,
where x( i ) = abs( X( 1 + ( i - 1 )*INCX ) ). so every element gets abs'd first, then squared β that's the whole recipe π
the value of sumsq is assumed to be at least unity (so, β₯ 1, don't come in below that), and the value of ssq will then satisfy:
1.0 .le. ssq .le. ( sumsq + 2*n ).
scale is assumed to be non-negative, and scl returns the value:
scl = max( scale, abs( real( x( i ) ) ), abs( aimag( x( i ) ) ) ),
i
so it's the max over all i, lowkey taking the biggest of: scale itself, the absolute real part of each x( i ), and the absolute imaginary part of each x( i ). that's the ceiling, that's the moment π
scale and sumsq must be supplied in SCALE and SUMSQ respectively β you have to hand them in, like giving your friend your order before they go to the counter. then SCALE and SUMSQ are overwritten by scl and ssq respectively. so heads up: they don't survive, they get replaced fr fr π
and the iconic part: the routine makes only one pass through the vector X. one. pass. no re-reading, no going back, efficient queen behavior β¨
π Parameters π
N
N is INTEGER β the number of elements to be used from the vector X. like how many of them you're actually inviting to the function π
X
X is COMPLEX*16 array, dimension (N) β the vector x as described above, meaning:
x( i ) = X( 1 + ( i - 1 )*INCX ), 1 <= i <= n.
so it's strided, okurrr π
INCX
INCX is INTEGER β the increment between successive values of the vector X. and INCX > 0, so it's strictly positive, no zero, no negative, none of that chaos π«Ά
SCALE
SCALE is DOUBLE PRECISION β on entry, the value scale in the equation above. on exit, SCALE is overwritten with the value scl. she goes in as one thing and comes out as another, main character transformation arc π¦
SUMSQ
SUMSQ is DOUBLE PRECISION β on entry, the value sumsq in the equation above. on exit, SUMSQ is overwritten with the value ssq. same deal, same glow-up π
π Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
the whole squad really came together for this one, we love a collab ππ
β Date β
December 2016 β vintage, but still iconic π
Definition at line 108 of file zlassq.f. (go look, it's literally right there π)
π Author π
Generated automatically by Doxygen for LAPACK from the source code. so no human wrote that part, it's giving robot intern energy π but make no mistake, it's doing its job
okay bestie that's the whole page! and for the cute sign-off: this was Version 3.8.0, dated Tue Nov 14 2017, and you just read zlassq.f(3) πβ¨ you understood it, you slayed it, periodt ππ«Ά
π¦ where this page comes from
- centos-stream 9: lapack 3.9.0-10.el9 Β· BSD
- centos-stream 9: lapack 3.9.0-10.el9 Β· BSD
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms