[Coin-lpsolver] building a model correctly

Scott Drader sdrader at shaw.ca
Tue Jul 26 20:17:44 EDT 2005


Hi,

I'm using CLP to solve some geometry problems, but have had problems with segmentation faults. These problems need only be loaded from memory and never written to disk. I suspect my problem might be in how I'm building and loading my model, but I am unsure. The sequence of operations I perform are roughly:

1. Create bounds and objective arrays.
2. Create a CoinPackedMatrix and populate it with several appendRow() operations.
3. Create a ClpSimplex model with loadProblem(), passing in the matrix and bounds/objective arrays.
4. Do a solve with initialSolve().

I've attached a stripped-down source file demonstrating the above sequence in more detail.

With the above procedure I get consistent segmentation faults. There are however two ways that I have found will indefinitely prevent the segmentation faults.

1. Writing the problem to a file and reading it back in with writeMps()/readMps() before solving (inbetween step 3 and 4 above).
2. Disabling the presolve (this causes several of my problems to solve less than ideally however, maybe beacause of their degenerate nature).

I'm currently using the read/write fix above, but this is less than ideal since I'm doing iterative real-time solves (many many solves).

Is there an obvious problems with this means of constructing and solving a problem?

Thanks,

Scott




-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: coin_crash_example.cpp
URL: <http://list.coin-or.org/pipermail/clp/attachments/20050726/32b94365/attachment.ksh>


More information about the Clp mailing list