source: trunk/Cbc/src/unitTestClp.cpp @ 1132

Last change on this file since 1132 was 1132, checked in by forrest, 11 years ago

chnages to try and make faster

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 19.6 KB
Line 
1// Copyright (C) 2002, International Business Machines
2// Corporation and others.  All Rights Reserved.
3
4#include <cstdio>
5#include <string>
6#include <iostream>
7
8#include "CoinTime.hpp"
9#include "CbcModel.hpp"
10#include "CbcCutGenerator.hpp"
11#include "CbcBranchCut.hpp"
12#include "CglProbing.hpp"
13#include "OsiClpSolverInterface.hpp"
14#include "ClpFactorization.hpp"
15#include "OsiRowCutDebugger.hpp"
16//#############################################################################
17
18#ifdef NDEBUG
19#undef NDEBUG
20#endif
21
22//#############################################################################
23
24// Display message on stdout and stderr
25void testingMessage( const char * const msg )
26{
27  std::cout <<msg;
28  //cout <<endl <<"*****************************************"
29  //     <<endl <<msg <<endl;
30}
31
32//#############################################################################
33
34static inline bool CbcTestFile(const std::string name)
35{
36  FILE *fp = fopen(name.c_str(),"r");
37  if (fp) {
38    fclose(fp);
39    return true;
40  }
41  return false;
42}
43
44//#############################################################################
45
46bool CbcTestMpsFile(std::string& fname)
47{
48  if (CbcTestFile(fname)) {
49    return true;
50  }
51  if (CbcTestFile(fname+".mps")) {
52    fname += ".mps";
53    return true;
54  }
55  if (CbcTestFile(fname+".MPS")) {
56    fname += ".MPS";
57    return true;
58  }
59#ifdef COIN_HAS_ZLIB
60  if (CbcTestFile(fname+".gz")) {
61    return true;
62  }
63  if (CbcTestFile(fname+".mps.gz")) {
64    fname += ".mps";
65    return true;
66  }
67  if (CbcTestFile(fname+".MPS.gz")) {
68    fname += ".MPS";
69    return true;
70  }
71  if (CbcTestFile(fname+".MPS.GZ")) {
72    fname += ".MPS";
73    return true;
74  }
75#endif
76  return false;
77}
78
79//#############################################################################
80
81int CbcClpUnitTest (const CbcModel & saveModel, std::string& dirMiplib,
82                    bool unitTestOnly,
83                    double * stuff)
84{
85  // Stop Windows popup
86  WindowsErrorPopupBlocker();
87  unsigned int m ;
88
89  // Set directory containing miplib data files.
90  std::string test1 = dirMiplib +"p0033";
91  // See if files exist
92  bool doTest=CbcTestMpsFile(test1);
93
94  if (!doTest) {
95    printf("Not doing miplib run as can't find mps files - ? .gz without libz\n");
96    return -1;
97  }
98  /*
99    Vectors to hold test problem names and characteristics. The objective value
100    after optimization (objValue) must agree to the specified tolerance
101    (objValueTol).
102  */
103  std::vector<std::string> mpsName ;
104  std::vector<int> nRows ;
105  std::vector<int> nCols ;
106  std::vector<double> objValueC ;
107  std::vector<double> objValue ;
108  std::vector<int> strategy ;
109  /*
110    And a macro to make the vector creation marginally readable.
111  */
112#define PUSH_MPS(zz_mpsName_zz,\
113                 zz_nRows_zz,zz_nCols_zz,zz_objValue_zz,zz_objValueC_zz, \
114                 zz_strategy_zz) \
115  mpsName.push_back(zz_mpsName_zz) ; \
116  nRows.push_back(zz_nRows_zz) ; \
117  nCols.push_back(zz_nCols_zz) ; \
118  objValueC.push_back(zz_objValueC_zz) ; \
119  strategy.push_back(zz_strategy_zz) ; \
120  objValue.push_back(zz_objValue_zz) ;
121
122  if (unitTestOnly) {
123    PUSH_MPS("p0033",16,33,3089,2520.57,7);
124    PUSH_MPS("p0201",133,201,7615,6875.0,7);
125  } else {
126    /*
127      Load up the problem vector. Note that the row counts here include the
128      objective function.
129    */
130    // 0 for no test, 1 for some, 2 for many, 3 for all
131    //PUSH_MPS("blend2",274,353,7.598985,6.9156751140,7);
132    //PUSH_MPS("p2756",755,2756,3124,2688.75,7);
133    //PUSH_MPS("seymour_1",4944,1372,410.7637014,404.35152,7);
134    //PUSH_MPS("enigma",21,100,0.0,0.0,7);
135    //PUSH_MPS("misc03",96,160,3360,1910.,7);
136    //PUSH_MPS("p0201",133,201,7615,6875.0,7);
137#define HOWMANY 2
138#if HOWMANY
139#if HOWMANY>1
140    PUSH_MPS("10teams",230,2025,924,917,7);
141#endif
142    PUSH_MPS("air03",124,10757,340160,338864.25,7);
143#if HOWMANY>2
144    PUSH_MPS("air04",823,8904,56137,55535.436,8);
145    PUSH_MPS("air05",426,7195,26374,25877.609,8);
146#endif
147  //    PUSH_MPS("arki001",1048,1388,7580813.0459,7579599.80787,7);
148    PUSH_MPS("bell3a",123,133,878430.32,862578.64,7);
149#if HOWMANY>1
150    PUSH_MPS("bell5",91,104,8966406.49,8608417.95,7);
151#endif
152    PUSH_MPS("blend2",274,353,7.598985,6.9156751140,7);
153#if HOWMANY>1
154    PUSH_MPS("cap6000",2176,6000,-2451377,-2451537.325,7);
155#endif
156    //    PUSH_MPS("dano3mip",3202,13873,728.1111,576.23162474,7);
157    //PUSH_MPS("danoint",664,521,65.67,62.637280418,7);
158    PUSH_MPS("dcmulti",290,548,188182,183975.5397,7);
159    PUSH_MPS("dsbmip",1182,1886,-305.19817501,-305.19817501,7);
160    PUSH_MPS("egout",98,141,568.101,149.589,7);
161    PUSH_MPS("enigma",21,100,0.0,0.0,7);
162#if HOWMANY>3
163    PUSH_MPS("fast0507",507,63009,174,172.14556668,7);
164#endif
165    PUSH_MPS("fiber",363,1298,405935.18000,156082.51759,7);
166#if HOWMANY>1
167    PUSH_MPS("fixnet6",478,878,3983,1200.88,7);
168#endif
169    PUSH_MPS("flugpl",18,18,1201500,1167185.7,7);
170    PUSH_MPS("gen",780,870,112313,112130.0,7);
171#if HOWMANY>1
172    PUSH_MPS("gesa2",1392,1224,25779856.372,25476489.678,7);
173    PUSH_MPS("gesa2_o",1248,1224,25779856.372,25476489.678,7);
174#endif
175    PUSH_MPS("gesa3",1368,1152,27991042.648,27833632.451,7);
176    PUSH_MPS("gesa3_o",1224,1152,27991042.648,27833632.451,7);
177    PUSH_MPS("gt2",29,188,21166.000,13460.233074,7);
178#if HOWMANY>2
179    PUSH_MPS("harp2",112,2993,-73899798.00,-74353341.502,7);
180#endif
181    PUSH_MPS("khb05250",101,1350,106940226,95919464.0,7);
182#if HOWMANY>1
183    PUSH_MPS("l152lav",97,1989,4722,4656.36,7);
184#endif
185    PUSH_MPS("lseu",28,89,1120,834.68,7);
186    PUSH_MPS("misc03",96,160,3360,1910.,7);
187    PUSH_MPS("misc06",820,1808,12850.8607,12841.6,7);
188#if HOWMANY>1
189    PUSH_MPS("misc07",212,260,2810,1415.0,7);
190    PUSH_MPS("mitre",2054,10724,115155,114740.5184,7);
191#endif
192    PUSH_MPS("mod008",6,319,307,290.9,7);
193    PUSH_MPS("mod010",146,2655,6548,6532.08,7);
194#if HOWMANY>2
195    PUSH_MPS("mod011",4480,10958,-54558535,-62121982.55,7);
196    PUSH_MPS("modglob",291,422,20740508,20430947.,7);
197#endif
198#if HOWMANY>3
199    PUSH_MPS("noswot",182,128,-43,-43.0,7);
200#endif
201#if HOWMANY>1
202    PUSH_MPS("nw04",36,87482,16862,16310.66667,7);
203#endif
204    PUSH_MPS("p0033",16,33,3089,2520.57,7);
205    PUSH_MPS("p0201",133,201,7615,6875.0,7);
206    PUSH_MPS("p0282",241,282,258411,176867.50,7);
207    PUSH_MPS("p0548",176,548,8691,315.29,7);
208    PUSH_MPS("p2756",755,2756,3124,2688.75,7);
209#if HOWMANY>2
210    PUSH_MPS("pk1",45,86,11.0,0.0,7);
211#endif
212#if HOWMANY>1
213    PUSH_MPS("pp08a",136,240,7350.0,2748.3452381,7);
214    PUSH_MPS("pp08aCUTS",246,240,7350.0,5480.6061563,7);
215#endif
216#if HOWMANY>2
217    PUSH_MPS("qiu",1192,840,-132.873137,-931.638857,7);
218#endif
219    PUSH_MPS("qnet1",503,1541,16029.692681,14274.102667,7);
220    PUSH_MPS("qnet1_o",456,1541,16029.692681,12095.571667,7);
221    PUSH_MPS("rentacar",6803,9557,30356761,28806137.644,7);
222    PUSH_MPS("rgn",24,180,82.1999,48.7999,7);
223#if HOWMANY>3
224    PUSH_MPS("rout",291,556,1077.56,981.86428571,7);
225    PUSH_MPS("set1ch",492,712,54537.75,32007.73,7);
226#endif
227    //    PUSH_MPS("seymour",4944,1372,423,403.84647413,7);
228    PUSH_MPS("stein27",118,27,18,13.0,7);
229#if HOWMANY>1
230    PUSH_MPS("stein45",331,45,30,22.0,7);
231#endif
232    PUSH_MPS("vpm1",234,378,20,15.4167,7);
233    PUSH_MPS("vpm2",234,378,13.75,9.8892645972,7);
234#endif
235  }
236#undef PUSH_MPS
237   
238  int numProbSolved = 0;
239  double timeTaken=0.0;
240  //#define CLP_FACTORIZATION_INSTRUMENT
241#ifdef CLP_FACTORIZATION_INSTRUMENT
242  double timeTakenFac=0.0;
243#endif
244  int numberFailures=0;
245 
246  /*
247    Open the main loop to step through the MPS problems.
248  */
249  for (m = 0 ; m < mpsName.size() ; m++) {
250    std::cout << "  processing mps file: " << mpsName[m] 
251              << " (" << m+1 << " out of " << mpsName.size() << ")\n";
252    /*
253      Stage 1: Read the MPS
254      and make sure the size of the constraint matrix is correct.
255    */
256    CbcModel * model = new CbcModel(saveModel);
257     
258    std::string fn = dirMiplib+mpsName[m] ;
259    if (!CbcTestMpsFile(fn)) {
260      std::cout << "ERROR: Cannot find MPS file " << fn << "\n";
261      continue;
262    }
263    model->solver()->readMps(fn.c_str(),"") ;
264    assert(model->getNumRows() == nRows[m]) ;
265    assert(model->getNumCols() == nCols[m]) ;
266
267    /*
268      Stage 2: Call solver to solve the problem.
269      then check the return code and objective.
270    */
271
272#ifdef CLP_FACTORIZATION_INSTRUMENT
273    extern double factorization_instrument(int type);
274    double facTime1=factorization_instrument(0);
275    printf("Factorization - initial solve %g seconds\n",
276           facTime1);
277    timeTakenFac += facTime1;
278#endif
279    double startTime = CoinCpuTime()+CoinCpuTimeJustChildren();
280    if (model->getMaximumNodes()>200000) {
281      model->setMaximumNodes(200000);
282    }
283    OsiClpSolverInterface * si =
284      dynamic_cast<OsiClpSolverInterface *>(model->solver()) ;
285    ClpSimplex * modelC = NULL;
286    if (si) {
287      // get clp itself
288      modelC = si->getModelPtr();
289      if (stuff&&stuff[9]) {
290        // vector matrix!
291        ClpMatrixBase * matrix = modelC->clpMatrix();
292        if (dynamic_cast< ClpPackedMatrix*>(matrix)) {
293          ClpPackedMatrix * clpMatrix = dynamic_cast< ClpPackedMatrix*>(matrix);
294          clpMatrix->makeSpecialColumnCopy();
295        }
296      }
297      modelC->tightenPrimalBounds(0.0,0,true);
298      model->initialSolve();
299      if (modelC->dualBound()==1.0e10) {
300        // user did not set - so modify
301        // get largest scaled away from bound
302        ClpSimplex temp=*modelC;
303        temp.dual(0,7);
304        double largestScaled=1.0e-12;
305        double largest=1.0e-12;
306        int numberRows = temp.numberRows();
307        const double * rowPrimal = temp.primalRowSolution();
308        const double * rowLower = temp.rowLower();
309        const double * rowUpper = temp.rowUpper();
310        const double * rowScale = temp.rowScale();
311        int iRow;
312        for (iRow=0;iRow<numberRows;iRow++) {
313          double value = rowPrimal[iRow];
314          double above = value-rowLower[iRow];
315          double below = rowUpper[iRow]-value;
316          if (above<1.0e12) {
317            largest = CoinMax(largest,above);
318          }
319          if (below<1.0e12) {
320            largest = CoinMax(largest,below);
321          }
322          if (rowScale) {
323            double multiplier = rowScale[iRow];
324            above *= multiplier;
325            below *= multiplier;
326          }
327          if (above<1.0e12) {
328            largestScaled = CoinMax(largestScaled,above);
329          }
330          if (below<1.0e12) {
331            largestScaled = CoinMax(largestScaled,below);
332          }
333        }
334       
335        int numberColumns = temp.numberColumns();
336        const double * columnPrimal = temp.primalColumnSolution();
337        const double * columnLower = temp.columnLower();
338        const double * columnUpper = temp.columnUpper();
339        const double * columnScale = temp.columnScale();
340        int iColumn;
341        for (iColumn=0;iColumn<numberColumns;iColumn++) {
342          double value = columnPrimal[iColumn];
343          double above = value-columnLower[iColumn];
344          double below = columnUpper[iColumn]-value;
345          if (above<1.0e12) {
346            largest = CoinMax(largest,above);
347          }
348          if (below<1.0e12) {
349            largest = CoinMax(largest,below);
350          }
351          if (columnScale) {
352            double multiplier = 1.0/columnScale[iColumn];
353            above *= multiplier;
354            below *= multiplier;
355          }
356          if (above<1.0e12) {
357            largestScaled = CoinMax(largestScaled,above);
358          }
359          if (below<1.0e12) {
360            largestScaled = CoinMax(largestScaled,below);
361          }
362        }
363        std::cout<<"Largest (scaled) away from bound "<<largestScaled
364                 <<" unscaled "<<largest<<std::endl;
365#if 1
366        modelC->setDualBound(CoinMax(1.0001e8,
367                                     CoinMin(1000.0*largestScaled,1.00001e10)));
368#else
369        modelC->setDualBound(CoinMax(1.0001e9,
370                                     CoinMin(1000.0*largestScaled,1.e10)));
371#endif
372      }
373    }
374    model->setMinimumDrop(CoinMin(5.0e-2,
375                              fabs(model->getMinimizationObjValue())*1.0e-3+1.0e-4));
376    if (CoinAbs(model->getMaximumCutPassesAtRoot())<=100) {
377      if (model->getNumCols()<500) {
378        model->setMaximumCutPassesAtRoot(-100); // always do 100 if possible
379      } else if (model->getNumCols()<5000) {
380        model->setMaximumCutPassesAtRoot(100); // use minimum drop
381      } else {
382        model->setMaximumCutPassesAtRoot(20);
383      }
384    }
385    // If defaults then increase trust for small models
386    if (model->numberStrong()==5&&model->numberBeforeTrust()==10) {
387      int numberColumns = model->getNumCols();
388      if (numberColumns<=50) {
389        model->setNumberBeforeTrust(1000);
390      } else if (numberColumns<=100) {
391        model->setNumberBeforeTrust(100);
392      } else if (numberColumns<=300) {
393        model->setNumberBeforeTrust(50);
394      }
395    }
396    //if (model->getNumCols()>=500) {
397      // switch off Clp stuff
398      //model->setFastNodeDepth(-1);
399    //}
400    if (model->getNumCols()==-2756) {
401      // p2756
402      std::string problemName ;
403      model->solver()->getStrParam(OsiProbName,problemName) ;
404      model->solver()->activateRowCutDebugger(problemName.c_str()) ;
405    }
406    if (model->getNumCols()==-201) {
407      // p201
408      std::string problemName ;
409      model->solver()->getStrParam(OsiProbName,problemName) ;
410      model->solver()->activateRowCutDebugger(problemName.c_str()) ;
411    }
412    if (model->getNumCols()==-104) {
413      // bell5
414      std::string problemName ;
415      model->solver()->getStrParam(OsiProbName,problemName) ;
416      model->solver()->activateRowCutDebugger(problemName.c_str()) ;
417    }
418    if (model->getNumCols()==-548&&model->getNumRows()==176) {
419      // p0548
420      std::string problemName ;
421      model->solver()->getStrParam(OsiProbName,problemName) ;
422      model->solver()->activateRowCutDebugger(problemName.c_str()) ;
423    }
424    if (model->getNumCols()==-160) {
425      // misc03
426      std::string problemName ;
427      model->solver()->getStrParam(OsiProbName,problemName) ;
428      model->solver()->activateRowCutDebugger(problemName.c_str()) ;
429    }
430    if (model->getNumCols()==-353) {
431      // blend2
432      std::string problemName ;
433      model->solver()->getStrParam(OsiProbName,problemName) ;
434      model->solver()->activateRowCutDebugger(problemName.c_str()) ;
435    }
436    if (model->getNumCols()==-100&&model->getNumRows()==21) {
437      // enigma
438      std::string problemName ;
439      model->solver()->getStrParam(OsiProbName,problemName) ;
440      model->solver()->activateRowCutDebugger(problemName.c_str()) ;
441    }
442    if (model->getNumCols()==-1541) {
443      // qnet1
444      std::string problemName ;
445      model->solver()->getStrParam(OsiProbName,problemName) ;
446      model->solver()->activateRowCutDebugger(problemName.c_str()) ;
447    }
448    if (model->getNumCols()==-10724) {
449      // mitre
450      std::string problemName ;
451      model->solver()->getStrParam(OsiProbName,problemName) ;
452      model->solver()->activateRowCutDebugger(problemName.c_str()) ;
453    }
454    if (model->getNumCols()==-1224) {
455      //PUSH_MPS("gesa2",1392,1224,25779856.372,25476489.678,7);
456      // gesa2
457      std::string problemName ;
458      model->solver()->getStrParam(OsiProbName,problemName) ;
459      model->solver()->activateRowCutDebugger(problemName.c_str()) ;
460    }
461    if (model->getNumCols()==-282) {
462      //PUSH_MPS("p0282",241,282,258411,176867.50,7);
463      // p0282
464      std::string problemName ;
465      model->solver()->getStrParam(OsiProbName,problemName) ;
466      model->solver()->activateRowCutDebugger(problemName.c_str()) ;
467    }
468    if (model->getNumCols()==-141) {
469      // egout
470      std::string problemName ;
471      model->solver()->getStrParam(OsiProbName,problemName) ;
472      model->solver()->activateRowCutDebugger(problemName.c_str()) ;
473    }
474    if (model->getNumCols()==-378) {
475      // vpm2
476      std::string problemName ;
477      model->solver()->getStrParam(OsiProbName,problemName) ;
478      model->solver()->activateRowCutDebugger(problemName.c_str()) ;
479    }
480    if (model->getNumCols()==-240&&model->getNumRows()==246) {
481      // pp08aCUTS
482      std::string problemName ;
483      model->solver()->getStrParam(OsiProbName,problemName) ;
484      model->solver()->activateRowCutDebugger(problemName.c_str()) ;
485    }
486    if (model->getNumCols()==-240&&model->getNumRows()==136) {
487      // pp08a
488      std::string problemName ;
489      model->solver()->getStrParam(OsiProbName,problemName) ;
490      model->solver()->activateRowCutDebugger(problemName.c_str()) ;
491    }
492    if (model->getNumCols()==-1372&&model->getNumRows()==4944) {
493      // seymour1
494      std::string problemName ;
495      model->solver()->getStrParam(OsiProbName,problemName) ;
496      model->solver()->activateRowCutDebugger(problemName.c_str()) ;
497    }
498    setCutAndHeuristicOptions(*model);
499    if (si) {
500#ifdef CLP_MULTIPLE_FACTORIZATIONS   
501      int denseCode = stuff ? static_cast<int> (stuff[4]) : -1;
502      int smallCode = stuff ? static_cast<int> (stuff[10]) : -1;
503      if (stuff&&stuff[8]>=1) {
504        if (denseCode<0)
505          denseCode=40;
506        if (smallCode<0)
507          smallCode=40;
508      }
509      if (denseCode>0)
510        modelC->factorization()->setGoDenseThreshold(denseCode);
511      if (smallCode>0)
512        modelC->factorization()->setGoSmallThreshold(smallCode);
513      if (denseCode>=modelC->numberRows()) {
514        //printf("problem going dense\n");
515        //modelC->factorization()->goDenseOrSmall(modelC->numberRows());
516      }
517#endif
518      if (stuff&&stuff[8]>=1) {
519        if (modelC->numberColumns()+modelC->numberRows()<=500&&
520            model->fastNodeDepth()==-1) 
521          model->setFastNodeDepth(-12);
522      }
523    }
524    //OsiObject * obj = new CbcBranchToFixLots(model,0.3,0.0,3,3000003);
525    //model->addObjects(1,&obj);
526    //delete obj;
527    model->branchAndBound();
528#ifdef CLP_FACTORIZATION_INSTRUMENT
529    double facTime=factorization_instrument(0);
530    printf("Factorization %g seconds\n",
531           facTime);
532    timeTakenFac += facTime;
533#endif
534     
535    double timeOfSolution = CoinCpuTime()+CoinCpuTimeJustChildren()-startTime;
536    // Print more statistics
537    std::cout<<"Cuts at root node changed objective from "<<model->getContinuousObjective()
538             <<" to "<<model->rootObjectiveAfterCuts()<<std::endl;
539    int numberGenerators = model->numberCutGenerators();
540    for (int iGenerator=0;iGenerator<numberGenerators;iGenerator++) {
541      CbcCutGenerator * generator = model->cutGenerator(iGenerator);
542#ifndef CLP_INVESTIGATE
543      CglImplication * implication = dynamic_cast<CglImplication*>(generator->generator());
544      if (implication)
545        continue;
546#endif
547      std::cout<<generator->cutGeneratorName()<<" was tried "
548               <<generator->numberTimesEntered()<<" times and created "
549               <<generator->numberCutsInTotal()<<" cuts of which "
550               <<generator->numberCutsActive()<<" were active after adding rounds of cuts";
551      if (generator->timing())
552        std::cout<<" ( "<<generator->timeInCutGenerator()<<" seconds)"<<std::endl;
553      else
554        std::cout<<std::endl;
555    }
556    if (!model->status()) { 
557      double soln = model->getObjValue(); 
558      double tolerance = CoinMax(1.0e-5,1.0e-5*CoinMin(fabs(soln),fabs(objValue[m])));
559      //CoinRelFltEq eq(1.0e-3) ;
560      if (fabs(soln-objValue[m])<tolerance) { 
561        std::cout
562          <<"cbc_clp"<<" "
563          << soln << " = " << objValue[m] << " ; okay";
564        numProbSolved++;
565      } else  { 
566        std::cout <<"cbc_clp" <<" " <<soln << " != " <<objValue[m]
567                  << "; error=" << fabs(objValue[m] - soln); 
568        numberFailures++;
569        //#ifdef COIN_DEVELOP
570        //abort();
571        //#endif
572      }
573    } else {
574      std::cout << "error; too many nodes" ;
575    }
576    timeTaken += timeOfSolution;
577    std::cout<<" - took " <<timeOfSolution<<" seconds.("<<
578      model->getNodeCount()<<" / "<<model->getIterationCount()<<
579      " ) subtotal "<<timeTaken<<std::endl;
580    delete model;
581  }
582  int returnCode=0;
583  std::cout
584    <<"cbc_clp" 
585    <<" solved " 
586    <<numProbSolved
587    <<" out of "
588    <<objValue.size();
589  int numberOnNodes = objValue.size()-numProbSolved-numberFailures;
590  if (numberFailures||numberOnNodes) {
591    if (numberOnNodes) {
592      std::cout<<" ("<<numberOnNodes<<" stopped on nodes)";
593      returnCode = numberOnNodes;
594    }
595    if (numberFailures) {
596      std::cout<<" ("<<numberFailures<<" gave bad answer!)";
597      returnCode += 100*numberFailures;
598    }
599  }
600  std::cout<<" and took "
601    <<timeTaken
602    <<" seconds."
603    <<std::endl;
604  if (unitTestOnly) {
605    if(numberFailures||numberOnNodes) {
606      printf("****** Unit Test failed\n");
607      fprintf(stderr,"****** Unit Test failed\n");
608    } else {
609      fprintf(stderr,"Unit Test succeeded\n");
610    }
611  }
612#ifdef CLP_FACTORIZATION_INSTRUMENT
613  printf("Total factorization time %g seconds\n",
614         timeTakenFac);
615#endif
616  return returnCode;
617}
Note: See TracBrowser for help on using the repository browser.