NAME
funct_gen -- create unit to make function
PROTOTYPE
unitptr funct_gen( int iNum, float *afX, float *afY, int iMode, unitptr uHost)
ARGUMENTS
- int iNum
- nr of support points
- float *afX
- support points: x-values
- float *afY
- support points: y-values
- int iMode
- mode: 0 = step, 1 = linear, 2 = quadratic 3 = spline, 4 = decaying exponential
- 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[0]:
- (input field 0) next x-value for f(x)
- Y_in[0]:
- (input field 1) auto increment for x
- CTL_in[0]:
- (control field) auto increment mode (see below)
- X_out[1]:
- (output field 1) current x-value used
- Y_out[1]:
- (output field 0) scalar output value f(x)
EXECUTION OF CREATED UNIT:
The function f(x) is computed according to the following rule:
- if CTL_in[0] = 0:
- use input at X_in[0] to set x-value
and compute f(x);
- if CTL_in[0] != 0:
- increment internal x-value # by
value at CTL_in[0]. If the resulting interval [X_in[0], #]
contains the value Y_in[0], reset # to value at X_in[0].
Then compute f(x) and send result to output X_out[0].
INITIALIZATION:
A call ctrl_unit(NST_INIT,u)
sets x=X_in[0]. The next exec-call will return f(x).
DESCRIPTION:
CONTROL MODES:
EXAMPLES:
STATUS:
Preliminary.
SEE ALSO:
FILE
/local/homes/rhaschke/nst7/man/../o.linx86//../foldersrc/nst_math.c