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

Applicability & Efficiency

The VEC_ routines are designed for optimum efficiency when processing large arrays of data and are consequently far more efficient at performing this task than the corresponding VAL_ functions. When possible, VEC_ routines should always be used in preference to VAL_ functions unless the number of calculations to be performed is small (typically 1000 or less).

The main disadvantage in using VEC_ routines is likely to be the additional programming effort, because workspace arrays will probably be required and may have to be acquired dynamically -- unless only a single operation is being performed. Also, certain operations cannot be performed using VEC_ routines (summing the pixels in an image for example) and, in such cases, routines from the NUM facility (section [*]) may have to be used instead. Note, however, that if NUM_ routines are used, then security against numerical errors is more difficult to achieve and (especially in the case of arithmetic operations) VAX-specific programming techniques may be required. The resulting applications will not then be portable.


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

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