src/mapping/quadratic.rs

branch
dev
changeset 110
a1278320be26
parent 109
943c6b3b9414
equal deleted inserted replaced
109:943c6b3b9414 110:a1278320be26
5 5
6 #![allow(non_snake_case)] 6 #![allow(non_snake_case)]
7 7
8 use super::{DifferentiableImpl, LipschitzDifferentiableImpl, Mapping}; 8 use super::{DifferentiableImpl, LipschitzDifferentiableImpl, Mapping};
9 use crate::convex::ConvexMapping; 9 use crate::convex::ConvexMapping;
10 use crate::error::DynResult;
10 use crate::euclidean::Euclidean; 11 use crate::euclidean::Euclidean;
11 use crate::instance::{Instance, Space}; 12 use crate::instance::{Instance, Space};
12 use crate::linops::{BoundedLinear, Linear, Preadjointable}; 13 use crate::linops::{BoundedLinear, Linear, Preadjointable};
13 use crate::norms::{Norm, NormExponent, Normed, L2}; 14 use crate::norms::{Norm, NormExponent, Normed, L2};
14 use crate::types::Float; 15 use crate::types::Float;
91 A: Clone + BoundedLinear<X, ExpX, L2, F>, 92 A: Clone + BoundedLinear<X, ExpX, L2, F>,
92 Self: DifferentiableImpl<X>, 93 Self: DifferentiableImpl<X>,
93 { 94 {
94 type FloatType = F; 95 type FloatType = F;
95 96
96 fn diff_lipschitz_factor(&self, seminorm: ExpX) -> Option<F> { 97 fn diff_lipschitz_factor(&self, seminorm: ExpX) -> DynResult<F> {
97 Some(self.opA.opnorm_bound(seminorm, L2).powi(2)) 98 Ok(self.opA.opnorm_bound(seminorm, L2)?.powi(2))
98 } 99 }
99 } 100 }

mercurial