Ignore:
Timestamp:
Oct 2, 2003 1:21:02 PM (17 years ago)
Author:
forrest
Message:

lots of stuff

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/pre/ClpPackedMatrix.cpp

    r208 r212  
    282282    else if (numberRows*2<numberColumns)
    283283      factor=0.2;
    284     if (model->numberIterations()%50==0)
    285       printf("%d nonzero\n",numberInRowArray);
     284    //if (model->numberIterations()%50==0)
     285    //printf("%d nonzero\n",numberInRowArray);
    286286  }
    287287  if (numberInRowArray>factor*numberRows||!rowCopy) {
     
    11261126  // mark empty and fixed columns
    11271127  // also see if worth scaling
    1128   assert (model->scalingFlag()==1); // dynamic not implemented
     1128  assert (model->scalingFlag()<4); // dynamic not implemented
    11291129  double largest=0.0;
    11301130  double smallest=1.0e50;
     
    11641164    return 1;
    11651165  } else {
     1166    int scalingMethod = model->scalingFlag();
     1167    if (scalingMethod==3) {
     1168      // Choose between 1 and 2
     1169      if (smallest<1.0e-5||smallest*largest<1.0)
     1170        scalingMethod=1;
     1171      else
     1172        scalingMethod=2;
     1173    }
    11661174    // and see if there any empty rows
    11671175    for (iRow=0;iRow<numberRows;iRow++) {
     
    11831191    double overallLargest=-1.0e-30;
    11841192    double overallSmallest=1.0e30;
    1185     if (model->scalingFlag()==1) {
     1193    if (scalingMethod==1) {
    11861194      // Maximum in each row
    11871195      for (iRow=0;iRow<numberRows;iRow++) {
     
    12021210      }
    12031211    } else {
    1204       assert(model->scalingFlag()==2);
     1212      assert(scalingMethod==2);
    12051213      int numberPass=3;
    12061214#ifdef USE_OBJECTIVE
     
    13141322      }
    13151323    }
     1324#define RANDOMIZE
     1325#ifdef RANDOMIZE
     1326    // randomize by up to 10%
     1327    for (iRow=0;iRow<numberRows;iRow++) {
     1328      double value = 0.5-CoinDrand48();//between -0.5 to + 0.5
     1329      rowScale[iRow] *= (1.0+0.1*value);
     1330    }
     1331#endif
    13161332    overallLargest=1.0;
    1317     if (overallSmallest<1.0e-3)
     1333    if (overallSmallest<1.0e-1)
    13181334      overallLargest = 1.0/sqrt(overallSmallest);
    13191335    overallLargest = min(1000.0,overallLargest);
     
    13341350        }
    13351351        columnScale[iColumn]=overallLargest/largest;
     1352#ifdef RANDOMIZE
     1353        double value = 0.5-CoinDrand48();//between -0.5 to + 0.5
     1354        columnScale[iColumn] *= (1.0+0.1*value);
     1355#endif
    13361356        overallSmallest = min(overallSmallest,smallest*columnScale[iColumn]);
    13371357      }
Note: See TracChangeset for help on using the changeset viewer.