A UserFunc Block is like an STFunc or OAFunc or NAFunc, etc., but the UserFunc framework is more general and powerful (and complicated). UserFuncs can call other (user-defined) UserFuncs, and they allow more general function signatures, with vector arguments and results
This is an example of a very simple UserFunc that takes a single scalar argument (of float type) and squares it:
<UserFunc square>
kind = expression
inputOrder = [b]
<Input b>
kind = arbitraryVector
types = [float]
</Input>
expression = b^2
</UserFunc>
A few terms, very briefly:
kind = expression
,
except that the <Expression> block does not have to specify the
inputOrder or <Input> blocks. See expression.inputOrder
attribute,
the <Input> blocks give the input signature of the function: the
number and types of arguments.kind = expression
).