Some commercial solvers like GuRoBi have a nifty function which can be used to write the optimization problem to a .lp
file or a .mps
file. For instance,GuRoBi python interface has this command,
model.write("test.lp")
I am using SCIP's c++
interface I was wondering if I can write the model I described in c++
to an lp
file. Googling seems to just give me answers about reading .lp files and not writing.
You should call SCIPwriteOrigProblem.
Example:
int retcode = SCIPwriteOrigProblem(scip, "test.lp", NULL, FALSE);
assert(retcode == SCIP_OKAY);