|
The Vector Function block lets you use a function or procedure as a block in a
NeurOn-Line diagram. The block applies the function or procedure to its input
vector and passes the result. Specify the name of the routine in the attribute Arithmetic Function.
abs
|
arctan
|
ceiling
|
cos
|
exp
|
floor
|
int
|
ln
|
log
|
random
|
sin
|
sqrt
|
tan
|
|
|
|
The picture below shows a diagram that applies the function
exp to each element
of a vector.
|
Using a User-Defined Function
You can use any user-defined function that accepts one quantitative argument
and returns one quantitative value. Set the attribute Arithmetic Function to the
name of the function.
|
Using a Procedure
You can use a procedure that accepts a vector as an argument and returns a vector.
Use a procedure if you want to operate on a vector as a whole, instead of
operating on each element individually.
vector-path-value, which has the superior class
float-array and contains the following two additional attributes.
| Attribute | Type | Description |
|---|---|---|
collection-time
|
float
|
The collection-time of the block's input vector.
|
quality
|
symbol
|
The quality of the block's input vector.
|
This diagram contains a Vector Function block with a procedure that creates a
two-element vector containing the minimum and maximum values of the input
vector.
|
This is the definition of the procedure.
minmax(in-vec:class vector-path-value) = (class vector-path-value)
out-vec: class vector-path-value;
begin
create a vector-path-value out-vec;
change the array-length of out-vec to 2;
change out-vec[0] = the maximum over each float F in in-vec of (F);
change out-vec[1] = the minimum over each float F in in-vec of (F);
return out-vec;
end
tabular-function-of-1-arg function that accepts one argument
and returns a value. Set the attribute Arithmetic Function to the name of your
function. The block passes its input value to the function as an argument and
passes the function's return value as its output value. If the function cannot
evaluate the input value, NeurOn-Line signals an error. For information on a G2
tabular-function-of-1-arg, see the G2 Reference Manual.
This diagram shows a Vector Function block that uses a
tabular-function-of-1-arg.
|
Configuring
This is the configuration panel for Vector Function.
|
| Attribute | Description |
|---|---|
|
Arithmetic Function
|
The function to apply to each element of the input
vector.
|
See Also
For more information on how to use this block, see the pages below.
| Click here for more information... |
|---|
|
Basic Block Behavior
|
|
Vector Function of Two Arguments
|
| Prev
| Next | Start of Chapter | End of Chapter | Contents | Index | (17 out of 18)
Copyright © 1996, Gensym Corporation, Inc.