diff -r d7c0f431cbd6 -r c5f70e767511 src/mapping.rs --- a/src/mapping.rs Mon Dec 30 09:49:08 2024 -0500 +++ b/src/mapping.rs Tue Dec 31 08:48:50 2024 -0500 @@ -4,8 +4,7 @@ use std::marker::PhantomData; use std::borrow::Cow; -use crate::types::{Num, Float}; -use serde::Serialize; +use crate::types::{Num, Float, ClosedMul}; use crate::loc::Loc; pub use crate::instance::{Instance, Decomposition, BasicDecomposition, Space}; use crate::norms::{Norm, NormExponent}; @@ -45,6 +44,17 @@ { Composition{ outer : self, inner : other, intermediate_norm_exponent : norm } } + + /// Multiply `self` by the scalar `a`. + #[inline] + fn weigh(self, a : C) -> Weighted + where + Self : Sized, + C : Constant, + Self::Codomain : ClosedMul, + { + Weighted { weight : a, base_fn : self } + } } /// Automatically implemented shorthand for referring to [`Mapping`]s from [`Loc`] to `F`.