Changeset 418 for branches


Ignore:
Timestamp:
Aug 8, 2006 7:11:35 AM (13 years ago)
Author:
forrest
Message:

sorting

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/devel/Cbc/src/Cbc_ampl.cpp

    r391 r418  
    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];
Note: See TracChangeset for help on using the changeset viewer.