Skip to main content

Crate cobre_solver

Crate cobre_solver 

Source
Expand description

§cobre-solver

LP/MIP solver abstraction for the Cobre power systems ecosystem.

This crate defines a backend-agnostic interface for mathematical programming solvers, with a default HiGHS backend:

  • Solver trait: unified API for LP and MIP problem construction, solving, and dual/basis extraction.
  • HiGHS backend (highs feature, on by default): production-grade open-source solver, well-suited for iterative LP solving in power system optimization; exposed as HighsSolver and HighsProfile.
  • CLP backend (clp feature, off by default): optional CLP/CoinUtils backend exposed as ClpSolver and ClpProfile; conformance-validated as a drop-in implementing the same SolverInterface. Requires the Clp and CoinUtils submodules to be initialized (git submodule update --init --recursive) before the first build with --features clp.
  • Basis management: warm-starting support for iterative algorithms that solve sequences of related LPs.

§Status

This crate is in early development. The API will change.

See the repository for the current status.

Re-exports§

pub use trait_def::SolverInterface;
pub use types::Basis;
pub use types::LpSolution;
pub use types::RowBatch;
pub use types::SolutionView;
pub use types::SolverError;
pub use types::SolverStatistics;
pub use types::StageTemplate;
pub use profile::DEFAULT_PROFILE_HEURISTIC_SENTINEL;
pub use profile::DEFAULT_PROFILE_IPM_UNBOUNDED_SENTINEL;
pub use baking::BakingScratch;
pub use baking::bake_rows_into_template;
pub use backends::profiled::ProfiledSolver;
pub use backends::highs::HighsProfile;
pub use backends::highs::HighsSolver;
pub use backends::highs::highs_version;
pub use backends::highs;

Modules§

backends
Concrete LP/MIP solver backends behind the crate’s public vocabulary.
baking
CSR-to-CSC template baking for reusable LP stage templates.
ffi
Raw FFI boundary to the LP solver C wrapper layers.
profile
Sentinel constants for LP-solver profile iteration limits.
trait_def
The SolverInterface trait definition.
types
Core types for the solver abstraction layer.

Functions§

active_solver_metadata_id
Returns the canonical lowercase backend id used in persisted output metadata (OutputContext.solver).
active_solver_name
Returns the display name of the compile-time-selected active backend.
active_solver_version
Returns the version string of the compile-time-selected active backend.

Type Aliases§

ActiveProfile
The solver profile type of the compile-time-selected active backend.
ActiveSolver
The compile-time-selected active LP solver backend.