[Coin-discuss] Problem with row names in ClpModel
John J Forrest
jjforre at us.ibm.com
Wed Feb 22 11:15:07 EST 2006
Anureet,
The coding in ClpModel could lead to problems and I have changed it but
that was not the problem here. There is no efficient way for the code to
know what names already exist when it adds rows and so you will get two
rows called R0000007 with your test case. You could of course drop all
names at the beginning which would make adding cuts slightly faster and
then the writeMps would generate names each time.
What I have done is to modify writeMps in CoinMpsIO.cpp so that it will
check for duplicate names (only of the type Rnnnnnnn or Cnnnnnnn) and
change them with a message. With your test case you now get R0000005,
R0000007, R0000009, R0000008 as the last 4 row names. That is the best I
can think of for now. As a user you could also note the number of
original rows and then rename any additional cuts left at time of
writeMps.
John Forrest
Anureet Saxena <anureet at yahoo.com>
Sent by: coin-discuss-bounces at list.coin-or.org
02/21/2006 09:44 PM
Please respond to
Discussions about open source software for Operations Research
<coin-discuss at list.coin-or.org>
To
coin-discuss at list.coin-or.org, anureet at yahoo.com, anureet at cmu.com,
fmargot at andrew.cmu.edu
cc
Subject
[Coin-discuss] Problem with row names in ClpModel
hi,
I think there is an error in the row (re)naming routines of ClpModel. I am
using the latest version of Clp, which I downloaded today (Feb 21, 2006).
There is a small code with 5 variables and 5 constraints which captures
this error and is available at
http://www.andrew.cmu.edu/user/anureets/workspace.tgz
A README file in the above .tgz directory contains a brief message
describing the code. In particular, after the following operations the
test3.mps file generated by the code is corrupted (it has two rows with
the same name):
o 3 cuts added
o 1 cut is removed
o 2 cuts added
The bug seems to be related to the following piece of code from
ClpModel::resize()
--------------------------------------
#ifndef CLP_NO_STD
if (lengthNames_) {
// reduce row and column names vectors only if necessary
if (rowNames_.size() < (unsigned int)numberRows_)
rowNames_.resize(numberRows_);
if (columnNames_.size() < (unsigned int)numberColumns_)
columnNames_.resize(numberColumns_);
}
#endif
-------------------------------------------------------
I guess the row and column names vectors should be resized "always"
irrespective of whether
"rowNames_.size() < (unsigned int)numberRows_) "
or not. I would greatly appreciate any help in this regard.
Thanking You,
Anureet Saxena
Anureet Saxena
anureet at cmu.edu
anureet at yahoo.com
--This mail was delivered to you on 100% recyclable electrons.
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com _______________________________________________
Coin-discuss mailing list
Coin-discuss at list.coin-or.org
http://list.coin-or.org/mailman/listinfo/coin-discuss
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/coin-discuss/attachments/20060222/07a55b28/attachment.html>
More information about the Coin-discuss
mailing list