Changeset 434


Ignore:
Timestamp:
Sep 22, 2006 4:05:51 PM (13 years ago)
Author:
forrest
Message:

ampl fix

Location:
trunk/Cbc/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cbc/src/CbcModel.cpp

    r397 r434  
    17031703    status_=1;
    17041704  if (!status_) {
    1705     bestPossibleObjective_=bestObjective_;
     1705    // Set best possible unless stopped on gap
     1706    if(secondaryStatus_ != 2)
     1707      bestPossibleObjective_=bestObjective_;
    17061708    handler_->message(CBC_END_GOOD,messages_)
    17071709      << bestObjective_ << numberIterations_ << numberNodes_<<getCurrentSeconds()
  • trunk/Cbc/src/Cbc_ampl.cpp

    r391 r434  
    2929#include <string>
    3030#include <cassert>
     31#include "CoinSort.hpp"
    3132/* so decodePhrase and clpCheck can access */
    3233static ampl_info * saveInfo=NULL;
     
    7273}
    7374static void
    74 sos_kludge(int nsos, int *sosbeg, double *sosref)
     75sos_kludge(int nsos, int *sosbeg, double *sosref,int * sosind)
    7576{
    7677  // Adjust sosref if necessary to make monotonic increasing
    7778  int i, j, k;
     79  // first sort
     80  for (i=0;i<nsos;i++) {
     81    k = sosbeg[i];
     82    int end=sosbeg[i+1];
     83    CoinSort_2(sosref+k,sosref+end,sosind+k);
     84  }
    7885  double t, t1;
    7986  for(i = j = 0; i++ < nsos; ) {
     
    316323      info->sosIndices = (int *) malloc(nsosnz*sizeof(int));
    317324      info->sosReference = (double *) malloc(nsosnz*sizeof(double));
    318       sos_kludge(nsos, sosbeg, sosref);
     325      sos_kludge(nsos, sosbeg, sosref,sosind);
    319326      for (int i=0;i<nsos;i++) {
    320327        int ichar = sostype[i];
     
    402409  } else {
    403410    /* all slack basis */
     411    // leave status for output */
     412#if 0
    404413    free(info->rowStatus);
    405414    info->rowStatus=NULL;
    406415    free(info->columnStatus);
    407416    info->columnStatus=NULL;
     417#endif
    408418  }
    409419  /* add -solve - unless something there already
Note: See TracChangeset for help on using the changeset viewer.