NAME
cxVecCoerce
- converts a vector of data from one primitive type to another
C SPECIFICATION
#include <cx/Coerce.h>
cxErrorCode cxVecCoerce(long n, cxPrimType typei, void *datain, cxPrimType typeo, void *dataout)
FORTRAN SPECIFICATION
integer function cxVecCoerce(n, typei, datain, typeo, dataout)
integer n
integer typei, typeo
integer datain(*), dataout(*)
PARAMETERS
-
n
-
Input length of the data vector.
-
typei
-
Input enumerated constant indicating the type of the input vector.
-
datain
-
Input vector of n elements of primitive type specified by typei.
-
typeo
-
Input enumerated constant indicating the type of the output vector.
-
dataout
-
Output vector of n elements of primitive type specified by
typeo. The vector is assumed to be previously allocated by the
caller.
FUNCTION RETURN VALUE
The returned value for this function is a cxErrorCode enumerated
constant indicating success (cx_err_none or 0) or failure (other
values).
DESCRIPTION
cxVecCoerce copies n values from datain to
dataout, performing a scalar type coercion on each value.
Values within the normal range of the output type are converted to the
output type, while values outside the range are clamped to the minimum
or maximum of the range, as required.
cxVecCoerce does not allocate storage for the output vector, but
rather expects dataout to be an array of at least n words.
Arguments datain and dataout are arrays of the scalar
types indicated in the typei and typeo variables, based on
the cxPrimType enumeration. Possible scalar types are unsigned
byte integer, signed short integer, signed long integer, single
precision floating point, double precision floating point, and
null-terminated (C style) character string.
cxVecCoerce is used by the Module Data Wrapper in array
coercions, but may also be used in writing modules.
SEE ALSO
cxVecClipGet(3E),
cxVecClipSet(3E).
Last modified: May 27 15:48 1999
[ Documentation Home ]
© The Numerical Algorithms Group Ltd, Oxford UK. 1999