Skip to main content

MetricRegularityChecker

Struct MetricRegularityChecker 

Source
pub struct MetricRegularityChecker {
    pub radius: f64,
    pub num_tests: usize,
    pub tol: f64,
}
Expand description

Checks metric regularity properties of a mapping at a point.

Fields§

§radius: f64

Perturbation radius for numerical testing.

§num_tests: usize

Number of test perturbations.

§tol: f64

Tolerance for regularity bound checks.

Implementations§

Source§

impl MetricRegularityChecker

Source

pub fn new(radius: f64, num_tests: usize, tol: f64) -> Self

Create a new checker.

Source

pub fn estimate_modulus( &self, f: impl Fn(&[f64]) -> Vec<f64>, x0: &[f64], y0: &[f64], domain_samples: &[Vec<f64>], ) -> f64

Estimate the metric regularity modulus κ of F at (x₀, y₀): κ ≈ sup_{(x,y) near (x₀,y₀)} d(x, F⁻¹(y)) / d(y, F(x)).

Here F is represented as f: &[f64] -> Vec<f64> and F⁻¹(y) is approximated by the preimage computed via nearest-point search.

Source

pub fn check_constraint_qualification( constraints: &[impl Fn(&[f64]) -> f64], x: &[f64], h: f64, ) -> bool

Check whether a constraint qualification (MFCQ-like) holds by verifying that the constraint gradients at x span a “rich” direction set.

Source

pub fn check_quasiconvex( f: impl Fn(&[f64]) -> f64, x: &[f64], y: &[f64], num_samples: usize, ) -> bool

Check whether a set of points satisfies a quasiconvexity condition: f on the line segment [x,y] is ≤ max(f(x), f(y)) for sample points.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.