pub struct LinearSession { /* private fields */ }Expand description
An incremental solve session for repeated solves of one linear problem whose constants change (see the module documentation).
Implementations§
Source§impl LinearSession
impl LinearSession
Sourcepub fn new(
problem: &Problem,
moving: &[usize],
opts: SolveOptions,
) -> Option<Self>
pub fn new( problem: &Problem, moving: &[usize], opts: SolveOptions, ) -> Option<Self>
Build a session for problem. moving are indices into problem.rules of
the rules whose constants change from solve to solve (drag targets); their
rows must be equalities. Returns None when the problem has a nonlinear
component, an unsupported rule, a non-finite value, or required rules that
already contradict each other — a full solve handles those.
Sourcepub fn is_broken(&self) -> bool
pub fn is_broken(&self) -> bool
Whether the session can no longer be used (a constraint could not be re-added); build a new one.
Sourcepub fn resolve(&mut self, problem: &Problem) -> Option<Solution>
pub fn resolve(&mut self, problem: &Problem) -> Option<Solution>
Solve problem, which must have the structure of the problem the session
was built from (same variables, fixed flags, rules and targets; constants,
coefficients and reference values may differ). Returns an accepted,
independently verified solution, or None when a full solve is needed.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LinearSession
impl RefUnwindSafe for LinearSession
impl Send for LinearSession
impl Sync for LinearSession
impl Unpin for LinearSession
impl UnsafeUnpin for LinearSession
impl UnwindSafe for LinearSession
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
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.