3 ms·
The REPL transcript at the end shows the `Idot` verb in action, by applying it to an array of shape `2 3 4` (that is, imagine two "layers" of matrices, each con
by FireFly 10y ago
The REPL transcript at the end shows the `Idot` verb in action, by applying it
to an array of shape `2 3 4` (that is, imagine two "layers" of matrices, each
containing 3 rows, each row being a vector of 4 elements). The `I.` operation
finds the indices of 1's in a vector, but the `Idot` shows the indices of 1's
in a higher-rank matrix (in this case rank 3, i.e. a three-dimensional array).
Compare the locations of the 1's in `array` (the output with 0's and 1's) with
the final output (`0 1 1` is the index of the first 1, `1 1 2` is the index of
the second 1).
Does that help? I mainly wanted to show how the base conversion <=> array
index relationship could be used in practice.