[Clp] code sample for feasible point

LMH lmh_users-groups at molconn.com
Wed Oct 3 16:35:35 EDT 2018


Hello,

I need to add some code to a program that will take a set of data points and
determine the feasible point. More specifically, I think I only need to know if the
model is feasible or not. Something like isProvenPrimalInfeasible() is probably
sufficient.

Currently, my data is stored in a vector of row objects where each objects holds a
vector<double> with the column values for the row. I need to translate this data to
the proper clp container (it looks like clp uses its own matrix class,
ClpPackedMatrix), construct a model, and then retrieve weather or not the model is
feasible or infeasible.

I have some sample data where all points are part of a convex set where the model
should be feasible, and another set where one point is not part of the convex set and
the model should be infeasible. The data is in R7 if that matters. This version of
the data is not scaled but I can do that if it would be helpful.

I have read most of the users guide and understand what allot of the methods do.

Can I just do something like what is shown here,

https://projects.coin-or.org/Clp/browser/trunk/Clp/examples/addRows.cpp

which is

- declare an empty model
- resize the model to the proper number of columns
- declare a row array
- populate the row array

If this is correct, there are a few things I don't understand.

What is the purpose of the objective coefficient set on lines 35-41?

In lines 47-50 where the data is added to each row, it doesn't look like the two rows
have the same dimensions. This doesn't make sense. The code starting on line 155
looks more reasonable.

Is there not a way to just declare and populate a matrix and pass that to a model
method? The code starting on line 199 likes more like this, but all of the different
implementations in this sample are a bit confusing.

LMH


More information about the Clp mailing list