ILOG CPLEX: how to populate IloLPMatrix while using addGe to set up the model?

Posted by downer on Stack Overflow See other posts from Stack Overflow or by downer
Published on 2010-04-19T00:02:09Z Indexed on 2010/04/19 0:13 UTC
Read the original article Hit count: 585

I have a queatoin about IloLPMatrix and addGe.

I was trying to follow the example of AdMIPex5.java to generate user defined cutting planes based on the solution to the LP relaxation. The difference is that eh initial MIP model is not read in from a mps file, but set up in the code using methods like addGe, addLe etc.

I think this is why I ran into problems while copying the exampe to do the following.

IloLPMatrix lp = (IloLPMatrix)cplex.LPMatrixIterator().next();

lp from the above line turns to be NULL.

I am wondering 1. What is the relationship between IloLPMatrix and the addLe, addGe commands? I tried to addLPMatrix() to the model, and then used model.addGe methods. but the LPMatrix seems to be empty still.

  1. How do I populate the IloLPMatrix of the moel according to the value that I had set up using addGe and addLe. Is the a method to this easily, or do I have to set them up row by row myself?

  2. I was doing this to get the number of variables and their values by doing lp.getNumVars(). Is there other methods that I can use to get the number of variables and their values wihout doing these, since my system is set up by addLe, addGe etc?

Thanks a lot for your help on this.

© Stack Overflow or respective owner

Related posts about linear-programming

Related posts about cplex