SCLIPL/DCLIPL/ICLIPL |
|
| Left sided vector clip |
| incy | Increment for the array y, incy ≠ 0: | |
|
| incy > 0 | y is stored forward in array y; that is, |
|
|
| yi is stored in y((i−1)⋅incy+1). |
|
| incy < 0 | y is stored backward in array y; that |
|
|
| is, yi is stored in y((i−n)⋅incy+1). |
|
| Use incy = 1 if the vector y is stored contiguously in | |
|
| array y; that is, if yi is stored in y(i). Refer to “BLAS | |
|
| Indexing Conventions” in the introduction to this | |
|
| chapter. |
|
Output | y | Array of length leny = (n−1)⋅incy+1 containing the | |
|
|
set as specified in “Purpose.”
Notes x and y can be the same array if incx = incy. Otherwise, the result is unspecified if x and y overlap such that any element of x shares a memory location with any element of y.
Fortran Equivalent
SUBROUTINE SCLIPL (N, A, X,INCX, Y,INCY) REAL*4 A,X(*),Y(*)
IF ( N .LE. 0 ) RETURN IX = 1
IY = 1
IF ( INCX .LT. 0 ) IX = 1 -
Y(IY) = MAX ( X(IX) , A ) IX = IX + INCX
IY = IY + INCY
10CONTINUE RETURN END
Example Clip the REAL*8 vector x below −1 into y, where x and y are vectors 10 elements long stored in
INTEGER*4 | N,INCX,INCY |
REAL*8 | A,X(20),Y(20) |
N = 10 |
|
INCX = 1 |
|
INCY = 1 |
|
A = |
|
CALL DCLIPL (N,A,X,INCX,Y,INCY)
76HP MLIB User’s Guide