Shrinkage

shrinkage::SolverObserver

Shrinkage for Rust · rust · 0.3.0

pub trait SolverObserver

A read-only consumer of solver states.

Closures accepting SolverStep implement this trait. Copy any parameters that must outlive a callback. Observers cannot alter stopping or acceptance.

Methods

observe

fn observe(&mut self, step: SolverStep<'_>)

Observe initialization, an accepted update, or the final state.

observe_inner

fn observe_inner(&mut self, _step: SolverStep<'_>, _outer_iteration: usize)

Observe an update inside an outer iteration.

These states solve a surrogate or a block restriction. They need not decrease the original objective or become an accepted outer state. The default ignores them, including for closure observers. outer_iteration identifies the parent IRLS update or hybrid sweep.