Skip to main content

PersistentSolver

Trait PersistentSolver 

Source
pub trait PersistentSolver: Solver {
    type Handle: Solver<Options = Self::Options>;

    // Required method
    fn persistent(&self) -> Self::Handle;
}
Expand description

A Solver that can hand out a stateful handle keeping the built backend model resident across solves.

The returned Handle is itself a Solver: build it once, then call solve on it repeatedly. When only objective coefficients or variable bounds changed between calls it updates the resident model in place and warm-starts from the previous basis. Any structural change rebuilds transparently, so results always match a one-shot solve.

Required Associated Types§

Source

type Handle: Solver<Options = Self::Options>

The stateful, resident handle. Solving the same (or a structurally identical) model on it repeatedly reuses the build.

Required Methods§

Source

fn persistent(&self) -> Self::Handle

Create a fresh resident handle with no model loaded yet. The first solve builds it.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§