--- a/src/zero.rs Sat Dec 07 21:54:59 2024 -0500 +++ b/src/zero.rs Sun Dec 15 01:10:52 2024 -0500 @@ -2,7 +2,7 @@ Implementation of the the constant zero function on a manifold. */ -use alg_tools::mapping::Apply; +use alg_tools::mapping::{Mapping, Instance}; use crate::manifold::ManifoldPoint; use crate::fb::{Grad, Desc, Prox}; use std::marker::PhantomData; @@ -19,21 +19,14 @@ } } -impl<M : ManifoldPoint> Apply<M> for ZeroFn<M> { - type Output = f64; +impl<M : ManifoldPoint> Mapping<M> for ZeroFn<M> { + type Codomain = f64; - fn apply(&self, _x : M) -> Self::Output { + fn apply<I : Instance<M>>(&self, _x : I) -> Self::Codomain { 0.0 } } -impl<'a, M : ManifoldPoint> Apply<&'a M> for ZeroFn<M> { - type Output = f64; - - fn apply(&self, _x : &'a M) -> Self::Output { - 0.0 - } -} impl<M : ManifoldPoint> Desc<M> for ZeroFn<M> { fn desc(&self, _τ : f64, x : M) -> M {