pub struct ConstraintSet<B = NoBounds, L = NoLinearConstraints, N = NoNonlinearConstraints> { /* private fields */ }Expand description
A complete set of problem-side constraints.
Equality and inequality blocks remain distinct. Builders change the set’s type, so constrained solvers cannot ignore unsupported blocks.
Implementations§
Source§impl ConstraintSet
impl ConstraintSet
Source§impl<B, L, N> ConstraintSet<B, L, N>
impl<B, L, N> ConstraintSet<B, L, N>
Sourcepub fn with_bounds<V>(
self,
bounds: BoxBounds<V>,
) -> ConstraintSet<BoxBounds<V>, L, N>
pub fn with_bounds<V>( self, bounds: BoxBounds<V>, ) -> ConstraintSet<BoxBounds<V>, L, N>
Set the bounds without changing other blocks.
Source§impl<B, E, I, N> ConstraintSet<B, LinearBlocks<E, I>, N>
impl<B, E, I, N> ConstraintSet<B, LinearBlocks<E, I>, N>
Sourcepub fn with_linear_equalities<M, R>(
self,
block: LinearBlock<M, R>,
) -> ConstraintSet<B, LinearBlocks<LinearBlock<M, R>, I>, N>
pub fn with_linear_equalities<M, R>( self, block: LinearBlock<M, R>, ) -> ConstraintSet<B, LinearBlocks<LinearBlock<M, R>, I>, N>
Set the linear equalities A x = b.
Sourcepub fn with_linear_inequalities<M, R>(
self,
block: LinearBlock<M, R>,
) -> ConstraintSet<B, LinearBlocks<E, LinearBlock<M, R>>, N>
pub fn with_linear_inequalities<M, R>( self, block: LinearBlock<M, R>, ) -> ConstraintSet<B, LinearBlocks<E, LinearBlock<M, R>>, N>
Set the linear inequalities A x <= b.
Source§impl<B, L, E, I> ConstraintSet<B, L, NonlinearBlocks<E, I>>
impl<B, L, E, I> ConstraintSet<B, L, NonlinearBlocks<E, I>>
Sourcepub fn with_nonlinear_equalities(
self,
count: usize,
) -> ConstraintSet<B, L, NonlinearBlocks<NonlinearBlock, I>>
pub fn with_nonlinear_equalities( self, count: usize, ) -> ConstraintSet<B, L, NonlinearBlocks<NonlinearBlock, I>>
Declare a nonlinear equality callback h(x) = 0 with count values.
Sourcepub fn with_nonlinear_inequalities(
self,
count: usize,
) -> ConstraintSet<B, L, NonlinearBlocks<E, NonlinearBlock>>
pub fn with_nonlinear_inequalities( self, count: usize, ) -> ConstraintSet<B, L, NonlinearBlocks<E, NonlinearBlock>>
Declare a nonlinear inequality callback c(x) <= 0 with count values.
Trait Implementations§
Source§impl<B: BorrowConstraint, L: BorrowConstraint, N: BorrowConstraint> ConstraintDescription for ConstraintSet<B, L, N>
impl<B: BorrowConstraint, L: BorrowConstraint, N: BorrowConstraint> ConstraintDescription for ConstraintSet<B, L, N>
Source§type Borrowed<'a> = ConstraintSet<<B as BorrowConstraint>::Borrowed<'a>, <L as BorrowConstraint>::Borrowed<'a>, <N as BorrowConstraint>::Borrowed<'a>>
where
Self: 'a
type Borrowed<'a> = ConstraintSet<<B as BorrowConstraint>::Borrowed<'a>, <L as BorrowConstraint>::Borrowed<'a>, <N as BorrowConstraint>::Borrowed<'a>> where Self: 'a
A view that borrows the block data without cloning it.
Source§impl<'de, B, L, N> Deserialize<'de> for ConstraintSet<B, L, N>
Available on crate feature serde only.
impl<'de, B, L, N> Deserialize<'de> for ConstraintSet<B, L, N>
Available on crate feature
serde only.Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<B, L, N> Serialize for ConstraintSet<B, L, N>
Available on crate feature serde only.
impl<B, L, N> Serialize for ConstraintSet<B, L, N>
Available on crate feature
serde only.Auto Trait Implementations§
impl<B, L, N> Freeze for ConstraintSet<B, L, N>
impl<B, L, N> RefUnwindSafe for ConstraintSet<B, L, N>
impl<B, L, N> Send for ConstraintSet<B, L, N>
impl<B, L, N> Sync for ConstraintSet<B, L, N>
impl<B, L, N> Unpin for ConstraintSet<B, L, N>
impl<B, L, N> UnsafeUnpin for ConstraintSet<B, L, N>
impl<B, L, N> UnwindSafe for ConstraintSet<B, L, N>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T, U> Imply<T> for U
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
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.