help-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-glpk] MathProg, glpk and C language


From: Michael Hennebry
Subject: Re: [Help-glpk] MathProg, glpk and C language
Date: Wed, 4 Oct 2017 19:26:10 -0500 (CDT)
User-agent: Alpine 2.20 (DEB 67 2015-01-07)

On Wed, 4 Oct 2017, Lyndon D'Arcy wrote:

Below is some example code for reading MathProg using my extension:

 int status;
 char *buf = "var x1;\
 var x2;\
 maximize obj: 0.6 * x1 + 0.5 * x2;\
 s.t. c1: x1 + 2 * x2 <= 1;\
 s.t. c2: 3 * x1 + x2 <= 2;\
 end;";
 glp_prob *lp;
 glp_tran *tran = glp_mpl_alloc_wksp();
 status = glp_mpl_read_buffer_into_model(tran, buf, strlen(buf), 0);
 ck_assert_int_eq(status, 0);
   if (!status) {
     status = glp_mpl_generate(tran, NULL);
     if (!status) {
         lp = glp_create_prob();
         glp_mpl_build_prob(tran, lp);
     }
 }
 glp_mpl_free_wksp(tran);
 glp_delete_prob(lp);
 glp_free_env();

The example does not solve the problem or retrieve the solution.

--
Michael   address@hidden
"Sorry but your password must contain an uppercase letter, a number,
a haiku, a gang sign, a heiroglyph, and the blood of a virgin."
                                                             --  someeecards



reply via email to

[Prev in Thread] Current Thread [Next in Thread]