pub struct HighsPersistent { /* private fields */ }highs only.Expand description
A stateful HiGHS solver handle that keeps the built model resident across solves.
Created by Highs::persistent.
When only objective coefficients or variable bounds changed since the last call
it pushes those deltas and HiGHS warm-starts from the retained basis.
Any structural change (new rows/columns, changed matrix coefficients or row bounds,
flipped integrality or sense, or a quadratic objective) triggers a transparent
full rebuild, so every result matches a cold Highs::solve.
Options passed to each solve are applied to the resident instance and persist
across calls. Changing a field takes effect on the next solve, but a field you
stop setting keeps its previous value rather than reverting to the HiGHS default.
Call reset (or build a fresh handle) when you want the next
solve to behave exactly like a cold Highs::solve,
options and all.
A failed solve (HiGHS returning an error) leaves the handle without a resident
model, the next call rebuilds from scratch.
Implementations§
Source§impl HighsPersistent
impl HighsPersistent
Sourcepub fn new() -> HighsPersistent
pub fn new() -> HighsPersistent
A fresh handle with no model loaded. The first solve builds it.
Sourcepub fn reset(&mut self)
pub fn reset(&mut self)
Drop the resident model so the next solve rebuilds from
scratch, clearing the warm-start basis and any solver options carried on the
HiGHS instance. After this, the next solve behaves exactly like a cold
Highs::solve, regardless of earlier calls.
Trait Implementations§
Source§impl Debug for HighsPersistent
impl Debug for HighsPersistent
Source§impl Default for HighsPersistent
impl Default for HighsPersistent
Source§fn default() -> HighsPersistent
fn default() -> HighsPersistent
Source§impl Solver for HighsPersistent
impl Solver for HighsPersistent
Source§type Options = HighsOptions
type Options = HighsOptions
() for solvers without any
tunables.fn name(&self) -> &str
fn supports(&self, kind: ModelKind) -> bool
Source§fn solve(
&mut self,
model: &Model,
opts: &HighsOptions,
) -> Result<SolverResult, SolverError>
fn solve( &mut self, model: &Model, opts: &HighsOptions, ) -> Result<SolverResult, SolverError>
Model using this solver. Read moreSource§fn supports_sos(&self, _sos_type: SosType) -> bool
fn supports_sos(&self, _sos_type: SosType) -> bool
sos_type.Source§fn supports_indicators(&self) -> bool
fn supports_indicators(&self) -> bool
Source§fn supports_model(&self, model: &Model) -> bool
fn supports_model(&self, model: &Model) -> bool
model.Auto Trait Implementations§
impl !Send for HighsPersistent
impl !Sync for HighsPersistent
impl Freeze for HighsPersistent
impl RefUnwindSafe for HighsPersistent
impl Unpin for HighsPersistent
impl UnsafeUnpin for HighsPersistent
impl UnwindSafe for HighsPersistent
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T, U> Imply<T> for U
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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> ⓘ
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> ⓘ
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