NAME

scale_vec - affine scaling of vector elements

PROTOTYPE

unitptr scale_vec( int iDim, float fFromMin, float fFromMax, float fToMin, float fToMax, unitptr uHost)

ARGUMENTS

int iDim
vector dim. iDim=0 makes dynamic input
float fFromMin
lower limit of interval to scale
float fFromMax
upper limit of interval to scale
float fToMin
value to which fFromMin is scaled
float fToMax
value to which fFromMax is scaled
unitptr uHost
host unit

INTERFACE OF CREATED UNIT:

X_in[iDim]:
input vector
CTL_in[0]
control field. A value of 0 switches the unit off. Any nonzero value leads to normal operation.
X_out[iDim]:
output vector

DESCRIPTION:

Affinely scales elements of a vector such that the interval [fFromMin, fFromMax] is mapped to the interval [fToMin, fToMax]. If fFromMin == fFromMax, scaling factors will be determined such that the min and max values of the input vector elements become mapped to fToMin and fToMax, resp. If the input vector are all of the same value, this value will be mapped to the midpoint (fToMin+fToMax)/2. If iDim<0, the input and output fields will be packed. If iDim=0, input and output fields will be of dynamic dimension. NaN entries will remain NaN entries and will not affect scaling of other elements.

FILE

/local/homes/rhaschke/nst7/man/../o.linx86_64//../foldersrc/nst_vector.c