Changeset 823 for stable


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

for unit test return code

Location:
stable/2.0/Cbc/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • stable/2.0/Cbc/src/CbcSolver.cpp

    r808 r823  
    32513251}
    32523252
    3253 void CbcClpUnitTest (const CbcModel & saveModel,
     3253int CbcClpUnitTest (const CbcModel & saveModel,
    32543254                     std::string& dirMiplib, bool unitTestOnly);
    32553255#ifdef NEW_STYLE_SOLVER
     
    69216921                   says -miplib
    69226922                */
    6923                 CbcClpUnitTest(model_, dirMiplib, false);
    6924                 return 777;
     6923                return CbcClpUnitTest(model_, dirMiplib, false);
    69256924              } else {
    69266925                strengthenedModel = babModel_->strengthenedModel();
  • stable/2.0/Cbc/src/unitTestClp.cpp

    r768 r823  
    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  /*
     
    129129#endif
    130130    PUSH_MPS("air03",124,10757,340160,338864.25,7);
    131 #if HOWMANY==3
     131#if HOWMANY>2
    132132    PUSH_MPS("air04",823,8904,56137,55535.436,8);
    133133    PUSH_MPS("air05",426,7195,26374,25877.609,8);
     
    148148    PUSH_MPS("egout",98,141,568.101,149.589,7);
    149149    PUSH_MPS("enigma",21,100,0.0,0.0,7);
    150 #if HOWMANY==3
     150#if HOWMANY>3
    151151    PUSH_MPS("fast0507",507,63009,174,172.14556668,7);
    152152#endif
     
    164164    PUSH_MPS("gesa3_o",1224,1152,27991042.648,27833632.451,7);
    165165    PUSH_MPS("gt2",29,188,21166.000,13460.233074,7);
    166 #if HOWMANY==3
     166#if HOWMANY>2
    167167    PUSH_MPS("harp2",112,2993,-73899798.00,-74353341.502,7);
    168168#endif
     
    180180    PUSH_MPS("mod008",6,319,307,290.9,7);
    181181    PUSH_MPS("mod010",146,2655,6548,6532.08,7);
    182 #if HOWMANY==3
     182#if HOWMANY>2
    183183    PUSH_MPS("mod011",4480,10958,-54558535,-62121982.55,7);
    184184    PUSH_MPS("modglob",291,422,20740508,20430947.,7);
     185#endif
     186#if HOWMANY>3
    185187    PUSH_MPS("noswot",182,128,-43,-43.0,7);
    186188#endif
     
    193195    PUSH_MPS("p0548",176,548,8691,315.29,7);
    194196    PUSH_MPS("p2756",755,2756,3124,2688.75,7);
    195 #if HOWMANY==3
     197#if HOWMANY>2
    196198    PUSH_MPS("pk1",45,86,11.0,0.0,7);
    197199#endif
     
    200202    PUSH_MPS("pp08aCUTS",246,240,7350.0,5480.6061563,7);
    201203#endif
    202 #if HOWMANY==3
     204#if HOWMANY>2
    203205    PUSH_MPS("qiu",1192,840,-132.873137,-931.638857,7);
    204206#endif
     
    207209    PUSH_MPS("rentacar",6803,9557,30356761,28806137.644,7);
    208210    PUSH_MPS("rgn",24,180,82.1999,48.7999,7);
    209 #if HOWMANY==3
     211#if HOWMANY>3
    210212    PUSH_MPS("rout",291,556,1077.56,981.86428571,7);
    211213    PUSH_MPS("set1ch",492,712,54537.75,32007.73,7);
     
    224226  int numProbSolved = 0;
    225227  double timeTaken=0.0;
     228  int numberFailures=0;
    226229 
    227230  /*
     
    364367        std::cout <<"cbc_clp" <<" " <<soln << " != " <<objValue[m]
    365368                  << "; error=" << fabs(objValue[m] - soln);
     369        numberFailures++;
    366370      }
    367371    } else {
     
    372376    delete model;
    373377  }
     378  int returnCode=0;
    374379  std::cout
    375380    <<"cbc_clp"
     
    377382    <<numProbSolved
    378383    <<" out of "
    379     <<objValue.size()
    380     <<" 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 "
    381397    <<timeTaken
    382398    <<" seconds."
    383399    <<std::endl;
     400  return returnCode;
    384401}
Note: See TracChangeset for help on using the changeset viewer.