Solver

Trait Solver 

Source
pub trait Solver {
    type Model: SolverModel;

    // Required methods
    fn create_model(&mut self, problem: UnsolvedProblem) -> Self::Model;
    fn name() -> &'static str;
}
Expand description

An entity that is able to solve linear problems

Required Associated Types§

Source

type Model: SolverModel

The internal model type used by the solver

Required Methods§

Source

fn create_model(&mut self, problem: UnsolvedProblem) -> Self::Model

Solve the given problem

Source

fn name() -> &'static str

The human readable name of the solver, for instance “Coin Cbc”

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<SOLVER, MODEL> Solver for SOLVER
where SOLVER: FnMut(UnsolvedProblem) -> MODEL, MODEL: SolverModel,

A function that takes an UnsolvedProblem and returns a SolverModel automatically implements Solver

Source§

type Model = MODEL

Source§

impl<T: SolverTrait + Clone> Solver for LpSolver<T>

Available on crate feature lp-solvers only.