next up previous contents
Next: VEC_ Type Conversion Routines
Up: THE VEC_ ROUTINES
Previous: VEC_ Error Handling

VEC_ Arithmetic and Mathematical Routines

Arithmetic and mathematical operations may be performed on vectorised arrays of data of any numerical type by invoking appropriate VEC_ routines, using statements such as:

  CALL VEC_$<$FUNC$><$T$>$ ( BAD, N, ARG, RESULT, IERR, NERR, STATUS )
or CALL VEC_$<$FUNC$><$T$>$ ( BAD, N, ARG1, ARG2, RESULT, IERR, NERR, STATUS )

Here, the VEC_ routine takes a vectorised input argument array (or arrays) with N elements of type $<$T$>$ and returns a vectorised result array which is also of type $<$T$>$, having performed the arithmetic or mathematical operation specified by $<$FUNC$>$ on each array element. The data type code $<$T$>$ may be any of those specified in Table [*] and $<$FUNC$>$ may be any of the function codes specified in Tables [*] & [*]. The number of input argument arrays (1 or 2) appropriate to each function is also indicated in these latter Tables.

Thus, for example, the subroutine VEC_ADDUW adds two vectorised unsigned word arrays to produce an array of unsigned word results, while VEC_SQRTD evaluates the square root of a single vectorised array of double precision values, returning an array of double precision results.


next up previous contents
Next: VEC_ Type Conversion Routines
Up: THE VEC_ ROUTINES
Previous: VEC_ Error Handling

PRIMDAT --- Processing of Primitive Numerical Data
Starlink User Note 39
R F Warren-Smith
28 February 1995
E-mail:ussc@star.rl.ac.uk

Copyright © 2009 Science and Technology Facilities Council