문제

I was wondering if there is an equivalent in GLPK Api of the command line function "glpsol".

Because I have a model which is written in a .mod file and data in .dat file. In command line I can solve it by calling this line :

glpsol --model flow-glpk.mod --data your_data_set.dat

I would like to solve the same problem in a C/C++ program without execute an "execv()" call.

도움이 되었습니까?

해결책

Have a look at mplsamp2.c in the examples directory of the source distribution, I believe it does what you want, you just have to change the hardcoded names appropriately to your application.

GLPK comes with a nice manual, 3.2 Routines for processing MathProg models details how to deal with MathProg models using the C API.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top