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

ampl fix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.