These subroutines implement the first-order time-varying recursive
equation, using initial value s, target vectors u and
x, and output vector y.
s, u, x, y | Subroutine |
---|---|
Short-precision real | STREC |
Long-precision real | DTREC |
Fortran | CALL STREC | DTREC (s, u, incu, x, incx, y, incy, n , iopt) |
C and C++ | strec | dtrec (s, u, incu, x, incx, y, incy, n, iopt); |
PL/I | CALL STREC | DTREC (s, u, incu, x, incx, y, incy, n , iopt); |
Vectors u, x, and y must have no common elements; otherwise, results are unpredictable. See Concepts.
The first-order time-varying recursive equation is expressed as follows:
STREC provides the same function as the IBM 3838 function REC, with restrictions removed. DTREC provides a long-precision computation that is not included in the IBM 3838 functions. See the IBM 3838 Array Processor Functional Characteristics manual.
None
This example shows all strides INCU, INCX, and INCY equal to 1 for vectors u, x, and y, respectively.
S U INCU X INCX Y INCY N IOPT | | | | | | | | | CALL STREC( 1.0 , U , 1 , X , 1 , Y , 1 , 8 , 0 ) U = (1.0, 2.0, 3.0, 3.0, 2.0, 1.0, 1.0, 2.0) X = (3.0, 2.0, 1.0, 1.0, 2.0, 3.0, 3.0, 2.0)
Y = (4.0, 10.0, 31.0, 94.0, 190.0, 193.0, 196.0, 394.0)
This example shows a stride, INCU, that is greater than 1 for vector u. The strides INCX and INCY for vectors x and y, respectively, are 1.
S U INCU X INCX Y INCY N IOPT | | | | | | | | | CALL STREC( 1.0 , U , 2 , X , 1 , Y , 1 , 4 , 0 ) U = (1.0, . , 3.0, . , 2.0, . , 1.0, . ) X = (3.0, 2.0, 1.0, 1.0, 2.0, 3.0, 3.0, 2.0)
Y = (4.0, 14.0, 29.0, 30.0)
This example shows a stride, INCU, of 1 for vector u, a stride, INCX, that is greater than 1 for vector x, and a negative stride, INCY, for vector y. For y, results are stored beginning at element Y(4).
S U INCU X INCX Y INCY N IOPT | | | | | | | | | CALL STREC( 1.0 , U , 1 , X , 2 , Y , -1 , 4 , 1 ) U = (1.0, 2.0, 3.0, 3.0, 2.0, 1.0, 1.0, 2.0) X = (3.0, . , 1.0, . , 2.0, . , 3.0)
Y = (90.0, 29.0, 9.0, 4.0)