How should I implement a constraint like the following one using the GLKP API?

s.t. c{i in 1..N} :
 w[i] <= x[i] * M;

x[i] is a binary variable.

I tried to do something like this:

for (int i=1; i <= N; i++) {
     glp_set_row_bnds(lp, i, GLP_UP, 0.0, glp_get_col_prim(lp, i)*M);
     ia[i] = i, ja[i] = i, ar[i] = 1;
  }

Is it right to use the glp_get_col_prim routine in this case?

Thank you very much, 
Juliana.


      
____________________________________________________________________________________
Veja quais são os assuntos do momento no Yahoo! +Buscados
http://br.maisbuscados.yahoo.com





_______________________________________________
Help-glpk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-glpk

Reply via email to