# HG changeset patch # User Tuomo Valkonen # Date 1746075437 18000 # Node ID e1455e48bd2b023331cfc1e3b0f3f06e7b1aa4d4 # Parent a1278320be26dfa8c7f08c0554d0651e28762994 clone diff -r a1278320be26 -r e1455e48bd2b src/mapping/dataterm.rs --- a/src/mapping/dataterm.rs Wed Apr 30 16:39:01 2025 -0500 +++ b/src/mapping/dataterm.rs Wed Apr 30 23:57:17 2025 -0500 @@ -16,19 +16,39 @@ //use serde::{Deserialize, Serialize}; -/// Functions of the form $\frac{1}{2}\|Ax-b\|_2^2$ for an operator $A$ -/// to a [`Euclidean`] space. +/// Functions of the form $g(Ax-b)$ for an operator $A$, data $b$, and fidelity $g$. pub struct DataTerm< F: Float, Domain: Space, A: Mapping, G: Mapping, > { + // The operator A opA: A, + // The data b b: >::Codomain, + // The outer fidelity g: G, } +// Derive has troubles with `b`. +impl Clone for DataTerm +where + F: Float, + Domain: Space, + A: Mapping + Clone, + >::Codomain: Clone, + G: Mapping + Clone, +{ + fn clone(&self) -> Self { + DataTerm { + opA: self.opA.clone(), + b: self.b.clone(), + g: self.g.clone(), + } + } +} + #[allow(non_snake_case)] impl, G: Mapping> DataTerm