Skip to content

Instantly share code, notes, and snippets.

@ryanrhymes
Last active August 21, 2017 01:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryanrhymes/14de074b56cd36b5b876eeaac37eea92 to your computer and use it in GitHub Desktop.
Save ryanrhymes/14de074b56cd36b5b876eeaac37eea92 to your computer and use it in GitHub Desktop.
test new slicing function
let x = Arr.sequential [|2;3;4|];;
Owl_slicing_ext.(get_slice_list_typ [] x);;
Owl_slicing_ext.(get_slice_list_typ [ R[]; R[]; R[]] x);;
Owl_slicing_ext.(get_slice_list_typ [ I 1; R[]; R[]] x);;
Owl_slicing_ext.(get_slice_list_typ [ I 1; I 2; R[]] x);;
Owl_slicing_ext.(get_slice_list_typ [ I 1; I 0; I 3] x);;
Owl_slicing_ext.(get_slice_list_typ [ I 1; I 0; I 2] x);;
Owl_slicing_ext.(get_slice_list_typ [ L [0;1]; I 0; I 2] x);;
Owl_slicing_ext.(get_slice_list_typ [ R [-1;0]; I 0; R []] x);;
Owl_slicing_ext.(get_slice_list_typ [ R [-1;0]; I 0; R [1;2]] x);;
Owl_slicing_ext.(get_slice_list_typ [ R [-1;0]; I 0; R [2;1]] x);;
Owl_slicing_ext.(get_slice_list_typ [ R []; L [0;1;2]; R []] x);;
Owl_slicing_ext.(get_slice_list_typ [ R []; L [1;0;2]; R []] x);;
Owl_slicing_ext.(get_slice_list_typ [ R []; L [2;1;0]; R []] x);;
Owl_slicing_ext.(get_slice_list_typ [ R [1;0]; R []; R []] x);;
Owl_slicing_ext.(get_slice_list_typ [ R [0]; L [2;1;0;2]; R []] x);;
Owl_slicing_ext.(get_slice_list_typ [ R []; R []; R [1;1;1]] x);;
Owl_slicing_ext.(get_slice_list_typ [ R []; R []; L [1;1;1]] x);;
Owl_slicing_ext.(get_slice_list_typ [ L [0;0]; R []; R []] x);;
Owl_slicing_ext.(get_slice_list_typ [ L [0;0]; R []; R [-1;0]] x);;
Owl_slicing_ext.(get_slice_list_typ [ L [0;0]; R []; R [0;-1;2]] x);;
let x = Arr.sequential [|2;3;1|];;
Owl_slicing_ext.(get_slice_list_typ [] x);;
Owl_slicing_ext.(get_slice_list_typ [ R[]; R[]; R[]] x);;
Owl_slicing_ext.(get_slice_list_typ [ L [0;0]; R []; R [-1;0]] x);;
Owl_slicing_ext.(get_slice_list_typ [ L [0;0]; R []; R [0;-1]] x);;
let x = Arr.sequential [|2;1;3|];;
Owl_slicing_ext.(get_slice_list_typ [ R []; R []; R [-1;0]] x);;
Owl_slicing_ext.(get_slice_list_typ [ R []; R []; R [0;-1]] x);;
Owl_slicing_ext.(get_slice_list_typ [ L [0;0]; R []; R [-1;0]] x);;
Owl_slicing_ext.(get_slice_list_typ [ L [0;0]; R []; R [0;-1]] x);;
let x = Arr.sequential [|2;10;3|];;
Owl_slicing_ext.(get_slice_list_typ [ R []; R [-1;0;-2]; R []] x);;
Owl_slicing_ext.(get_slice_list_typ [ R []; R [-1;0;-2]; L [2;1;0]] x);;
let x = Arr.sequential [|200;300;400|];;
let f () = Owl_slicing_ext.(get_slice_list_typ [ R [0]; R []; R []] x);;
Utils.time f;;
let f () = Owl_slicing_ext.(get_slice_list_typ [ R [-1;0]; R []; R []] x);;
Utils.time f;;
let f () = Owl_slicing_ext.(get_slice_list_typ [ R []; R [0;-1]; R []] x);;
Utils.time f;;
let f () = Owl_slicing_ext.(get_slice_list_typ [ R []; R [-1;0]; R []] x);;
Utils.time f;;
let f () = Owl_slicing_ext.(get_slice_list_typ [ R []; R []; R [-1;0]] x);;
Utils.time f;;
let f () = Owl_slicing_ext.(get_slice_list_typ [ R []; R []; L [2;1;0]] x);;
Utils.time f;;
let x = Arr.uniform [|2;3;4|];;
let y = Arr.sequential [|1;2;1|];;
Owl_slicing_ext.(set_slice_list_typ [ I 0; L [0;1]; L [0]] x y);;
let x = Arr.uniform [|2;3;4|];;
let y = Arr.sequential [|1;2;3|];;
Owl_slicing_ext.(set_slice_list_typ [ I 0; L [1;0]; L [2;1;0]] x y);;
let x = Arr.uniform [|2;3;4|];;
let y = Arr.sequential [|1;2;3|];;
Owl_slicing_ext.(set_slice_list_typ [ I 1; L [2;0]; L [2;1;0]] x y);;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment