|
The Vector Function of Two Arguments 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 two input vectors and passes one vector as the result. Specify the name of
the routine in the attribute Arithmetic Function.
quality of either input path is no-value.
arctan
|
average
|
expt
|
max
|
min
|
quotient
|
random
|
remainder
|
The Vector Function of Two Arguments block applies the function to each of the
elements in the two input vectors and creates an output vector of the results. For
example, this diagram computes
25 and 34.
|
Using a User-Defined Function
You may use any user-defined function that accepts two quantitative arguments
and returns one quantitative value. Set the attribute Arithmetic Function to the
name of the function.The Two Argument Vector Function block applies the
function to each of the elements in the two input vectors and creates an output
vector of the results. For example, the diagram below applies the function
to each member of two vectors. In this case, it computes
and
|
Using a Procedure
You can use a procedure that accepts two vectors as arguments and returns a
vector. Use a procedure if you want to operate on the vectors 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 of Two Arguments block with a
procedure that creates a two-element vector containing the average values of the
two input vectors.
|
This is the definition of the procedure.
ave-2(v1: class vector-path-value, v2: 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 average over each float F in v1 of (F);
change out-vec[1] = the average over each float F in v2 of (F);
return out-vec;
end
|
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
|
| Prev
| Start of Chapter | Next Chapter | Contents | Index | (18 out of 18)
Copyright © 1996, Gensym Corporation, Inc.