NAME

polynom_unit -- unit to compute polynomial function for vector

PROTOTYPE

unitptr polynom_unit( int iDim, int iDeg, int iDerivs, unitptr uHost)

ARGUMENTS

int iDim
dimension of input vector
int iDeg
degree of polynomial
int iDerivs
nr of derivatives desired [currently ignored]
unitptr uHost
host unit

RETURN VALUE:

A pointer to the created unit or NULL in the case of an error.

INTERFACE OF CREATED UNIT:

X_in[Dim]:
input vector with Dim=|iDim| elements, packed for iDim<0
Y_in[iDeg+1]:
iDeg+1 polynomial coefficients a[0],a[1],..a[iDeg]
CTL_in[1]:
(control field) a value of 0 switches this unit off.
X_out[Dim]:
output vector with Dim=|iDim| elements, packed for iDim<0

EXECUTION OF CREATED UNIT:

This unit computes a polynomial for all elements X_in[0..Dim-1] of its input vector:

     X_out[i] = a[0] + a[1]*X_in[i] + ... a[iDeg]*X_in[i]^iDeg

where a[j]=Y_in[j]. The default is a[0]=..a[iDeg-1]=0 and a[iDeg]=1, i.e., computation of the highest power only (this is an alternative to the pow_vec - unit, when integer powers for negative numbers are required). If CTL_in[0] = 0, no computations are made and the output values remain unchanged.

SEE ALSO:


   sin_vec, tan_vec, exp_vec, tanh_vec, log_vec, pow_vec

FILE

/local/homes/rhaschke/nst7/man/../o.linx86//../foldersrc/nst_funct.c