[Coin-osi-devel] **SPAM** Spec for row/column name handling, with first cut at code.

fmargot at andrew.cmu.edu fmargot at andrew.cmu.edu
Thu Feb 8 09:29:02 EST 2007


Lou:

It would be nice if the way default names work in Osi, 
OsiXXXSolverInterface, CoinMpsIO and CoinLpIO is similar.

First, a name for the objective function should probably be included. 
In both CoinMpsIO and CoinLpIO, when asking for the row names,
you get a vector with (#rows+1) entries with names for all the rows and the
last entry for the objective function.

Second, in CoinMpsIO and OsiClpSolverInterface, default row names are 
RNN (R%7.7d), default columns 
names are CNN (C%7.7d). In CoinLpIO, they are respectively consNN and xNN. 
The R%7.7d and C%7.7d conventions are rather ugly for an LP file, but the
fixed length might be useful for MPS files. In any case, ColNN is wasteful
for LP files. I would prefer CNN or xNN. Probably RNN would be then better
for the default row names.

Maybe enforce rules for names: maximum length, possibly character set.

Lookup for names is important. Is it allowed to have two identical row
names or two identical column names? What happens if the user defines
name "Row2" for row with index 0, no name for row 2 and asks for the
name of row with index 2? Without a lookup table for names, it is impossible
to quickly test for these conflicts.

It seems to me that the "lazy" handling of names is overly clever and might
creates problems. It is simpler to have the default names mode (where
the user gives up control of names) or user names mode (where the user 
takes care of all names, and names must be provided upon generation). 
In lazy mode, what happens when rows are removed?

Francois


On Wed, 7 Feb 2007, Lou Hafer wrote:

> Folks,
>
> 	Here's the first cut:  basic functionality to manipulate row and column
> names.  I've attached three files:
>
>  * OsiSolverParameters.hpp contains the OsiNameDiscipline integer parameter.
>  * OsiSolverInterface.hpp contains declarations and doxygen doc'n
>  * OsiNames.cpp contains the first cut at implementation
>
> In OsiSolverParameters.hpp and OsiSolverInterface.hpp, look for OSI_KEEP_NAMES
> to find the relevant portions.  This is all untested and surely chock ablock
> with bugs, but it should (mostly :-) satisfy Matt's request for a complete spec.
> Tweaking, for sure --- for one thing, I havn't gone through and attached const
> qualifiers in places that probably should have them.
>
> I haven't attached the modified OsiSolverInterface.cpp, but the changes are easy
> to summarise:  add calls to setRowColNames in readMps, readGMPL, readLp, and
> loadFromCoinModel.  As the comments point out, when a OsiXXX interface overrides
> any of these methods, they'll need to be sure to add the call to setRowColNames.
> Where people are adding rows/columns individually, or using one of the
> loadProblem variants, they can make explicit calls to add names.  To do
> otherwise gets into serious ugliness, as the functions in question are pure
> virtual.
>
> 	I haven't addressed Ted's request for name lookup. I'll poke at that
> next. Nor has there been any reply to the issue of error handling. In the
> absence of opinions, I'll go with asserts guarded by COIN_OSI_CHECKLEVEL.
>
> 	Have at it  :-)
>
> 							Lou
>



More information about the Osi mailing list