Scale vector

 

SRSCL/DRSCL/CRSCL/CSRSCL/ZRSCL/ZDRSCL

 

INTEGER*8

n, incx

 

REAL*8

a, x(lenx)

 

CALL DRSCL(n, a, x, incx)

 

INTEGER*8

n, incx

 

COMPLEX*8

a, x(lenx)

 

CALL CRSCL(n, a, x, incx)

 

INTEGER*8

n, incx

 

REAL*4

a

 

COMPLEX*8

x(lenx)

 

CALL CSRSCL(n, a, x, incx)

 

INTEGER*8

n, incx

 

COMPLEX*16

a, x(lenx)

 

CALL ZRSCL(n, a, x, incx)

 

INTEGER*8

n, incx

 

REAL*8

a

 

COMPLEX*16

x(lenx)

 

CALL ZDRSCL(n, a, x, incx)

Input

n

Number of elements of vector x to be used in the scaling

 

 

operation. If n ≤ 0, the subprograms do not reference x.

 

a

The scalar a, a ≠ 0.

 

x

Array of length lenx = (n−1)⋅incx+1 containing the

 

 

n-vector x.

 

incx

Increment for the array x, incx ≠ 0. x is stored forward

 

 

in array x with increment incx; that is, xi is stored in

 

 

x((i−1)⋅incx+1).

 

 

Use incx = 1 if the vector x is stored contiguously in

 

 

array x; that is, if xi is stored in x(i). Refer to “BLAS

 

 

Indexing Conventions” in the introduction to this

 

 

chapter.

Output

x

If n ≤ 0, then x is unchanged. Otherwise, xa replaces

 

 

the input.

Notes

The result is unspecified if incx = 0.

 

A divide-by-zero error occurs if a = 0 and n > 0.

Chapter 2 Basic Vector Operations 131