Changeset 487


Ignore:
Timestamp:
Apr 24, 2007 11:57:35 AM (12 years ago)
Author:
pbonami
Message:

Missing new line in CouenneSetup?

Location:
trunk/Bonmin/experimental/NotConvex
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Bonmin/experimental/NotConvex/BonCouenneCbc.cpp

    r481 r487  
    431431        delete [] bestSolution_;
    432432
    433       bestSolution_ = new double[nlpSolver->getNumCols()];
    434       CoinCopyN(model.bestSolution(), nlpSolver->getNumCols(), bestSolution_);
    435 
    436433      //Check solution validity
    437434      double violation = nlpSolver->getConstraintsViolation(bestSolution_, obj);
  • trunk/Bonmin/experimental/NotConvex/BonCouenneInterface.cpp

    r481 r487  
    118118
    119119   start[0] = 0;
    120 
     120   int nnz = 0;
    121121   /* fill the four arrays. */
    122122   for(int i = 0 ; i < numrowsconv ; i++)
     
    126126     const CoinPackedVector &v = cut->row();
    127127     start[i+1] = start[i] + v.getNumElements();
    128 
     128     nnz += v.getNumElements();
    129129     length[i] = v.getNumElements();
    130130
     
    132132     rowUpper[i] = cut->ub();
    133133   }
    134    
     134   assert(nnz == start[numrowsconv]);
    135135   /* Now fill the elements arrays. */
    136136   int * ind = new int[start[numrowsconv]];
     
    144144     if(v.getNumElements() != length[i])
    145145       std::cout<<"Empty row"<<std::endl;
    146 
     146     cut->print();
    147147     CoinCopyN(v.getIndices(), length[i], ind + start[i]);
    148148     CoinCopyN(v.getElements(), length[i], elem + start[i]);
     
    154154                  start[numrowsconv], elem, ind,
    155155                  start, length);
    156 
     156   if(A.getNumCols() != numcolsconv || A.getNumRows() != numrowsconv){
     157     std::cout<<"Error in row number"<<std::endl;
     158   }
     159   assert(A.getNumElements() == nnz);
    157160   // Objective function
    158161   double * obj = new double[numcolsconv];
  • trunk/Bonmin/experimental/NotConvex/BonCouenneSetup.hpp

    r481 r487  
    4444 
    4545}
     46
Note: See TracChangeset for help on using the changeset viewer.