NAME

normalize_vec - create unit that normalizes a vector

PROTOTYPE

unitptr normalize_vec( int n, unitptr dest)

ARGUMENTS

int n
dimensionality of input vector
unitptr dest
host unit

RETURN VALUE:

unitptr u:
pointer to newly created unit

INTERFACE OF CREATED UNIT:

X_in[n]:
(input field 0) input vector
X_out[n]:
(output field 0) output vector

EXECUTION OF CREATED UNIT:

X_out=X_in/||X_in||

DESCRIPTION:

Creates a unit with one input field and one output field of n pins each. The created unit becomes a subunit of unit dest and computes from its input an output vector of the same direction but with unit euclidean length. If n is specified as a negative integer, all fields will be packed fields with ABS(n) pins.

FILE:

nst_math

SEE ALSO:

scl_vec, euc_len, sqr_len

FILE

/local/homes/rhaschke/nst7/man/../o.linx86_64//../foldersrc/nst_vector.c