summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristoph Groth <christoph.groth@cea.fr>2025-01-09 13:53:24 +0100
committerChristoph Groth <christoph.groth@cea.fr>2025-01-09 13:53:24 +0100
commit52600bbfe3e48d66d1dce00bcde3e2012807c9e0 (patch)
tree137c847c4b17edde8d5ddfb167f78234b5c56fad /src
parent475f692ed8f9faea14577f9049ddfa3b8c40fd96 (diff)
Demonstrate some array operations
Diffstat (limited to 'src')
-rw-r--r--src/main.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
index 949dfb6..c0ee447 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -23,4 +23,16 @@ fn main() {
matmul(&a, &b, &mut c);
assert_eq!(c, expr![[4.0, 5.0, 6.0], [5.0, 7.0, 9.0]]);
+
+ // slice
+ let d = a.view(1, ..);
+ dbg!(std::any::type_name_of_val(&d));
+
+ // index
+ let e = c[4];
+ dbg!(std::any::type_name_of_val(&e));
+
+ // permute
+ let f = c.permute::<1, 0>();
+ dbg!(std::any::type_name_of_val(&f));
}