single_blas_level1(3)
π single_blas_level1 π
okay bestie, gather round, because this is the glow-up of the LAPACK single_blas_level1(3) page β the whole squad of real LEVEL 1 BLAS routines, all in one place. i folded the manual name up here so you know what you're reading: this is the single_blas_level1 page from the LAPACK manual. no cap, it's a lot, so we're doing it in two parts. this is part 1. π
β¨ NAME β¨
single_blas_level1 β real π
π¦ SYNOPSIS π¦
Functions
real function sasum (N, SX, INCX)β SASUMsubroutine saxpy (N, SA, SX, INCX, SY, INCY)β SAXPYreal function scabs1 (Z)β SCABS1real function scasum (N, CX, INCX)β SCASUMsubroutine scopy (N, SX, INCX, SY, INCY)β SCOPYreal function sdot (N, SX, INCX, SY, INCY)β SDOTreal function sdsdot (N, SB, SX, INCX, SY, INCY)β SDSDOTsubroutine srot (N, SX, INCX, SY, INCY, C, S)β SROTsubroutine srotm (N, SX, INCX, SY, INCY, SPARAM)β SROTMsubroutine srotmg (SD1, SD2, SX1, SY1, SPARAM)β SROTMGsubroutine sscal (N, SA, SX, INCX)β SSCALsubroutine sswap (N, SX, INCX, SY, INCY)β SSWAP
πΈ DETAILED DESCRIPTION πΈ
This is the group of real LEVEL 1 BLAS routines. that's the whole vibe. it's the foundational friend group of linear algebra, and they all live right here. π«Ά
π₯ FUNCTION DOCUMENTATION π₯
real function sasum (integer N, real, dimension(*) SX, integer INCX)
SASUM π
Purpose
SASUM takes the sum of the absolute values. it uses unrolled loops for increment equal to one. efficiency queen behavior, honestly. β¨
Parameters
NβNisINTEGER, number of elements in input vector(s)SXβSXisREALarray, dimension( 1 + ( N - 1 )*abs( INCX ) )INCXβINCXisINTEGER, storage spacing between elements ofSX
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Further Details
jack dongarra, linpack, 3/11/78.
modified 3/93 to return if incx .le. 0.
modified 12/3/93, array(1) declarations changed to array(*)
subroutine saxpy (integer N, real SA, real, dimension() SX, integer INCX, real, dimension() SY, integer INCY)
SAXPY π
Purpose
SAXPY does constant times a vector plus a vector. it uses unrolled loops for increments equal to one. the classic y = a*x + y, she's iconic and she knows it.
Parameters
NβNisINTEGER, number of elements in input vector(s)SAβSAisREAL. On entry,SAspecifies the scalar alpha.SXβSXisREALarray, dimension( 1 + ( N - 1 )*abs( INCX ) )INCXβINCXisINTEGER, storage spacing between elements ofSXSYβSYisREALarray, dimension( 1 + ( N - 1 )*abs( INCY ) )INCYβINCYisINTEGER, storage spacing between elements ofSY
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Further Details
jack dongarra, linpack, 3/11/78.
modified 12/3/93, array(1) declarations changed to array(*)
real function scabs1 (complex Z)
SCABS1 π
Purpose
SCABS1 computes |Re(.)| + |Im(.)| of a complex number. that's it. that's the whole function. short and slays. π
Parameters
ZβZisCOMPLEX
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
real function scasum (integer N, complex, dimension(*) CX, integer INCX)
SCASUM π
Purpose
SCASUM takes the sum of the (|Re(.)| + |Im(.)|)'s of a complex vector and returns a single precision result. so it's SASUM's complex bestie, fr fr.
Parameters
NβNisINTEGER, number of elements in input vector(s)CXβCXisCOMPLEXarray, dimension( 1 + ( N - 1 )*abs( INCX ) )INCXβINCXisINTEGER, storage spacing between elements ofSX
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Further Details
jack dongarra, linpack, 3/11/78.
modified 3/93 to return if incx .le. 0.
modified 12/3/93, array(1) declarations changed to array(*)
subroutine scopy (integer N, real, dimension() SX, integer INCX, real, dimension() SY, integer INCY)
SCOPY π§
Purpose
SCOPY copies a vector, x, to a vector, y. it uses unrolled loops for increments equal to 1. literally just passing the vibe along, no notes. π
Parameters
NβNisINTEGER, number of elements in input vector(s)SXβSXisREALarray, dimension( 1 + ( N - 1 )*abs( INCX ) )INCXβINCXisINTEGER, storage spacing between elements ofSXSYβSYisREALarray, dimension( 1 + ( N - 1 )*abs( INCY ) )INCYβINCYisINTEGER, storage spacing between elements ofSY
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Further Details
jack dongarra, linpack, 3/11/78.
modified 12/3/93, array(1) declarations changed to array(*)
real function sdot (integer N, real, dimension() SX, integer INCX, real, dimension() SY, integer INCY)
SDOT β
Purpose
SDOT forms the dot product of two vectors. it uses unrolled loops for increments equal to one. multiply, add, repeat β the main character of level 1, honestly. π
Parameters
NβNisINTEGER, number of elements in input vector(s)SXβSXisREALarray, dimension( 1 + ( N - 1 )*abs( INCX ) )INCXβINCXisINTEGER, storage spacing between elements ofSXSYβSYisREALarray, dimension( 1 + ( N - 1 )*abs( INCY ) )INCYβINCYisINTEGER, storage spacing between elements ofSY
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Further Details
jack dongarra, linpack, 3/11/78.
modified 12/3/93, array(1) declarations changed to array(*)
real function sdsdot (integer N, real SB, real, dimension() SX, integer INCX, real, dimension() SY, integer INCY)
SDSDOT π
Purpose
Compute the inner product of two vectors with extended precision accumulation.
Returns S.P. result with dot product accumulated in D.P.
SDSDOT = SB + sum for I = 0 to N-1 of SX(LX+I*INCX)*SY(LY+I*INCY),
where LX = 1 if INCX .GE. 0, else LX = 1+(1-N)*INCX, and LY is
defined in a similar way using INCY.
so yeah β single precision result, double precision glow-up during the math. it's giving "best of both worlds". β¨
Parameters
NβNisINTEGER, number of elements in input vector(s)SBβSBisREAL, single precision scalar to be added to inner productSXβSXisREALarray, dimension( 1 + ( N - 1 )*abs( INCX ) ), single precision vector withNelementsINCXβINCXisINTEGER, storage spacing between elements ofSXSYβSYisREALarray, dimension( 1 + ( N - 1 )*abs( INCX ) ), single precision vector withNelementsINCYβINCYisINTEGER, storage spacing between elements ofSY
Author
Lawson, C. L., (JPL), Hanson, R. J., (SNLA),
Kincaid, D. R., (U. of Texas), Krogh, F. T., (JPL)
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Further Details
REFERENCES
C. L. Lawson, R. J. Hanson, D. R. Kincaid and F. T. Krogh, Basic linear algebra subprograms for Fortran usage, Algorithm No. 539, Transactions on Mathematical Software 5, 3 (September 1979), pp. 308-323.
REVISION HISTORY (YYMMDD)
791001 DATE WRITTEN
890531 Changed all specific intrinsics to generic. (WRB)
890831 Modified array declarations. (WRB)
890831 REVISION DATE from Version 3.2
891214 Prologue converted to Version 4.0 format. (BAB)
920310 Corrected definition of LX in DESCRIPTION. (WRB)
920501 Reformatted the REFERENCES section. (WRB)
070118 Reformat to LAPACK coding style
subroutine srot (integer N, real, dimension() SX, integer INCX, real, dimension() SY, integer INCY, real C, real S)
SROT π
Purpose
applies a plane rotation. spin those vectors, bestie. π«
Parameters
NβNisINTEGER, number of elements in input vector(s)SXβSXisREALarray, dimension( 1 + ( N - 1 )*abs( INCX ) )INCXβINCXisINTEGER, storage spacing between elements ofSXSYβSYisREALarray, dimension( 1 + ( N - 1 )*abs( INCY ) )INCYβINCYisINTEGER, storage spacing between elements ofSYCβCisREALSβSisREAL
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Further Details
jack dongarra, linpack, 3/11/78.
modified 12/3/93, array(1) declarations changed to array(*)
subroutine srotm (integer N, real, dimension() SX, integer INCX, real, dimension() SY, integer INCY, real, dimension(5) SPARAM)
SROTM π₯
Purpose
APPLY THE MODIFIED GIVENS TRANSFORMATION, H, TO THE 2 BY N MATRIX
(SX**T) , WHERE **T INDICATES TRANSPOSE. THE ELEMENTS OF SX ARE IN (SX**T)
SX(LX+I*INCX), I = 0 TO N-1, WHERE LX = 1 IF INCX .GE. 0, ELSE LX = (-INCX)*N, AND SIMILARLY FOR SY USING USING LY AND INCY.
WITH SPARAM(1)=SFLAG, H HAS ONE OF THE FOLLOWING FORMS..
SFLAG=-1.E0 SFLAG=0.E0 SFLAG=1.E0 SFLAG=-2.E0
(SH11 SH12) (1.E0 SH12) (SH11 1.E0) (1.E0 0.E0)
H=( ) ( ) ( ) ( )
(SH21 SH22), (SH21 1.E0), (-1.E0 SH22), (0.E0 1.E0).
SEE SROTMG FOR A DESCRIPTION OF DATA STORAGE IN SPARAM.
heads up bestie: which of those four forms H takes is decided entirely bySFLAGinSPARAM(1)β so don't go guessing, the flag tells you. π
Parameters
NβNisINTEGER, number of elements in input vector(s)SXβSXisREALarray, dimension( 1 + ( N - 1 )*abs( INCX ) )INCXβINCXisINTEGER, storage spacing between elements ofSXSYβSYisREALarray, dimension( 1 + ( N - 1 )*abs( INCY ) )INCYβINCYisINTEGER, storage spacing between elements ofSYSPARAMβSPARAMisREALarray, dimension(5)SPARAM(1)=SFLAGSPARAM(2)=SH11SPARAM(3)=SH21SPARAM(4)=SH12SPARAM(5)=SH22
Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
subroutine srotmg π
subroutine srotmg (real SD1, real SD2, real SX1, real SY1, real,
dimension(5) SPARAM)
SROTMG
Purpose: ok bestie, listen up β this routine constructs the modified Givens transformation matrix H which zeros the second component of the 2-vector (SQRT(SD1)*SX1,SQRT(SD2)*> SY2)**T. With SPARAM(1)=SFLAG, H can take one of these forms:
SFLAG=-1.E0 SFLAG=0.E0 SFLAG=1.E0 SFLAG=-2.E0
(SH11 SH12) (1.E0 SH12) (SH11 1.E0) (1.E0 0.E0)
H=( ) ( ) ( ) ( )
(SH21 SH22), (SH21 1.E0), (-1.E0 SH22), (0.E0 1.E0).
Locations 2-4 of SPARAM contain SH11, SH21, SH12, and SH22 respectively. (Values of 1.E0, -1.E0, or 0.E0 implied by the value of SPARAM(1) are not stored in SPARAM.)
The values of GAMSQ and RGAMSQ set in the DATA statement may be inexact. This is OK as they are only used for testing the size of SD1 and SD2. All actual scaling of data is done using GAM.
Parameters:
SD1βSD1isREALSD2βSD2isREALSX1βSX1isREALSY1βSY1isREALSPARAMβSPARAMisREALarray, dimension(5)SPARAM(1)=SFLAGSPARAM(2)=SH11SPARAM(3)=SH21SPARAM(4)=SH12SPARAM(5)=SH22
Author: Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver, NAG Ltd.
subroutine sscal π¦
subroutine sscal (integer N, real SA, real, dimension(*) SX, integer INCX)
SSCAL
Purpose: SSCAL scales a vector by a constant. It uses unrolled loops for increment equal to 1. Lowkey efficient, no cap.
Parameters:
NβNisINTEGERnumber of elements in input vector(s)SAβSAisREALOn entry,SAspecifies the scalar alpha.SXβSXisREALarray, dimension( 1 + ( N - 1 )*abs( INCX ) )INCXβINCXisINTEGERstorage spacing between elements ofSX
Author: Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver, NAG Ltd.
Further Details:
- jack dongarra, linpack, 3/11/78.
- modified 3/93 to return if incx .le. 0.
- modified 12/3/93, array(1) declarations changed to array(*)
subroutine sswap πΈ
subroutine sswap (integer N, real, dimension(*) SX, integer INCX, real,
dimension(*) SY, integer INCY)
SSWAP
Purpose: SSWAP interchanges two vectors. It uses unrolled loops for increments equal to 1. Itβs giving swap energy, periodt.
Parameters:
NβNisINTEGERnumber of elements in input vector(s)SXβSXisREALarray, dimension( 1 + ( N - 1 )*abs( INCX ) )INCXβINCXisINTEGERstorage spacing between elements ofSXSYβSYisREALarray, dimension( 1 + ( N - 1 )*abs( INCY ) )INCYβINCYisINTEGERstorage spacing between elements ofSY
Author: Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver, NAG Ltd.
Further Details:
- jack dongarra, linpack, 3/11/78.
- modified 12/3/93, array(1) declarations changed to array(*)
Author π
Generated automatically by Doxygen for LAPACK from the source code.
This whole page is serving Version 3.11.0, dated Sun Nov 27 2022. Stay iconic, bestie! πβ¨
π¦ where this page comes from
- debian bookworm: liblapack-doc 3.11.0-2 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms