Update to current alg_tools

Thu, 19 Dec 2024 15:55:32 -0500

author
Tuomo Valkonen <tuomov@iki.fi>
date
Thu, 19 Dec 2024 15:55:32 -0500
changeset 56
34f8ec636368
parent 55
15f01efc034b
child 57
1afca417d71b

Update to current alg_tools

Cargo.lock file | annotate | diff | comparison | revisions
src/cube.rs file | annotate | diff | comparison | revisions
src/cylinder.rs file | annotate | diff | comparison | revisions
src/fb.rs file | annotate | diff | comparison | revisions
src/main.rs file | annotate | diff | comparison | revisions
src/manifold.rs file | annotate | diff | comparison | revisions
src/scaled.rs file | annotate | diff | comparison | revisions
--- a/Cargo.lock	Sun Dec 15 01:10:52 2024 -0500
+++ b/Cargo.lock	Thu Dec 19 15:55:32 2024 -0500
@@ -24,7 +24,6 @@
  "colored",
  "cpu-time",
  "csv",
- "either",
  "itertools 0.13.0",
  "nalgebra",
  "num",
@@ -33,6 +32,7 @@
  "rayon",
  "serde",
  "serde_json",
+ "simba",
 ]
 
 [[package]]
--- a/src/cube.rs	Sun Dec 15 01:10:52 2024 -0500
+++ b/src/cube.rs	Thu Dec 19 15:55:32 2024 -0500
@@ -6,6 +6,7 @@
 use serde::Serialize;
 use alg_tools::loc::Loc;
 use alg_tools::norms::{Norm, L2};
+use alg_tools::impl_basic_space;
 use crate::manifold::{EmbeddedManifoldPoint, FacedManifoldPoint, ManifoldPoint};
 
 /// All the difference faces of a [`OnCube`].
@@ -359,6 +360,9 @@
     }
 }
 
+impl_basic_space!(OnCube);
+
+
 #[cfg(test)]
 mod tests {
     use super::*;
--- a/src/cylinder.rs	Sun Dec 15 01:10:52 2024 -0500
+++ b/src/cylinder.rs	Thu Dec 19 15:55:32 2024 -0500
@@ -2,12 +2,13 @@
 Implementation of the surface of a 3D cylinder as a [`ManifoldPoint`].
 */
 
-use alg_tools::euclidean::{Euclidean, Dot};
+use alg_tools::euclidean::Euclidean;
 use serde_repr::*;
 use serde::{Serialize, Deserialize};
 use alg_tools::loc::Loc;
 use alg_tools::norms::{Norm, L2};
 use alg_tools::types::Float;
+use alg_tools::impl_basic_space;
 use crate::manifold::{ManifoldPoint, EmbeddedManifoldPoint, FacedManifoldPoint};
 use crate::newton::{newton_sym1x1, newton_sym2x2};
 
@@ -908,6 +909,8 @@
     }
 }
 
+impl_basic_space!(OnCylinder<'a> where 'a);
+
 #[cfg(test)]
 mod tests {
     use super::*;
@@ -1142,3 +1145,4 @@
         }
     }
 }
+
--- a/src/fb.rs	Sun Dec 15 01:10:52 2024 -0500
+++ b/src/fb.rs	Thu Dec 19 15:55:32 2024 -0500
@@ -75,10 +75,12 @@
     τ : f64,
     iterator : I
 ) -> M
-where M : ManifoldPoint + EmbeddedManifoldPoint,
-      F : Desc<M> +  Mapping<M, Codomain = f64>,
-      G : Prox<M> +  Mapping<M, Codomain = f64>,
-      I : AlgIteratorFactory<IterInfo<M>> {
+where
+    M : ManifoldPoint + EmbeddedManifoldPoint,
+    F : Desc<M> +  Mapping<M, Codomain = f64>,
+    G : Prox<M> +  Mapping<M, Codomain = f64>,
+    I : AlgIteratorFactory<IterInfo<M>>
+{
     
     // Closure that calculates current status
     let status = |x : &M| IterInfo {
--- a/src/main.rs	Sun Dec 15 01:10:52 2024 -0500
+++ b/src/main.rs	Thu Dec 19 15:55:32 2024 -0500
@@ -210,12 +210,14 @@
     τ : f64,
     logmap : impl Fn(usize, IterInfo<M>) -> I
 ) -> DynError
-where M : ManifoldPoint
-          + EmbeddedManifoldPoint<EmbeddedCoords = Loc<f64, 3>>
-          + FacedManifoldPoint,
-      F : Desc<M> +  Mapping<M, Codomain = f64>,
-      G : Prox<M> +  Mapping<M, Codomain = f64>,
-      I : Serialize {
+where
+    M : ManifoldPoint
+        + EmbeddedManifoldPoint<EmbeddedCoords = Loc<f64, 3>>
+        + FacedManifoldPoint,
+    F : Desc<M> +  Mapping<M, Codomain = f64>,
+    G : Prox<M> +  Mapping<M, Codomain = f64>,
+    I : Serialize
+{
     
     let mut logger = Logger::new();
     let iter = AlgIteratorOptions{
--- a/src/manifold.rs	Sun Dec 15 01:10:52 2024 -0500
+++ b/src/manifold.rs	Thu Dec 19 15:55:32 2024 -0500
@@ -4,9 +4,10 @@
 
 use serde::Serialize;
 use alg_tools::euclidean::Euclidean;
+use alg_tools::instance::{Space, BasicDecomposition};
 
 /// A point on a manifold
-pub trait ManifoldPoint : Clone + PartialEq {
+pub trait ManifoldPoint : Space<Decomp=BasicDecomposition> + Clone + PartialEq {
     // Type of tangent factors
     type Tangent : Euclidean<f64, Output=Self::Tangent> + std::fmt::Debug + Serialize;
 
--- a/src/scaled.rs	Sun Dec 15 01:10:52 2024 -0500
+++ b/src/scaled.rs	Thu Dec 19 15:55:32 2024 -0500
@@ -2,7 +2,7 @@
 Implementation of scaling of functions on a manifold by a scalar.
 */
 
-use alg_tools::mapping::{Mapping, Instance};
+use alg_tools::mapping::{Mapping, Instance, Space};
 use crate::manifold::ManifoldPoint;
 use crate::fb::{Grad, Desc, Prox};
 
@@ -22,7 +22,7 @@
     }
 }
 
-impl<M, G : Mapping<M, Codomain=f64>> Mapping<M> for Scaled< G> {
+impl<M : Space, G : Mapping<M, Codomain=f64>> Mapping<M> for Scaled< G> {
     type Codomain = f64;
 
     fn apply<I : Instance<M>>(&self, x : I) -> Self::Codomain {

mercurial