MP Library is a set of tools recommended to create new AMPL solver interfaces.
Reusable building blocks for new interfaces.
mp::MIPFlatConverterfacilitate conversion of NL expressions which are not natively accepted by a solver into simpler forms. For example,
max(a, b)is translated into a construct meaning
<new var> = max(a, b), which is in turn redefined into a MIP construct or passed to the solver (Gurobi:
GRBaddgenconstrMax). Logical and CP constraints are supported.
Concrete solver interfaces.
Interfaces to solvers with expression-based APIs. For solvers with an expression-based API, NL forests can be efficiently mapped. For example, AMPL expression
max(a, b)directly maps to IBM ILOG Concert’s
IloMax. The library has the following C++ interfaces of this kind, all of which support AMPL extensions for logic and constraint programming:
Interfaces to solvers with “flat” APIs (WIP). For solvers with more traditional “flat” APIs, class
mp::MIPFlatConvertertranslates many non-linear AMPL expressions. Currently there are two experimental implementations:
An efficient type-safe C++ adapter for the previous ASL library for connecting solvers to AMPL and other systems: source
SMPSWriter, a converter from deterministic equivalent of a two-stage stochastic programming (SP) problem written in AMPL to an SP problem in SMPS format.
End-to-end solver testing script for testing of various solver features: source