Module vector

Module vector 

Source

Structs§

BoolVector
FloatVector
IntVector

Functions§

bool_vector_and
BOOLVECTOR.AND: Pushes the result of applying element-wise AND of the top item to the second item on the BOOLVECTOR stack. It applies an offset to the indices of the top item. The offset is taken from the INTEGER stack. Indices that are outside of the valid range of the second item are ignored. If there is no overlap of indices the second item of the stack is pushed as a result.
bool_vector_count
BOOLVECTOR.COUNT Pushes the count of true elements to the INTEGER stack.
bool_vector_define
BOOLVECTOR.DEFINE: Defines the name on top of the NAME stack as an instruction that will push the top item of the BOOLVECTOR stack onto the EXEC stack.
bool_vector_dup
BOOLVECTOR.DUP: Duplicates the top item on the stack. Does not pop its argument (which, if it did, would negate the effect of the duplication!).
bool_vector_flush
BOOLVECTOR.FLUSH: Empties the BOOLVECTOR stack.
bool_vector_get
BOOLVECTOR.GET: Copies the element at index i of the top BOOLVECTOR item to the BOOLEAN stack where i taken from the INTEGER stack limited to valid range.
bool_vector_id
BOOLVECTOR.ID: Pushes the ID of the BOOLVECTOR stack to the INTEGER stack.
bool_vector_length
BOOLVECTOR.LENGTH: Pushes the length of the top BOOLVECTOR item to the INTEGER stack.
bool_vector_not
BOOLVECTOR.NOT Applies the negation operator for the elements of the top item. It only considers indices larger than the offset. The offset is taken from the INTEGER stack.
bool_vector_ones
BOOLVECTOR.ONES: Pushes a newly generated BOOLVECTOR with all elements set to true. The size is taken from the INTEGER stack
bool_vector_or
BOOLVECTOR.OR: Pushes the result of applying element-wise OR of the top item to the second item on the BOOLVECTOR stack. It applies an offset to the indices of the top item. The offset is taken from the INTEGER stack. Indices that are outside of the valid range of the second item are ignored. If there is no overlap of indices the second item of the stack is pushed as a result.
bool_vector_pop
BOOLVECTOR.POP: Pops the BOOLVECTOR stack.
bool_vector_rand
BOOLVECTOR.RAND: Pushes a newly generated random BOOLVECTOR. The size is taken from the INTEGER stack, the sparsity from the FLOAT stack. If the size is <0 or the sparcity not in [0,1] this acts as a NOOP.
bool_vector_rotate
BOOLVECTOR.ROTATE: Moves all elements of the top item to the adjacent position on the left. The first item is removed while the last element of the vector is taken from the BOOLEAN stack.
bool_vector_set
BOOLVECTOR.SET: Replaces the ith element of the top BOOLVECTOR item by the top item of the BOOLEAN stack. The index i is taken from the INTEGER stack.
bool_vector_shove
BOOLVECTOR.SHOVE: Inserts the second INTEGER “deep” in the stack, at the position indexed by the top INTEGER. The index position is calculated after the index is removed.
bool_vector_sort_asc
BOOLVECTOR.SORT*ASC: Sorts the top BOOLVECTOR item in ascending order.
bool_vector_sort_desc
BOOLVECTOR.SORT*DESC: Sorts the top BOOLVECTOR item in descending order.
bool_vector_stack_depth
BOOLVECTOR.STACKDEPTH: Pushes the stack depth onto the INTEGER stack (thereby increasing it!).
bool_vector_swap
BOOLVECTOR.SWAP: Swaps the top two BOOLVECTORs.
bool_vector_yank
BOOLVECTOR.YANK: Removes an indexed item from “deep” in the stack and pushes it on top of the stack. The index is taken from the INTEGER stack, and the indexing is done after the index is removed.
bool_vector_yank_dup
BOOLVECTOR.YANKDUP: Pushes a copy of an indexed item “deep” in the stack onto the top of the stack, without removing the deep item. The index is taken from the INTEGER stack, and the indexing is done after the index is removed.
bool_vector_zeros
BOOLVECTOR.ZEROS: Pushes a newly generated BOOLVECTOR with all elements set to false. The size is taken from the INTEGER stack.
float_vector_add
FLOATVECTOR.+: Pushes the result of applying element-wise ADD of the top item to the second item on the FLOATVECTOR stack. It applies an offset to the indices of the top item. The offset is taken from the INTEGER stack. Indices that are outside of the valid range of the second item are ignored. If there is no overlap of indices the second item of the stack is pushed as a result.
float_vector_append
FLOATVECTOR.APPEND: Appends the top FLOAT item to the top FLOATVECTOR item.
float_vector_define
FLOATVECTOR.DEFINE: Defines the name on top of the NAME stack as an instruction that will push the top item of the FLOATVECTOR stack onto the EXEC stack.
float_vector_divide
FLOATVECTOR./: Pushes the result of element-wise DIVIDE of the second item by the top item on the FLOATVECTOR stack. It applies an offset to the indices of the top item. The offset is taken from the INTEGER stack. Indices that are outside of the valid range of the second item are ignored. If there is no overlap of indices the second item of the stack is pushed as a result. If at least one divisor is zero the instruction acts as NOOP.
float_vector_dup
FLOATVECTOR.DUP: Duplicates the top item on the stack. Does not pop its argument (which, if it did, would negate the effect of the duplication!).
float_vector_flush
FLOATVECTOR.FLUSH: Empties the FLOATVECTOR stack.
float_vector_get
FLOATVECTOR.GET: Copies the element at index i of the top FLOATVECTOR item to the FLOAT stack where i is taken from the FLOAT stack limited to valid range.
float_vector_id
FLOATVECTOR.ID: Pushes the ID of the FLOATVECTOR stack to the INTEGER stack.
float_vector_length
FLOATVECTOR.LENGTH: Pushes the length of the top FLOATVECTOR item to the INTEGER stack.
float_vector_mean
FLOATVECTOR.MEAN: Pushes the mean of the top FLOATVECTOR to the float stack
float_vector_multiply
FLOATVECTOR.*: Pushes the result of element-wise MULTIPLY of the top item to the second item on the INTVECTOR stack. It applies an offset to the indices of the top item. The offset is taken from the INTEGER stack. Indices that are outside of the valid range of the second item are ignored. If there is no overlap of indices the second item of the stack is pushed as a result.
float_vector_multiply_scalar
FLOATVECTOR.*SCALAR: Multiplies the top item of the FLOAT stack with each element of the top FLOATVECTOR element.
float_vector_ones
FLOATVECTOR.ONES: Pushes a newly generated FLOATVECTOR with all elements set to 1. The size is taken from the INTEGER stack
float_vector_pop
FLOATVECTOR.POP: Pops the FLOATVECTOR stack.
float_vector_rand
FLOATVECTOR.RAND: Pushes a newly generated random INTVECTOR. The size is taken from the INTEGER stack while the parameters for mean and standard deviation are the first (top) and second item on the FLOAT stack. If size < 0 or standard deviation < 0 this act as a NOOP.
float_vector_rotate
FLOATVECTOR.ROTATE: Moves all elements of the top item to the adjacent position on the left. The first item is removed while the last element of the vector is taken from the FLOAT stack.
float_vector_set
FLOATVECTOR.SET: Replaces the ith element of the top FLOATVECTOR item by the top item of the FLOAT stack. The top item of the INTEGER stack is the index i limited to valid range.
float_vector_shove
FLOATVECTOR.SHOVE: Inserts the second FLOATVECTOR “deep” in the stack, at the position indexed by the top INTEGER. The index position is calculated after the index is removed.
float_vector_sine
FLOATVECTOR.SINE: Pushes a FLOATVECTOR item whose elements describe a sine wave. The sine wave for the element at index i is calulated as Asin(2pixi + phi). The amplitude A (1st), the angle velocity x (2nd) and the phase angle phi (3rd) are taken from the FLOAT stack (in that order). The vector length is taken from the INTEGER stack.
float_vector_sort_asc
FLOATVECTOR.SORT*ASC: Sorts the top FLOATVECTOR item in ascending order.
float_vector_sort_desc
FLOATVECTOR.SORT*DESC: Sorts the top FLOATVECTOR item in descending order.
float_vector_stack_depth
FLOATVECTOR.STACKDEPTH: Pushes the stack depth onto the INTEGER stack (thereby increasing it!).
float_vector_subtract
FLOATVECTOR.-: Pushes the result of element-wise SUBTRACT of the top item from the second item on the INTVECTOR stack. It applies an offset to the indices of the top item. The offset is taken from the INTEGER stack. Indices that are outside of the valid range of the second item are ignored. If there is no overlap of indices the second item of the stack is pushed as a result.
float_vector_sum
FLOATVECTOR.SUM Pushes the sum of the elements to the FLOAT stack.
float_vector_swap
FLOATVECTOR.SWAP: Swaps the top two FLOATVECTORs.
float_vector_yank
FLOATVECTOR.YANK: Removes an indexed item from “deep” in the stack and pushes it on top of the stack. The index is taken from the INTEGER stack, and the indexing is done after the index is removed.
float_vector_yank_dup
FLOATVECTOR.YANKDUP: Pushes a copy of an indexed item “deep” in the stack onto the top of the stack, without removing the deep item. The index is taken from the INTEGER stack, and the indexing is done after the index is removed.
float_vector_zeros
FLOATVECTOR.ZEROS: Pushes a newly generated FLOATVECTOR with all elements set to 0. The size is taken from the INTEGER stack
int_vector_add
INTVECTOR.+: Pushes the result of applying element-wise ADD of the top item to the second item on the INTVECTOR stack. It applies an offset to the indices of the top item. The offset is taken from the INTEGER stack. Indices that are outside of the valid range of the second item are ignored. If there is no overlap of indices the second item of the stack is pushed as a result.
int_vector_append
INTVECTOR.APPEND: Appends the top integer item to the top intvector item.
int_vector_bool_index
INTVECTOR.BOOLINDEX: Pushes an INTVECTOR item that contains the indices of all true values of the top BOOLVECTOR item. For example, this instruction pushes INT[0,2] if the top item on the BOOLVECTOR stack is BOOL[1,0,1]. The BOOLVECTOR item is popped.
int_vector_contains
INTVECTOR.CONTAINS: Pushes true to the BOOLEAN stack if the top INTEGER is included in the top INTVECTOR item. This instruction acts as a NOOP if there is no INTEGER or INTVECTOR. The INTVECTOR item is popped.
int_vector_define
INTVECTOR.DEFINE: Defines the name on top of the NAME stack as an instruction that will push the top item of the INTVECTOR stack onto the EXEC stack.
int_vector_divide
INTVECTOR./: Pushes the result of element-wise DIVIDE of the second item by the top item on the INTVECTOR stack. It applies an offset to the indices of the top item. The offset is taken from the INTEGER stack. Indices that are outside of the valid range of the second item are ignored. If there is no overlap of indices the second item of the stack is pushed as a result. If at least one divisor is zero the instruction acts as NOOP.
int_vector_dup
INTVECTOR.DUP: Duplicates the top item on the stack. Does not pop its argument (which, if it did, would negate the effect of the duplication!).
int_vector_flush
INTVECTOR.FLUSH: Empties the INTVECTOR stack.
int_vector_from_int
INTVECTOR.FROMINT: Create an INTVECTOR from the elements of the INTEGER stack. The top element (min-max corrected) describes the number of elements. The elements 1..n of the INTEGER stack are pushed as vector to the INTVECTOR stack.
int_vector_get
INTVECTOR.GET: Copies the element at index i of the top INTVECTOR item to the INTEGER stack where i taken from the INTEGER stack and bound to valid range.
int_vector_id
INTVECTOR.ID: Pushes the ID of the INTVECTOR stack to the INTEGER stack.
int_vector_length
INTVECTOR.LENGTH: Pushes the length of the top INTVECTOR item to the INTEGER stack.
int_vector_loop
INTVECTOR.LOOP: Excecutes the top element of the EXEC stack once for each element of the top INTVECTOR item. The element that corresponds to the current loop iteration is pushed to the INTEGER stack.
int_vector_mean
INTVECTOR.MEAN: Pushes the mean of the top INTVECTOR to the float stack
int_vector_multiply
INTVECTOR.*: Pushes the result of element-wise MULTIPLY of the top item to the second item on the INTVECTOR stack. It applies an offset to the indices of the top item. The offset is taken from the INTEGER stack. Indices that are outside of the valid range of the second item are ignored. If there is no overlap of indices the second item of the stack is pushed as a result.
int_vector_ones
INTVECTOR.ONES: Pushes a newly generated INTVECTOR with all elements set to 1. The size is taken from the INTEGER stack
int_vector_pop
INTVECTOR.POP: Pops the INTVECTOR stack.
int_vector_rand
INTVECTOR.RAND: Pushes a newly generated random INTVECTOR. The size, min and max values taken from the INTEGER stack in that order. If the size is <0 or max < min this act as a NOOP.
int_vector_remove
INTVECTOR.REMOVE: Removes any occurance of the top element from the INTEGER stack from the top element of INTVECTOR if it is contained.
int_vector_rotate
INTVECTOR.ROTATE: Moves all elements of the top item to the adjacent position on the left. The first item is removed while the last element of the vector is taken from the INTEGER stack.
int_vector_set
INTVECTOR.SET: Replaces the ith element of the top INTVECTOR item by the second item of the INTVECTOR stack. The top item of the INTEGER stack is the index i bound to valid range.
int_vector_set_insert
INTVECTOR.SET*INSERT: Appends the top integer item to the top INTVECTOR item - only if it does not already exit in the intvector. If no INTVECTOR item exists, a new one will be created
int_vector_shove
INTVECTOR.SHOVE: Inserts the second INTEGER “deep” in the stack, at the position indexed by the top INTEGER. The index position is calculated after the index is removed.
int_vector_sort_asc
INTVECTOR.SORT*ASC: Sorts the top INTVECTOR item in ascending order.
int_vector_sort_desc
INTVECTOR.SORT*DESC: Sorts the top INTVECTOR item in descending order.
int_vector_stack_depth
INTVECTOR.STACKDEPTH: Pushes the stack depth onto the INTEGER stack (thereby increasing it!).
int_vector_subtract
INTVECTOR.-: Pushes the result of element-wise SUBTRACT of the top item from the second item on the INTVECTOR stack. It applies an offset to the indices of the top item. The offset is taken from the INTEGER stack. Indices that are outside of the valid range of the second item are ignored. If there is no overlap of indices the second item of the stack is pushed as a result.
int_vector_sum
INTVECTOR.SUM Pushes the sum of the elements to the INTEGER stack.
int_vector_swap
INTVECTOR.SWAP: Swaps the top two INTVECTORs.
int_vector_yank
INTVECTOR.YANK: Removes an indexed item from “deep” in the stack and pushes it on top of the stack. The index is taken from the INTEGER stack, and the indexing is done after the index is removed.
int_vector_yank_dup
INTVECTOR.YANKDUP: Pushes a copy of an indexed item “deep” in the stack onto the top of the stack, without removing the deep item. The index is taken from the INTEGER stack, and the indexing is done after the index is removed.
int_vector_zeros
INTVECTOR.ZEROS: Pushes a newly generated INTVECTOR with all elements set to 0. The size is taken from the INTEGER stack
load_vector_instructions