Closed zoj613 closed 2 weeks ago
Does the library expose a function to map a list of index constructors into a list of the resulting array coordinates? Something like [L [0; 2]; R [1;3]; I 4] getting mapped to [[0; 1; 4]; [0; 2; 4]; [0; 3; 4]; [2; 1; 4]; [2; 2; 4]; [2; 3; 4]]?
[L [0; 2]; R [1;3]; I 4]
[[0; 1; 4]; [0; 2; 4]; [0; 3; 4]; [2; 1; 4]; [2; 2; 4]; [2; 3; 4]]
I figured out how to do this using a combination of Owl_base_slicing.check_slice_definition, a custom range and cartesian_product functions
Owl_base_slicing.check_slice_definition
range
cartesian_product
Does the library expose a function to map a list of index constructors into a list of the resulting array coordinates? Something like
[L [0; 2]; R [1;3]; I 4]
getting mapped to[[0; 1; 4]; [0; 2; 4]; [0; 3; 4]; [2; 1; 4]; [2; 2; 4]; [2; 3; 4]]
?