MCPcopy Create free account
hub / github.com/alphaville/optimization-engine / AlgorithmEngine

Interface AlgorithmEngine

rust/src/core/mod.rs:59–72  ·  view source on GitHub ↗

Engine supporting an algorithm An engine is responsible for the allocation of memory for an algorithm, especially memory that is reuasble is multiple instances of the same algorithm (as in model predictive control). It defines what the algorithm does at every step (see `step`) and whether the specified termination criterion is satisfied

Source from the content-addressed store, hash-verified

57/// the specified termination criterion is satisfied
58///
59pub trait AlgorithmEngine<T = f64> {
60 /// Take a step of the algorithm and return `Ok(true)` only if the iterations should continue.
61 ///
62 /// Returns `Err(SolverError)` if a callback or projection fails, if a
63 /// non-finite value is produced, or if the engine detects an invalid
64 /// numerical state.
65 fn step(&mut self, u: &mut [T]) -> Result<bool, SolverError>;
66
67 /// Initializes the algorithm.
68 ///
69 /// Returns `Err(SolverError)` if initialization requires evaluating a
70 /// callback/projection and that operation fails.
71 fn init(&mut self, u: &mut [T]) -> FunctionCallResult;
72}

Callers

nothing calls this directly

Implementers 2

fbs_engine.rsrust/src/core/fbs/fbs_engine.rs
panoc_engine.rsrust/src/core/panoc/panoc_engine.rs

Calls

no outgoing calls

Tested by

no test coverage detected