Level 1 BLAS
SUBROUTINE ICOPY(N,IX,INCX,IY,INCY)
copies one integer vector IX into another IY. IY:= IX.
N Input, INTEGER N, number of elements in the vectors.
IX Input, INTEGER IX(N), vector to be copied.
INCX Input, INTEGER INCX, increment between elements of IX. For
contiguous elements, INCX = 1.
IY Output, INTEGER IY(N), result vector.
INCY Input, INTEGER INCY, increment between elements of IY. For
contiguous elements, INCY = 1.
SUBROUTINE IINIT(N,IA,IX,INCX)
sets all the entries of a vector IX to the scalar value IA.
N Input, INTEGER N, number of elements in IX.
IA Input, INTEGER IA, the scalar value to be assigned to all entries.
IX Output, INTEGER IX(N), the vector, all of whose entries are
now equal to IA.
INCX Input, INTEGER INCX, increment between elements of IX. For
contiguous elements, INCX=1.
INTEGER FUNCTION ISAMAX(N,SX,INCX)
an integer function that returns the index of the element in a real vector
with the largest absolute value.
N Input, INTEGER N, number of elements in SX.
SX Input, REAL SX(N), vector to be searched.
INCX Input, INTEGER INCX, increment between elements of SX. For contiguous
elements, INCX = 1.
ISAMAX Output, INTEGER ISAMAX, the index of the entry of maximum absolute
magnitude.
INTEGER FUNCTION ISAMIN(N,SX,INCX)
an integer function that returns the index of the element in a real vector
with the smallest absolute value.
N Input, INTEGER N, number of elements in SX.
SX Input, REAL SX(N), vector to be searched.
INCX Input, INTEGER INCX, increment between elements of SX. For contiguous
elements, INCX = 1.
ISAMIN Output, INTEGER ISAMIN, the index of the entry of minimum absolute
magnitude.
INTEGER FUNCTION ISMAX(N,SX,INCX)
an integer function that returns the index of the element in a real vector
with the largest value.
N Input, INTEGER N, number of elements in SX.
SX Input, REAL SX(N), vector to be searched.
INCX Input, INTEGER INCX, increment between elements of SX. For contiguous
elements, INCX = 1.
ISMAX Output, INTEGER ISMAX, the index of the entry of maximum value.
INTEGER FUNCTION ISMIN(N,SX,INCX)
an integer function that returns the index of the element in a real vector
with the smallest value.
N Input, INTEGER N, number of elements in SX.
SX Input, REAL SX(N), vector to be searched.
INCX Input, INTEGER INCX, increment between elements of SX. For contiguous
elements, INCX = 1.
ISMIN Output, INTEGER ISMIN, the index of the entry of minimum value.
LOGICAL FUNCTION IVSAME(N,IX,IY)
checks whether two vectors are identical.
N Input, INTEGER N, number of elements in IX and IY.
IX Input, INTEGER IX(N), first vector to compare.
IY Input, INTEGER IY(N), second vector to compare.
IVSAME Output, LOGICAL IVSAME, .TRUE. if IX(I).EQ.IY(I) for I=1 to N,
.FALSE. otherwise.
REAL FUNCTION SAMAX(N,SX,INCX)
returns the maximum absolute value of all entries in SX.
N Input, INTEGER N, number of elements in SX.
SX Input, REAL SX(N), vector to be searched.
INCX Input, INTEGER INCX, increment between elements of SX. For contiguous
elements, INCX = 1.
SAMAX Output, REAL SAMAX, the maximum absolute value of all entries in SX.
REAL FUNCTION SAMIN(N,SX,INCX)
returns the minimum absolute value of all entries in SX.
N Input, INTEGER N, number of elements in SX.
SX Input, REAL SX(N), vector to be searched.
INCX Input, INTEGER INCX, increment between elements of SX. For contiguous
elements, INCX = 1.
SAMIN Output, REAL SAMIN, the minimum absolute value of all entries in SX.
REAL FUNCTION SASUM(N,SX,INCX)
a real function that returns the sum of the absolute values of a real vector.
N Input, INTEGER N, number of elements in SX.
SX Input, REAL SX(N), real vector whose entries are to be summed.
INCX Input, INTEGER INCX, increment between elements of SX. For contiguous
elements, INCX = 1.
SASUM Output, REAL SASUM, the sum of the absolute values of the
entries.
SUBROUTINE SAXPY(N,SA,SX,INCX,SY,INCY)
adds a scalar multiple SA of one vector SX to another vector SY.
SY := SA*SX + SY
N Input, INTEGER N, number of elements in the vectors.
SA Input, REAL SA, scalar multiplier.
SX Input, REAL SX(N), vector.
INCX Input, INTEGER INCX, increment between elements of SX. For contiguous
elements, INCX = 1.
SY Input/output, REAL SY(N). On input, the vector to which SA*SX
is to be added, on output, SY:=SY+SA*SX.
INCY Input, INTEGER INCY, increment between elements of SY. For contiguous
elements, INCY = 1.
SUBROUTINE SAXPYX(N,SA,SX,INCX,SY,INCY)
SAXPYX scales a vector SX, and adds SY to it. SX := SA*SX + SY.
N Input, INTEGER N, number of elements in the vectors.
SA Input, REAL SA, scalar multiplier.
SX Input/output, REAL SX(N), vector. Output value of SX
is SA*SX+SY.
INCX Input, INTEGER INCX, increment between elements of SX. For contiguous
elements, INCX = 1.
SY Input, REAL SY(N), the vector to be added to SX.
INCY Input, INTEGER INCY, increment between elements of SY. For contiguous
elements, INCY = 1.
SUBROUTINE SCOPY(N,SX,INCX,SY,INCY)
copies one real vector SX into another SY. SY:= SX.
N Input, INTEGER N, number of elements in the vectors.
SX Input, REAL SX(N), real vector to be copied.
INCX Input, INTEGER INCX, increment between elements of SX. For contiguous
elements, INCX = 1.
SY Output, REAL SY(N), real result vector.
INCY Input, INTEGER INCY, increment between elements of SY. For contiguous
elements, INCY = 1.
REAL FUNCTION SDOT(N,SX,INCX,SY,INCY)
computes the inner (dot) product of two vectors.
SDOT = SUM(I=1 to N) of SX(I)*SY(I).
N Input, INTEGER N, number of elements in the vectors.
SX Input, REAL SX(N), vector operand.
INCX Input, INTEGER INCX, increment between elements of SX. For contiguous
elements, INCX = 1.
SY Input, REAL SY(N), vector operand.
INCY Input, INTEGER INCY, increment between elements of SY. For contiguous
elements, INCY = 1.
SDOT Output, REAL SDOT, the dot product of SX and SY.
REAL FUNCTION SDSDOT(N,SX,INCX,SY,INCY)
computes the inner (dot) product of two vectors.
SDSDOT = SUM(I=1 to N) of SX(I)*SY(I). Double precision arithmetic is
used to compute the dot product with greater accuracy, although the
final result is returned as single precision.
N Input, INTEGER N, number of elements in the vectors.
SX Input, REAL SX(N), vector operand.
INCX Input, INTEGER INCX, increment between elements of SX. For contiguous
elements, INCX = 1.
SY Input, REAL SY(N), vector operand.
INCY Input, INTEGER INCY, increment between elements of SY. For contiguous
elements, INCY = 1.
SDSDOT Output, REAL SDSDOT, the dot product of SX and SY.
SUBROUTINE SINIT(N,SA,SX,INCX)
sets all the entries of a vector SX to the scalar value SA.
N Input, INTEGER N, number of elements in SX.
SA Input, REAL SA, the scalar value to be assigned to all entries.
SX Output, REAL SX(N), the vector, all of whose entries are
now equal to SA.
INCX Input, INTEGER INCX, increment between elements of SX. For contiguous
elements, INCX=1.
REAL FUNCTION SMACH(JOB)
returns machine constants for the real limits of a given machine.
JOB Input, INTEGER JOB, determines the number to be computed.
1, compute the machine epsilon (the smallest number eps
such that (1. + eps > 1) and (1. - eps < 1)).
2, compute a number close to smallest normalized, representable
number.
3, compute a number close to largest normalized, representable
number.
SMACH Output, REAL SMACH, the request machine number.
REAL FUNCTION SMAX(N,SX,INCX)
returns the maximum entry in SX.
N Input, INTEGER N, number of elements in SX.
SX Input, REAL SX(N), vector to be searched.
INCX Input, INTEGER INCX, increment between elements of SX. For contiguous
elements, INCX = 1.
SMAX Output, REAL SMAX, the maximum entry in SX.
REAL FUNCTION SMIN(N,SX,INCX)
returns the minimum entry in SX.
N Input, INTEGER N, number of elements in SX.
SX Input, REAL SX(N), vector to be searched.
INCX Input, INTEGER INCX, increment between elements of SX. For contiguous
elements, INCX = 1.
SMIN Output, REAL SMIN, the minimum entry in SX.
REAL FUNCTION SNRM2(N,SX,INCX)
a real function that computes the Euclidean norm of a real
vector, also known as the root-mean-square norm, or the square root
of the sum of the squares of the entries.
N Input, INTEGER N, number of elements in vector.
SX Input, REAL SX(N), the vector whose norm is to be taken.
INCX Input, INTEGER INCX, increment between elements of SX. For contiguous
elements, INCX = 1.
SNRM2 Output, REAL SNRM2, the Euclidean norm of SX.
SUBROUTINE SROT(N,SX,INCX,SY,INCY,C,S)
applies a Givens rotation to two vectors, which generally represent
rows or columns of a matrix.
TEMP :=-S*SX(I)+C*SY(I)
SX(I):= C*SX(I)+S*SY(I)
SY(I):= TEMP
N Input, INTEGER N, number of elements in vectors.
SX Input/output, REAL SX(N), vector to be modified.
INCX Input, INTEGER INCX, increment between elements of SX. For contiguous
elements, INCX = 1.
SY Input/output, REAL SY(N), vector to be modified.
INCY Input, INTEGER INCY, increment between elements of SY. For contiguous
elements, INCY = 1.
C Input, REAL C, cosine normally calculated using SROTG.
S Input, REAL S, sine normally calculated using SROTG.
SUBROUTINE SROTG(A,B,C,S)
computes the elements of a Givens rotation
matrix. Given that A and B are elements of two different rows
of a matrix in the same column, or of two different vectors in
the same position, SROTG computes a cosine C and sine S such
that the rotation through the angle defined by C and S will
zero out the entry B in the second vector. That is, setting
X=C*X+S*Y and Y=-S*X+C*Y results in the entry of Y that was
equal to B now being zero.
A Input/output, REAL A. On input, the value of the vector or matrix
entry which is not required to be zeroed out. On output, it is
overwritten by other information.
B Input/output, REAL B. On input, the value of the vector or matrix
entry which is required to be zeroed out. It is overwritten on return.
C Output, REAL C, cosine of rotation matrix.
S Output, REAL S, sine of rotation matrix.
SUBROUTINE SROTM(N,SX,INCX,SY,INCY,SPARAM)
SROTM applies the modified Givens rotation H to the 2 by N matrix
( X(1) ... X(N) )
( Y(1) ... Y(N) )
H takes one of the following forms, depending on the value of SPARAM:
SPARAM(1) = -2.0
H11 = 1.0 H12 = 0.0
H21 = 0.0 H22 = 1.0
SPARAM(1) = -1.0
H11 = SPARAM(2) H12 = SPARAM(4)
H21 = SPARAM(3) H22 = SPARAM(5)
SPARAM(1) = 0.0
H11 = 1.0 H12 = SPARAM(4)
H21 = SPARAM(3) H22 = 1.0
SPARAM(1) = 1.0
H11 = SPARAM(2) H12 = 1.0
H21 = -1.0 H22 = SPARAM(5)
N Input, INTEGER N, length of vectors X and Y.
SX Input/output, REAL SX(N).
SROTM replaces X(I) with H11*X(I)+H12*Y(I) for I=1,...,N.
X(I) and Y(I) refer to specific elements of SX and SY.
The H components refer to the rotation defined by SPARAM.
INCX Input, INTEGER INCX, displacement between elements of SX.
X(I) is defined to be
SX(1+(I-1)*INCX) if INCX.GE.0 or
SX(1+(I-N)*INCX) if INCX.LT.0.
SY Input/output, REAL SY(N).
SROTM replaces Y(I) with H21*X(I)+H22*Y(I) for I=1,...,N.
X(I) and Y(I) refer to specific elements of SX and SY.
The H components refer to the rotation defined by SPARAM.
INCY Input, INTEGER INCY, displacement between elements of SY.
Y(I) is defined to be
SY(1+(I-1)*INCY) if INCY.GE.0 or
SY(1+(I-N)*INCY) if INCY.LT.0.
SPARAM Input, REAL SPARAM(5), defines the rotation matrix H.
See remarks above.
SUBROUTINE SROTMG(SD1,SD2,SX1,SY1,SPARAM)
SROTMG constructs a modified Givens rotation H and updates the
scale factors SD1 and SD2 which zero SY1. The transformed value of
SD1 replaces SD1, i.e.
On input, SW1 = SQRT(SD1)*SX1, SZ1 = SQRT(SD2)*SY1.
On output, ( C S ) (SW1) = (C*SW1 + S*SZ1) = (SQRT(SD1)*SX1)
(-S C ) (SZ1) = ( 0 ) = ( 0 )
where C and S define a Givens rotation.
H takes the form:
SPARAM(1) = -2.0
SPARAM(2) = Unchanged SPARAM(4) = Unchanged
SPARAM(3) = Unchanged SPARAM(5) = Unchanged
SPARAM(1) = -1.0
SPARAM(2) = H11 SPARAM(4) = H12
SPARAM(3) = H21 SPARAM(5) = H22
SPARAM(1) = 0.0
SPARAM(2) = Unchanged SPARAM(4) = H12
SPARAM(3) = H21 SPARAM(5) = Unchanged
SPARAM(1) = 1.0
SPARAM(2) = H11 SPARAM(4) = Unchanged
SD1 Input/output, REAL SD1, scale factor.
On input, SD1 contains the first scale factor. On
output, SD1 contains the updated scale factor.
SD2 Input/output, REAL SD2, scale factor.
On input, SD2 contains the second scale factor. On
output, SD2 contains the updated scale factor.
SX1 Input/output, REAL SX1, on input contains the first component of the
vector to be rotated and output SX1 contains the rotated value
of the first component.
SY1 Input, REAL SY1, on input, second component of the vector to be
rotated. Since this component is zeroed by the rotation, it is
left unchanged in storage.
SPARAM Input/output, REAL SPARAM(5), defines the rotation matrix H.
See remarks above.
SUBROUTINE SSCAL(N,SA,SX,INCX)
scales a real vector SX by multiplying it by a real number SA.
N Input, INTEGER N, number of elements in vector.
SA Input, REAL SA, scaling factor.
SX Input/output, REAL SX(N), vector to be scaled.
INCX Input, INTEGER INCX, increment between elements of SX. For
contiguous elements, INCX = 1.
SUBROUTINE SSET(N,SA,SX,INCX)
SSET sets all the entries of a vector SX to the scalar value SA.
N Input, INTEGER N, number of elements in SX.
SA Input, REAL SA, the scalar value to be assigned to all entries.
SX Output, REAL SX(N), the vector, all of whose entries are
now equal to SA.
INCX Input, INTEGER INCX, increment between elements of SX. For contiguous
elements, INCX=1.
REAL FUNCTION SSUM(N,SX,INCX)
a real function that returns the sum of the values of a real vector.
N Input, INTEGER N, number of elements in SX.
SX Input, REAL SX(N), real vector whose entries are to be summed.
INCX Input, INTEGER INCX, increment between elements of SX. For contiguous
elements, INCX = 1.
SSUM Output, REAL SSUM, the sum of the values of the entries.
SUBROUTINE SSWAP(N,SX,INCX,SY,INCY)
exchanges two real vectors SX and SY.
N Input, INTEGER N, number of elements in vectors.
SX Input/output, REAL SX(N). On output, the contents of
SX and SY have been interchanged.
INCX Input, INTEGER INCX, increment between elements of SX. For contiguous
elements, INCX = 1.
SY Input/output, REAL SY(N), the other vector to interchange.
INCY Input, INTEGER INCY, increment between elements of SY. For contiguous
elements, INCY = 1.
SUBROUTINE SVCAL(N,SA,SX,INCX,SY,INCY)
sets the vector SY to SA times the vector SX.
N Input, INTEGER N, number of elements in vector.
SA Input, REAL SA, scaling factor.
SX Input, REAL SX(N), vector to be copied.
INCX Input, INTEGER INCX, increment between elements of SX. For contiguous
elements, INCX = 1.
SY Output, REAL SY(N), SY(I)=SA*SX(I).
INCY Input, INTEGER INCY, increment between elements of SY. For contiguous
elements, INCY=1.
LOGICAL FUNCTION SVSAME(N,SX,SY)
checks whether two vectors are identical.
N Input, INTEGER N, number of elements in SX and SY.
SX Input, REAL SX(N), first vector to compare.
SY Input, REAL SY(N), second vector to compare.
SVSAME Output, LOGICAL SVSAME, .TRUE. if SX(I).EQ.SY(I) for I=1 to N,
.FALSE. otherwise.
SUBROUTINE CAXPY(N,CA,CX,INCX,CY,INCY)
CAXPY adds a scalar multiple CA of one vector CX to another vector CY.
CY:=CY+CA*CX.
N Input, INTEGER N, number of elements in the vectors.
CA Input, COMPLEX CA, scalar multiplier.
CX Input, COMPLEX CX(N), vector to be added.
INCX Input, INTEGER INCX, increment between elements of CX. For contiguous
elements, INCX = 1.
CY Input/output, COMPLEX CY(N), vector to which CA*CX is to be
added.
INCY Input, INTEGER INCY, increment between elements of CY. For contiguous
elements, INCY = 1.
SUBROUTINE CCOPY(N,CX,INCX,CY,INCY)
copies one vector to another, CY:=CX.
N Input, INTEGER N, number of elements in the vectors.
CX Input, COMPLEX CX(N), vector to be copied.
INCX Input, INTEGER INCX, increment between elements of CX. For contiguous
elements, INCX = 1.
CY Output, COMPLEX CY(N), result vector.
INCY Input, INTEGER INCY, increment between elements of CY. For contiguous
elements, INCY = 1.
COMPLEX FUNCTION CDOTC(N,CX,INCX,CY,INCY)
computes the (conjugated) dot product of two vectors.
CDOTC=SUM(I=1 to N) CONJUGATE(CX(I)) * CY(I)
N Input, INTEGER N, number of elements in the vectors.
CX Input, COMPLEX CX(N), operand.
INCX Input, INTEGER INCX, increment between elements of CX. For contiguous
elements, INCX = 1.
CY Input, COMPLEX CY(N), operand.
INCY Input, INTEGER INCY, increment between elements of CY. For contiguous
elements, INCY = 1.
CDOTC Output, COMPLEX CDOTC, the conjugated dot product of CX and CY.
COMPLEX FUNCTION CDOTU(N,CX,INCX,CY,INCY)
computes the (unconjugated) dot product of two vectors.
This is the simple sum of the product of the entries of the vectors.
N Input, INTEGER N, number of elements in the vectors.
CX Input, COMPLEX CX(N), operand.
INCX Input, INTEGER INCX, increment between elements of CX. For contiguous
elements, INCX = 1.
CY Input, COMPLEX CY(N), operand.
INCY Input, INTEGER INCY, increment between elements of CY. For contiguous
elements, INCY = 1.
CDOTU Output, COMPLEX CDOTU, the unconjugated dot product of CX and CY.
SUBROUTINE CINIT(N,CA,CX,INCX)
sets all the entries of a vector CX to the scalar value CA.
N Input, INTEGER N, number of elements in CX.
CA Input, COMPLEX CA, the scalar value to be assigned to all entries.
CX Output, COMPLEX CX(N), the vector, all of whose entries are
now equal to CA.
INCX Input, INTEGER INCX, increment between elements of CX. For contiguous
elements, INCX=1.
REAL FUNCTION CMACH(JOB)
returns (real valued) machine constants for a given machine.
JOB Input, INTEGER JOB, determines the number to be computed.
1, compute the machine epsilon (the norm of the smallest number eps
such that (1. + eps > 1) and (1. - eps < 1)).
2, compute the norm of a number close to smallest normalized,
representable number.
3, compute the norm of a number close to largest normalized,
representable number.
CMACH Output, REAL CMACH, the value of the number requested.
SUBROUTINE CROT(N,CX,INCX,CY,INCY,C,S)
carries out a complex Given's plane rotation:
TEMP :=-CONJUGATE(S)*CX(I)+C*CY(I)
CX(I):= C*CX(I)+S*CY(I)
CY(I):= TEMP
N Input, INTEGER N, number of elements in vectors.
CX Input/output, COMPLEX CX(N), vector to be modified.
INCX Input, INTEGER INCX, increment between elements of CX. For contiguous
elements, INCX = 1.
CY Input/output, COMPLEX CY(N), vector to be modified.
INCY Input, INTEGER INCY, increment between elements of CY. For contiguous
elements, INCY = 1.
C Input, COMPLEX C, cosine of transformation.
S Input, COMPLEX S, sine of transformation.
SUBROUTINE CROTG(A,B,C,S)
CROTG computes the elements of a Givens rotation
matrix. Given that A and B are elements of two different rows
of a matrix in the same column, or of two different vectors in
the same position, CROTG computes a real cosine C and complex sine S such
that the rotation through the angle defined by C and S will
zero out the entry B in the second vector. That is, setting
X=C*X+S*Y and Y=-S*X+C*Y results in the entry of Y that was
equal to B now being zero.
A Input/output, COMPLEX A, on input, the value of the vector or matrix
entry which is not required to be zeroed out. It is overwritten
on return.
B Input/output, COMPLEX B, on input, the value of the vector or matrix
entry which is required to be zeroed out. It is overwritten on
return.
C Output, REAL C, cosine of rotation matrix.
S Output, COMPLEX S, sine of rotation matrix.
SUBROUTINE CSCAL(N,CA,CX,INCX)
scales a complex vector by multiplying it by a complex number.
N Input, INTEGER N, number of elements in vector.
CA Input, COMPLEX CA, scaling factor.
CX Input/output, COMPLEX CX(N), vector to be scaled.
INCX Input, INTEGER INCX, increment between elements of CX. For contiguous
elements, INCX = 1.
SUBROUTINE CSROT(N,CX,INCX,CY,INCY,C,S)
carries out a real Given's plane rotation:
TEMP :=-S*CX(I)+C*CY(I)
CX(I):= C*CX(I)+S*CY(I)
CY(I):= TEMP
N Input, INTEGER N, number of elements in vectors.
CX Input/output, COMPLEX CX(N), vector to be modified.
INCX Input, INTEGER INCX, increment between elements of CX. For contiguous
elements, INCX = 1.
CY Input/output, COMPLEX CY(N), vector to be modified.
INCY Input, INTEGER INCY, increment between elements of CY. For contiguous
elements, INCY = 1.
C Input, REAL C, cosine normally calculated using SROTG (the REAL
arithmetic routine).
S Input, REAL S, sine normally calculated using SROTG (the REAL
arithmetic routine).
SUBROUTINE CSSCAL(N,SA,CX,INCX)
scales a complex vector by multiplying it by a REAL number.
N Input, INTEGER N, number of elements in vector.
SA Input, REAL SA, scaling factor.
CX Input/output, COMPLEX CX(N), vector to be scaled.
INCX Input, INTEGER INCX, increment between elements of CX. For contiguous
elements, INCX = 1.
SUBROUTINE CSWAP(N,CX,INCX,CY,INCY)
exchanges two vectors.
N Input, INTEGER N, number of elements in vectors.
CX Input/output, COMPLEX CX(N).
INCX Input, INTEGER INCX, increment between elements of CX. For contiguous
elements, INCX = 1.
CY Input/output, COMPLEX CY(N).
INCY Input, INTEGER INCY, increment between elements of CY. For contiguous
elements, INCY = 1.
LOGICAL FUNCTION CVSAME(N,CX,CY)
checks whether two vectors are identical.
N Input, INTEGER N, number of elements in CX and CY.
CX Input, COMPLEX CX(N), first vector to compare.
CY Input, COMPLEX CY(N), second vector to compare.
CVSAME Output, LOGICAL CVSAME, .TRUE. if CX(I).EQ.CY(I) for I=1 to N,
.FALSE. otherwise.
INTEGER FUNCTION ICAMAX(N,CX,INCX)
an integer function that returns the index of the first occurrence of the
element in a complex vector with the largest absolute value. Here
absolute value is defined as ABS(X)=ABS(REAL(X)) + ABS(AIMAG(X)).
N Input, INTEGER N, number of elements to process in vector CX.
CX Input, COMPLEX CX(N), vector to be searched.
INCX Input, INTEGER INCX, increment between elements of CX. For contiguous
elements, INCX = 1.
ICAMAX Output, INTEGER ICAMAX, the index of the entry in CX of
largest absolute value.
INTEGER FUNCTION ICAMIN(N,CX,INCX)
an integer function that returns the index of the first occurrence of the
element in a complex vector with the smallest absolute value. Here
absolute value is defined as ABS(X)=ABS(REAL(X)) + ABS(AIMAG(X)).
N Input, INTEGER N, number of elements to process in vector CX.
CX Input, COMPLEX CX(N), vector to be searched.
INCX Input, INTEGER INCX, increment between elements of CX. For contiguous
elements, INCX = 1.
ICAMIN Output, INTEGER ICAMIN, the index of the entry in CX of
smallest absolute value.
REAL FUNCTION SCAMAX(N,CX,INCX)
returns the maximum "absolute value" of the entries in CX. Here,
absolute value is defined as ABS(X)=ABS(REAL(X)) + ABS(AIMAG(X)).
N Input, INTEGER N, number of elements to process in vector CX.
CX Input, COMPLEX CX(N), vector to be searched.
INCX Input, INTEGER INCX, increment between elements of CX. For contiguous
elements, INCX = 1.
SCAMAX Output, REAL SCAMAX, the maximum absolute value of the
entries in CX.
REAL FUNCTION SCAMIN(N,CX,INCX)
returns the minimum "absolute value" of the entries of CX. Here,
absolute value is defined as ABS(X)=ABS(REAL(X)) + ABS(AIMAG(X)).
N Input, INTEGER N, number of elements to process in vector CX.
CX Input, COMPLEX CX(N), vector to be searched.
INCX Input, INTEGER INCX, increment between elements of CX. For contiguous
elements, INCX = 1.
SCAMIN Output, REAL SCAMIN, the minimum absolute value of the
entries in CX.
REAL FUNCTION SCASUM(N,CX,INCX)
a REAL function that returns the sum of the absolute values
of the real and complex parts of a complex vector. SCASUM=
SUM(I=1 to N) ABS(REAL(CX(I))) + ABS(AIMAG(CX(I))).
N Input, INTEGER N, number of elements to process in vector CX.
CX Input, COMPLEX CX(N), vector to be summed.
INCX Input, INTEGER INCX, increment between elements of CX. For contiguous
elements, INCX = 1.
SCASUM Output, REAL SCASUM, the sum of the absolute values of
the entries of CX.
REAL FUNCTION SCNRM2(N,CX,INCX)
a real function that computes the Euclidean norm of a complex
vector, also known as the root-mean-square norm, or the square root
of the sum of the squares of the entries.
SCNRM2:=SQRT(SUM(I=1 to N)REAL(CX(I))**2+AIMAG(CX(I))**2)
N Input, INTEGER N, number of elements in vector.
SX Input, COMPLEX SX(N), vector whose norm is desired.
INCX Input, INTEGER INCX, increment between elements of SX. For contiguous
elements, INCX = 1.
SCNRM2 Output, REAL SCNRM2, the euclidean norm of the vector SX.
This material was reproduced for educational use only from
the Pittsburgh Supercomputing Center and is copyrighted
© by the PSC.