summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Groth <christoph.groth@cea.fr>2026-02-09 11:30:17 +0100
committerChristoph Groth <christoph.groth@cea.fr>2026-02-09 11:49:46 +0100
commit1c0916d182df7d6f438cc6283140aecc519b41b6 (patch)
tree8c2aafeb088d0074bbf82964a00bf70711e9eb4b
parent33938712af1b7191cf18c8a06f214b61dc279d02 (diff)
Add expressions
-rw-r--r--Cargo.toml2
-rw-r--r--src/main.rs15
2 files changed, 15 insertions, 2 deletions
diff --git a/Cargo.toml b/Cargo.toml
index 3dbda44..28c60c7 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -4,4 +4,4 @@ version = "0.1.0"
edition = "2024"
[dependencies]
-mdarray = { git = "https://github.com/fre-hu/mdarray.git", rev = "2a67f2ec7ed326fad9dc95a94f772b7e2140c8eb" }
+mdarray = "0.7.2"
diff --git a/src/main.rs b/src/main.rs
index bba61f1..ed21626 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,6 +1,6 @@
use std::mem::MaybeUninit;
-use mdarray::{view, tensor, Slice, Dim, Const, expr::Expression};
+use mdarray::{view, tensor, Slice, Dim, Const, expr::{self, Expression}};
use mdarray as md;
// Indexing convention: C_ij <- A_ik * B_kj
@@ -59,4 +59,17 @@ fn main() {
let index = [0, i, 0, 0, i, 0, 0];
println!("{} {} {} {}", a[i], a[[i, 0]], c[&index[..2]], d[index]);
}
+
+ // Expressions
+ for i in a.cols() {
+ dbg!(&i);
+ }
+
+ for i in a.expr() {
+ dbg!(&i);
+ }
+
+ for i in expr::zip(tensor![0, 1, 2], tensor![3, 4, 5]) {
+ dbg!(&i);
+ }
}