Cube contains fix

Sat, 01 Aug 2026 23:33:44 -0500

author
Tuomo Valkonen <tuomov@iki.fi>
date
Sat, 01 Aug 2026 23:33:44 -0500
changeset 202
7a1f1f6f34b5
parent 201
ea2d1e40d707
child 203
ad16acf47726

Cube contains fix

Cargo.lock file | annotate | diff | comparison | revisions
Cargo.toml file | annotate | diff | comparison | revisions
src/sets.rs file | annotate | diff | comparison | revisions
--- a/Cargo.lock	Sun Jul 12 11:29:06 2026 +0300
+++ b/Cargo.lock	Sat Aug 01 23:33:44 2026 -0500
@@ -4,7 +4,7 @@
 
 [[package]]
 name = "alg_tools"
-version = "0.5.2-dev"
+version = "0.5.3-dev"
 dependencies = [
  "anyhow",
  "colored",
--- a/Cargo.toml	Sun Jul 12 11:29:06 2026 +0300
+++ b/Cargo.toml	Sat Aug 01 23:33:44 2026 -0500
@@ -1,6 +1,6 @@
 [package]
 name = "alg_tools"
-version = "0.5.2-dev"
+version = "0.5.3-dev"
 edition = "2021"
 rust-version = "1.85"
 authors = ["Tuomo Valkonen <tuomov@iki.fi>"]
--- a/src/sets.rs	Sun Jul 12 11:29:06 2026 +0300
+++ b/src/sets.rs	Sat Aug 01 23:33:44 2026 -0500
@@ -35,8 +35,9 @@
 where
     U: Num + PartialOrd + Sized,
 {
+    #[inline]
     fn contains<I: Instance<Loc<N, U>>>(&self, item: I) -> bool {
-        item.eval_ref(|r| self.0.iter().zip(r.iter()).all(|(s, x)| s.contains(x)))
+        item.eval_ref(|r| self.0.iter().zip(r.iter()).all(|([a, b], x)| a<=x && x<=b))
     }
 }
 

mercurial