pub enum ConvexSet {
Hyperplane {
a: Vec<f64>,
b: f64,
},
Halfspace {
a: Vec<f64>,
b: f64,
},
Ball {
center: Vec<f64>,
radius: f64,
},
Polytope {
a_rows: Vec<Vec<f64>>,
b_vec: Vec<f64>,
},
}Expand description
A representation of a convex set in ℝⁿ.
Supports hyperplanes, halfspaces, Euclidean balls, and polytopes in H-representation (intersection of halfspaces).
Variants§
Hyperplane
Hyperplane {x : aᵀx = b}.
Halfspace
Halfspace {x : aᵀx ≤ b}.
Ball
Euclidean ball {x : ||x - c|| ≤ r}.
Polytope
Polytope in H-form: {x : A x ≤ b}.
a_rows[i] is the i-th row of A and b_vec[i] is b_i.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ConvexSet
impl RefUnwindSafe for ConvexSet
impl Send for ConvexSet
impl Sync for ConvexSet
impl Unpin for ConvexSet
impl UnsafeUnpin for ConvexSet
impl UnwindSafe for ConvexSet
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.