[Cgl] cgl, cpx, mir, error

Matthew Galati Matthew.Galati at sas.com
Sun Apr 15 19:54:28 EDT 2007


> >> I'll put together a basic empty OSI class this weekend and 
> see how it 
> >> works out with CGL.  I need it for my work anyway.  Then, you can 
> >> choose to include it or no with the current OSI distribution.
> >
> > 	Thanks, Matt! This is an idea that deserves a try-out.
> 


Here's a first draft. 
   https://coral.ie.lehigh.edu/projects/DECOMP/browser/trunk/TempFix/OsiNull

As expected, this brings up a lot of design questions. This probably needs more thought. In particular, do we want this object to manage its own memory? 

As this is just a "patch" until OSI2 is out, I took the quickest path, which was to use Francois's idea of a data object that just carries const pointers (i.e., OsiData is for the most part, just like CglData). That means, the user is responsible for all memory allocation and freeing. Also, the user must manipulate the data themselves and only pass in pointers (which are const). This means, that many of the Osi methods had to be disabled - like those involving changing the model dynamically. The only non-const members are those needed to make the Cgl generators work. 

I did not derive all of the pure virtual methods -- just enough to get some of Cgl to work. Methods that "should not be called" from OsiNull will throw an exception/assertion using CoinAssert.

I have not tested it much - only in the context of my framework. It seems to run fine with CGLs: Knapsack, Flow Cover, Clique and MIRs. It throws an error with Gomory (as expected). 

For now, it is good enough for my needs -- but, I am not sure how useful it will be to others. Have a look, let me know what you think.

Matt G


 



More information about the Cgl mailing list