Skip to content

Commit

Permalink
Few more examples.
Browse files Browse the repository at this point in the history
  • Loading branch information
kurtschelfthout committed May 27, 2024
1 parent b4396c7 commit f13cdf5
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions examples/fancy_indexing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,17 @@ type TrB = CpuBool;
fn main() {
let_example!(t, TrI::new(&[4, 3, 2], &(1..25).collect::<Vec<_>>()));

// intro
// slicing
do_example!(t.vix3(1..3, 2.., ..));
// slicing and int indexing
let_example!(i, TrI::new(&[2], &[2, 1]));
do_example!(t.vix3(&i, &i, 1));

// slicing and masking
let_example!(b, TrB::new(&[4], &[false, false, true, false]));
do_example!(t.vix3(&b, &i, 1..));

// basic indexing
do_example!(t.ix3(0, 1, 2).to_scalar());
with_shapes!(t, t.ix1(1));
Expand Down

0 comments on commit f13cdf5

Please sign in to comment.