[Coin-discuss] CoinPackedMatrix: problems appending matrices
Joerg Herbers
Joerg.Herbers at inform-ac.com
Mon Dec 19 05:28:51 EST 2005
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
More information about the Coin-discuss
mailing list