pub struct SosConstraintHandle<'a> { /* private fields */ }Expand description
A model-bound handle to an SOS constraint.
Single-constraint forms of crate::sos_constraint! and the programmatic
SOS registration methods return this handle.
Implementations§
Source§impl SosConstraintHandle<'_>
impl SosConstraintHandle<'_>
pub const fn id(self) -> SosConstraintId
pub fn index(self) -> usize
Sourcepub fn to_reformulated_model(
self,
options: SosReformulationOptions,
) -> Result<ReformulatedModel, ReformulationError>
pub fn to_reformulated_model( self, options: SosReformulationOptions, ) -> Result<ReformulatedModel, ReformulationError>
Produce an independent model in which this SOS constraint is replaced by mixed-integer algebraic constraints.
§Errors
Returns ReformulationError when a fallback Big-M is invalid or a
member lacks a finite bound and no fallback was supplied.
Sourcepub fn reformulate(
self,
options: SosReformulationOptions,
) -> Result<Option<SosReformulationArtifacts>, ReformulationError>
pub fn reformulate( self, options: SosReformulationOptions, ) -> Result<Option<SosReformulationArtifacts>, ReformulationError>
Replace this SOS constraint on its source model without cloning the
model. Returns Ok(None) if it was already reformulated.
§Errors
Returns ReformulationError before modifying the model when the
fallback Big-M or a required member bound is invalid.
Trait Implementations§
Source§impl<'a> Clone for SosConstraintHandle<'a>
impl<'a> Clone for SosConstraintHandle<'a>
impl<'a> Copy for SosConstraintHandle<'a>
Source§impl Debug for SosConstraintHandle<'_>
impl Debug for SosConstraintHandle<'_>
Source§impl From<SosConstraintHandle<'_>> for SosConstraintId
impl From<SosConstraintHandle<'_>> for SosConstraintId
Source§fn from(value: SosConstraintHandle<'_>) -> Self
fn from(value: SosConstraintHandle<'_>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for SosConstraintHandle<'a>
impl<'a> !Send for SosConstraintHandle<'a>
impl<'a> !Sync for SosConstraintHandle<'a>
impl<'a> !UnwindSafe for SosConstraintHandle<'a>
impl<'a> Freeze for SosConstraintHandle<'a>
impl<'a> Unpin for SosConstraintHandle<'a>
impl<'a> UnsafeUnpin for SosConstraintHandle<'a>
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<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 more