help-glpk
[Top][All Lists]
Advanced

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

[Help-glpk] Variable constraint


From: Juliana Freitag
Subject: [Help-glpk] Variable constraint
Date: Fri, 16 Oct 2009 22:49:53 +0400

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







reply via email to

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