Changeset 824 for trunk


Ignore:
Timestamp:
Oct 12, 2007 11:55:57 AM (12 years ago)
Author:
forrest
Message:

for unit test return code

Location:
trunk/Cbc/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cbc/src/CbcSolver.cpp

    r822 r824  
    730730  return new CbcStopNow(*this);
    731731}
     732//#undef NEW_STYLE_SOLVER
    732733//#define NEW_STYLE_SOLVER
    733734//#undef COIN_HAS_ASL
     
    33003301}
    33013302
    3302 void CbcClpUnitTest (const CbcModel & saveModel,
     3303int CbcClpUnitTest (const CbcModel & saveModel,
    33033304                     std::string& dirMiplib, bool unitTestOnly);
    33043305#ifdef NEW_STYLE_SOLVER
     
    70277028                */
    70287029                int extra1 = parameters_[whichParam(EXTRA1,numberParameters_,parameters_)].intValue();
    7029                 CbcClpUnitTest(model_, dirMiplib, extra1==1);
     7030                int returnCode=CbcClpUnitTest(model_, dirMiplib, extra1==1);
    70307031                babModel_=NULL;
    7031                 return 777;
     7032                return returnCode;
    70327033              } else {
    70337034                strengthenedModel = babModel_->strengthenedModel();
  • trunk/Cbc/src/CoinSolve.cpp

    r822 r824  
    1414#include <cstring>
    1515#include <iostream>
     16//#undef NEW_STYLE_SOLVER
    1617//#define NEW_STYLE_SOLVER
    1718#ifndef NEW_STYLE_SOLVER
     
    254255  addAmplToCbc(&control);
    255256#endif
    256   return control.solve (argc, argv, 1);
     257  int returnCode= control.solve (argc, argv, 1);
     258  return returnCode;
    257259}
    258260#endif
  • trunk/Cbc/src/unitTestClp.cpp

    r819 r824  
    7676//#############################################################################
    7777
    78 void CbcClpUnitTest (const CbcModel & saveModel, std::string& dirMiplib,
     78int CbcClpUnitTest (const CbcModel & saveModel, std::string& dirMiplib,
    7979                     bool unitTestOnly)
    8080{
     
    8888  if (!doTest) {
    8989    printf("Not doing miplib run as can't find mps files - ? .gz without libz\n");
    90     return;
     90    return -1;
    9191  }
    9292  /*
     
    226226  int numProbSolved = 0;
    227227  double timeTaken=0.0;
     228  int numberFailures=0;
    228229 
    229230  /*
     
    366367        std::cout <<"cbc_clp" <<" " <<soln << " != " <<objValue[m]
    367368                  << "; error=" << fabs(objValue[m] - soln);
     369        numberFailures++;
    368370      }
    369371    } else {
     
    374376    delete model;
    375377  }
     378  int returnCode=0;
    376379  std::cout
    377380    <<"cbc_clp"
     
    379382    <<numProbSolved
    380383    <<" out of "
    381     <<objValue.size()
    382     <<" and took "
     384    <<objValue.size();
     385  int numberOnNodes = objValue.size()-numProbSolved-numberFailures;
     386  if (numberFailures||numberOnNodes) {
     387    if (numberOnNodes) {
     388      std::cout<<" ("<<numberOnNodes<<" stopped on nodes)";
     389      returnCode = numberOnNodes;
     390    }
     391    if (numberFailures) {
     392      std::cout<<" ("<<numberFailures<<" gave bad answer!)";
     393      returnCode += 100*numberFailures;
     394    }
     395  }
     396  std::cout<<" and took "
    383397    <<timeTaken
    384398    <<" seconds."
    385399    <<std::endl;
     400  return returnCode;
    386401}
Note: See TracChangeset for help on using the changeset viewer.