NDMultiIter#
- class NDMultiIter()#
Constructs an NDMultiIter instance.
- Arguments:
...args (Array.<NDArray>)
- NDMultiIter.index#
type: Number
- NDMultiIter.iters#
type: Array.<NDIter>
- NDMultiIter.length#
type: Number
- NDMultiIter.lengthm1#
type: Number
- NDMultiIter.nd#
type: Number
- NDMultiIter.numiter#
type: Number
- NDMultiIter.pos#
type: Array.<Number>
- NDMultiIter.shape#
type: Array.<Number>
- static NDMultiIter.current()#
Returns the current indices of the iterators
- Returns:
Object – current
- Returns:
Array.<Number> – [current.value]
- Returns:
Boolean – current.done
Examples:
import { array } from 'vectorious/core/array'; import { NDMultiIter } from 'vectorious/iterator'; const iter = new NDMultiIter(array([1, 2, 3]), array([4, 5, 6])); iter.current(); // { value: [0, 0], done: false }
- static NDMultiIter.done()#
Returns true if the iterator is done, false otherwise
- Returns:
Boolean –
Examples:
import { array } from 'vectorious/core/array'; import { NDMultiIter } from 'vectorious/iterator'; const iter = new NDMultiIter(array([1, 2, 3]), array([4, 5, 6])); iter.done(); // false
- static NDMultiIter.next()#
Steps to the next position in the iterator. Returns the current indices of the iterators, or undefined if done.
- Returns:
Object – current
- Returns:
Array.<Number> – [current.value]
- Returns:
Boolean – current.done
Examples:
import { array } from 'vectorious/core/array'; import { NDMultiIter } from 'vectorious/iterator'; const iter = new NDMultiIter(array([1, 2, 3]), array([4, 5, 6])); iter.next(); // { value: [0, 0], done: false } iter.next(); // { value: [1, 1], done: false } iter.next(); // { value: [2, 2], done: false }, iter.next(); // { value: undefined, done: true },