next up previous
Next: Mapping the Variance Component as Standard Deviations
Up: ACCESSING ARRAY COMPONENTS
Previous: Implicit Type Conversion

Accessing Complex Values   

Array components which hold complex values may be accessed using the routine NDF_MAPZ, which is identical to NDF_MAP except that it returns a pair of pointers for each component mapped; one for each of the real and imaginary parts. For instance:

      INTEGER RPNTR( 1 ), IPNTR( 1 )

      ...

      CALL NDF_MAPZ( INDF, 'Data', '_DOUBLE', RPNTR, IPNTR, EL, STATUS )

will return pointers to the real (i.e. non-imaginary) and imaginary parts of an NDF's data component, as double-precision values, via the arguments RPNTR and IPNTR. As with the routine NDF_MAP, a list of components may also be supplied and the RPNTR and IPNTR arguments must then have sufficient elements to accommodate the returned pointers. Unmapping of components mapped using NDF_MAPZ is performed in exactly the same manner as if NDF_MAP had been used.

Implicit type conversion can be performed between non-complex and complex types (and vice versa) if required, so the use of NDF_MAPZ is not restricted to array components which hold complex values. Equivalent comments also apply to NDF_MAP. A non-complex component accessed via NDF_MAPZ will be converted to have an imaginary part of zero, while a complex component accessed using NDF_MAP will have its imaginary part discarded.



next up previous
Next: Mapping the Variance Component as Standard Deviations
Up: ACCESSING ARRAY COMPONENTS
Previous: Implicit Type Conversion


Starlink User Note 33
R.F. Warren-Smith
11th January 2000
E-mail:rfws@star.rl.ac.uk

Copyright © 2000 Council for the Central Laboratory of the Research Councils