[Coin-discuss] CoinPackedMatrix: problems appending matrices

John J Forrest jjforre at us.ibm.com
Tue Dec 20 11:37:51 EST 2005


Joerg,

Your fixes seem absolutely correct.  We welcome having bugs pointed out, 
especially in lesser used areas - it is a big bonus when you also fix the 
bug.

I have committed changes to CVS - thank you.

John Forrest



"Joerg Herbers" <Joerg.Herbers at inform-ac.com> 
Sent by: coin-discuss-bounces at list.coin-or.org
12/19/2005 05:28 AM
Please respond to
Discussions about open source software for Operations Research 


To
<coin-discuss at list.coin-or.org>
cc

Subject
[Coin-discuss] CoinPackedMatrix: problems appending matrices






I have had problems (bottom-)appending column-ordered matrices to 
row-ordered matrices (using CoinPackedMatrix::bottomAppendPackedMatrix) 
and (right-)appending row-ordered matrices to column-ordered matrices 
(using CoinPackedMatrix::rightAppendPackedMatrix). In both cases, 
CoinPackedMatrix::majorAppendOrthoOrdered is called, yielding matrices 
which don't look correct in terms of major dimensions. Adding the two 
lines

   majorDim_ += matrix.minorDim_;
   size_ += matrix.size_;

to the end of majorAppendOrthoOrdered() corrects this problem in my 
implementation.

Additionally, there seems to be an indexing problem in a for loop in the 
same function (line 1330 of CoinPackedMatrix.cpp) which led to a crash in 
my application. The code segment reads as

     for (i = 0; i < matrix.minorDim_ - 1; ++i) {
       start_[i+1] = start_[i] + CoinLengthWithExtra(orthoLength[i], 
extra_gap);
     }

meaning that the start_ array is only adapted up to a value of 
i+1==matrix.minorDim-1. However, the implementation of CoinPackedMatrix 
obviously assumes that start_[matrix.minorDim_] is filled with the size of 
the index vector. If I change the conditional part of the for loop to "i < 
matrix.minorDim_", everything works fine.

Could you check if I'm right? Or did I miss something?

Thanks in advance,
Jörg




Dr. Jörg Herbers
Geschäftsbereich Systeme Airport
INFORM GmbH, Pascalstraße 23, 52076 Aachen, Germany
Telefon: (+49) 2408 9456-24, Fax: (+49) 2408 9456-25
E-Mail: joerg.herbers at inform-ac.com, Web: http://www.inform-ac.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/20051220/8297ac93/attachment.html>


More information about the Coin-discuss mailing list