HP MLIB User's Guide Vol. 1 7th Ed.

Chapter 2 Basic Vector Operations 71
Two sided vector clip SCLIP/DCLIP/ICLIP
Name SCLIP/DCLIP/ICLIP
Two sided vector clip
Purpose Given scalars a and b and a vector x of length n, these subprograms form the
vector y by the clip operation
The vectors can be stored in one-dimensional arrays or in either rows or
columns of two-dimensional arrays. Indexing through the arrays can be either
forward or backward.
Usage VECLIB:
INTEGER*4 n, incx, incy
REAL*4 a, b, x(lenx), y(leny)
CALL SCLIP(n, a, b, x, incx, y, incy)
INTEGER*4 n, incx, incy
REAL*8 a, b, x(lenx), y(leny)
CALL DCLIP(n, a, b, x, incx, y, incy)
INTEGER*4 n, incx, incy, a, b, x(lenx), y(leny)
CALL ICLIP(n, a, b, x, incx, y, incy)
VECLIB8:
INTEGER*8 n, incx, incy
REAL*4 a, b, x(lenx), y(leny)
CALL SCLIP(n, a, b, x, incx, y, incy)
INTEGER*8 n, incx, incy
REAL*8 a, b, x(lenx), y(leny)
CALL DCLIP(n, a, b, x, incx, y, incy)
INTEGER*8 n, incx, incy, a, b, x(lenx), y(leny)
CALL ICLIP(n, a, b, x, incx, y, incy)
Input n Number of elements of vectors x and y to be used. If
, the subprograms do not reference x or y.
a The scalar a.
b The scalar b.
y
i
a if x
i
a
x
i
if ax
i
b<< i 12 n,, ,=
b if bx
i
=
n 0