Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Initialize AMPL MP, load a model, solve, and retrieve variable values
#include "mp.h"
#include <iostream>
int main() {
// Initialize AMPL MP environment
mp_Env* env = mp_EnvCreate();
if (!env) {
std::cerr << "Failed to create AMPL MP environment" << std::endl;
return 1;
}
// Load a model (example: simple LP)
const char* model = "var x; minimize obj: x; subject to c: x >= 0;";
mp_EnvReadString(env, model);
// Solve
mp_EnvSolve(env);
// Get solution
double val;
mp_VarGetValue(env, "x", &val);
std::cout << "x = " << val << std::endl;
mp_EnvDestroy(env);
return 0;
}
Debug
Known issues
No known issues recorded.
Audit
Dependencies
No dependency data recorded yet.
Resources
No resource links recorded.