[CoinUtils-tickets] [COIN-OR Common Utilities] #62: Bug in factorSparseSmall (CoinFactorization2.cpp)

COIN-OR Common Utilities coin-trac at coin-or.org
Sun Apr 18 16:28:48 EDT 2010


#62: Bug in factorSparseSmall (CoinFactorization2.cpp)
-------------------+--------------------------------------------------------
Reporter:  sssiii  |       Type:  defect
  Status:  new     |   Priority:  major 
 Version:          |   Keywords:        
-------------------+--------------------------------------------------------

Comment(by sssiii):

 It seems a comparison with lengthAreaU_ does the job. Here is what I added
 to the code in the pivot() routine:

     //assume no zero elements

     if ( numberInPivotColumn > space ) {
       //getColumnSpace also moves fixed part
       if ( !getColumnSpace ( iColumn, numberInPivotColumn ) ) {
         return false;
       }
       //redo starts
       positionLargest = positionLargest + startColumnU[iColumn] -
 startColumn;
       startColumn = startColumnU[iColumn];
       put = startColumn + numberInColumn[iColumn];
     }
     double tolerance = zeroTolerance_;

     int *nextCount = nextCount_.array();
     for ( j = 0; j < numberInPivotColumn; j++ ) {
       value = work[j] - thisPivotValue * multipliersL[j];
       double absValue = fabs ( value );

       if ( absValue > tolerance ) {
         work[j] = 0.0;

         if (put >= lengthAreaU_) {
           std::cerr << "@@@@@ case D" << std::endl;
           std::cerr << "lengthU_: " << lengthU_ << std::endl;
           std::cerr << "put: " << put << std::endl;
           std::cerr << "jColumn: " << jColumn << std::endl;
           std::cerr << "space: " << space << std::endl;
           std::cerr << "numberInPivotColumn: " << numberInPivotColumn <<
 std::endl;
         }


         elementU[put] = value;
         indexRowU[put] = indexL[j];

         if ( absValue > largest ) {
           largest = absValue;
           positionLargest = put;
         }
         put++;
       } else {
 ...

 And here is the output I got:


 @@@@@ case D
 lengthU_: 65760
 put: 551938
 jColumn: 0
 space: 4
 numberInPivotColumn: 3
 @@@@@ case D
 lengthU_: 65760
 put: 551938
 jColumn: 0
 space: 3
 numberInPivotColumn: 3
 @@@@@ case D
 lengthU_: 65760
 put: 551939
 jColumn: 0
 space: 3
 numberInPivotColumn: 3

-- 
Ticket URL: <https://projects.coin-or.org/CoinUtils/ticket/62#comment:10>
COIN-OR Common Utilities <http://projects.coin-or.org/CoinUtils>
Common data structures and linear algebra functions for COIN-OR projects



More information about the CoinUtils-tickets mailing list