HELP NEWZFLOATARRAY David Young July 2003 LIB * ______________NEWZFLOATARRAY provides procedures which make and recognise packed arrays of complex double-precision floats. These are suitable for passing to external procedures that expect complex arrays with alternating real and imaginary values. In addition, a vector class for the arrayvectors is defined. newzfloatarray(___________bounds_list, ____________element_init) -> ___________float_array The arguments are as for *newarray. The second is optional. oldzfloatarray(___tag, ___________bounds_list, ____________element_init) -> __________byte_array The last two arguments are as above, with ____________element_init optional. The ___tag argument is an identifier such as a word or integer. If oldzfloatarray is called twice with the same tag, the arrays returned may share storage. This can reduce garbage collection, and this procedure should be used in preference to newzfloatarray for any array which is only needed temporarily. See *oldarray for more details. iszfloatarray(_____array) -> _______boolean Returns if _____array is an array created with newzfloatarray, or more generally whose arrayvector has the *dataword "zfloatvec". Note that isdfloatarray will also return for these arrays. WARNING: some Pop-11 array procedures will not handle these complex arrays properly. Usually unsuitable procedures will mishap when given a zfloat array, but not always, so it is important to run some test examples to ensure that you are getting the correct behaviour. A vector class with dataword zfloatvec is defined. This means that the constant zfloatvec_key and the procedures iszfloatvec, conszfloatvec, initzfloatvec, destzfloatvec, subscrzfloatvec and fast_subscrzfloatvec are defined and made available. (See REF * _________DEFSTRUCT and REF * ____KEYS.) These procedures will all treat the vector as containing complex values, and indexed access and update (e.g. v(i)) will work correctly too. Printing the vector will show the complex values. Unfortunately, *datalength and *length will return double the correct length for a complex vector - there seems no obvious way to fix this. Also, the procedures associated with the key (obtained, for example, with class_subscr(zfloatvec_key)) will treat their argument as a vector of real floats, of double the expected length, in which the real and imaginary parts of the complex vector alternate. The for-form *in_vectorclass will likewise only operate on the underlying real vector. --- $_____________________________popvision/help/newzfloatarray --- Copyright University of Sussex 2003. All rights reserved. ----------