# HG changeset patch # User Tuomo Valkonen # Date 1745990584 18000 # Node ID 1256e7f7f7ade7bf36fe9c0ecda42c16ca674dd1 # Parent 103aa137fcb24ffed2e1d6f21d480ac64f70bb23 Added missing derives diff -r 103aa137fcb2 -r 1256e7f7f7ad src/convex.rs --- a/src/convex.rs Tue Apr 29 07:55:18 2025 -0500 +++ b/src/convex.rs Wed Apr 30 00:23:04 2025 -0500 @@ -9,6 +9,7 @@ use crate::norms::*; use crate::operator_arithmetic::{Constant, Weighted}; use crate::types::*; +use serde::{Deserialize, Serialize}; use std::marker::PhantomData; /// Trait for convex mappings. Has no features, just serves as a constraint @@ -74,6 +75,7 @@ } /// Constraint to the unit ball of the norm described by `E`. +#[derive(Copy, Clone, Debug, Serialize, Deserialize)] pub struct NormConstraint { radius: F, norm: NormMapping, @@ -178,6 +180,7 @@ } /// Projection to the unit ball of the norm described by `E`. +#[derive(Copy, Clone, Debug, Serialize, Deserialize)] pub struct NormProjection { radius: F, exponent: E, @@ -211,6 +214,7 @@ } /// The zero mapping +#[derive(Copy, Clone, Debug, Serialize, Deserialize)] pub struct Zero(PhantomData<(Domain, F)>); impl Zero { @@ -271,6 +275,7 @@ } /// The zero indicator +#[derive(Copy, Clone, Debug, Serialize, Deserialize)] pub struct ZeroIndicator(PhantomData<(Domain, F)>); impl ZeroIndicator { @@ -319,6 +324,7 @@ } /// The squared Euclidean norm divided by two +#[derive(Copy, Clone, Serialize, Deserialize)] pub struct Norm222(PhantomData); impl,*/ F: Float> Norm222 { diff -r 103aa137fcb2 -r 1256e7f7f7ad src/norms.rs --- a/src/norms.rs Tue Apr 29 07:55:18 2025 -0500 +++ b/src/norms.rs Wed Apr 30 00:23:04 2025 -0500 @@ -5,14 +5,14 @@ use crate::euclidean::*; use crate::mapping::{Instance, Mapping, Space}; use crate::types::*; -use serde::Serialize; +use serde::{Deserialize, Serialize}; use std::marker::PhantomData; // // Abstract norms // -#[derive(Copy, Clone, Debug)] +#[derive(Copy, Clone, Debug, Serialize, Deserialize)] /// Helper structure to convert a [`NormExponent`] into a [`Mapping`] pub struct NormMapping { pub(crate) exponent: E,