classq.f(3)
π classq.f(3) β the LAPACK glow-up you didn't know you needed
okay so this is classq.f, straight out of LAPACK, and it's a little baddie of a routine that does exactly one job and does it iconically. it's in section 3 (library calls), iykyk. let's get into it π
β¨ NAME β¨
classq.f β yes bestie, that's literally the whole name, she's minimal like that.
β¨ SYNOPSIS β¨
πΈ Functions/Subroutines πΈ
subroutine classq (N, X, INCX, SCALE, SUMSQ)β CLASSQ updates a sum of squares represented in scaled form. that's the whole vibe. π
β¨ Function/Subroutine Documentation β¨
π¦ the actual signature π¦
subroutine classq (integer N, complex, dimension( * ) X, integer INCX, real
SCALE, real SUMSQ)
CLASSQ updates a sum of squares represented in scaled form. periodt.
π Purpose:
okay so CLASSQ returns 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 ) ).
and like β the value of sumsq is assumed to be at least unity, and the value of ssq will then satisfy
1.0 .le. ssq .le. ( sumsq + 2*n ).
no cap, that's the bound. π«Ά
also scale is assumed to be non-negative, and scl returns the value
scl = max( scale, abs( real( x( i ) ) ), abs( aimag( x( i ) ) ) ),
i
scale and sumsq must be supplied in SCALE and SUMSQ respectively. and then β plot twist β SCALE and SUMSQ are overwritten by scl and ssq respectively. π so don't come crying when your inputs are gone, that's the whole point.
the routine makes only one pass through the vector X. one. single. pass. efficient queen. π
π Parameters: π
NβNisINTEGER. the number of elements to be used from the vectorX. that's how many besties we're inviting to the party.XβXisCOMPLEX array, dimension (N). the vectorxas described above, bestie:
x( i ) = X( 1 + ( i - 1 )*INCX ), 1 <= i <= n.
INCXβINCXisINTEGER. the increment between successive values of the vectorX. andINCX > 0β gotta be strictly positive, no zero, no negatives, we don't do that here. π«SCALEβSCALEisREAL. on entry, the valuescalein the equation above. on exit,SCALEis overwritten with the valuescl. she came in as one thing and left as another, main character energy fr. β¨SUMSQβSUMSQisREAL. on entry, the valuesumsqin the equation above. on exit,SUMSQis overwritten with the valuessq. same deal, glow-up on the way out. π₯
π Author:
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
look at that little coalition of geniuses, we stan. π
π Date:
December 2016
π Definition at line 108 of file classq.f.
π Author π
Generated automatically by Doxygen for LAPACK from the source code. (the robots wrote the docs, we just made them cute π§)
π alright bestie, real talk: if you're passingSCALEandSUMSQin, remember they get overwritten on the way out. that's not a bug, that's the design. no cap.
okay that's the whole page!! π and for the sign-off: this lil masterpiece is Version 3.8.0, dated Tue Nov 14 2017 β oldie but a goodie, she's still slaying πβ¨π¦
π¦ 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