pub trait Constraint {
    // Required methods
    fn project(&self, x: &mut [f64]);
    fn is_convex(&self) -> bool;
}
Expand description

A set which can be used as a constraint

This trait defines an abstract function that allows to compute projections on sets; this is implemented by a series of structures (see below for details)

Required Methods§

source

fn project(&self, x: &mut [f64])

Projection onto the set, that is,

$$ \Pi_C(v) = \mathrm{argmin}_{z\in C}\Vert{}z-v{}\Vert $$

§Arguments
  • x: The given vector $x$ is updated with the projection on the set
source

fn is_convex(&self) -> bool

Returns true if and only if the set is convex

Implementors§