Changeset 221 for branches


Ignore:
Timestamp:
Oct 8, 2003 4:15:44 PM (16 years ago)
Author:
forrest
Message:

Still trying to go faster

Location:
branches/pre
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • branches/pre/ClpModel.cpp

    r210 r221  
    10751075      unsigned int maxLength=0;
    10761076      int iRow;
     1077      rowNames_ = std::vector<std::string> ();
     1078      columnNames_ = std::vector<std::string> ();
    10771079      rowNames_.reserve(numberRows_);
    10781080      for (iRow=0;iRow<numberRows_;iRow++) {
     
    13621364    unsigned int maxLength=0;
    13631365    int iRow;
     1366    rowNames_ = std::vector<std::string> ();
     1367    columnNames_ = std::vector<std::string> ();
    13641368    rowNames_.reserve(numberRows_);
    13651369    for (iRow=0;iRow<numberRows_;iRow++) {
     
    14341438#endif
    14351439}
     1440// Copies in names
     1441void
     1442ClpModel::copyNames(std::vector<std::string> & rowNames,
     1443                 std::vector<std::string> & columnNames)
     1444{
     1445  unsigned int maxLength=0;
     1446  int iRow;
     1447  rowNames_ = std::vector<std::string> ();
     1448  columnNames_ = std::vector<std::string> ();
     1449  rowNames_.reserve(numberRows_);
     1450  for (iRow=0;iRow<numberRows_;iRow++) {
     1451    rowNames_[iRow] = rowNames[iRow];
     1452    maxLength = max(maxLength,(unsigned int) strlen(rowNames_[iRow].c_str()));
     1453  }
     1454  int iColumn;
     1455  columnNames_.reserve(numberColumns_);
     1456  for (iColumn=0;iColumn<numberColumns_;iColumn++) {
     1457    columnNames_[iColumn] = columnNames[iColumn];
     1458    maxLength = max(maxLength,(unsigned int) strlen(columnNames_[iColumn].c_str()));
     1459  }
     1460  lengthNames_=(int) maxLength;
     1461}
    14361462//#############################################################################
    14371463// Constructors / Destructor / Assignment
  • branches/pre/ClpNetworkBasis.cpp

    r180 r221  
    682682      for (i=0;i<numberNonZero;i++) {
    683683        int j = regionIndex2[i];
    684         double value = region2[j];
    685         region2[j]=0.0;
     684        double value = region2[i];
     685        region2[i]=0.0;
    686686        region[j]=value;
    687687        regionIndex[i]=j;
  • branches/pre/ClpNetworkMatrix.cpp

    r208 r221  
    1515#include "ClpPlusMinusOneMatrix.hpp"
    1616#include "ClpMessage.hpp"
     17#include <iostream>
    1718
    1819//#############################################################################
     
    382383    else if (numberRows*2<numberColumns)
    383384      factor=0.2;
    384     if (model->numberIterations()%50==0)
    385       printf("%d nonzero\n",numberInRowArray);
     385    //if (model->numberIterations()%50==0)
     386    //printf("%d nonzero\n",numberInRowArray);
    386387  }
    387388  if (numberInRowArray>factor*numberRows||!rowCopy) {
     
    826827void ClpNetworkMatrix::deleteCols(const int numDel, const int * indDel)
    827828{
     829  std::cerr<<"deleteCols not implemented in ClpNetworkMatrix"<<std::endl;
    828830  abort();
    829831}
     
    831833void ClpNetworkMatrix::deleteRows(const int numDel, const int * indDel)
    832834{
     835  std::cerr<<"deleteRows not implemented in ClpNetworkMatrix"<<std::endl;
    833836  abort();
    834837}
  • branches/pre/ClpPresolve.cpp

    r220 r221  
    4141  nonLinearValue_(0.0),
    4242  originalColumn_(NULL),
     43  originalRow_(NULL),
    4344  paction_(0),
    4445  ncols_(0),
     
    6465  }
    6566  delete [] originalColumn_;
     67  delete [] originalRow_;
    6668  paction_=NULL;
    6769  originalColumn_=NULL;
     70  originalRow_=NULL;
    6871}
    6972
     
    8790  delete [] originalColumn_;
    8891  originalColumn_ = new int[ncols_];
     92  delete [] originalRow_;
     93  originalRow_ = new int[nrows_];
    8994
    9095  // Check matrix
     
    105110    delete presolvedModel_;
    106111    presolvedModel_ = new ClpSimplex(si);
    107     if (dropNames)
    108       presolvedModel_->dropNames();
     112    presolvedModel_->dropNames();
    109113
    110114    // drop integer information if wanted
     
    210214      int ncolsNow = presolvedModel_->getNumCols();
    211215      memcpy(originalColumn_,prob.originalColumn_,ncolsNow*sizeof(int));
     216      delete [] prob.originalColumn_;
     217      prob.originalColumn_=NULL;
     218      int nrowsNow = presolvedModel_->getNumRows();
     219      memcpy(originalRow_,prob.originalRow_,nrowsNow*sizeof(int));
     220      delete [] prob.originalRow_;
     221      prob.originalRow_=NULL;
     222      if (!dropNames&&si.lengthNames()) {
     223        // Redo names
     224        int iRow;
     225        std::vector<std::string> rowNames;
     226        rowNames.reserve(nrowsNow);
     227        for (iRow=0;iRow<nrowsNow;iRow++) {
     228          int kRow = originalRow_[iRow];
     229          rowNames.push_back(si.rowName(kRow));
     230        }
     231     
     232        int iColumn;
     233        std::vector<std::string> columnNames;
     234        columnNames.reserve(ncolsNow);
     235        for (iColumn=0;iColumn<ncolsNow;iColumn++) {
     236          int kColumn = originalColumn_[iColumn];
     237          columnNames.push_back(si.columnName(kColumn));
     238        }
     239        presolvedModel_->copyNames(rowNames,columnNames);
     240      }
    212241      // now clean up integer variables.  This can modify original
    213242      int i;
     
    355384  return originalColumn_;
    356385}
     386// return pointer to original rows
     387const int *
     388ClpPresolve::originalRows() const
     389{
     390  return originalRow_;
     391}
    357392// Set pointer to original model
    358393void
     
    477512#else
    478513    // normal
    479 #if 1
     514#if 0
     515    const bool slackd = true;
     516    const bool doubleton = false;
     517    const bool tripleton = true;
     518    const bool forcing = false;
     519    const bool ifree = true;
     520    const bool zerocost = true;
     521    const bool dupcol = false;
     522    const bool duprow = false;
     523    const bool dual = doDualStuff;
     524#else
    480525    const bool slackd = true;
    481526    const bool doubleton = true;
     
    487532    const bool duprow = true;
    488533    const bool dual = doDualStuff;
    489 #else
    490     const bool slackd = false;
    491     const bool doubleton = true;
    492     const bool forcing = true;
    493     const bool ifree = false;
    494     const bool zerocost = false;
    495     const bool dupcol = false;
    496     const bool duprow = false;
    497     const bool dual = false;
    498534#endif
    499535#endif
     
    10311067  rup_(new double[nrows_in]),
    10321068  originalColumn_(new int[ncols_in]),
     1069  originalRow_(new int[nrows_in]),
    10331070
    10341071  ztolzb_(getTolerance(si, ClpPrimalTolerance)),
     
    10501087  for (i=0;i<ncols_in;i++)
    10511088    originalColumn_[i]=i;
     1089  for (i=0;i<nrows_in;i++)
     1090    originalRow_[i]=i;
    10521091  sol_=NULL;
    10531092  rowduals_=NULL;
  • branches/pre/ClpPrimalColumnSteepest.cpp

    r212 r221  
    337337      printf("switching to devex %d nel ratio %g\n",numberElements,ratio);
    338338    }
    339     if (model_->numberIterations()%1000==0)
    340       printf("numels %d ratio %g wanted %d\n",numberElements,ratio,numberWanted);
     339    //if (model_->numberIterations()%1000==0)
     340    //printf("numels %d ratio %g wanted %d\n",numberElements,ratio,numberWanted);
    341341  }
    342342  if(switchType==4) {
     
    368368      updates->clear();
    369369    }
    370     if (model_->numberIterations()%1000==0)
    371       printf("numels %d ratio %g wanted %d\n",numberElements,ratio,numberWanted);
     370    //if (model_->numberIterations()%1000==0)
     371    //printf("numels %d ratio %g wanted %d\n",numberElements,ratio,numberWanted);
    372372  }
    373373  if (switchType<4) {
  • branches/pre/ClpSolve.cpp

    r220 r221  
    1616#include "ClpPackedMatrix.hpp"
    1717#include "ClpPlusMinusOneMatrix.hpp"
     18#include "ClpNetworkMatrix.hpp"
    1819#include "ClpMessage.hpp"
    1920#include "CoinTime.hpp"
     
    7172  int savePerturbation=perturbation_;
    7273  int saveScaling = scalingFlag_;
     74  if (dynamic_cast< ClpNetworkMatrix*>(matrix_)) {
     75    // network - switch off stuff
     76    presolve = ClpSolve::presolveOff;
     77  }
    7378
    7479  if (presolve!=ClpSolve::presolveOff) {
     
    175180    abort();
    176181  }
     182  if (dynamic_cast< ClpNetworkMatrix*>(matrix_)) {
     183    // network - switch off stuff
     184    doIdiot=0;
     185    doSprint=0;
     186  }
    177187  int numberColumns = model2->numberColumns();
    178188  int numberRows = model2->numberRows();
     
    243253      int nPasses=0;
    244254      Idiot info(*model2);
    245       // Get ratio of average number of elements per column to 5
    246       double ratio  = ((double) numberElements/(double) numberColumns)/5.0;
     255      // Get average number of elements per column
     256      double ratio  = ((double) numberElements/(double) numberColumns);
     257      // look at rhs
     258      int iRow;
     259      double largest=0.0;
     260      double smallest = 1.0e30;
     261      double largestGap=0.0;
     262      int numberNotE=0;
     263      for (iRow=0;iRow<numberRows;iRow++) {
     264        double value1 = model2->rowLower_[iRow];
     265        if (value1&&value1>-1.0e31) {
     266          largest = max(largest,fabs(value1));
     267          smallest=min(smallest,fabs(value1));
     268        }
     269        double value2 = model2->rowUpper_[iRow];
     270        if (value2&&value2<1.0e31) {
     271          largest = max(largest,fabs(value2));
     272          smallest=min(smallest,fabs(value2));
     273        }
     274        if (value2>value1) {
     275          numberNotE++;
     276          if (value2>1.0e31||value1<-1.0e31)
     277            largestGap = COIN_DBL_MAX;
     278          else
     279            largestGap = value2-value1;
     280        }
     281      }
    247282      if (numberRows>200&&numberColumns>5000&&numberColumns>2*numberRows) {
    248283        if (plusMinus) {
    249           // look at rhs
    250           int iRow;
    251           double largest=0.0;
    252           double smallest = 1.0e30;
    253           for (iRow=0;iRow<numberRows;iRow++) {
    254             double value;
    255             value = model2->rowLower_[iRow];
    256             if (value) {
    257               largest = max(largest,fabs(value));
    258               smallest=min(smallest,fabs(value));
    259             }
    260             value = model2->rowUpper_[iRow];
    261             if (value) {
    262               largest = max(largest,fabs(value));
    263               smallest=min(smallest,fabs(value));
    264             }
    265           }
    266284          if (largest/smallest>2.0) {
    267285            nPasses = 10+numberColumns/100000;
    268286            nPasses = min(nPasses,50);
    269287            nPasses = max(nPasses,15);
    270             if (numberElements<3*numberColumns)
    271               nPasses=10; // probably not worh it
    272             info.setLightweight(1); // say lightweight idiot
     288            if (numberRows>25000&&nPasses>5) {
     289              // Might as well go for it
     290              nPasses = max(nPasses,71);
     291            } else if (numberElements<3*numberColumns) {
     292              nPasses=min(nPasses,10); // probably not worh it
     293            }
     294            if (doIdiot<0)
     295              info.setLightweight(1); // say lightweight idiot
    273296          } else if (largest/smallest>1.01||numberElements<=3*numberColumns) {
    274297            nPasses = 10+numberColumns/1000;
    275298            nPasses = min(nPasses,100);
    276299            nPasses = max(nPasses,30);
     300            if (numberRows>25000) {
     301              // Might as well go for it
     302              nPasses = max(nPasses,71);
     303            }
     304            if (!largestGap)
     305              nPasses *= 2;
    277306          } else {
    278307            nPasses = 10+numberColumns/1000;
     
    281310            info.setStartingWeight(1.0e-1);
    282311            info.setReduceIterations(6);
     312            if (!largestGap)
     313              nPasses *= 2;
    283314            //info.setFeasibilityTolerance(1.0e-7);
    284315          }
     316          // If few passes - don't bother
     317          if (nPasses<=5)
     318            nPasses=0;
    285319        } else {
    286           nPasses = 10+numberColumns/100000;
    287           if (numberColumns>4*numberRows)
    288             nPasses = min(nPasses,50);
    289           else
    290             nPasses=5;
    291           info.setLightweight(1); // say lightweight idiot
    292           if (numberElements<3*numberColumns)
    293             nPasses=2; // probably not worh it
    294           else
     320          if (doIdiot<0)
     321            info.setLightweight(1); // say lightweight idiot
     322          if (largest/smallest>1.01||numberNotE) {
     323            if (numberRows>25000||numberColumns>5*numberRows) {
     324              nPasses = 50;
     325            } else if (numberColumns>4*numberRows) {
     326              nPasses = 20;
     327            } else {
     328              nPasses=5;
     329            }
     330          } else {
     331            if (numberRows>25000||numberColumns>5*numberRows) {
     332              nPasses = 50;
     333              info.setLightweight(0); // say not lightweight idiot
     334            } else if (numberColumns>4*numberRows) {
     335              nPasses = 20;
     336            } else {
     337              nPasses=15;
     338            }
     339          }
     340          if (numberElements<3*numberColumns) {
     341            nPasses=(int) ((2.0*(double) nPasses)/ratio); // probably not worh it
     342          } else {
    295343            nPasses = max(nPasses,5);
    296           nPasses = (int) (((double) nPasses)/ratio); // reduce if lots of elements per column
    297           if (nPasses<2)
     344            nPasses = (int) (((double) nPasses)*5.0/ratio); // reduce if lots of elements per column
     345          }
     346          if (numberRows>25000&&nPasses>5) {
     347            // Might as well go for it
     348            nPasses = max(nPasses,71);
     349          } else if (plusMinus) {
     350            nPasses *= 2;
     351            nPasses=min(nPasses,71);
     352          }
     353          if (nPasses<=5)
    298354            nPasses=0;
    299355          //info.setStartingWeight(1.0e-1);
     
    303359        // pick up number passes
    304360        nPasses=options.getExtraInfo(1);
    305         if (nPasses>70)
     361        if (nPasses>70) {
     362          info.setStartingWeight(1.0e3);
    306363          info.setReduceIterations(6);
     364        }
    307365      }
    308366      if (nPasses) {
     
    508566      double offset=0.0;
    509567      const double * objective = model2->objective();
    510       for (iColumn=0;iColumn<numberColumns_;iColumn++)
     568      for (iColumn=0;iColumn<numberColumns;iColumn++)
    511569        offset += fullSolution[iColumn]*objective[iColumn];
    512570      small.setDblParam(ClpObjOffset,originalOffset-offset);
     
    569627        <<numberNegative
    570628        <<CoinMessageEol;
    571       if ((small.objectiveValue()>lastObjective-1.0e-7&&iPass>5)||
     629      if ((small.objectiveValue()*optimizationDirection_>lastObjective-1.0e-7&&iPass>5)||
    572630          !small.numberIterations()||
    573631          iPass==maxPass-1||small.status()==3) {
     
    575633        break; // finished
    576634      } else {
    577         lastObjective = small.objectiveValue();
     635        lastObjective = small.objectiveValue()*optimizationDirection_;
    578636        // sort
    579637        CoinSort_2(weight,weight+numberColumns,sort);
     
    590648    delete [] whichRows;
    591649    if (saveLower) {
    592       // unperturb
    593       memcpy(model2->rowLower_,saveLower,numberRows*sizeof(double));
     650      // unperturb and clean
     651      for (iRow=0;iRow<numberRows;iRow++) {
     652        double diffLower = saveLower[iRow]-model2->rowLower_[iRow];
     653        double diffUpper = saveUpper[iRow]-model2->rowUpper_[iRow];
     654        model2->rowLower_[iRow]=saveLower[iRow];
     655        model2->rowUpper_[iRow]=saveUpper[iRow];
     656        if (diffLower)
     657          assert (!diffUpper||fabs(diffLower-diffUpper)<1.0e-5);
     658        else
     659          diffLower = diffUpper;
     660        model2->rowActivity_[iRow] += diffLower;
     661      }
    594662      delete [] saveLower;
    595       memcpy(model2->rowUpper_,saveUpper,numberRows*sizeof(double));
    596663      delete [] saveUpper;
    597664    }
    598     model2->primal(1);
     665    model2->primal(0);
    599666    model2->setPerturbation(savePerturbation);
    600667    time2 = CoinCpuTime();
  • branches/pre/INSTALL

    r2 r221  
    88(e.g., Linux-g).
    99
    10 To build Osi library and unitTest
     10To build Clp library and unitTest
    1111  - read and edit the top of Makefile to select
    1212      - whether shared or static library should be built
    1313      - optimization level
    1414      - where the compiled library should be installed
    15       - make sure SOLVERLIBS += libOsiClp is uncommented
    16         If you want to use the Volume Algorithm as a solver then first
    17         you must build and install libvol. See Vol/INSTALL in the COIN
    18         root directory.
    1915  - read and edit ../Common/make/Makefile.locations to uncomment Clp lines
    2016  - 'make' to build and install the library.
     
    2521    library and place them in doc/html.
    2622
    27 To run Osi unitTest
    28   - unitTest from Osi directory
     23To run Clp unitTest
     24  - clp -unitTest from Clp directory
     25To run Clp on netlib
     26  - clp -netlib from Clp directory (or -netlibp for primal).
    2927
    30 To build Clp executable (after Osi libraries)
     28To build Clp executable (after Clp libraries)
    3129  In This directory 'make unitTest'.  This actually creates and executable
    3230    clp in this directory which can both do unit test and act as simple
    3331    Clp driver
     32
     33Tuning information.  On Intel Linux I modified Makefiles/Makefile.Linux to add:
     34
     35ifeq ($(OptLevel),-O1)
     36     CXXFLAGS += -DNDEBUG
     37     CXXFLAGS += -ffast-math -fomit-frame-pointer
     38     CXXFLAGS += -march=i686
     39endif
     40
     41in Coin/Makefile I added the following to get dense code handling
     42
     43CXXFLAGS += -DDENSE_CODE=1
     44
     45and change Optimization level to -O1 (same level in Clp/Makefile.Clp).
     46
     47and finally in Clp/Test/Makefile.test I added
     48
     49#if DENSE and using given libraries
     50LDFLAGS += -llapack -lblas -lg2c
     51
     52If you have not got these libraries then leave out dense code flags
     53
    3454For more information see README and files in Samples
    3555
     56
  • branches/pre/Idiot.cpp

    r212 r221  
    355355  if ((strategy_&1024)!=0) reasonableInfeas=0.5*firstInfeas;
    356356  if (lastResult.infeas<reasonableInfeas) lastResult.infeas=reasonableInfeas;
     357  double keepinfeas=1.0e31;
     358  double lastInfeas=1.0e31;
     359  double bestInfeas=1.0e31;
    357360  while ((mu>stopMu&&lastResult.infeas>smallInfeas)||
    358361         (lastResult.infeas<=smallInfeas&&
    359362         dropping(lastResult,exitDrop,smallInfeas,&badIts))||
    360363         checkIteration<2||lambdaIteration<lambdaIterations_) {
    361     double keepinfeas;
    362364    if (lastResult.infeas<=exitFeasibility_)
    363365      break;
     
    410412    if (iteration>50&&n==numberAway&&result.infeas<1.0e-4)
    411413      break; // not much happening
     414    if (lightWeight_&&iteration>10&&result.infeas>1.0) {
     415      if (lastInfeas!=bestInfeas&&min(result.infeas,lastInfeas)>0.95*bestInfeas)
     416        break; // not getting feasible
     417    }
     418    bestInfeas=min(bestInfeas,result.infeas);
     419    lastInfeas = result.infeas;
    412420    numberAway=n;
    413421    keepinfeas = result.infeas;
     
    421429        iteration--;
    422430        memcpy(colsol,saveSol,ncols*sizeof(double));
    423         mu*=1.0e-1;
     431        if (majorIterations_<50)
     432          mu*=1.0e-1;
     433        else
     434          mu*=0.7;
    424435        bestFeasible=1.0e31;
    425436        bestWeighted=1.0e60;
  • branches/pre/Makefile.Clp

    r217 r221  
    77# between then specify the exact level you want, e.g., -O1 or -O2
    88OptLevel := -g
    9 #OptLevel := -O1
     9OptLevel := -O1
    1010
    1111LIBNAME := Clp
  • branches/pre/README

    r102 r221  
    11To build Clp see INSTALL file
    22
    3 To use Clp you need the Clp and Osi libraries
     3To use Clp you need the Clp and Coin libraries
    44
    55To make the unitTest and standalone executable do
     
    2626
    2727There are samples in ./Samples.  Use the corresponding Makefile to
    28 create an executable - testit.
     28create an executable - testit.  For later ones do "make DRIVER=sprint" etc.
    2929
    3030At present there are only three useful samples.
  • branches/pre/Samples/Makefile.volume

    r139 r221  
    6060endif
    6161#LDFLAGS += -lefence
     62#if DENSE and using given libraries
     63LDFLAGS += -llapack -lblas -lg2c
    6264LDFLAGS += -lVol
    6365###############################################################################
  • branches/pre/Samples/useVolume.cpp

    r180 r221  
    211211    }
    212212  }
     213#if 0
    213214  FILE* infile = fopen("parameters", "r");
    214215  if (!infile) {
     
    217218    volprob.read_params("parameters");
    218219  }
    219 
     220#endif
     221  // should save and restore
     222  model.tightenPrimalBounds();
    220223  lpHook myHook(model.getColLower(), model.getColUpper(),
    221224                model.getObjCoefficients(),
     
    259262  // solve
    260263  model.dual(1);
     264  //model.primal(1);
    261265#ifdef MODIFYCOSTS
    262266  memcpy(model.objective(),saveObj,numberColumns*sizeof(double));
  • branches/pre/Test/ClpMain.cpp

    r217 r221  
    870870    std::string saveFile ="default.prob";
    871871    std::string restoreFile ="default.prob";
    872     std::string solutionFile ="default.sol";
     872    std::string solutionFile ="stdout";
    873873#define MAXPARAMETERS 100
    874874    ClpItem parameters[MAXPARAMETERS];
     
    899899      (
    900900       "If crash is set on and there is an all slack basis then Clp will put structural\
    901 variables into basis with the aim of getting dual feasible.  On the whole dual seems to be\
    902 better without it and there alernative types of 'crash' for primal e.g. 'idiot' or 'sprint'."
     901 variables into basis with the aim of getting dual feasible.  On the whole dual seems to be\
     902 better without it and there alernative types of 'crash' for primal e.g. 'idiot' or 'sprint'."
    903903       );
    904904    parameters[numberParameters++]=
     
    10641064    parameters[numberParameters-1].setLonghelp
    10651065      (
    1066        ""
     1066       "If this is at its default value of 200 then in this executable clp will guess at a\
     1067 value to use.  Otherwise the user can set a value.  The code may decide to re-factorize\
     1068 earlier."
    10671069       );
    10681070    parameters[numberParameters-1].setIntValue(models->factorizationFrequency());
     
    10731075    parameters[numberParameters-1].setLonghelp
    10741076      (
    1075        ""
     1077       "This can be used for testing purposes.  The corresponding library call\n\
     1078      \tsetMaximumIterations(value)\n can be useful.  If the code stops on\
     1079 seconds or by an interrupt this will be treated as stopping on maximum iterations"
    10761080       );
    10771081    parameters[numberParameters-1].setIntValue(models->maximumIterations());
     
    11571161    parameters[numberParameters-1].setLonghelp
    11581162      (
    1159        ""
     1163       "Presolve analyzes the model to find such things as redundant equations, equations\
     1164 which fix some variables, equations which can be transformed into bounds etc etc.  For the\
     1165 initial solve of any problem this is worth doing unless you know that it will have no effect."
    11601166       );
    11611167    parameters[numberParameters++]=
     
    11691175    parameters[numberParameters-1].setLonghelp
    11701176      (
    1171        ""
     1177       "Clp can use any pivot selection algorithm which the user codes as long as it\
     1178 implements the features in the abstract pivot base class.  The Dantzig method is implemented\
     1179 to show a simple method but its use is deprecated.  Exact devex is the method of choice and there\
     1180 are two variants which keep all weights updated but only scan a subset each iteration.\
     1181 Partial switches this on while change initially does dantzig until the factorization\
     1182 becomes denser.  This is still a work in progress."
    11721183       );
    11731184    parameters[numberParameters++]=
     
    11761187    parameters[numberParameters-1].setLonghelp
    11771188      (
    1178        ""
     1189       "This command solves the current model using the primal algorithm.\
     1190  The default is to use exact devex.\
     1191 The time and iterations may be affected by settings such as presolve, scaling, crash\
     1192 and also by column selection  method, infeasibility weight and dual and primal tolerances."
    11791193       );
    11801194    parameters[numberParameters++]=
     
    11841198    parameters[numberParameters-1].setLonghelp
    11851199      (
    1186        ""
     1200       "Normally the default tolerance is fine, but you may want to increase it a\
     1201 bit if a primal run seems to be having a hard time"
    11871202       );
    11881203    parameters[numberParameters-1].setDoubleValue(models->primalTolerance());
     
    11931208    parameters[numberParameters-1].setLonghelp
    11941209      (
    1195        ""
     1210       "The primal algorithm in Clp is a single phase algorithm as opposed to a two phase\
     1211 algorithm where you first get feasible then optimal.  So Clp is minimizing this weight times\
     1212 the sum of primal infeasibilities plus the true objective function (in minimization sense).\
     1213  Too high a value may mean more iterations, while too low a bound means\
     1214 the code may go all the way and then have to increase the weight in order to get feasible.\
     1215  OSL had a heuristic to\
     1216 adjust bounds, maybe we need that here."
    11961217       );
    11971218    parameters[numberParameters-1].setDoubleValue(models->infeasibilityCost());
     
    12081229    parameters[numberParameters-1].setLonghelp
    12091230      (
    1210        "This will write an MPS format file to the given file name.  It will use the default\
     1231       "This reads data save by saveModel from the given file.  It will use the default\
    12111232 directory given by 'directory'.  A name of '$' will use the previous value for the name.  This\
    1212  is initialized to 'default.mps'."
    1213        ""
     1233 is initialized to 'default.prob'."
    12141234       );
    12151235    parameters[numberParameters-1].setStringValue(restoreFile);
     
    12261246    parameters[numberParameters-1].setLonghelp
    12271247      (
    1228        "This will write an MPS format file to the given file name.  It will use the default\
     1248       "This will save the problem to the given file name for future use\
     1249 by restoreModel.  It will use the default\
    12291250 directory given by 'directory'.  A name of '$' will use the previous value for the name.  This\
    1230  is initialized to 'default.mps'."
    1231        ""
     1251 is initialized to 'default.prob'."
    12321252       );
    12331253    parameters[numberParameters-1].setStringValue(saveFile);
     
    12401260    parameters[numberParameters-1].setLonghelp
    12411261      (
    1242        ""
     1262       "Scaling can help in solving problems which might otherwise fail because of lack of\
     1263 accuracy.  It can also reduce the number of iterations.  It is not applied if the range\
     1264 of elements is small.  When unscaled it is possible that there may be small primal and/or\
     1265 infeasibilities."
    12431266       );
    12441267    parameters[numberParameters++]=
     
    12471270    parameters[numberParameters-1].setLonghelp
    12481271      (
    1249        ""
     1272       "After this many seconds clp will act as if maximum iterations had been reached.\
     1273  In this program it is really only useful for testing but the library function\n\
     1274      \tsetMaximumSeconds(value)\n can be useful."
    12501275       );
    12511276    parameters[numberParameters-1].setDoubleValue(models->maximumSeconds());
     
    12551280    parameters[numberParameters-1].setLonghelp
    12561281      (
    1257        "This will write an MPS format file to the given file name.  It will use the default\
     1282       "This will write a primitive solution file to the given file name.  It will use the default\
    12581283 directory given by 'directory'.  A name of '$' will use the previous value for the name.  This\
    1259  is initialized to 'default.mps'."
    1260        ""
     1284 is initialized to 'stdout'."
    12611285       );
    12621286    parameters[numberParameters-1].setStringValue(solutionFile);
     
    12681292    parameters[numberParameters++]=
    12691293      ClpItem("sprint!Crash","Whether to try sprint crash",
    1270               0,200,SPRINT);
    1271     parameters[numberParameters-1].setLonghelp
    1272       (
    1273        ""
     1294              -1,500,SPRINT);
     1295    parameters[numberParameters-1].setLonghelp
     1296      (
     1297       "For long and thin problems this program may solve a series of small problems\
     1298 created by taking a subset of the columns.  I introduced the idea as 'Sprint' after\
     1299 an LP code of that name of the 60's which tried the same tactic (not totally successfully).\
     1300  Cplex calls it 'sifting'.  -1 is automatic choice, 0 is off, n is number of passes"
    12741301       );
    12751302    parameters[numberParameters-1].setIntValue(doSprint);
     
    13711398          std::cout<<"One command per line (and no -)"<<std::endl;
    13721399          std::cout<<"abcd? gives list of possibilities, if only one + explanation"<<std::endl;
    1373           std::cout<<"abcd?? adds explanation, if only one fuller help(LATER)"<<std::endl;
     1400          std::cout<<"abcd?? adds explanation, if only one fuller help"<<std::endl;
    13741401          std::cout<<"abcd without value (where expected) gives current value"<<std::endl;
    13751402          std::cout<<"abcd value sets value"<<std::endl;
     
    18031830                // Pass in array saying if each variable integer
    18041831                writer.copyInIntegerInformation(model2->integerInformation());
    1805                 writer.writeMps(fileName.c_str());
     1832                writer.writeMps(fileName.c_str(),0,0,1);
    18061833                if (rowNames) {
    18071834                  for (iRow=0;iRow<numberRows;iRow++) {
     
    21032130              std::string fileName;
    21042131              FILE *fp=NULL;
    2105               if (field=="-"||field=="EOL") {
     2132              if (field=="-"||field=="EOL"||field=="stdout") {
    21062133                // stdout
    21072134                fp=stdout;
     2135              } else if (field=="stderr") {
     2136                // stderr
     2137                fp=stderr;
    21082138              } else {
    21092139                if (field[0]=='/'||field[0]=='~')
  • branches/pre/Test/Makefile.test

    r214 r221  
    6969#if DENSE and using given libraries
    7070LDFLAGS += -llapack -lblas -lg2c
    71 
     71#LDFLAGS += -Wl,-M
    7272###############################################################################
    7373
  • branches/pre/include/ClpModel.hpp

    r210 r221  
    165165  /// Drops names - makes lengthnames 0 and names empty
    166166  void dropNames();
     167  /// Copies in names
     168  void copyNames(std::vector<std::string> & rowNames,
     169                 std::vector<std::string> & columnNames);
    167170 
    168171  //@}
  • branches/pre/include/ClpPresolve.hpp

    r181 r221  
    7777  /// return pointer to original columns
    7878  const int * originalColumns() const;
     79  /// return pointer to original rows
     80  const int * originalRows() const;
    7981  /** "Magic" number. If this is non-zero then any elements with this value
    8082      may change and so presolve is very limited in what can be done
     
    111113  /// Original column numbers
    112114  int * originalColumn_;
     115  /// Original row numbers
     116  int * originalRow_;
    113117  /// The list of transformations applied.
    114118  const CoinPresolveAction *paction_;
Note: See TracChangeset for help on using the changeset viewer.