F002: Elementary Vector Processing

Author(s): H. Lipps Library: KERNLIB
Submitter: Submitted: 18.12.1979
Language: Fortran or Assembler or COMPASS Revised: 27.05.1987

These subprograms perform elementary vector operations.

Structure:

SUBROUTINE and FUNCTION subprograms
User Entry Names:
RVADD, RVCPY, RVDIV, RVMPA, RVMPY, RVMUL, RVMULA, RVMUNA,
RVRAN, RVSCA, RVSCL, RVSCS, RVSET, RVSUB, RVSUM, RVXCH,
DVADD, DVCPY, DVDIV, DVMPA, DVMPY, DVMUL, DVMULA, DVMUNA,
DVRAN, DVSCA, DVSCL, DVSCS, DVSET, DVSUB, DVSUM, DVXCH,
CVADD, CVCPY, CVDIV, CVMPA, CVMPY, CVMUL, CVMULA, CVMUNA,
CVRAN, CVSCA, CVSCL, CVSCS, CVSET, CVSUB, CVSUM, CVXCH,
CVMPYC, CVMPAC

External References: LOCF, RANF, DRANF (some Fortran versions only).

Usage:

For tex2html_wrap_inline181 (type REAL), tex2html_wrap_inline183 (type DOUBLE PRECISION), tex2html_wrap_inline185 (type COMPLEX):

CALL tVSET (N,S,Z1,Z2) tex2html_wrap_inline187
CALL tVRAN (N,A,B,Z1,Z2) tex2html_wrap_inline189 random (see Note 2)
CALL tVCPY (N,X1,X2,Z1,Z2) tex2html_wrap_inline191
CALL tVXCH (N,X1,X2,Y1,Y2) interchanges tex2html_wrap_inline193 with tex2html_wrap_inline195
CALL tVADD (N,X1,X2,Y1,Y2,Z1,Z2) tex2html_wrap_inline197
CALL tVSUB (N,X1,X2,Y1,Y2,Z1,Z2) tex2html_wrap_inline199
CALL tVMUL (N,X1,X2,Y1,Y2,Z1,Z2) tex2html_wrap_inline201
CALL tVMULA(N,X1,X2,Y1,Y2,Z1,Z2) tex2html_wrap_inline203
CALL tVMUNA(N,X1,X2,Y1,Y2,Z1,Z2) tex2html_wrap_inline205
CALL tVDIV (N,X1,X2,Y1,Y2,Z1,Z2,IFAIL) tex2html_wrap_inline207 (see Note 3)
CALL tVSCL (N,S,X1,X2,Z1,Z2) tex2html_wrap_inline209
CALL tVSCA (N,S,X1,X2,Y1,Y2,Z1,Z2) tex2html_wrap_inline211
CALL tVSCS (N,S,X1,X2,Y1,Y2,Z1,Z2) tex2html_wrap_inline213
F = tVSUM (N,X1,X2) tex2html_wrap_inline215
F = tVMPY (N,X1,X2,Y1,Y2) tex2html_wrap_inline217
F = tVMPA (N,X1,X2,Y1,Y2,S) tex2html_wrap_inline219
F = CVMPYC(N,X1,X2,Y1,Y2) tex2html_wrap_inline221
F = CVMPAC(N,X1,X2,Y1,Y2,S) tex2html_wrap_inline223

where tex2html_wrap_inline225 is the complex conjugate of tex2html_wrap_inline227 .

N
(INTEGER) The mathematical dimension of the vectors tex2html_wrap_inline229 .
S,A,B
(Type according to t) The scalar values s, a, and b, respectively.
X1,X2
(Type according to t) Array elements. They must contain the elements tex2html_wrap_inline237 of the vector tex2html_wrap_inline239 .
Y1,Y2
(Type according to t) Array elements. They must contain the elements tex2html_wrap_inline241 of the vector tex2html_wrap_inline243 .
Z1,Z2
(Type according to t) Array elements. On exit, they will contain the elements tex2html_wrap_inline245 of the result vector tex2html_wrap_inline247 .
IFAIL
(INTEGER) On exit, IFAIL is set to zero if all elements tex2html_wrap_inline249 are non-zero. Otherwise IFAIL is set to the smallest index k for which tex2html_wrap_inline253 .
For tex2html_wrap_inline255 all subroutines return control without action; functions tVSUM, tVMPY and CVMPYC assume the value zero, and tVMPA and CVMPAC assume the value S.

Restrictions:

If vector tex2html_wrap_inline257 overlaps with vector tex2html_wrap_inline259 or tex2html_wrap_inline261 , results will be correct provided each element tex2html_wrap_inline263 coincides with an element tex2html_wrap_inline265 or tex2html_wrap_inline267 , where k<j.

Accuracy:

On computers with IBM 370 architecture, RVMPY, RVMPA, CVMPY and CVMPA accumulate the inner product using double-precision arithmetic internally; the final result is then rounded to single precision.

Notes:

  1. The vectors tex2html_wrap_inline271 etc. need not be packed: any equidistant spacing of their elements is permitted. The subprograms determine the location of the vector element tex2html_wrap_inline273 from the actual arguments X1 and X2.
  2. tVRAN sets tex2html_wrap_inline275 to a random value of type t that is uniformly distributed in the interval (A,B). For CVRAN, the real and imaginary parts of tex2html_wrap_inline277 are distributed uniformly and independently in (REAL(A),REAL(B)) and in (AIMAG(A),AIMAG(B)).
  3. If tex2html_wrap_inline279 and tex2html_wrap_inline281 are non-zero, tVDIV computes only tex2html_wrap_inline283 and sets tex2html_wrap_inline285 .
  4. The use of an in-line DO loop will be more efficient than calling the equivalent vector processing subprogram when the vector length is sufficiently small, due to the overhead of the subprogram call.
tex2html_wrap_inline287

Michel Goossens Wed Jun 5 03:57:00 METDST 1996