- Main Page
- Namespaces
- Classes
- Files
- Related Pages

- File List
- File Members

# /home/coin/SVN-release/OS-2.3.5/OS/test/unitTest.cpp

Go to the documentation of this file.

    00001 /* $Id: unitTest.cpp 4120 2011-03-30 06:28:16Z kmartin $ */
    00122 #define DEBUG
    00123 //#define GUS_DEBUG
    00124
    00125 #include <cppad/cppad.hpp>
    00126 //#include "CoinUtilsConfig.h"
    00127 #include "OSCoinSolver.h"
    00128 #include "OSConfig.h"
    00129 #include "OSmps2osil.h"
    00130 #include "OSResult.h"
    00131 #include "OSOption.h"
    00132 #include "OSiLReader.h"
    00133 #include "OSiLWriter.h"
    00134 #include "OSoLReader.h"
    00135 #include "OSoLWriter.h"
    00136 #include "OSrLReader.h"
    00137 #include "OSrLWriter.h"
    00138 #include "OSInstance.h"
    00139 #include "OSFileUtil.h"
    00140 #include "CoinError.hpp"
    00141
    00142 #include "OSDefaultSolver.h"
    00143 #include "OSWSUtil.h"
    00144 #include "OSSolverAgent.h"
    00145 #include "OShL.h"
    00146 #include "OSErrorClass.h"
    00147 #include "OSBase64.h"
    00148 #include "OSMathUtil.h"
    00149
    00150
    00151 #include <CoinMpsIO.hpp>
    00152 #include <CoinPackedMatrix.hpp>
    00153
    00154
    00155 #include "CoinError.hpp"
    00156 #include "CoinHelperFunctions.hpp"
    00157
    00158
    00159
    00160 #ifdef COIN_HAS_GLPK
    00161 #include <OsiGlpkSolverInterface.hpp>
    00162 #endif
    00163
    00164 #ifdef COIN_HAS_COUENNE
    00165 #include "OSCouenneSolver.h"
    00166 #endif
    00167
    00168 #ifdef COIN_HAS_ASL
    00169 #include "OSnl2osil.h"
    00170 #endif
    00171
    00172 #ifdef COIN_HAS_LINDO
    00173 #include "OSLindoSolver.h"
    00174 #endif
    00175
    00176 #ifdef COIN_HAS_IPOPT
    00177 #include "OSIpoptSolver.h"
    00178 #endif
    00179
    00180 #ifdef COIN_HAS_BONMIN
    00181 #include "OSBonminSolver.h"
    00182 #endif
    00183
    00184 #ifdef COIN_HAS_GAMSUTILS
    00185 #include "OSgams2osil.hpp"
    00186 #endif
    00187
    00188 #ifdef HAVE_CTIME
    00189 # include <ctime>
    00190 #else
    00191 # ifdef HAVE_TIME_H
    00192 #  include <time.h>
    00193 # else
    00194 #  error "don't have header file for time"
    00195 # endif
    00196 #endif
    00197
    00198
    00199 #ifdef HAVE_CMATH
    00200 # include <cmath>
    00201 #else
    00202 # ifdef HAVE_CMATH_H
    00203 #  include <cmath.h>
    00204 # endif
    00205 #endif
    00206
    00207
    00208
    00209 #ifdef HAVE_CSTDIO
    00210 # include <cstdio>
    00211 #else
    00212 # ifdef HAVE_STDIO_H
    00213 #  include <stdio.h>
    00214 # else
    00215 #  error "don't have header file for stdio"
    00216 # endif
    00217 #endif
    00218
    00219 //#ifdef HAVE_WINDOWS_H
    00220 //#include <windows.h>
    00221 //#endif
    00222
    00223 using std::cout;
    00224 using std::endl;
    00225 using std::ostringstream;
    00226
    00227
    00228 int main(int argC, char* argV[])
    00229 {
    00230 //#ifdef HAVE_WINDOWS_H
    00231 //   SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX);
    00232 //#endif
    00233         WindowsErrorPopupBlocker();
    00234         double getObjVal(std::string osrl);
    00235         void tempPrintArrays(OSResult* os); //  OSrl parser development only
    00236         //using CppAD::NearEqual;
    00237         bool ok;
    00238         double check;
    00239
    00240
    00241         bool BASIC_TESTS;  // minimal functionality tests
    00242         bool SOLVER_TESTS; // at least one problem for each solver
    00243         bool THOROUGH;     // multiple problems for some solvers
    00244         bool PARSER_TESTS; // test parser logic
    00245         bool OTHER_TESTS;  // other input formats, b64 conversion, etc.
    00246
    00247         //set level of testing
    00248
    00249         std::string testConfig = "install";
    00250         int testLevel = 1;
    00251         if( argC > 2){
    00252                 std::cout << "Too Many Input Parameters" << std::endl;
    00253                 return 1;
    00254         }
    00255         if(argC == 2){
    00256                 testConfig = argV[ 1];
    00257                 std::cout << "test configuration = \'" <<  testConfig << "\'"<< std::endl;
    00258         }
    00259
    00260 #ifdef GUS_DEBUG
    00261         testConfig = "parser";
    00262 #endif
    00263
    00264         if (testConfig == "install") testLevel = 1;
    00265         if (testConfig == "parser" ) testLevel = 2;
    00266         if (testConfig == "parsers") testLevel = 2;
    00267         if (testConfig == "solver" ) testLevel = 3;
    00268         if (testConfig == "solvers") testLevel = 3;
    00269         if (testConfig == "release") testLevel = 4;
    00270         if (testConfig == "nightlyBuild") testLevel = 4;
    00271         if (testConfig == "all") testLevel = 4;
    00272         if (testConfig == "NB") testLevel = 4;
    00273         if (testConfig == "nb") testLevel = 4;
    00274
    00275         switch (testLevel){
    00276         case 1:
    00277                 BASIC_TESTS  = true;
    00278                 SOLVER_TESTS = true;
    00279                 THOROUGH     = false;
    00280                 PARSER_TESTS = false;
    00281                 OTHER_TESTS  = false;
    00282                 break;
    00283         case 2:
    00284                 BASIC_TESTS  = false;
    00285                 SOLVER_TESTS = false;
    00286                 THOROUGH     = false;
    00287                 PARSER_TESTS = true;
    00288                 OTHER_TESTS  = false;
    00289                 break;
    00290         case 3:
    00291                 BASIC_TESTS  = false;
    00292                 SOLVER_TESTS = true;
    00293                 THOROUGH     = true;
    00294                 PARSER_TESTS = false;
    00295                 OTHER_TESTS  = false;
    00296                 break;
    00297         case 4:
    00298         default:
    00299                 BASIC_TESTS  = true;
    00300                 SOLVER_TESTS = true;
    00301                 THOROUGH     = true;
    00302                 PARSER_TESTS = true;
    00303                 OTHER_TESTS  = true;
    00304                 break;
    00305         }
    00306
    00307         if (BASIC_TESTS) std::cout << "Perform basic tests" << std::endl;
    00308         if (SOLVER_TESTS) {
    00309                 if (THOROUGH)
    00310                         std::cout << "Perform thorough solver tests" << std::endl;
    00311                 else
    00312                         std::cout << "Perform simple solver tests" << std::endl;
    00313         }
    00314         if (PARSER_TESTS) std::cout << "Perform parser tests" << std::endl;
    00315         if (OTHER_TESTS) std::cout << "Perform other tests" << std::endl;
    00316         std::cout << std::endl << std::endl;
    00317
    00318         // end level of testing
    00319
    00320         cout << "START UNIT TEST" << endl;
    00321         int nOfTest = 0;
    00322         // define the classes
    00323         FileUtil *fileUtil = NULL;
    00324 #ifdef COIN_HAS_ASL
    00325         OSnl2osil *nl2osil = NULL;
    00326 #endif
    00327         OSmps2osil *mps2osil = NULL;
    00328         DefaultSolver *solver  = NULL;
    00329         OSiLReader *osilreader = NULL;
    00330         OSiLWriter *osilwriter = NULL;
    00331         OSoLReader *osolreader = NULL;
    00332         OSoLReader *osolreader2 = NULL;
    00333         OSrLReader *osrlreader = NULL;
    00334         OSrLWriter *osrlwriter = NULL;
    00335         OSInstance *osinstance = NULL;
    00336         OSOption *osoption = NULL;
    00337         OSOption *osoption2 = NULL;
    00338         OSOption *osoption3 = NULL;
    00339
    00340         //common arrays
    00341         std::string *nodeNames1 = NULL;
    00342         std::string *nodeNames2 = NULL;
    00343         double *x = NULL;
    00344
    00345         //other common variables
    00346         std::string osilFileName;
    00347         std::string osolFileName;
    00348         std::string osrlFileName;
    00349         std::string nlFileName;
    00350         std::string mpsFileName;
    00351         std::string osil;
    00352         std::string osol;
    00353         ostringstream unitTestResult;
    00354         ostringstream unitTestResultFailure;
    00355
    00356         // get the input files
    00357          const char dirsep =  CoinFindDirSeparator();
    00358         // Set directory containing data files.
    00359         std::string dataDir;
    00360     dataDir = dirsep == '/' ? "../data/" : "..\\data\\";
    00361 #ifdef GUS_DEBUG
    00362         dataDir = "C:\\datafiles\\research\\OS\\OS-trunk-work\\OS\\data\\";
    00363 #endif
    00364
    00365         fileUtil = new FileUtil();
    00366
    00367
    00368 if(BASIC_TESTS == true){
    00369
    00370         //first make sure we can read files
    00371         try{
    00372                 std::cout << endl << "TEST " << ++nOfTest << ": Try to read a sample file" << endl << endl;
    00373                 osilFileName =  dataDir  + "osilFiles" + dirsep +  "parincLinearByRow.osil";
    00374                 //osilFileName =  dataDir  + "osilFiles" + dirsep +  "parincLinear.osil";
    00375                 std::cout << "The file is: " ;
    00376                 std::cout <<  osilFileName << std::endl;
    00377                 osil = fileUtil->getFileAsString( osilFileName.c_str() );
    00378                 std::cout << "Done reading the test file" << std::endl;
    00379                 osilreader = new OSiLReader();
    00380                 osinstance = osilreader->readOSiL( osil);
    00381                 //osinstance->initForAlgDiff();
    00382                 unitTestResult << "TEST " << nOfTest << ": Reading files successfully" << std::endl;
    00383                 cout << endl << "TEST " << nOfTest << ": Completed successfully" << endl << endl;
    00384                 osilwriter = new OSiLWriter();
    00385                 osilwriter->m_bWhiteSpace = true;
    00386                 std::cout << osilwriter->writeOSiL( osinstance) << std::endl;
    00387                 delete osilreader;
    00388                 osilreader = NULL;
    00389                 delete osilwriter;
    00390                 osilwriter = NULL;
    00391         }
    00392         catch(const ErrorClass& eclass){
    00393                 unitTestResultFailure << "Sorry Unit Test Failed Reading a file: "  + eclass.errormsg<< endl;
    00394                 //no point continuing -- we can't even read a file
    00395                 unitTestResultFailure << "Since we can't read files we are terminating"  << endl;
    00396                 cout << unitTestResultFailure.str() << endl << endl;
    00397                 cout << "Conclusion: FAILURE" << endl;
    00398                 if (osilreader != NULL)
    00399                 {
    00400                         delete osilreader;
    00401                         osilreader = NULL;
    00402                 }
    00403                 if (osilwriter != NULL)
    00404                 {
    00405                         delete osilwriter;
    00406                         osilwriter = NULL;
    00407                 }
    00408                 return 1;
    00409         }
    00410
    00411 // Make sure we can read and write without loss of precision
    00412         try{
    00413                 cout << endl << "TEST " << ++nOfTest << ": Lossless I/O" << endl << endl;
    00414                 osilwriter = new OSiLWriter();
    00415                 osilreader = new OSiLReader();
    00416                 //mpsFileName =  dataDir + "mpsFiles" + dirsep + "testfile2.mps";
    00417                 mpsFileName =  dataDir + "mpsFiles" + dirsep + "parinc.mps";
    00418                 mps2osil = new OSmps2osil( mpsFileName);
    00419                 // create the first in-memory OSInstance
    00420                 mps2osil->createOSInstance() ;
    00421                 // write the instance to a string
    00422                 OSInstance *osinstance1 = mps2osil->osinstance;
    00423                 std::string sOSiL = osilwriter->writeOSiL( osinstance1  );
    00424 #ifdef DEBUG
    00425                 cout << sOSiL << endl;
    00426 #endif
    00428                 // now create a second object
    00429                 OSInstance *osinstance2 = osilreader->readOSiL( sOSiL);
    00430                 // now compare the elements in the A matrix for the two instances
    00431                 int nvals = osinstance1->instanceData->linearConstraintCoefficients->numberOfValues;
    00432                 double theDiff, theMax;
    00433                 int theIndex = -1;
    00434                 theMax = 0;
    00435                 for(int i = 0; i < nvals; i++){
    00436                         theDiff = fabs(osinstance1->instanceData->linearConstraintCoefficients->value->el[ i] -
    00437                                 osinstance2->instanceData->linearConstraintCoefficients->value->el[ i])/ fabs(osinstance1->instanceData->linearConstraintCoefficients->value->el[ i]);
    00438                         if(theDiff > theMax){
    00439                                 theMax = theDiff;
    00440                                 theIndex = i;
    00441                         }
    00442                         //std::cout << theDiff << std::endl;
    00443                 }
    00444                 std::cout << "MAXIMUM DIFF = " << theMax << std::endl;
    00445                 if(theMax > 0)
    00446                 {
    00447                         std::cout << "MAXIMUM DIFF INDEX  = " << theIndex << std::endl;
    00448                         unitTestResult << "WARNING:  you do not have lossless IO" << std::endl;
    00449                 }
    00450                 else
    00451                 {
    00452                         unitTestResult << "TEST " << nOfTest << ": Passed lossless IO test" << std::endl;
    00453                         cout << endl << "TEST " << nOfTest << ": Completed successfully" << endl << endl;
    00454                 }
    00455                 delete mps2osil;
    00456                 mps2osil = NULL;
    00457                 delete osilreader;
    00458                 osilreader = NULL;
    00459                 delete osilwriter;
    00460                 osilwriter = NULL;
    00461
    00462         }
    00463         catch(const ErrorClass& eclass){
    00464                 unitTestResultFailure << "Unit Test Failed Lossless I/O test: "  + eclass.errormsg<< endl;
    00465                 if (mps2osil != NULL)
    00466                         delete mps2osil;
    00467                 mps2osil = NULL;
    00468                 if (osilreader != NULL)
    00469                         delete osilreader;
    00470                 osilreader = NULL;
    00471                 if (osilwriter != NULL)
    00472                         delete osilwriter;
    00473                 osilwriter = NULL;
    00474         }
    00475
    00476
    00477         // now test the nonlinear operators
    00478         try{
    00479                 cout << endl << "TEST " << ++nOfTest << ": nonlinear operators" << endl << endl;
    00480                 ok = true;
    00481                 std::string operatorTest =  dataDir  + "osilFiles" + dirsep + "testOperators.osil";
    00482                 osil = fileUtil->getFileAsString( operatorTest.c_str() );
    00483                 OSInstance *osinstance = NULL;
    00484                 //osinstance = new OSInstance();
    00485                 OSiLReader *osilreader = NULL;
    00486                 osilreader = new OSiLReader();
    00487                 OSiLWriter *osilwriter = NULL;
    00488                 osilwriter = new OSiLWriter();
    00489 //              cout << "Read testOperators.osil...";
    00490                 osinstance = osilreader->readOSiL( osil);
    00491
    00492                 cout << "Done" << endl;
    00493                 OSExpressionTree* expTree = osinstance->getNonlinearExpressionTree( -1);
    00494                 std::vector<OSnLNode*> postfixVec;
    00495                 postfixVec = expTree->m_treeRoot->getPostfixFromExpressionTree();
    00496                 int n = postfixVec.size();
    00497                 nodeNames1 = new std::string[ n];
    00498                 for (int i = 0 ; i < n; i++){
    00499                 //      std::cout << postfixVec[i]->getTokenName() << std::endl;
    00500                         nodeNames1[i] = postfixVec[i]->getTokenName();
    00501                 }
    00502 //              std::cout << std::endl << std::endl;
    00503 //              std::cout << osilwriter->writeOSiL( osinstance) << std::endl;
    00504                 // now test value
    00505                 x = new double[2];
    00506                 x[0] = 1;
    00507                 x[1] = 2;
    00508 //              double parserTestVal = expTree->m_treeRoot->calculateFunction( x);
    00509 //              std::cout << "ParserTest Val = " << parserTestVal << std::endl;
    00510                 check = 11;
    00511                 //ok &= NearEqual(expTree->m_treeRoot->calculateFunction( x) , check,  1e-10 , 1e-10);
    00512                 ok = ( fabs(check -  expTree->m_treeRoot->calculateFunction( x))/(fabs( check) + OS_NEAR_EQUAL) <= OS_NEAR_EQUAL) ? true : false;
    00513                 delete[] x;
    00514                 delete[] nodeNames1;
    00515                 delete osilreader;
    00516                 osilreader = NULL;
    00517                 delete osilwriter;
    00518                 osilwriter = NULL;
    00519                 osinstance = NULL;
    00520
    00521                 if (ok == false) throw ErrorClass(" Problem evaluating expression tree");
    00522                 unitTestResult << "TEST " << nOfTest << ": Successful test of nonlinear operators using file testOperators.osil" << std::endl;
    00523                 cout << endl << "TEST " << nOfTest << ": Completed successfully" << endl << endl;
    00524         }
    00525         catch(const ErrorClass& eclass){
    00526                 cout << endl << endl << endl;
    00527                 unitTestResultFailure << eclass.errormsg << endl;
    00528                 if (x != NULL)
    00529                         delete[] x;
    00530                 if (nodeNames1 != NULL)
    00531                         delete[] nodeNames1;
    00532                 if (osilreader != NULL)
    00533                         delete osilreader;
    00534                 osilreader = NULL;
    00535                 if (osilwriter != NULL)
    00536                         delete osilwriter;
    00537                 osilwriter = NULL;
    00538         }
    00539
    00540
    00541         // Automatic differentiation
    00542         try{
    00543                 cout << endl << "TEST " << ++nOfTest << ": Automatic differentiation" << endl << endl;
    00544 //              std::cout << std::endl << std::endl;
    00545 //              std::cout << "Testing AD Features " << std::endl;
    00546                 std::string expTreeTest =  dataDir  + "osilFiles" + dirsep + "CppADTestLag.osil";
    00547                 /*
    00548                 min x0^2 + 9*x1   -- w[0]
    00549                 s.t.
    00550                 33 - 105 + 1.37*x1 + 2*x3 + 5*x1 <= 10  -- y[0]
    00551                 ln(x0*x3)  + 7*x2 >= 10  -- y[1]
    00552                 Note: in the first constraint 33 is a constant term and 105
    00553                 is part of the nl node
    00554                 */
    00555                 osil = fileUtil->getFileAsString( expTreeTest.c_str() );
    00556                 OSInstance *osinstance = NULL;
    00557                 //osinstance = new OSInstance();
    00558                 OSiLReader *osilreader = NULL;
    00559                 osilreader = new OSiLReader();
    00560                 //create an osinstance
    00561                 osinstance = osilreader->readOSiL( osil);
    00562                 double *x;
    00563                 x = new double[ 4];
    00564                 x[0] = 1;
    00565                 x[1] = 5;
    00566                 x[2] = 10;
    00567                 x[3] = 5;
    00568                 SparseVector *sp;
    00569                 // get the gradient for constraint 1
    00570                 osinstance->getJacobianSparsityPattern();
    00571                 sp = osinstance->calculateConstraintFunctionGradient(x, 1, true);
    00572 //              for(int i = 0; i < sp->number; i++){
    00573 //                      std::cout << "gradient value " << sp->values[i] << std::endl;
    00574 //              }
    00575                 ok = true;
    00576                 //check gradient for constraint with index 1
    00577                 double checkPartial2Con1 = 7.0 ;
    00578                 //ok &= NearEqual( sp->values[ 0], checkPartial2Con1, 1e-10, 1e-10);
    00579                 ok = ( fabs(checkPartial2Con1 - sp->values[ 0] )/(fabs( checkPartial2Con1) + OS_NEAR_EQUAL) <= OS_NEAR_EQUAL) ? true : false;
    00580                 if(ok == false) throw ErrorClass(" Fail testing gradient calculation");
    00581                 double checkPartial0Con1 = (1./x[0])  ;
    00582                 //ok &= NearEqual(sp->values[ 1], checkPartial0Con1, 1e-10, 1e-10);
    00583                 ok = ( fabs(checkPartial0Con1 - sp->values[ 1] )/(fabs( checkPartial0Con1) + OS_NEAR_EQUAL) <= OS_NEAR_EQUAL) ? true : false;
    00584                 if(ok == false) throw ErrorClass(" Fail testing gradient calculation");
    00585                 double checkPartial3Con1 = (1./x[3]) ;
    00586                 //ok &= NearEqual( sp->values[ 2], checkPartial3Con1, 1e-10, 1e-10);
    00587                 ok = ( fabs(checkPartial3Con1 - sp->values[ 2] )/(fabs( checkPartial3Con1) + OS_NEAR_EQUAL) <= OS_NEAR_EQUAL) ? true : false;
    00588                 if(ok == false) throw ErrorClass(" Fail testing gradient calculation");
    00589                 delete sp;
    00590                 sp = NULL;
    00591                 SparseHessianMatrix *sh;
    00592                 // calcuate Hessian of objective function (index = -1)
    00593                 osinstance->getLagrangianHessianSparsityPattern( );
    00594                 sh = osinstance->calculateHessian(x, -1, true);
    00595 //              for(int i = 0; i < sh->hessDimension; i++){
    00596 //                      std::cout << "Hessian value " << sh->hessValues[i] << std::endl;
    00597 //              }
    00598                 //ok &= NearEqual( sh->hessValues[ 0], 2., 1e-10, 1e-10);
    00599                 ok = ( fabs(2. - sh->hessValues[0] )/(2. + OS_NEAR_EQUAL) <= OS_NEAR_EQUAL) ? true : false;
    00600                 if(ok == false) throw ErrorClass(" Fail testing Hessian calculation");
    00601                 //ok &= NearEqual( sh->hessValues[ 1], 0., 1e-10, 1e-10);
    00602                 ok = ( fabs(0. - sh->hessValues[ 1] )/(0. + OS_NEAR_EQUAL) <= OS_NEAR_EQUAL) ? true : false;
    00603                 if(ok == false) throw ErrorClass(" Fail testing Hessian calculation");
    00604                 //ok &= NearEqual( sh->hessValues[ 2], 0., 1e-10, 1e-10);
    00605                 ok = ( fabs(0. - sh->hessValues[2] )/(0. + OS_NEAR_EQUAL) <= OS_NEAR_EQUAL) ? true : false;
    00606                 if(ok == false) throw ErrorClass(" Fail testing Hessian calculation");
    00607                 delete[] x;
    00608                 delete osilreader;
    00609                 osilreader = NULL;
    00610                 unitTestResult << "TEST " << nOfTest << ": Successful test of AD gradient and Hessian calculations" << std::endl;
    00611                 cout << endl << "TEST " << nOfTest << ": Completed successfully" << endl << endl;
    00612         }
    00613         catch(const ErrorClass& eclass){
    00614                 cout << endl << endl << endl;
    00615                 unitTestResultFailure << eclass.errormsg << endl;
    00616                 if (x != NULL)
    00617                         delete[] x;
    00618                 if (osilreader != NULL)
    00619                 delete osilreader;
    00620                 osilreader = NULL;
    00621         }
    00622 } // end of if (BASIC_TESTS)
    00623
    00624
    00625         //
    00626         // Now test the parsers --- OSiL parser first
    00627 if (PARSER_TESTS){
    00628
    00629 //#if 0   //!!!  OSrL parser development
    00630         try{
    00631                 clock_t start, finish;
    00632                 double duration;
    00633                 osilwriter = new OSiLWriter();
    00634                 //delete fileUtil;
    00635                 //fileUtil = NULL;
    00636                 //fileUtil = new FileUtil();
    00637                 cout << "Test parsing a model" << endl;
    00638                 cout << "First read the file into a string" << endl;
    00639                 start = clock();
    00640                 osilFileName = dataDir  + "osilFiles" + dirsep + "parincLinear.osil";
    00641                 osil = fileUtil->getFileAsString( osilFileName.c_str());
    00642                 finish = clock();
    00643                 duration = (double) (finish - start) / CLOCKS_PER_SEC;
    00644                 cout << "Reading the file into a string took (seconds): "<< duration << endl;
    00645                 OSiLReader *osilreader = NULL;
    00646                 osilreader = new OSiLReader();
    00647                 start = clock();
    00648                 cout << "PARSE THE OSIL STRING INTO AN OSINSTANCE OBJECT" << endl;
    00649                 osilreader->readOSiL( osil);
    00650                 //cout << osilwriter->writeOSiL( osilreader->readOSiL( osil)) << endl;
    00651                 delete osilreader;
    00652                 osilreader = NULL;
    00653                 delete osilwriter;
    00654                 osilwriter = NULL;
    00655                 finish = clock();
    00656                 duration = (double) (finish - start) / CLOCKS_PER_SEC;
    00657                 cout << "Parsing took (seconds): "<< duration << endl;
    00658                 unitTestResult << "TEST " << nOfTest << ": Successful test of OSiL parser on problem parincLinear.osil" << std::endl;
    00659                 cout << endl << "TEST " << nOfTest << ": Completed successfully" << endl << endl;
    00660         }
    00661         catch(const ErrorClass& eclass){
    00662                 cout << endl << endl << endl;
    00663                 cout << eclass.errormsg << endl;
    00664                 unitTestResultFailure << "Sorry Unit Test Failed Testing An OSiL Parser" << endl;
    00665
    00666                 if (osilreader != NULL)
    00667                         delete osilreader;
    00668                 osilreader = NULL;
    00669                 if (osilwriter != NULL)
    00670                         delete osilwriter;
    00671                 osilwriter = NULL;
    00672         }
    00673
    00674 #if 0
    00675         //
    00676         // Now test the extensions to the OSiL format: <timeDomain>, etc.
    00677
    00678         // some pointer declarations
    00679         std::string *sncheck = new std::string[6];
    00680         int *nvcheck = new int[6];
    00681         int *nccheck = new int[6];
    00682         int *nocheck = new int[6];
    00683         int **lvcheck = new int*[6];
    00684         int **lccheck = new int*[6];
    00685         int **locheck = new int*[6];
    00686         std::string *sn1 = new std::string[6];
    00687         int *nv1= new int[6];
    00688         int *nc1 = new int[6];
    00689         int *no1 = new int[6];
    00690         int **lv1 = new int*[6];
    00691         int **lc1 = new int*[6];
    00692         int **lo1 = new int*[6];
    00693         int *nelem = new int[4];
    00694         int *startIdx = new int[4];
    00695         int **VI = new int*[4];
    00696
    00697         try{
    00698                 cout << endl << "TEST " << ++nOfTest << ": Stochastic extensions to OSiL" << endl << endl;
    00699                 clock_t start, finish;
    00700                 double duration;
    00701                 OSiLWriter *osilwriter = NULL;
    00702                 osilwriter = new OSiLWriter();
    00703                 //delete fileUtil;
    00704                 //fileUtil = NULL;
    00705                 //fileUtil = new FileUtil();
    00706                 cout << "\nTest parsing a stochastic model" << endl;
    00707                 cout << "First read the file into a string" << endl;
    00708                 start = clock();
    00709                 osilFileName = dataDir  + "osilFiles" + dirsep + "finplan1.osil";
    00710                 osil = fileUtil->getFileAsString( &osilFileName[0]);
    00711                 finish = clock();
    00712                 duration = (double) (finish - start) / CLOCKS_PER_SEC;
    00713                 cout << "Reading the file into a string took (seconds): "<< duration << endl;
    00714                 OSiLReader *osilreader = NULL;
    00715                 osilreader = new OSiLReader();
    00716                 start = clock();
    00717                 cout << "PARSE THE OSIL STRING INTO AN OSINSTANCE OBJECT" << endl;
    00718                 osilreader->readOSiL( osil);
    00719                 //cout << osilwriter->writeOSiL( osilreader->readOSiL( &osil)) << endl;
    00720                 delete osilreader;
    00721                 osilreader = NULL;
    00722                 delete osilwriter;
    00723                 osilwriter = NULL;
    00724                 finish = clock();
    00725                 duration = (double) (finish - start) / CLOCKS_PER_SEC;
    00726                 cout << "Parsing took (seconds): "<< duration << endl;
    00727                 unitTestResult << "TEST " << nOfTest << ": Successful test of OSiL parser on problem finplan1.osil" << std::endl;
    00728                 cout << endl << "TEST " << nOfTest << ": Completed successfully" << endl << endl;
    00729         }
    00730         catch(const ErrorClass& eclass){
    00731                 cout << endl << endl << endl;
    00732                 cout << eclass.errormsg << endl;
    00733                 unitTestResultFailure << "Error parsing an osil file with time domain information" << endl;
    00734
    00735                 if (osilreader != NULL)
    00736                         delete osilreader;
    00737                 osilreader = NULL;
    00738                 if (osilwriter != NULL)
    00739                         delete osilwriter;
    00740                 osilwriter = NULL;
    00741         }
    00745         try{
    00746                 cout << endl << "TEST " << ++nOfTest << ": GET() AND SET() METHODS FOR TimeDomain OBJECT" << endl << endl;
    00747                 OSInstance *osinstance = NULL;
    00748                 //osinstance = new OSInstance();
    00749                 //OSiLReader *osilreader = NULL;
    00750                 osilreader = new OSiLReader();
    00751                 //create an osinstance
    00752                 osinstance = osilreader->readOSiL( osil);
    00753                 std::string f = osinstance->getTimeDomainFormat();
    00754                 ok = (f == "stages");
    00755                 int n = osinstance->getTimeDomainStageNumber();
    00756                 ok &= (n == 6);
    00757
    00758                 sncheck[0] = "";
    00759                 sncheck[1] = "";
    00760                 sncheck[2] = "";
    00761                 sncheck[3] = "test";
    00762                 sncheck[4] = "Wha'zzup?";
    00763                 sncheck[5] = "";
    00764
    00765                 std::string* sn = osinstance->getTimeDomainStageNames();
    00766
    00767                 for (int i = 0; i < 6; i++)
    00768                         ok &= (sn[i] == sncheck[i]);
    00769
    00770                 int* nv = osinstance->getTimeDomainStageNumberOfVariables();
    00771
    00772                 nvcheck[0] = 2;
    00773                 nvcheck[1] = 2;
    00774                 nvcheck[2] = 0;
    00775                 nvcheck[3] = 0;
    00776                 nvcheck[4] = 2;
    00777                 nvcheck[5] = 2;
    00778
    00779                 for (int i = 0; i < 6; i++)
    00780                         ok &= (nv[i] == nvcheck[i]);
    00781
    00782                 int* nc = osinstance->getTimeDomainStageNumberOfConstraints();
    00783
    00784                 nccheck[0] = 1;
    00785                 nccheck[1] = 1;
    00786                 nccheck[2] = 0;
    00787                 nccheck[3] = 0;
    00788                 nccheck[4] = 1;
    00789                 nccheck[5] = 1;
    00790
    00791                 for (int i = 0; i < 6; i++)
    00792                         ok &= (nc[i] == nccheck[i]);
    00793
    00794                 int* no = osinstance->getTimeDomainStageNumberOfObjectives();
    00795
    00796                 nocheck[0] = 1;
    00797                 nocheck[1] = 1;
    00798                 nocheck[2] = 1;
    00799                 nocheck[3] = 0;
    00800                 nocheck[4] = 1;
    00801                 nocheck[5] = 1;
    00802
    00803                 for (int i = 0; i < 6; i++)
    00804                         ok &= (no[i] == nocheck[i]);
    00805
    00806                 int** lv = osinstance->getTimeDomainStageVarList();
    00807                 int** lc = osinstance->getTimeDomainStageConList();
    00808                 int** lo = osinstance->getTimeDomainStageObjList();
    00809
    00810                 for (int i = 0; i < 6; i++)
    00811                 {
    00812                         lvcheck[i] = new int[2];
    00813                         lccheck[i] = new int[2];
    00814                         locheck[i] = new int[2];
    00815                 };
    00816                 lvcheck[0][0] = 0;
    00817                 lvcheck[0][1] = 1;
    00818                 lvcheck[1][0] = 2;
    00819                 lvcheck[1][1] = 3;
    00820                 lvcheck[4][0] = 4;
    00821                 lvcheck[4][1] = 5;
    00822                 lvcheck[5][0] = 6;
    00823                 lvcheck[5][1] = 7;
    00824                 lccheck[0][0] = 0;
    00825                 lccheck[1][0] = 1;
    00826                 lccheck[4][0] = 2;
    00827                 lccheck[5][0] = 3;
    00828                 locheck[0][0] = -1;
    00829                 locheck[1][0] = -1;
    00830                 locheck[2][0] = -1;
    00831                 locheck[4][0] = -1;
    00832                 locheck[5][0] = -1;
    00833
    00834                 for (int i = 0; i < 6; i++) {
    00835                         for (int j = 0; j < nv[i]; j++)
    00836                                 ok &= (lvcheck[i][j] == lv[i][j]);
    00837                         for (int j = 0; j < nc[i]; j++)
    00838                                 ok &= (lccheck[i][j] == lc[i][j]);
    00839                         for (int j = 0; j < no[i]; j++)
    00840                                 ok &= (locheck[i][j] == lo[i][j]);
    00841                 };
    00842
    00843
    00844                 for (int i = 0; i < 6; i++) {
    00845                         sn1[i] = sn[i];
    00846                         nv1[i] = nv[i];
    00847                         nc1[i] = nc[i];
    00848                         no1[i] = no[i];
    00849                         lv1[i] = new int[2];
    00850                         lc1[i] = new int[2];
    00851                         lo1[i] = new int[2];
    00852                         for (int j = 0; j < nv[i]; j++) {
    00853                                 lv1[i][j] = lv[i][j];
    00854                         };
    00855                         for (int j = 0; j < nc[i]; j++) {
    00856                                 lc1[i][j] = lc[i][j];
    00857                         };
    00858                         for (int j = 0; j < no[i]; j++) {
    00859                                 lo1[i][j] = lo[i][j];
    00860                         };
    00861                 };
    00862
    00863                 ok &= osinstance->setTimeDomain("none");
    00864                 n = 0;
    00865                 ok &= osinstance->setTimeDomainStages(n,NULL);
    00866                 ok &= osinstance->setTimeDomainStages(4,NULL);
    00867
    00868                 n = osinstance->getTimeDomainStageNumber();
    00869                 ok &= (n == 4);
    00870
    00871                 for (int i = 0; i < 4; i++)
    00872                 {       nelem[i] = 2;
    00873                         startIdx[i] = 2*i;
    00874                         VI[i] = new int[2];
    00875                         VI[i][0] = 2*i;
    00876                         VI[i][1] = 2*i + 1;
    00877                 };
    00878                 ok &= osinstance->setTimeDomainStageVariablesUnordered(4,nelem,VI);
    00879
    00880                 for (int i = 0; i < 4; i++)
    00881                 {       nelem[i] = 1;
    00882                         startIdx[i] = i;
    00883                 };
    00884                 ok &= osinstance->setTimeDomainStageConstraintsOrdered(4,nelem,startIdx);
    00885
    00886                 for (int i = 0; i < 4; i++)
    00887                 {       nelem[i] = 1;
    00888                         startIdx[i] = -1;
    00889                 };
    00890                 ok &= osinstance->setTimeDomainStageObjectivesOrdered(4,nelem,startIdx);
    00891
    00892                 ok &= osinstance->setTimeDomain("none");
    00893
    00894                 ok &= osinstance->setTimeDomain("interval");
    00895
    00896                 ok &= osinstance->setTimeDomainInterval(0.0, 1.0);
    00897                 double lower = osinstance->getTimeDomainIntervalStart();
    00898                 ok &= (lower == 0.0);
    00899                 double upper = osinstance->getTimeDomainIntervalHorizon();
    00900                 ok &= (upper == 1.0);
    00901
    00902                 ok &= osinstance->setTimeDomain("none");
    00903
    00904                 ok &= osinstance->setTimeDomainStages(6,sncheck);
    00905                 ok &= osinstance->setTimeDomainStageVariablesUnordered(6,nvcheck,lvcheck);
    00906                 ok &= osinstance->setTimeDomainStageObjectivesUnordered(6,nocheck,locheck);
    00907                 ok &= osinstance->setTimeDomainStageConstraintsUnordered(6,nccheck,lccheck);
    00908                 int n2 = osinstance->getTimeDomainStageNumber();
    00909                 ok &= (n2 == 6);
    00910                 std::string* sn2 = osinstance->getTimeDomainStageNames();
    00911                 int* nv2 = osinstance->getTimeDomainStageNumberOfVariables();
    00912                 int* nc2 = osinstance->getTimeDomainStageNumberOfConstraints();
    00913                 int* no2 = osinstance->getTimeDomainStageNumberOfObjectives();
    00914                 int** lv2 = osinstance->getTimeDomainStageVarList();
    00915                 int** lc2 = osinstance->getTimeDomainStageConList();
    00916                 int** lo2 = osinstance->getTimeDomainStageObjList();
    00917                 for (int i = 0; i < n2; i++)
    00918                 {       ok &= (sn2[i] == sncheck[i]);
    00919                         ok &= (nv2[i] == nvcheck[i]);
    00920                         ok &= (nc2[i] == nccheck[i]);
    00921                         ok &= (no2[i] == nocheck[i]);
    00922                         for (int j = 0; j < nv2[i]; j++)
    00923                                 ok &= (lv2[i][j] == lvcheck[i][j]);
    00924                         for (int j = 0; j < nc2[i]; j++)
    00925                                 ok &= (lc2[i][j] == lccheck[i][j]);
    00926                         for (int j = 0; j < no2[i]; j++)
    00927                                 ok &= (lo2[i][j] == locheck[i][j]);
    00928                 };
    00929                 // Garbage Collection
    00930                 if (sncheck != NULL)
    00931                         delete [] sncheck;
    00932                 sncheck = NULL;
    00933                 if (nvcheck != NULL)
    00934                         delete [] nvcheck;
    00935                 nvcheck = NULL;
    00936                 if (nccheck != NULL)
    00937                         delete [] nccheck;
    00938                 nccheck = NULL;
    00939                 if (nocheck != NULL)
    00940                         delete [] nocheck;
    00941                 nocheck = NULL;
    00942
    00943                 for (int i = 0; i < 6; i++) {
    00944                         if (lvcheck[i] != NULL)
    00945                                 delete [] lvcheck[i];
    00946                         if (lccheck[i] != NULL)
    00947                                 delete [] lccheck[i];
    00948                         if (locheck[i] != NULL)
    00949                                 delete [] locheck[i];
    00950                         if (lv1[i] != NULL)
    00951                                 delete [] lv1[i];
    00952                         if (lc1[i] != NULL)
    00953                                 delete [] lc1[i];
    00954                         if (lo1[i] != NULL)
    00955                                 delete [] lo1[i];
    00956                         };
    00957                 if (lvcheck != NULL)
    00958                         delete [] lvcheck;
    00959                 lvcheck = NULL;
    00960                 if (lccheck != NULL)
    00961                         delete [] lccheck;
    00962                 lccheck = NULL;
    00963                 if (locheck != NULL)
    00964                         delete [] locheck;
    00965                 locheck = NULL;
    00966                 if (lv1 != NULL)
    00967                         delete [] lv1;
    00968                 lv1 = NULL;
    00969                 if (lc1 != NULL)
    00970                         delete [] lc1;
    00971                 lc1 = NULL;
    00972                 if (lo1 != NULL)
    00973                         delete [] lo1;
    00974                 lo1 = NULL;
    00975                 if (sn1 != NULL)
    00976                         delete [] sn1;
    00977                 sn1 = NULL;
    00978                 if (nv1 != NULL)
    00979                         delete[] nv1;
    00980                 nv1 = NULL;
    00981                 if (nc1 != NULL)
    00982                         delete[] nc1;
    00983                 nc1 = NULL;
    00984                 if (no1 != NULL)
    00985                         delete[] no1;
    00986                 no1 = NULL;
    00987                 if (nelem != NULL)
    00988                         delete [] nelem;
    00989                 nelem = NULL;
    00990                 if (startIdx != NULL)
    00991                         delete [] startIdx;
    00992                 startIdx = NULL;
    00993                 if (VI != NULL)
    00994                 {
    00995                         for (int i = 0; i < 4; i++) {
    00996                                 if (VI[i] != NULL)
    00997                                         delete [] VI[i];
    00998                         };
    00999                         delete [] VI;
    01000                         VI = NULL;
    01001                 }
    01002
    01003                 if (osilreader != NULL)
    01004                         delete osilreader;
    01005                 osilreader = NULL;
    01006                 unitTestResult << "TEST " << nOfTest << ": Successful test of osinstance get() and set() methods" << std::endl;
    01007                 cout << endl << "TEST " << nOfTest << ": Completed successfully" << endl << endl;
    01008         }
    01009         catch(const ErrorClass& eclass){
    01010                 cout << endl << endl << endl;
    01011                 cout << eclass.errormsg << endl;
    01012                 unitTestResultFailure << "Sorry Unit Test Failed osinstance get() and set() Methods" << endl;
    01013                 // Garbage Collection
    01014                 if (sncheck != NULL)
    01015                         delete [] sncheck;
    01016                 sncheck = NULL;
    01017                 if (nvcheck != NULL)
    01018                         delete [] nvcheck;
    01019                 nvcheck = NULL;
    01020                 if (nccheck != NULL)
    01021                         delete [] nccheck;
    01022                 nccheck = NULL;
    01023                 if (nocheck != NULL)
    01024                         delete [] nocheck;
    01025                 nocheck = NULL;
    01026
    01027                 for (int i = 0; i < 6; i++) {
    01028                         if (lvcheck[i] != NULL)
    01029                                 delete [] lvcheck[i];
    01030                         if (lccheck[i] != NULL)
    01031                                 delete [] lccheck[i];
    01032                         if (locheck[i] != NULL)
    01033                                 delete [] locheck[i];
    01034                         if (lv1[i] != NULL)
    01035                                 delete [] lv1[i];
    01036                         if (lc1[i] != NULL)
    01037                                 delete [] lc1[i];
    01038                         if (lo1[i] != NULL)
    01039                                 delete [] lo1[i];
    01040                         };
    01041                 if (lvcheck != NULL)
    01042                         delete [] lvcheck;
    01043                 lvcheck = NULL;
    01044                 if (lccheck != NULL)
    01045                         delete [] lccheck;
    01046                 lccheck = NULL;
    01047                 if (locheck != NULL)
    01048                         delete [] locheck;
    01049                 locheck = NULL;
    01050                 if (lv1 != NULL)
    01051                         delete [] lv1;
    01052                 lv1 = NULL;
    01053                 if (lc1 != NULL)
    01054                         delete [] lc1;
    01055                 lc1 = NULL;
    01056                 if (lo1 != NULL)
    01057                         delete [] lo1;
    01058                 lo1 = NULL;
    01059                 if (sn1 != NULL)
    01060                         delete [] sn1;
    01061                 sn1 = NULL;
    01062                 if (nv1 != NULL)
    01063                         delete[] nv1;
    01064                 nv1 = NULL;
    01065                 if (nc1 != NULL)
    01066                         delete[] nc1;
    01067                 nc1 = NULL;
    01068                 if (no1 != NULL)
    01069                         delete[] no1;
    01070                 no1 = NULL;
    01071                 if (nelem != NULL)
    01072                         delete [] nelem;
    01073                 nelem = NULL;
    01074                 if (startIdx != NULL)
    01075                         delete [] startIdx;
    01076                 startIdx = NULL;
    01077                 if (VI != NULL)
    01078                 {
    01079                         for (int i = 0; i < 4; i++) {
    01080                                 if (VI[i] != NULL)
    01081                                         delete [] VI[i];
    01082                         };
    01083                         delete [] VI;
    01084                         VI = NULL;
    01085                 }
    01086
    01087                 if (osilreader != NULL)
    01088                         delete osilreader;
    01089                 osilreader = NULL;
    01090         }
    01091 #endif // test of <timeDomain> and various set() and get) methods
    01092
    01093         //
    01094         // Now test the OSoL parser
    01095         OSoLWriter *osolwriter = NULL;
    01096 //      OSoLReader *osolreader = NULL;
    01097         //osolwriter = new OSoLWriter();
    01098         //osolreader = new OSoLReader();
    01099
    01100         try{
    01114                 cout << endl << "TEST " << ++nOfTest << ": OSoL parser" << endl << endl;
    01115                 std::string tmpOSoL;
    01116                 clock_t start, finish;
    01117                 double duration;
    01118                 osolwriter = new OSoLWriter();
    01119                 osolreader = new OSoLReader();
    01120                 //osoption = new OSOption();
    01121                 cout << "Test parsing an OSoL file" << endl;
    01122                 cout << "First read the OSoL file into a string" << endl;
    01123                 osolFileName = dataDir  + "osolFiles" + dirsep + "parsertest.osol";
    01124                 cout << osolFileName << endl;
    01125                 start = clock();
    01126                 std::string osol = fileUtil->getFileAsString( osolFileName.c_str() );
    01127                 finish = clock();
    01128                 duration = (double) (finish - start) / CLOCKS_PER_SEC;
    01129                 cout << "Reading the file into a string took (seconds): "<< duration << endl;
    01130                 start = clock();
    01131                 cout << "PARSE THE OSOL STRING INTO AN OSOPTION OBJECT" << endl;
    01132                 osoption = osolreader->readOSoL( osol);
    01133
    01134                 //Pad all the arrays
    01135                 cout << endl << "Test the add() methods" << endl;
    01136
    01137                 ok = osoption->setAnOtherGeneralOption("testing","one","two  three");
    01138                 ok = osoption->setOtherSystemOptions(0,NULL) && ok;
    01139                 ok = osoption->setAnOtherSystemOption("Ho Ho Ho","","") && ok;
    01140                 ok = osoption->setAnOtherServiceOption("OneMore","Option","To Go") && ok;
    01141                 ok = osoption->setAnotherJobDependency("DoReMi") && ok;
    01142                 ok = osoption->setAnotherRequiredDirectory("C:\\MSYS") && ok;
    01143                 ok = osoption->setAnotherRequiredFile("C:\\MSYS\\junk.tmp") && ok;
    01144                 ok = osoption->setAnotherDirectoryToMake("C:\\tempdir") && ok;
    01145                 ok = osoption->setAnotherFileToMake("C:\\tempdir\\temp.tmp") && ok;
    01146                 ok = osoption->setAnotherInputDirectoryToMove("C:\\tempdir","C:\\OS\\calc",true) && ok;
    01147                 ok = osoption->setAnotherInputFileToMove("C:\\OS\\parinc.osil","C:\\OS\\calc\\input.osil",true) && ok;
    01148                 ok = osoption->setAnotherOutputFileToMove("C:\\OS\\calc\\putput.osrl","C:\\OS\\parinc.osol",false) && ok;
    01149                 ok = osoption->setAnotherOutputDirectoryToMove("C:\\OS\\calc","C:\\OS\\save",false) && ok;
    01150                 ok = osoption->setAnotherFileToDelete("C:\\OS\\calc\\input.osil") && ok;
    01151                 ok = osoption->setAnotherDirectoryToDelete("C:\\tempdir") && ok;
    01152                 ok = osoption->setAnotherProcessToKill("ABC123") && ok;
    01153                 ok = osoption->setAnOtherJobOption("DoReMi","ABC","One Two Three") && ok;
    01154                 ok = osoption->setAnotherInitVarValue(5,12.3) && ok;
    01155                 ok = osoption->setAnotherInitVarValueString(6,"BLUE") && ok;
    01156                 ok = osoption->setAnotherInitBasisStatus(ENUM_PROBLEM_COMPONENT_variables,6,ENUM_BASIS_STATUS_unknown) && ok;
    01157                 ok = osoption->setAnotherInitBasisStatus(ENUM_PROBLEM_COMPONENT_objectives,-1,ENUM_BASIS_STATUS_basic) && ok;
    01158                 ok = osoption->setAnotherInitBasisStatus(ENUM_PROBLEM_COMPONENT_constraints,3,ENUM_BASIS_STATUS_superbasic) && ok;
    01159                 ok = osoption->setAnotherIntegerVariableBranchingWeight(5,100.) && ok;
    01160
    01161                 int SOS3idx[2];
    01162                 double SOS3val[2];
    01163                 SOS3idx[0] = 3;
    01164                 SOS3idx[1] = 6;
    01165                 SOS3val[0] = 1.0;
    01166                 SOS3val[1] = 2.0;
    01167                 int tnvar;
    01168                 tnvar = osoption->getNumberOfSOS();
    01169                 ok = osoption->setAnotherSOSVariableBranchingWeight(3,2,1.0,SOS3idx,SOS3val) && ok;
    01170                 assert (osoption->getNumberOfSOS() == (tnvar + 1));
    01171                 assert (osoption->optimization->variables->sosVariableBranchingWeights->sos[tnvar]->var[0]->idx == 3);
    01172                 assert (osoption->optimization->variables->sosVariableBranchingWeights->sos[tnvar]->var[1]->idx == 6);
    01173                 assert (osoption->optimization->variables->sosVariableBranchingWeights->sos[tnvar]->var[0]->value == 1.0);
    01174                 assert (osoption->optimization->variables->sosVariableBranchingWeights->sos[tnvar]->var[1]->value == 2.0);
    01175 #ifdef DEBUG
    01176                 cout << endl << "another SOS has been added" << endl << endl;
    01177 #endif
    01178
    01179                 OtherVariableOption *varopt;
    01180                 varopt = new OtherVariableOption();
    01181                 varopt->name = "testVarOpt";
    01182                 varopt->numberOfVar = 2;
    01183                 varopt->numberOfEnumerations = 0;
    01184                 varopt->var = new OtherVarOption*[2];
    01185                 varopt->var[0] = new OtherVarOption();
    01186                 varopt->var[0]->idx = 0;
    01187                 varopt->var[0]->value = "3.0";
    01188                 varopt->var[1] = new OtherVarOption();
    01189                 varopt->var[1]->idx = 1;
    01190                 varopt->var[1]->lbValue = "0.0";
    01191                 varopt->var[1]->ubValue = "10.0";
    01192                 ok = osoption->setAnOtherVariableOption(varopt) && ok;
    01193                 delete varopt;
    01194                 varopt = NULL;
    01195 #ifdef DEBUG
    01196                 cout << endl << "another variable option has been added" << endl << endl;
    01197 #endif
    01198
    01199                 OtherObjectiveOption *objopt;
    01200                 objopt = new OtherObjectiveOption();
    01201                 objopt->name = "testObjOpt";
    01202                 objopt->numberOfObj = 0;
    01203                 objopt->numberOfEnumerations = 0;
    01204                 ok = osoption->setAnOtherObjectiveOption(objopt) && ok;
    01205                 delete objopt;
    01206                 objopt = NULL;
    01207 #ifdef DEBUG
    01208                 cout << endl << "another objective option has been added" << endl << endl;
    01209 #endif
    01210
    01211                 ok = osoption->setAnotherInitConValue(2,17.0) && ok;
    01212                 ok = osoption->setAnotherInitDualVarValue(2,0.0,DBL_MAX) && ok;
    01213
    01214                 OtherConstraintOption *conopt;
    01215                 conopt = new OtherConstraintOption();
    01216                 conopt->name = "testConOpt";
    01217
    01218                 conopt->numberOfCon = 0;
    01219                 conopt->numberOfEnumerations = 1;
    01220
    01221                 conopt->enumeration = new OtherOptionEnumeration*[1];
    01222                 conopt->enumeration[0] = new OtherOptionEnumeration();
    01223                 conopt->enumeration[0]->numberOfEl = 3;
    01224                 conopt->enumeration[0]->value = "test";
    01225                 conopt->enumeration[0]->description = "this is not a test";
    01226                 conopt->enumeration[0]->numberOfEl = 3;
    01227                 conopt->enumeration[0]->el = new int[3];
    01228                 conopt->enumeration[0]->el[0] = 1;
    01229                 conopt->enumeration[0]->el[1] = 3;
    01230                 conopt->enumeration[0]->el[2] = 5;
    01231
    01232                 ok = osoption->setAnOtherConstraintOption(conopt) && ok;
    01233                 delete conopt;
    01234                 conopt = NULL;
    01235 #ifdef DEBUG
    01236                 cout << endl << "another constraint option has been added" << endl << endl;
    01237 #endif
    01238
    01239                 ok = osoption->setAnotherSolverOption("HoHum","gus","PhoNY","","test","") && ok;
    01240
    01241                 if (!ok)
    01242                         throw ErrorClass(" Could not add to osoption data structure");
    01243
    01244                 //Now transfer to another osoption using get() and set() methods
    01245                 std::string optionstring, fileName, fileSource, fileDescription, fileCreator, fileLicence;
    01246                 int option_i;
    01247                 double option_d;
    01248 //              OSOption* osoption2;
    01249                 osoption2= new OSOption();
    01250
    01251                 cout << endl << "transfer osoption to another OSOption object" << endl;
    01252
    01253                 fileName        = osoption->getFileName();
    01254                 fileSource      = osoption->getFileSource();
    01255                 fileDescription = osoption->getFileDescription();
    01256                 fileCreator     = osoption->getFileCreator();
    01257                 fileLicence     = osoption->getFileLicence();
    01258                 ok = osoption2->setOptionHeader(fileName, fileSource, fileDescription, fileCreator, fileLicence);
    01259 #ifdef DEBUG
    01260                 if (!ok)
    01261                         throw ErrorClass(" error in get/set option header");
    01262 #endif
    01263
    01264
    01265                 optionstring = osoption->getServiceURI();
    01266                 ok = osoption2->setServiceURI(optionstring);
    01267 #ifdef DEBUG
    01268                 if (!ok)
    01269                         throw ErrorClass(" error in get/set ServiceURI");
    01270 #endif
    01271
    01272                 optionstring = osoption->getServiceName();
    01273                 ok = osoption2->setServiceName(optionstring) && ok;
    01274 #ifdef DEBUG
    01275                 if (!ok)
    01276                         throw ErrorClass(" error in get/set ServiceName");
    01277 #endif
    01278
    01279                 optionstring = osoption->getInstanceName();
    01280                 ok = osoption2->setInstanceName(optionstring) && ok;
    01281 #ifdef DEBUG
    01282                 if (!ok)
    01283                         throw ErrorClass(" error in get/set InstanceName");
    01284 #endif
    01285
    01286                 optionstring = osoption->getInstanceLocation();
    01287                 ok = osoption2->setInstanceLocation(optionstring) && ok;
    01288 #ifdef DEBUG
    01289                 if (!ok)
    01290                         throw ErrorClass(" error in get/set InstanceLocation");
    01291 #endif
    01292
    01293                 optionstring = osoption->getInstanceLocationType();
    01294                 ok = osoption2->setInstanceLocationType(optionstring) && ok;
    01295 #ifdef DEBUG
    01296                 if (!ok)
    01297                         throw ErrorClass(" error in get/set InstanceLocationtype");
    01298 #endif
    01299
    01300                 optionstring = osoption->getJobID();
    01301                 ok = osoption2->setJobID(optionstring) && ok;
    01302 #ifdef DEBUG
    01303                 if (!ok)
    01304                         throw ErrorClass(" error in get/set JobID");
    01305 #endif
    01306
    01307                 optionstring = osoption->getSolverToInvoke();
    01308                 ok = osoption2->setSolverToInvoke(optionstring) && ok;
    01309 #ifdef DEBUG
    01310                 if (!ok)
    01311                         throw ErrorClass(" error in get/set SolverToInvoke");
    01312 #endif
    01313
    01314                 optionstring = osoption->getInstanceLocationType();
    01315                 ok = osoption2->setInstanceLocationType(optionstring) && ok;
    01316 #ifdef DEBUG
    01317                 if (!ok)
    01318                         throw ErrorClass(" error in get/set InstanceLocationType");
    01319 #endif
    01320
    01321                 optionstring = osoption->getUserName();
    01322                 ok = osoption2->setUserName(optionstring) && ok;
    01323 #ifdef DEBUG
    01324                 if (!ok)
    01325                         throw ErrorClass(" error in get/set UserName");
    01326 #endif
    01327
    01328                 optionstring = osoption->getPassword();
    01329 #ifdef DEBUG
    01330                 if (!ok)
    01331                         throw ErrorClass(" error in get/set Password");
    01332 #endif
    01333                 ok = osoption2->setPassword(optionstring) && ok;
    01334
    01335                 optionstring = osoption->getContact();
    01336                 ok = osoption2->setContact(optionstring) && ok;
    01337 #ifdef DEBUG
    01338                 if (!ok)
    01339                         throw ErrorClass(" error in get/set Contact");
    01340 #endif
    01341
    01342                 optionstring = osoption->getContactTransportType();
    01343                 ok = osoption2->setContactTransportType(optionstring) && ok;
    01344 #ifdef DEBUG
    01345                 if (!ok)
    01346                         throw ErrorClass(" error in get/set TransportType");
    01347 #endif
    01348
    01349                 int nopt;
    01350                 OtherOption** otherOpt;
    01351                 nopt = osoption->getNumberOfOtherGeneralOptions();
    01352                 otherOpt = osoption->getOtherGeneralOptions();
    01353                 ok = osoption2->setOtherGeneralOptions(nopt, otherOpt) && ok;
    01354 #ifdef DEBUG
    01355                 if (!ok)
    01356                         throw ErrorClass(" error in get/set OtherGeneralOption");
    01357 #endif
    01358
    01359                 std::string tempDescription;
    01360
    01361                 optionstring = osoption->getMinDiskSpaceUnit();
    01362                 tempDescription = osoption->getMinDiskSpaceDescription();
    01363                 option_d = osoption->getMinDiskSpace();
    01364                 ok = osoption2->setMinDiskSpace(optionstring,tempDescription,option_d) && ok;
    01365 #ifdef DEBUG
    01366                 if (!ok)
    01367                         throw ErrorClass(" error in get/set MinDiskSpace");
    01368 #endif
    01369
    01370                 optionstring = osoption->getMinMemoryUnit();
    01371                 tempDescription = osoption->getMinMemoryDescription();
    01372                 option_d = osoption->getMinMemorySize();
    01373                 ok = osoption2->setMinMemorySize(optionstring,tempDescription,option_d) && ok;
    01374 #ifdef DEBUG
    01375                 if (!ok)
    01376                         throw ErrorClass(" error in get/set MinMemorySize");
    01377 #endif
    01378
    01379                 optionstring = osoption->getMinCPUSpeedUnit();
    01380                 tempDescription = osoption->getMinCPUSpeedDescription();
    01381                 option_d = osoption->getMinCPUSpeed();
    01382                 ok = osoption2->setMinCPUSpeed(optionstring,tempDescription,option_d) && ok;
    01383 #ifdef DEBUG
    01384                 if (!ok)
    01385                         throw ErrorClass(" error in get/set MinCPUSpeed");
    01386 #endif
    01387
    01388                 option_i = osoption->getMinCPUNumber();
    01389                 optionstring = osoption->getMinCPUNumberDescription();
    01390                 ok = osoption2->setMinCPUNumber(option_i, optionstring) && ok;
    01391 #ifdef DEBUG
    01392                 if (!ok)
    01393                         throw ErrorClass(" error in get/set MinCPUNumber");
    01394 #endif
    01395
    01396                 OtherOption** otherOpt2;
    01397                 nopt = osoption->getNumberOfOtherSystemOptions();
    01398                 otherOpt2 = osoption->getOtherSystemOptions();
    01399                 ok = osoption2->setOtherSystemOptions(nopt, otherOpt2) && ok;
    01400 #ifdef DEBUG
    01401                 if (!ok)
    01402                         throw ErrorClass(" error in get/set OtherSystemOptions");
    01403 #endif
    01404
    01405
    01406                 optionstring = osoption->getServiceType();
    01407                 ok = osoption2->setServiceType(optionstring) && ok;
    01408 #ifdef DEBUG
    01409                 if (!ok)
    01410                         throw ErrorClass(" error in get/set ServiceType");
    01411 #endif
    01412
    01413                 OtherOption** otherOpt3;
    01414                 nopt = osoption->getNumberOfOtherServiceOptions();
    01415                 otherOpt3 = osoption->getOtherServiceOptions();
    01416                 ok = osoption2->setOtherServiceOptions(nopt, otherOpt3) && ok;
    01417 #ifdef DEBUG
    01418                 if (!ok)
    01419                         throw ErrorClass(" error in get/set OtherServiceOptions");
    01420 #endif
    01421
    01422
    01423                 option_d = osoption->getMaxTime();
    01424                 ok = osoption2->setMaxTime(option_d) && ok;
    01425 #ifdef DEBUG
    01426                 if (!ok)
    01427                         throw ErrorClass(" error in get/set MaxTime");
    01428 #endif
    01429
    01430                 optionstring = osoption->getMaxTimeUnit();
    01431                 ok = osoption2->setMaxTimeUnit(optionstring) && ok;
    01432 #ifdef DEBUG
    01433                 if (!ok)
    01434                         throw ErrorClass(" error in get/set MaxTimeUnit");
    01435 #endif
    01436
    01437                 optionstring = osoption->getRequestedStartTime();
    01438                 ok = osoption2->setRequestedStartTime(optionstring) && ok;
    01439 #ifdef DEBUG
    01440                 if (!ok)
    01441                         throw ErrorClass(" error in get/set RequestedStartTime");
    01442 #endif
    01443
    01444                 nopt = osoption->getNumberOfJobDependencies();
    01445                 std::string* tJobID = osoption->getJobDependencies();
    01446                 ok = osoption2->setJobDependencies(nopt, tJobID) && ok;
    01447 #ifdef DEBUG
    01448                 if (!ok)
    01449                         throw ErrorClass(" error in get/set JobDependencies");
    01450 #endif
    01451
    01452                 nopt = osoption->getNumberOfRequiredDirectories();
    01453                 std::string* reqDir = osoption->getRequiredDirectories();
    01454                 ok = osoption2->setRequiredDirectories(nopt, reqDir) && ok;
    01455 #ifdef DEBUG
    01456                 if (!ok)
    01457                         throw ErrorClass(" error in get/set RequiredDirectories");
    01458 #endif
    01459
    01460                 nopt = osoption->getNumberOfRequiredFiles();
    01461                 std::string* reqFil = osoption->getRequiredFiles();
    01462                 ok = osoption2->setRequiredFiles(nopt, reqFil) && ok;
    01463 #ifdef DEBUG
    01464                 if (!ok)
    01465                         throw ErrorClass(" error in get/set RequiredFiles");
    01466 #endif
    01467
    01468                 nopt = osoption->getNumberOfDirectoriesToMake();
    01469                 std::string* mkDir = osoption->getDirectoriesToMake();
    01470                 ok = osoption2->setDirectoriesToMake(nopt, mkDir) && ok;
    01471 #ifdef DEBUG
    01472                 if (!ok)
    01473                         throw ErrorClass(" error in get/set DirectoriesToMake");
    01474 #endif
    01475
    01476                 nopt = osoption->getNumberOfFilesToMake();
    01477                 std::string* mkFil = osoption->getFilesToMake();
    01478                 ok = osoption2->setFilesToMake(nopt, mkFil) && ok;
    01479 #ifdef DEBUG
    01480                 if (!ok)
    01481                         throw ErrorClass(" error in get/set FilesToMake");
    01482 #endif
    01483
    01484                 nopt = osoption->getNumberOfInputDirectoriesToMove();
    01485                 PathPair** inDMv = osoption->getInputDirectoriesToMove();
    01486                 ok = osoption2->setInputDirectoriesToMove(nopt, inDMv) && ok;
    01487 #ifdef DEBUG
    01488                 if (!ok)
    01489                         throw ErrorClass(" error in get/set InputDirectoriesToMove");
    01490 #endif
    01491
    01492                 nopt = osoption->getNumberOfInputFilesToMove();
    01493                 PathPair** inFMv = osoption->getInputFilesToMove();
    01494                 ok = osoption2->setInputFilesToMove(nopt, inFMv) && ok;
    01495 #ifdef DEBUG
    01496                 if (!ok)
    01497                         throw ErrorClass(" error in get/set InputFilesToMove");
    01498 #endif
    01499
    01500                 nopt = osoption->getNumberOfOutputFilesToMove();
    01501                 PathPair** outFMv = osoption->getOutputFilesToMove();
    01502                 ok = osoption2->setOutputFilesToMove(nopt, outFMv) && ok;
    01503 #ifdef DEBUG
    01504                 if (!ok)
    01505                         throw ErrorClass(" error in get/set OutputFilesToMove");
    01506 #endif
    01507
    01508                 nopt = osoption->getNumberOfOutputDirectoriesToMove();
    01509                 PathPair** outDMv = osoption->getOutputDirectoriesToMove();
    01510                 ok = osoption2->setOutputDirectoriesToMove(nopt, outDMv) && ok;
    01511 #ifdef DEBUG
    01512                 if (!ok)
    01513                         throw ErrorClass(" error in get/set OutputDirectoriesToMove");
    01514 #endif
    01515
    01516                 nopt = osoption->getNumberOfFilesToDelete();
    01517                 std::string* rmFil = osoption->getFilesToDelete();
    01518                 ok = osoption2->setFilesToDelete(nopt, rmFil) && ok;
    01519 #ifdef DEBUG
    01520                 if (!ok)
    01521                         throw ErrorClass(" error in get/set FilesToDelete");
    01522 #endif
    01523
    01524                 nopt = osoption->getNumberOfDirectoriesToDelete();
    01525                 std::string* rmDir = osoption->getDirectoriesToDelete();
    01526                 ok = osoption2->setDirectoriesToDelete(nopt, rmDir) && ok;
    01527 #ifdef DEBUG
    01528                 if (!ok)
    01529                         throw ErrorClass(" error in get/set DirectoriesToDelete");
    01530 #endif
    01531
    01532                 nopt = osoption->getNumberOfProcessesToKill();
    01533                 std::string* rmProc = osoption->getProcessesToKill();
    01534                 ok = osoption2->setProcessesToKill(nopt, rmProc) && ok;
    01535 #ifdef DEBUG
    01536                 if (!ok)
    01537                         throw ErrorClass(" error in get/set ProcessesToKill");
    01538 #endif
    01539
    01540                 OtherOption** otherOpt4;
    01541                 nopt = osoption->getNumberOfOtherJobOptions();
    01542                 otherOpt4 = osoption->getOtherJobOptions();
    01543                 ok = osoption2->setOtherJobOptions(nopt, otherOpt4) && ok;
    01544 #ifdef DEBUG
    01545                 if (!ok)
    01546                         throw ErrorClass(" error in get/set OtherJobOptions");
    01547 #endif
    01548
    01549                 int nvar, nobj, ncon;
    01550                 nvar = osoption->getOptionInt("numberOfVariables");
    01551                 ok = osoption2->setNumberOfVariables(nvar) && ok;
    01552                 nobj = osoption->getOptionInt("numberOfObjectives");
    01553                 ok = osoption2->setNumberOfObjectives(nobj) && ok;
    01554                 ncon = osoption->getOptionInt("numberOfConstraints");
    01555                 ok = osoption2->setNumberOfConstraints(ncon) && ok;
    01556                 // eliminate references to numberOfVariables
    01557                 nvar = 10;
    01558                 nobj = 2;
    01559                 ncon = 8;
    01560 #ifdef DEBUG
    01561                 if (!ok)
    01562                         throw ErrorClass(" error in get/set problem dimensions");
    01563 #endif
    01564
    01565 // use sparse methods only because some schema elements allow NaN
    01566                 nopt = osoption->getNumberOfInitVarValues();
    01567                 InitVarValue** IVV;
    01568                 IVV = osoption->getInitVarValuesSparse();
    01569                 ok = osoption2->setInitVarValuesSparse(nopt, IVV) && ok;
    01570 #ifdef DEBUG
    01571                 if (!ok)
    01572                         throw ErrorClass(" error in get/set InitVarValues");
    01573 #endif
    01574
    01575                 nopt = osoption->getNumberOfInitVarValuesString();
    01576                 InitVarValueString** IVV2;
    01577                 IVV2 = osoption->getInitVarValuesStringSparse();
    01578                 ok = osoption2->setInitVarValuesStringSparse(nopt, IVV2) && ok;
    01579 #ifdef DEBUG
    01580                 if (!ok)
    01581                         throw ErrorClass(" error in get/set InitVarValuesString");
    01582 #endif
    01583
    01584                 int*  IBS;
    01585
    01586                 nvar = osoption->getNumberOfInitialBasisElements(ENUM_PROBLEM_COMPONENT_variables,ENUM_BASIS_STATUS_basic);
    01587                 if (nvar > 0)
    01588                 {
    01589                         IBS = new int[nvar];
    01590                         ok = osoption->getInitialBasisElements(ENUM_PROBLEM_COMPONENT_variables,ENUM_BASIS_STATUS_basic,IBS);
    01591                         ok = osoption2->setInitBasisStatus(ENUM_PROBLEM_COMPONENT_variables,ENUM_BASIS_STATUS_basic, IBS, nvar) && ok;
    01592                         delete[] IBS;
    01593 #ifdef DEBUG
    01594                         if (!ok)
    01595                                 throw ErrorClass(" error in get/set InitBasisStatus");
    01596 #endif
    01597                 }
    01598
    01599                 nvar = osoption->getNumberOfInitialBasisElements(ENUM_PROBLEM_COMPONENT_variables,ENUM_BASIS_STATUS_atLower);
    01600                 if (nvar > 0)
    01601                 {
    01602                         IBS = new int[nvar];
    01603                         ok = osoption->getInitialBasisElements(ENUM_PROBLEM_COMPONENT_variables,ENUM_BASIS_STATUS_atLower,IBS);
    01604                         ok = osoption2->setInitBasisStatus(ENUM_PROBLEM_COMPONENT_variables,ENUM_BASIS_STATUS_atLower, IBS, nvar) && ok;
    01605                         delete[] IBS;
    01606 #ifdef DEBUG
    01607                         if (!ok)
    01608                                 throw ErrorClass(" error in get/set InitBasisStatus");
    01609 #endif
    01610                 }
    01611
    01612                 nvar = osoption->getNumberOfInitialBasisElements(ENUM_PROBLEM_COMPONENT_variables,ENUM_BASIS_STATUS_atUpper);
    01613                 if (nvar > 0)
    01614                 {
    01615                         IBS = new int[nvar];
    01616                         ok = osoption->getInitialBasisElements(ENUM_PROBLEM_COMPONENT_variables,ENUM_BASIS_STATUS_atUpper,IBS);
    01617                         ok = osoption2->setInitBasisStatus(ENUM_PROBLEM_COMPONENT_variables,ENUM_BASIS_STATUS_atUpper, IBS, nvar) && ok;
    01618                         delete[] IBS;
    01619 #ifdef DEBUG
    01620                         if (!ok)
    01621                                 throw ErrorClass(" error in get/set InitBasisStatus");
    01622 #endif
    01623                 }
    01624
    01625                 nvar = osoption->getNumberOfInitialBasisElements(ENUM_PROBLEM_COMPONENT_variables,ENUM_BASIS_STATUS_isFree);
    01626                 if (nvar > 0)
    01627                 {
    01628                         IBS = new int[nvar];
    01629                         ok = osoption->getInitialBasisElements(ENUM_PROBLEM_COMPONENT_variables,ENUM_BASIS_STATUS_isFree,IBS);
    01630                         ok = osoption2->setInitBasisStatus(ENUM_PROBLEM_COMPONENT_variables,ENUM_BASIS_STATUS_isFree, IBS, nvar) && ok;
    01631                         delete[] IBS;
    01632 #ifdef DEBUG
    01633                         if (!ok)
    01634                                 throw ErrorClass(" error in get/set InitBasisStatus");
    01635 #endif
    01636                 }
    01637
    01638                 nvar = osoption->getNumberOfInitialBasisElements(ENUM_PROBLEM_COMPONENT_variables,ENUM_BASIS_STATUS_superbasic);
    01639                 if (nvar > 0)
    01640                 {
    01641                         IBS = new int[nvar];
    01642                         ok = osoption->getInitialBasisElements(ENUM_PROBLEM_COMPONENT_variables,ENUM_BASIS_STATUS_superbasic,IBS);
    01643                         ok = osoption2->setInitBasisStatus(ENUM_PROBLEM_COMPONENT_variables,ENUM_BASIS_STATUS_superbasic, IBS, nvar) && ok;
    01644                         delete[] IBS;
    01645 #ifdef DEBUG
    01646                         if (!ok)
    01647                                 throw ErrorClass(" error in get/set InitBasisStatus");
    01648 #endif
    01649                 }
    01650
    01651                 nvar = osoption->getNumberOfInitialBasisElements(ENUM_PROBLEM_COMPONENT_variables,ENUM_BASIS_STATUS_unknown);
    01652                 if (nvar > 0)
    01653                 {
    01654                         IBS = new int[nvar];
    01655                         ok = osoption->getInitialBasisElements(ENUM_PROBLEM_COMPONENT_variables,ENUM_BASIS_STATUS_unknown,IBS);
    01656                         ok = osoption2->setInitBasisStatus(ENUM_PROBLEM_COMPONENT_variables,ENUM_BASIS_STATUS_unknown, IBS, nvar) && ok;
    01657                         delete[] IBS;
    01658 #ifdef DEBUG
    01659                         if (!ok)
    01660                                 throw ErrorClass(" error in get/set InitBasisStatus");
    01661 #endif
    01662                 }
    01663
    01664
    01665                 BranchingWeight** BW;
    01666                 BW = osoption->getIntegerVariableBranchingWeightsSparse();
    01667                 nopt = osoption->getNumberOfIntegerVariableBranchingWeights();
    01668                 ok = osoption2->setIntegerVariableBranchingWeightsSparse(nopt, BW) && ok;
    01669 #ifdef DEBUG
    01670                 if (!ok)
    01671                         throw ErrorClass(" error in get/set IntegerVariableBranchingWeights");
    01672 #endif
    01673
    01674                 SOSWeights** sos;
    01675                 sos = osoption->getSOSVariableBranchingWeightsSparse();
    01676                 nopt = osoption->getNumberOfSOS();
    01677                 ok = osoption2->setSOSVariableBranchingWeights(nopt, sos) && ok;
    01678 #ifdef DEBUG
    01679                 if (!ok)
    01680                         throw ErrorClass(" error in get/set SOSVariableBranchingWeights");
    01681 #endif
    01682
    01683                 OtherVariableOption** otherV;
    01684                 otherV = osoption->getAllOtherVariableOptions();
    01685                 nopt = osoption->getNumberOfOtherVariableOptions();
    01686                 ok = osoption2->setOtherVariableOptions(nopt, otherV) && ok;
    01687 #ifdef DEBUG
    01688                 if (!ok)
    01689                         throw ErrorClass(" error in get/set OtherVariableOptions");
    01690 #endif
    01691
    01692                 nopt = osoption->getNumberOfInitObjValues();
    01693                 InitObjValue** IOV;
    01694                 IOV = osoption->getInitObjValuesSparse();
    01695                 for (int lmn=0; lmn < nobj; lmn++)
    01696
    01697                 ok = osoption2->setInitObjValuesSparse(nopt, IOV) && ok;
    01698 #ifdef DEBUG
    01699                 if (!ok)
    01700                         throw ErrorClass(" error in get/set InitObjValues");
    01701 #endif
    01702
    01703                 nopt = osoption->getNumberOfInitObjBounds();
    01704                 InitObjBound** IOB;
    01705                 IOB = osoption->getInitObjBoundsSparse();
    01706                 ok = osoption2->setInitObjBoundsSparse(nopt, IOB) && ok;
    01707 #ifdef DEBUG
    01708                 if (!ok)
    01709                         throw ErrorClass(" error in get/set InitObjBounds");
    01710 #endif
    01711
    01712                 nvar = osoption->getNumberOfInitialBasisElements(ENUM_PROBLEM_COMPONENT_objectives,ENUM_BASIS_STATUS_basic);
    01713                 if (nvar > 0)
    01714                 {
    01715                         IBS = new int[nvar];
    01716                         ok = osoption->getInitialBasisElements(ENUM_PROBLEM_COMPONENT_objectives,ENUM_BASIS_STATUS_basic,IBS);
    01717                         ok = osoption2->setInitBasisStatus(ENUM_PROBLEM_COMPONENT_objectives,ENUM_BASIS_STATUS_basic, IBS, nvar) && ok;
    01718                         delete[] IBS;
    01719 #ifdef DEBUG
    01720                         if (!ok)
    01721                                 throw ErrorClass(" error in get/set InitBasisStatus");
    01722 #endif
    01723                 }
    01724
    01725                 nvar = osoption->getNumberOfInitialBasisElements(ENUM_PROBLEM_COMPONENT_objectives,ENUM_BASIS_STATUS_atLower);
    01726                 if (nvar > 0)
    01727                 {
    01728                         IBS = new int[nvar];
    01729                         ok = osoption->getInitialBasisElements(ENUM_PROBLEM_COMPONENT_objectives,ENUM_BASIS_STATUS_atLower,IBS);
    01730                         ok = osoption2->setInitBasisStatus(ENUM_PROBLEM_COMPONENT_objectives,ENUM_BASIS_STATUS_atLower, IBS, nvar) && ok;
    01731                         delete[] IBS;
    01732 #ifdef DEBUG
    01733                         if (!ok)
    01734                                 throw ErrorClass(" error in get/set InitBasisStatus");
    01735 #endif
    01736                 }
    01737
    01738                 nvar = osoption->getNumberOfInitialBasisElements(ENUM_PROBLEM_COMPONENT_objectives,ENUM_BASIS_STATUS_atUpper);
    01739                 if (nvar > 0)
    01740                 {
    01741                         IBS = new int[nvar];
    01742                         ok = osoption->getInitialBasisElements(ENUM_PROBLEM_COMPONENT_objectives,ENUM_BASIS_STATUS_atUpper,IBS);
    01743                         ok = osoption2->setInitBasisStatus(ENUM_PROBLEM_COMPONENT_objectives,ENUM_BASIS_STATUS_atUpper, IBS, nvar) && ok;
    01744                         delete[] IBS;
    01745 #ifdef DEBUG
    01746                         if (!ok)
    01747                                 throw ErrorClass(" error in get/set InitBasisStatus");
    01748 #endif
    01749                 }
    01750
    01751                 nvar = osoption->getNumberOfInitialBasisElements(ENUM_PROBLEM_COMPONENT_objectives,ENUM_BASIS_STATUS_isFree);
    01752                 if (nvar > 0)
    01753                 {
    01754                         IBS = new int[nvar];
    01755                         ok = osoption->getInitialBasisElements(ENUM_PROBLEM_COMPONENT_objectives,ENUM_BASIS_STATUS_isFree,IBS);
    01756                         ok = osoption2->setInitBasisStatus(ENUM_PROBLEM_COMPONENT_objectives,ENUM_BASIS_STATUS_isFree, IBS, nvar) && ok;
    01757                         delete[] IBS;
    01758 #ifdef DEBUG
    01759                         if (!ok)
    01760                                 throw ErrorClass(" error in get/set InitBasisStatus");
    01761 #endif
    01762                 }
    01763
    01764                 nvar = osoption->getNumberOfInitialBasisElements(ENUM_PROBLEM_COMPONENT_objectives,ENUM_BASIS_STATUS_superbasic);
    01765                 if (nvar > 0)
    01766                 {
    01767                         IBS = new int[nvar];
    01768                         ok = osoption->getInitialBasisElements(ENUM_PROBLEM_COMPONENT_objectives,ENUM_BASIS_STATUS_superbasic,IBS);
    01769                         ok = osoption2->setInitBasisStatus(ENUM_PROBLEM_COMPONENT_objectives,ENUM_BASIS_STATUS_superbasic, IBS, nvar) && ok;
    01770                         delete[] IBS;
    01771 #ifdef DEBUG
    01772                         if (!ok)
    01773                                 throw ErrorClass(" error in get/set InitBasisStatus");
    01774 #endif
    01775                 }
    01776
    01777                 nvar = osoption->getNumberOfInitialBasisElements(ENUM_PROBLEM_COMPONENT_objectives,ENUM_BASIS_STATUS_unknown);
    01778                 if (nvar > 0)
    01779                 {
    01780                         IBS = new int[nvar];
    01781                         ok = osoption->getInitialBasisElements(ENUM_PROBLEM_COMPONENT_objectives,ENUM_BASIS_STATUS_unknown,IBS);
    01782                         ok = osoption2->setInitBasisStatus(ENUM_PROBLEM_COMPONENT_objectives,ENUM_BASIS_STATUS_unknown, IBS, nvar) && ok;
    01783                         delete[] IBS;
    01784 #ifdef DEBUG
    01785                         if (!ok)
    01786                                 throw ErrorClass(" error in get/set InitBasisStatus");
    01787 #endif
    01788                 }
    01789
    01790                 OtherObjectiveOption** otherO;
    01791                 otherO = osoption->getAllOtherObjectiveOptions();
    01792                 nopt = osoption->getNumberOfOtherObjectiveOptions();
    01793                 ok = osoption2->setOtherObjectiveOptions(nopt, otherO) && ok;
    01794 #ifdef DEBUG
    01795                 if (!ok)
    01796                         throw ErrorClass(" error in get/set OtherObjectiveOptions");
    01797 #endif
    01798
    01799
    01800                 nopt = osoption->getNumberOfInitConValues();
    01801                 InitConValue** ICV;
    01802                 ICV = osoption->getInitConValuesSparse();
    01803                 ok = osoption2->setInitConValuesSparse(nopt, ICV) && ok;
    01804 #ifdef DEBUG
    01805                 if (!ok)
    01806                         throw ErrorClass(" error in get/set InitConValues");
    01807 #endif
    01808
    01809                 nopt = osoption->getNumberOfInitDualVarValues();
    01810                 InitDualVarValue** IDV;
    01811                 IDV = osoption->getInitDualVarValuesSparse();
    01812                 ok = osoption2->setInitDualVarValuesSparse(nopt, IDV) && ok;
    01813 #ifdef DEBUG
    01814                 if (!ok)
    01815                         throw ErrorClass(" error in get/set InitDualVarValues");
    01816 #endif
    01817
    01818                 nvar = osoption->getNumberOfInitialBasisElements(ENUM_PROBLEM_COMPONENT_constraints,ENUM_BASIS_STATUS_basic);
    01819                 if (nvar > 0)
    01820                 {
    01821                         IBS = new int[nvar];
    01822                         ok = osoption->getInitialBasisElements(ENUM_PROBLEM_COMPONENT_constraints,ENUM_BASIS_STATUS_basic,IBS);
    01823                         ok = osoption2->setInitBasisStatus(ENUM_PROBLEM_COMPONENT_constraints,ENUM_BASIS_STATUS_basic, IBS, nvar) && ok;
    01824                         delete[] IBS;
    01825 #ifdef DEBUG
    01826                         if (!ok)
    01827                                 throw ErrorClass(" error in get/set InitBasisStatus");
    01828 #endif
    01829                 }
    01830
    01831                 nvar = osoption->getNumberOfInitialBasisElements(ENUM_PROBLEM_COMPONENT_constraints,ENUM_BASIS_STATUS_atLower);
    01832                 if (nvar > 0)
    01833                 {
    01834                         IBS = new int[nvar];
    01835                         ok = osoption->getInitialBasisElements(ENUM_PROBLEM_COMPONENT_constraints,ENUM_BASIS_STATUS_atLower,IBS);
    01836                         ok = osoption2->setInitBasisStatus(ENUM_PROBLEM_COMPONENT_constraints,ENUM_BASIS_STATUS_atLower, IBS, nvar) && ok;
    01837                         delete[] IBS;
    01838 #ifdef DEBUG
    01839                         if (!ok)
    01840                                 throw ErrorClass(" error in get/set InitBasisStatus");
    01841 #endif
    01842                 }
    01843
    01844                 nvar = osoption->getNumberOfInitialBasisElements(ENUM_PROBLEM_COMPONENT_constraints,ENUM_BASIS_STATUS_atUpper);
    01845                 if (nvar > 0)
    01846                 {
    01847                         IBS = new int[nvar];
    01848                         ok = osoption->getInitialBasisElements(ENUM_PROBLEM_COMPONENT_constraints,ENUM_BASIS_STATUS_atUpper,IBS);
    01849                         ok = osoption2->setInitBasisStatus(ENUM_PROBLEM_COMPONENT_constraints,ENUM_BASIS_STATUS_atUpper, IBS, nvar) && ok;
    01850                         delete[] IBS;
    01851 #ifdef DEBUG
    01852                         if (!ok)
    01853                                 throw ErrorClass(" error in get/set InitBasisStatus");
    01854 #endif
    01855                 }
    01856
    01857                 nvar = osoption->getNumberOfInitialBasisElements(ENUM_PROBLEM_COMPONENT_constraints,ENUM_BASIS_STATUS_isFree);
    01858                 if (nvar > 0)
    01859                 {
    01860                         IBS = new int[nvar];
    01861                         ok = osoption->getInitialBasisElements(ENUM_PROBLEM_COMPONENT_constraints,ENUM_BASIS_STATUS_isFree,IBS);
    01862                         ok = osoption2->setInitBasisStatus(ENUM_PROBLEM_COMPONENT_constraints,ENUM_BASIS_STATUS_isFree, IBS, nvar) && ok;
    01863                         delete[] IBS;
    01864 #ifdef DEBUG
    01865                         if (!ok)
    01866                                 throw ErrorClass(" error in get/set InitBasisStatus");
    01867 #endif
    01868                 }
    01869
    01870                 nvar = osoption->getNumberOfInitialBasisElements(ENUM_PROBLEM_COMPONENT_constraints,ENUM_BASIS_STATUS_superbasic);
    01871                 if (nvar > 0)
    01872                 {
    01873                         IBS = new int[nvar];
    01874                         ok = osoption->getInitialBasisElements(ENUM_PROBLEM_COMPONENT_constraints,ENUM_BASIS_STATUS_superbasic,IBS);
    01875                         ok = osoption2->setInitBasisStatus(ENUM_PROBLEM_COMPONENT_constraints,ENUM_BASIS_STATUS_superbasic, IBS, nvar) && ok;
    01876                         delete[] IBS;
    01877 #ifdef DEBUG
    01878                         if (!ok)
    01879                                 throw ErrorClass(" error in get/set InitBasisStatus");
    01880 #endif
    01881                 }
    01882
    01883                 nvar = osoption->getNumberOfInitialBasisElements(ENUM_PROBLEM_COMPONENT_constraints,ENUM_BASIS_STATUS_unknown);
    01884                 if (nvar > 0)
    01885                 {
    01886                         IBS = new int[nvar];
    01887                         ok = osoption->getInitialBasisElements(ENUM_PROBLEM_COMPONENT_constraints,ENUM_BASIS_STATUS_unknown,IBS);
    01888                         ok = osoption2->setInitBasisStatus(ENUM_PROBLEM_COMPONENT_constraints,ENUM_BASIS_STATUS_unknown, IBS, nvar) && ok;
    01889                         delete[] IBS;
    01890 #ifdef DEBUG
    01891                         if (!ok)
    01892                                 throw ErrorClass(" error in get/set InitBasisStatus");
    01893 #endif
    01894                 }
    01895
    01896                 OtherConstraintOption** otherC;
    01897                 otherC = osoption->getAllOtherConstraintOptions();
    01898                 nopt = osoption->getNumberOfOtherConstraintOptions();
    01899                 ok = osoption2->setOtherConstraintOptions(nopt, otherC) && ok;
    01900 #ifdef DEBUG
    01901                 if (!ok)
    01902                         throw ErrorClass(" error in get/set OtherConstraintOptions");
    01903 #endif
    01904
    01905                 SolverOption** SO;
    01906                 SO = osoption->getAllSolverOptions();
    01907                 nopt = osoption->getNumberOfSolverOptions();
    01908                 ok = osoption2->setSolverOptions(nopt, SO) && ok;
    01909
    01910
    01911 #ifdef DEBUG
    01912                 if (!ok)
    01913                         throw ErrorClass(" error in get/set SolverOptions");
    01914 #endif
    01915
    01916                 ok = osoption->IsEqual(osoption2) && ok;
    01917                 if (!ok)
    01918                         throw ErrorClass("OSOption get() and  set() methods do not work correctly");
    01919
    01920                 cout << "Write the content to a new file" << endl;
    01921                 tmpOSoL = osolwriter->writeOSoL( osoption);
    01922                 cout << endl << "Here is tmpOSoL:" <<endl;
    01923                 cout << endl << endl << tmpOSoL << endl;
    01924                 cout << "-----------------------------------------" << endl << endl;
    01925
    01926                 // make sure we can parse without error
    01927                 osolreader2 = new OSoLReader();
    01928                 cout << "Read the string back" << endl;
    01929
    01930                 osoption3 = osolreader2->readOSoL( tmpOSoL);
    01931
    01932                 ok = osoption->IsEqual(osoption3);
    01933                 if (!ok)
    01934                         throw ErrorClass(" Loss of information in OSoL write/read");
    01935
    01936                 cout << "delete osoption2" << endl;
    01937
    01938                 delete osoption2;
    01939                 osoption2 = NULL;
    01940
    01941                 cout << "delete osolreader2" << endl;
    01942                 delete osolreader2;
    01943                 osolreader2 = NULL;
    01944
    01945                 cout << "delete osolwriter" << endl;
    01946                 delete osolwriter;
    01947                 osolwriter = NULL;
    01948                 cout << "delete osolreader" << endl;
    01949                 delete osolreader;
    01950                 osolreader = NULL;
    01951                 unitTestResult <<
    01952                      "TEST " << nOfTest << ": Successful test of OSoL set() and get() methods"
    01953                       << std::endl;
    01954                 cout << endl << "TEST " << nOfTest << ": Completed successfully" << endl << endl;
    01955         }
    01956         catch(const ErrorClass& eclass){
    01957                 cout << endl << endl << endl;
    01958                 cout << eclass.errormsg << endl;
    01959                 unitTestResultFailure << "Sorry Unit Test Failed OSoL set() and get() methods" << endl;
    01960
    01961                 if (osoption2 != NULL)
    01962                         delete osoption2;
    01963                 osoption2 = NULL;
    01964
    01965                 if (osolreader2 != NULL)
    01966                         delete osolreader2;
    01967                 osolreader2 = NULL;
    01968
    01969                 if (osolwriter != NULL)
    01970                         delete osolwriter;
    01971                 osolwriter = NULL;
    01972
    01973                 if (osolreader != NULL)
    01974                         delete osolreader;
    01975                 osolreader = NULL;
    01976         }
    01977
    01978         // a few more smaller examples
    01979         try{
    01980                 cout << endl << "TEST " << ++nOfTest << ": Parse another .osol file" << endl << endl;
    01981                 std::string tmpOSoL;
    01982                 clock_t start, finish;
    01983                 double duration;
    01984
    01985                 osolwriter = new OSoLWriter();
    01986                 osolreader = new OSoLReader();
    01987                 start = clock();
    01988
    01989                 cout << "First read the OSoL file into a string" << endl;
    01990                 osolFileName = dataDir  + "osolFiles" + dirsep + "parsertest2.osol";
    01991                 osol = fileUtil->getFileAsString( osolFileName.c_str() );
    01992                 finish = clock();
    01993                 duration = (double) (finish - start) / CLOCKS_PER_SEC;
    01994                 cout << "Reading the file into a string took (seconds): "<< duration << endl;
    01995                 cout << endl << osol << endl;
    01996                 cout << "Parse the OSoL string into an OSOption object" << endl;
    01997                 osoption = osolreader->readOSoL( osol);
    01998
    01999                 std::cout << "string read; now write again" << std::endl;
    02000                 tmpOSoL = osolwriter->writeOSoL( osoption) ;
    02001
    02002
    02003                 std::cout << "object written; delete osolreader" << std::endl;
    02004
    02005                 delete osolreader;
    02006                 osolreader = NULL;
    02007                 osolreader = new OSoLReader();
    02008                 osolreader->readOSoL( tmpOSoL);
    02009                 delete osolwriter;
    02010                 osolwriter = NULL;
    02011                 delete osolreader;
    02012                 osolreader = NULL;
    02013
    02014                 // a third example
    02015                 cout << "Test parsing another OSoL file" << endl;
    02016                 osolwriter = new OSoLWriter();
    02017                 osolreader = new OSoLReader();
    02018                 cout << "First read the OSoL file into a string" << endl;
    02019                 osolFileName = dataDir  + "osolFiles" + dirsep + "parsertest3.osol";
    02020                 osol = fileUtil->getFileAsString( osolFileName.c_str() );
    02021                 finish = clock();
    02022                 duration = (double) (finish - start) / CLOCKS_PER_SEC;
    02023                 cout << "Reading the file into a string took (seconds): "<< duration << endl;
    02024                 cout << "Parse the OSoL string into an OSOption object" << endl;
    02025                 osoption = osolreader->readOSoL( osol);
    02026                 tmpOSoL = osolwriter->writeOSoL( osoption) ;
    02027                 delete osolreader;
    02028                 osolreader = NULL;
    02029                 osolreader = new OSoLReader();
    02030                 osolreader->readOSoL( tmpOSoL);
    02031                 delete osolwriter;
    02032                 osolwriter = NULL;
    02033                 delete osolreader;
    02034                 osolreader = NULL;
    02035
    02036
    02037                 // a trivial string
    02038                 cout << "Test parsing a trivial string" << endl;
    02039                 osolreader = new OSoLReader();
    02040                 osol = "<osol></osol>";
    02041                 cout << "Parse the OSoL string into an OSOption object" << endl;
    02042                 osoption = osolreader->readOSoL( osol);
    02043                 delete osolreader;
    02044                 osolreader = NULL;
    02045
    02046
    02047                 unitTestResult << "TEST " << nOfTest << ": Successful test of OSoL parser" << std::endl;
    02048                 cout << endl << "TEST " << nOfTest << ": Completed successfully" << endl << endl;
    02049         }
    02050
    02051         catch(const ErrorClass& eclass){
    02052                 cout << endl << endl << endl;
    02053                 if(osolwriter != NULL) delete osolwriter;
    02054                 osolwriter = NULL;
    02055                 if(osolreader != NULL) delete osolreader;
    02056                 osolreader = NULL;
    02057                 // " Problem with the test reading OSoL data";
    02058                 unitTestResultFailure << eclass.errormsg << endl;
    02059                 unitTestResultFailure << "There was a failure in the test for reading OSoL" << endl;
    02060         }
    02061
    02062 //#endif //!!!  end of #if 0: OSrL parser development
    02063
    02073         OSResult *osresult;
    02074         OSResult *osresult1 = new OSResult();
    02075         OSResult *osresult2 = new OSResult();
    02076         OSResult *osresult3 = NULL;
    02077
    02078         int* intArray;
    02079         intArray = new int[3];
    02080         int* tempArray = new int[3];
    02081
    02082 //#ifdef TEMP   //---------------------------for the time being----------------------------------
    02083         try{
    02084                 cout << endl << "TEST " << ++nOfTest << ": OSrL set() tools" << endl << endl;
    02085
    02086                 ok = true;
    02087                 ok &= (osresult1->IsEqual(osresult2));
    02088                 if (!ok)
    02089                         throw ErrorClass("Empty osresult objects do not compare equal!");
    02090
    02091 //      <general> element
    02092                 ok &= osresult1->setGeneralStatusType("warning");
    02093                 if (!ok)
    02094                         throw ErrorClass("Error during setGeneralStatusType!");
    02095                 ok &= (!osresult1->IsEqual(osresult2));
    02096                 if (!ok)
    02097                         throw ErrorClass("setGeneralStatusType: osresult objects falsely compare equal!");
    02098                 ok &= osresult2->setGeneralStatusType("warning");
    02099                 if (!ok)
    02100                         throw ErrorClass("Error during setGeneralStatusType!");
    02101                 ok &= (osresult1->IsEqual(osresult2));
    02102                 if (!ok)
    02103                         throw ErrorClass("setGeneralStatusType: osresult objects falsely compare unequal!");
    02104
    02105                 ok &= osresult1->setGeneralStatusDescription("some nonempty string");
    02106                 if (!ok)
    02107                         throw ErrorClass("Error during setGeneralStatusDescription!");
    02108                 ok &= (!osresult1->IsEqual(osresult2));
    02109                 if (!ok)
    02110                         throw ErrorClass("setGeneralStatusDescription: osresult objects falsely compare equal!");
    02111                 ok &= osresult2->setGeneralStatusDescription("some nonempty string");
    02112                 if (!ok)
    02113                         throw ErrorClass("Error during setGeneralStatusDescription!");
    02114                 ok &= (osresult1->IsEqual(osresult2));
    02115                 if (!ok)
    02116                         throw ErrorClass("setGeneralStatusDescription: osresult objects falsely compare unequal!");
    02117
    02118                 ok &= osresult1->setNumberOfGeneralSubstatuses(3);
    02119                 if (!ok)
    02120                         throw ErrorClass("Error during setNumberOfGeneralSubstatuses!");
    02121                 ok &= (!osresult1->IsEqual(osresult2));
    02122                 if (!ok)
    02123                         throw ErrorClass("setNumberOfGeneralSubstatuses: osresult objects falsely compare equal!");
    02124                 ok &= osresult2->setNumberOfGeneralSubstatuses(3);
    02125                 if (!ok)
    02126                         throw ErrorClass("Error during setNumberOfGeneralSubstatuses!");
    02127                 ok &= (osresult1->IsEqual(osresult2));
    02128                 if (!ok)
    02129                         throw ErrorClass("setNumberOfGeneralSubstatuses: osresult objects falsely compare unequal!");
    02130
    02131                 for (int i=0; i < 3; ++i)
    02132                 {
    02133                         ok &= osresult1->setGeneralSubstatusName(i,"some name");
    02134                         if (!ok)
    02135                                 throw ErrorClass("Error during setGeneralSubstatusName!");
    02136                         ok &= (!osresult1->IsEqual(osresult2));
    02137                         if (!ok)
    02138                                 throw ErrorClass("setGeneralSubstatusName: osresult objects falsely compare equal!");
    02139                         ok &= osresult2->setGeneralSubstatusName(i,"some name");
    02140                         if (!ok)
    02141                                 throw ErrorClass("Error during setGeneralSubstatusName!");
    02142                         ok &= (osresult1->IsEqual(osresult2));
    02143                         if (!ok)
    02144                                 throw ErrorClass("setGeneralSubstatusName: osresult objects falsely compare unequal!");
    02145
    02146                         ok &= osresult1->setGeneralSubstatusDescription(i,"ABC 123");
    02147                         if (!ok)
    02148                                 throw ErrorClass("Error during setGeneralSubstatusDescription!");
    02149                         ok &= (!osresult1->IsEqual(osresult2));
    02150                         if (!ok)
    02151                                 throw ErrorClass("setGeneralSubstatusDescription: osresult objects falsely compare equal!");
    02152                         ok &= osresult2->setGeneralSubstatusDescription(i,"ABC 123");
    02153                         if (!ok)
    02154                                 throw ErrorClass("Error during setGeneralSubstatusDescription!");
    02155                         ok &= (osresult1->IsEqual(osresult2));
    02156                         if (!ok)
    02157                                 throw ErrorClass("setGeneralSubstatusDescription: osresult objects falsely compare unequal!");
    02158                 }
    02159
    02160                 ok &= osresult1->setGeneralMessage("testing 123");
    02161                 if (!ok)
    02162                         throw ErrorClass("Error during setGeneralMessage!");
    02163                 ok &= (!osresult1->IsEqual(osresult2));
    02164                 if (!ok)
    02165                         throw ErrorClass("setGeneralMessage: osresult objects falsely compare equal!");
    02166                 ok &= osresult2->setGeneralMessage("testing 123");
    02167                 if (!ok)
    02168                         throw ErrorClass("Error during setGeneralMessage!");
    02169                 ok &= (osresult1->IsEqual(osresult2));
    02170                 if (!ok)
    02171                         throw ErrorClass("setGeneralMessage: osresult objects falsely compare unequal!");
    02172
    02173                 ok &= osresult1->setServiceName("testing 123");
    02174                 if (!ok)
    02175                         throw ErrorClass("Error during setServiceName!");
    02176                 ok &= (!osresult1->IsEqual(osresult2));
    02177                 if (!ok)
    02178                         throw ErrorClass("setServiceName: osresult objects falsely compare equal!");
    02179                 ok &= osresult2->setServiceName("testing 123");
    02180                 if (!ok)
    02181                         throw ErrorClass("Error during setServiceName!");
    02182                 ok &= (osresult1->IsEqual(osresult2));
    02183                 if (!ok)
    02184                         throw ErrorClass("setServiceName: osresult objects falsely compare unequal!");
    02185
    02186                 ok &= osresult1->setServiceURI("testing 123");
    02187                 if (!ok)
    02188                         throw ErrorClass("Error during setServiceURI!");
    02189                 ok &= (!osresult1->IsEqual(osresult2));
    02190                 if (!ok)
    02191                         throw ErrorClass("setServiceURI: osresult objects falsely compare equal!");
    02192                 ok &= osresult2->setServiceURI("testing 123");
    02193                 if (!ok)
    02194                         throw ErrorClass("Error during setServiceURI!");
    02195                 ok &= (osresult1->IsEqual(osresult2));
    02196                 if (!ok)
    02197                         throw ErrorClass("setServiceURI: osresult objects falsely compare unequal!");
    02198
    02199                 ok &= osresult1->setInstanceName("testing 123");
    02200                 if (!ok)
    02201                         throw ErrorClass("Error during setInstanceName!");
    02202                 ok &= (!osresult1->IsEqual(osresult2));
    02203                 if (!ok)
    02204                         throw ErrorClass("setInstanceName: osresult objects falsely compare equal!");
    02205                 ok &= osresult2->setInstanceName("testing 123");
    02206                 if (!ok)
    02207                         throw ErrorClass("Error during setInstanceName!");
    02208                 ok &= (osresult1->IsEqual(osresult2));
    02209                 if (!ok)
    02210                         throw ErrorClass("setInstanceName: osresult objects falsely compare unequal!");
    02211
    02212                 ok &= osresult1->setJobID("testing 123");
    02213                 if (!ok)
    02214                         throw ErrorClass("Error during setJobID!");
    02215                 ok &= (!osresult1->IsEqual(osresult2));
    02216                 if (!ok)
    02217                         throw ErrorClass("setJobID: osresult objects falsely compare equal!");
    02218                 ok &= osresult2->setJobID("testing 123");
    02219                 if (!ok)
    02220                         throw ErrorClass("Error during setJobID!");
    02221                 ok &= (osresult1->IsEqual(osresult2));
    02222                 if (!ok)
    02223                         throw ErrorClass("setJobID: osresult objects falsely compare unequal!");
    02224
    02225                 ok &= osresult1->setSolverInvoked("testing 123");
    02226                 if (!ok)
    02227                         throw ErrorClass("Error during setSolverInvoked!");
    02228                 ok &= (!osresult1->IsEqual(osresult2));
    02229                 if (!ok)
    02230                         throw ErrorClass("setSolverInvoked: osresult objects falsely compare equal!");
    02231                 ok &= osresult2->setSolverInvoked("testing 123");
    02232                 if (!ok)
    02233                         throw ErrorClass("Error during setSolverInvoked!");
    02234                 ok &= (osresult1->IsEqual(osresult2));
    02235                 if (!ok)
    02236                         throw ErrorClass("setSolverInvoked: osresult objects falsely compare unequal!");
    02237
    02238                 ok &= osresult1->setTimeStamp("2001-12-17T09:30:47.0Z");
    02239                 if (!ok)
    02240                         throw ErrorClass("Error during setTimeStamp!");
    02241                 ok &= (!osresult1->IsEqual(osresult2));
    02242                 if (!ok)
    02243                         throw ErrorClass("setTimeStamp: osresult objects falsely compare equal!");
    02244                 ok &= osresult2->setTimeStamp("2001-12-17T09:30:47.0Z");
    02245                 if (!ok)
    02246                         throw ErrorClass("Error during setTimeStamp!");
    02247                 ok &= (osresult1->IsEqual(osresult2));
    02248                 if (!ok)
    02249                         throw ErrorClass("setTimeStamp: osresult objects falsely compare unequal!");
    02250
    02251                 ok &= osresult1->setNumberOfOtherGeneralResults(3);
    02252                 if (!ok)
    02253                         throw ErrorClass("Error during setNumberOfOtherGeneralResults!");
    02254                 ok &= (!osresult1->IsEqual(osresult2));
    02255                 if (!ok)
    02256                         throw ErrorClass("setNumberOfOtherGeneralResults: osresult objects falsely compare equal!");
    02257                 ok &= osresult2->setNumberOfOtherGeneralResults(3);
    02258                 if (!ok)
    02259                         throw ErrorClass("Error during setNumberOfOtherGeneralResults!");
    02260                 ok &= (osresult1->IsEqual(osresult2));
    02261                 if (!ok)
    02262                         throw ErrorClass("setNumberOfOtherGeneralResults: osresult objects falsely compare unequal!");
    02263
    02264                 for (int i=0; i < 3; ++i)
    02265                 {
    02266                         ok &= osresult1->setOtherGeneralResultName(i,"some name");
    02267                         if (!ok)
    02268                                 throw ErrorClass("Error during setOtherGeneralResultName!");
    02269                         ok &= (!osresult1->IsEqual(osresult2));
    02270                         if (!ok)
    02271                                 throw ErrorClass("setOtherGeneralResultName: osresult objects falsely compare equal!");
    02272                         ok &= osresult2->setOtherGeneralResultName(i,"some name");
    02273                         if (!ok)
    02274                                 throw ErrorClass("Error during setOtherGeneralResultName!");
    02275                         ok &= (osresult1->IsEqual(osresult2));
    02276                         if (!ok)
    02277                                 throw ErrorClass("setOtherGeneralResultName: osresult objects falsely compare unequal!");
    02278
    02279                         ok &= osresult1->setOtherGeneralResultValue(i,"some value");
    02280                         if (!ok)
    02281                                 throw ErrorClass("Error during setOtherGeneralResultValue!");
    02282                         ok &= (!osresult1->IsEqual(osresult2));
    02283                         if (!ok)
    02284                                 throw ErrorClass("setOtherGeneralResultValue: osresult objects falsely compare equal!");
    02285                         ok &= osresult2->setOtherGeneralResultValue(i,"some value");
    02286                         if (!ok)
    02287                                 throw ErrorClass("Error during setOtherGeneralResultValue!");
    02288                         ok &= (osresult1->IsEqual(osresult2));
    02289                         if (!ok)
    02290                                 throw ErrorClass("setOtherGeneralResultValue: osresult objects falsely compare unequal!");
    02291
    02292                         ok &= osresult1->setOtherGeneralResultDescription(i,"ABC 123");
    02293                         if (!ok)
    02294                                 throw ErrorClass("Error during setOtherGeneralResultDescription!");
    02295                         ok &= (!osresult1->IsEqual(osresult2));
    02296                         if (!ok)
    02297                                 throw ErrorClass("setOtherGeneralResultDescription: osresult objects falsely compare equal!");
    02298                         ok &= osresult2->setOtherGeneralResultDescription(i,"ABC 123");
    02299                         if (!ok)
    02300                                 throw ErrorClass("Error during setOtherGeneralResultDescription!");
    02301                         ok &= (osresult1->IsEqual(osresult2));
    02302                         if (!ok)
    02303                                 throw ErrorClass("setOtherGeneralResultDescription: osresult objects falsely compare unequal!");
    02304                 }
    02305
    02306 // <system> element
    02307                 ok &= osresult1->setSystemInformation("testing 123");
    02308                 if (!ok)
    02309                         throw ErrorClass("Error during setSystemInformation!");
    02310                 ok &= (!osresult1->IsEqual(osresult2));
    02311                 if (!ok)
    02312                         throw ErrorClass("setSystemInformation: osresult objects falsely compare equal!");
    02313                 ok &= osresult2->setSystemInformation("testing 123");
    02314                 if (!ok)
    02315                         throw ErrorClass("Error during setSystemInformation!");
    02316                 ok &= (osresult1->IsEqual(osresult2));
    02317                 if (!ok)
    02318                         throw ErrorClass("setSystemInformation: osresult objects falsely compare unequal!");
    02319
    02320                 ok &= osresult1->setAvailableDiskSpaceUnit("megabyte");
    02321                 if (!ok)
    02322                         throw ErrorClass("Error during setAvailableDiskSpaceUnit!");
    02323                 ok &= (!osresult1->IsEqual(osresult2));
    02324                 if (!ok)
    02325                         throw ErrorClass("setAvailableDiskSpaceUnit: osresult objects falsely compare equal!");
    02326                 ok &= osresult2->setAvailableDiskSpaceUnit("megabyte");
    02327                 if (!ok)
    02328                         throw ErrorClass("Error during setAvailableDiskSpaceUnit!");
    02329                 ok &= (osresult1->IsEqual(osresult2));
    02330                 if (!ok)
    02331                         throw ErrorClass("setAvailableDiskSpaceUnit: osresult objects falsely compare unequal!");
    02332
    02333                 ok &= osresult1->setAvailableDiskSpaceDescription("testing 123");
    02334                 if (!ok)
    02335                         throw ErrorClass("Error during setAvailableDiskSpaceDescription!");
    02336                 ok &= (!osresult1->IsEqual(osresult2));
    02337                 if (!ok)
    02338                         throw ErrorClass("setAvailableDiskSpaceDescription: osresult objects falsely compare equal!");
    02339                 ok &= osresult2->setAvailableDiskSpaceDescription("testing 123");
    02340                 if (!ok)
    02341                         throw ErrorClass("Error during setAvailableDiskSpaceDescription!");
    02342                 ok &= (osresult1->IsEqual(osresult2));
    02343                 if (!ok)
    02344                         throw ErrorClass("setAvailableDiskSpaceDescription: osresult objects falsely compare unequal!");
    02345
    02346                 ok &= osresult1->setAvailableDiskSpaceValue(100.0);
    02347                 if (!ok)
    02348                         throw ErrorClass("Error during setAvailableDiskSpaceValue!");
    02349                 ok &= (!osresult1->IsEqual(osresult2));
    02350                 if (!ok)
    02351                         throw ErrorClass("setAvailableDiskSpaceValue: osresult objects falsely compare equal!");
    02352                 ok &= osresult2->setAvailableDiskSpaceValue(100.0);
    02353                 if (!ok)
    02354                         throw ErrorClass("Error during setAvailableDiskSpaceValue!");
    02355                 ok &= (osresult1->IsEqual(osresult2));
    02356                 if (!ok)
    02357                         throw ErrorClass("setAvailableDiskSpaceValue: osresult objects falsely compare unequal!");
    02358
    02359                 ok &= osresult1->setAvailableMemoryUnit("megabyte");
    02360                 if (!ok)
    02361                         throw ErrorClass("Error during setAvailableMemoryUnit!");
    02362                 ok &= (!osresult1->IsEqual(osresult2));
    02363                 if (!ok)
    02364                         throw ErrorClass("setAvailableMemoryUnit: osresult objects falsely compare equal!");
    02365                 ok &= osresult2->setAvailableMemoryUnit("megabyte");
    02366                 if (!ok)
    02367                         throw ErrorClass("Error during setAvailableMemoryUnit!");
    02368                 ok &= (osresult1->IsEqual(osresult2));
    02369                 if (!ok)
    02370                         throw ErrorClass("setAvailableMemoryUnit: osresult objects falsely compare unequal!");
    02371
    02372                 ok &= osresult1->setAvailableMemoryDescription("testing 123");
    02373                 if (!ok)
    02374                         throw ErrorClass("Error during setAvailableMemoryDescription!");
    02375                 ok &= (!osresult1->IsEqual(osresult2));
    02376                 if (!ok)
    02377                         throw ErrorClass("setAvailableMemoryDescription: osresult objects falsely compare equal!");
    02378                 ok &= osresult2->setAvailableMemoryDescription("testing 123");
    02379                 if (!ok)
    02380                         throw ErrorClass("Error during setAvailableMemoryDescription!");
    02381                 ok &= (osresult1->IsEqual(osresult2));
    02382                 if (!ok)
    02383                         throw ErrorClass("setAvailableMemoryDescription: osresult objects falsely compare unequal!");
    02384
    02385                 ok &= osresult1->setAvailableMemoryValue(100.0);
    02386                 if (!ok)
    02387                         throw ErrorClass("Error during setAvailableMemoryValue!");
    02388                 ok &= (!osresult1->IsEqual(osresult2));
    02389                 if (!ok)
    02390                         throw ErrorClass("setAvailableMemoryValue: osresult objects falsely compare equal!");
    02391                 ok &= osresult2->setAvailableMemoryValue(100.0);
    02392                 if (!ok)
    02393                         throw ErrorClass("Error during setAvailableMemoryValue!");
    02394                 ok &= (osresult1->IsEqual(osresult2));
    02395                 if (!ok)
    02396                         throw ErrorClass("setAvailableMemoryValue: osresult objects falsely compare unequal!");
    02397
    02398                 ok &= osresult1->setAvailableCPUSpeedUnit("megahertz");
    02399                 if (!ok)
    02400                         throw ErrorClass("Error during setAvailableCPUSpeedUnit!");
    02401                 ok &= (!osresult1->IsEqual(osresult2));
    02402                 if (!ok)
    02403                         throw ErrorClass("setAvailableCPUSpeedUnit: osresult objects falsely compare equal!");
    02404                 ok &= osresult2->setAvailableCPUSpeedUnit("megahertz");
    02405                 if (!ok)
    02406                         throw ErrorClass("Error during setAvailableCPUSpeedUnit!");
    02407                 ok &= (osresult1->IsEqual(osresult2));
    02408                 if (!ok)
    02409                         throw ErrorClass("setAvailableCPUSpeedUnit: osresult objects falsely compare unequal!");
    02410
    02411                 ok &= osresult1->setAvailableCPUSpeedDescription("testing 123");
    02412                 if (!ok)
    02413                         throw ErrorClass("Error during setAvailableCPUSpeedDescription!");
    02414                 ok &= (!osresult1->IsEqual(osresult2));
    02415                 if (!ok)
    02416                         throw ErrorClass("setAvailableCPUSpeedDescription: osresult objects falsely compare equal!");
    02417                 ok &= osresult2->setAvailableCPUSpeedDescription("testing 123");
    02418                 if (!ok)
    02419                         throw ErrorClass("Error during setAvailableCPUSpeedDescription!");
    02420                 ok &= (osresult1->IsEqual(osresult2));
    02421                 if (!ok)
    02422                         throw ErrorClass("setAvailableCPUSpeedDescription: osresult objects falsely compare unequal!");
    02423
    02424                 ok &= osresult1->setAvailableCPUSpeedValue(100.0);
    02425                 if (!ok)
    02426                         throw ErrorClass("Error during setAvailableCPUSpeedValue!");
    02427                 ok &= (!osresult1->IsEqual(osresult2));
    02428                 if (!ok)
    02429                         throw ErrorClass("setAvailableCPUSpeedValue: osresult objects falsely compare equal!");
    02430                 ok &= osresult2->setAvailableCPUSpeedValue(100.0);
    02431                 if (!ok)
    02432                         throw ErrorClass("Error during setAvailableCPUSpeedValue!");
    02433                 ok &= (osresult1->IsEqual(osresult2));
    02434                 if (!ok)
    02435                         throw ErrorClass("setAvailableCPUSpeedValue: osresult objects falsely compare unequal!");
    02436
    02437                 ok &= osresult1->setAvailableCPUNumberDescription("testing 123");
    02438                 if (!ok)
    02439                         throw ErrorClass("Error during setAvailableCPUNumberDescription!");
    02440                 ok &= (!osresult1->IsEqual(osresult2));
    02441                 if (!ok)
    02442                         throw ErrorClass("setAvailableCPUNumberDescription: osresult objects falsely compare equal!");
    02443                 ok &= osresult2->setAvailableCPUNumberDescription("testing 123");
    02444                 if (!ok)
    02445                         throw ErrorClass("Error during setAvailableCPUNumberDescription!");
    02446                 ok &= (osresult1->IsEqual(osresult2));
    02447                 if (!ok)
    02448                         throw ErrorClass("setAvailableCPUNumberDescription: osresult objects falsely compare unequal!");
    02449
    02450                 ok &= osresult1->setAvailableCPUNumberValue(100);
    02451                 if (!ok)
    02452                         throw ErrorClass("Error during setAvailableCPUNumberValue!");
    02453                 ok &= (!osresult1->IsEqual(osresult2));
    02454                 if (!ok)
    02455                         throw ErrorClass("setAvailableCPUNumberValue: osresult objects falsely compare equal!");
    02456                 ok &= osresult2->setAvailableCPUNumberValue(100);
    02457                 if (!ok)
    02458                         throw ErrorClass("Error during setAvailableCPUNumberValue!");
    02459                 ok &= (osresult1->IsEqual(osresult2));
    02460                 if (!ok)
    02461                         throw ErrorClass("setAvailableCPUNumberValue: osresult objects falsely compare unequal!");
    02462
    02463                 ok &= osresult1->setNumberOfOtherSystemResults(3);
    02464                 if (!ok)
    02465                         throw ErrorClass("Error during setNumberOfOtherSystemResults!");
    02466                 ok &= (!osresult1->IsEqual(osresult2));
    02467                 if (!ok)
    02468                         throw ErrorClass("setNumberOfOtherSystemResults: osresult objects falsely compare equal!");
    02469                 ok &= osresult2->setNumberOfOtherSystemResults(3);
    02470                 if (!ok)
    02471                         throw ErrorClass("Error during setNumberOfOtherSystemResults!");
    02472                 ok &= (osresult1->IsEqual(osresult2));
    02473                 if (!ok)
    02474                         throw ErrorClass("setNumberOfOtherSystemResults: osresult objects falsely compare unequal!");
    02475
    02476                 for (int i=0; i < 3; ++i)
    02477                 {
    02478                         ok &= osresult1->setOtherSystemResultName(i,"some name");
    02479                         if (!ok)
    02480                                 throw ErrorClass("Error during setOtherSystemResultName!");
    02481                         ok &= (!osresult1->IsEqual(osresult2));
    02482                         if (!ok)
    02483                                 throw ErrorClass("setOtherSystemResultName: osresult objects falsely compare equal!");
    02484                         ok &= osresult2->setOtherSystemResultName(i,"some name");
    02485                         if (!ok)
    02486                                 throw ErrorClass("Error during setOtherSystemResultName!");
    02487                         ok &= (osresult1->IsEqual(osresult2));
    02488                         if (!ok)
    02489                                 throw ErrorClass("setOtherSystemResultName: osresult objects falsely compare unequal!");
    02490
    02491                         ok &= osresult1->setOtherSystemResultValue(i,"some value");
    02492                         if (!ok)
    02493                                 throw ErrorClass("Error during setOtherSystemResultValue!");
    02494                         ok &= (!osresult1->IsEqual(osresult2));
    02495                         if (!ok)
    02496                                 throw ErrorClass("setOtherSystemResultValue: osresult objects falsely compare equal!");
    02497                         ok &= osresult2->setOtherSystemResultValue(i,"some value");
    02498                         if (!ok)
    02499                                 throw ErrorClass("Error during setOtherSystemResultValue!");
    02500                         ok &= (osresult1->IsEqual(osresult2));
    02501                         if (!ok)
    02502                                 throw ErrorClass("setOtherSystemResultValue: osresult objects falsely compare unequal!");
    02503
    02504                         ok &= osresult1->setOtherSystemResultDescription(i,"ABC 123");
    02505                         if (!ok)
    02506                                 throw ErrorClass("Error during setSOtherSystemResultDescription!");
    02507                         ok &= (!osresult1->IsEqual(osresult2));
    02508                         if (!ok)
    02509                                 throw ErrorClass("setOtherSystemResultDescription: osresult objects falsely compare equal!");
    02510                         ok &= osresult2->setOtherSystemResultDescription(i,"ABC 123");
    02511                         if (!ok)
    02512                                 throw ErrorClass("Error during setOtherSystemResultDescription!");
    02513                         ok &= (osresult1->IsEqual(osresult2));
    02514                         if (!ok)
    02515                                 throw ErrorClass("setOtherSystemResultDescription: osresult objects falsely compare unequal!");
    02516                 }
    02517
    02518 //  <service> element
    02519                 ok &= osresult1->setCurrentState("busy");
    02520                 if (!ok)
    02521                         throw ErrorClass("Error during setCurrentState!");
    02522                 ok &= (!osresult1->IsEqual(osresult2));
    02523                 if (!ok)
    02524                         throw ErrorClass("setCurrentState: osresult objects falsely compare equal!");
    02525                 ok &= osresult2->setCurrentState("busy");
    02526                 if (!ok)
    02527                         throw ErrorClass("Error during setCurrentState!");
    02528                 ok &= (osresult1->IsEqual(osresult2));
    02529                 if (!ok)
    02530                         throw ErrorClass("setCurrentState: osresult objects falsely compare unequal!");
    02531
    02532                 ok &= osresult1->setCurrentJobCount(123);
    02533                 if (!ok)
    02534                         throw ErrorClass("Error during setCurrentJobCount!");
    02535                 ok &= (!osresult1->IsEqual(osresult2));
    02536                 if (!ok)
    02537                         throw ErrorClass("setCurrentJobCount: osresult objects falsely compare equal!");
    02538                 ok &= osresult2->setCurrentJobCount(123);
    02539                 if (!ok)
    02540                         throw ErrorClass("Error during setCurrentJobCount!");
    02541                 ok &= (osresult1->IsEqual(osresult2));
    02542                 if (!ok)
    02543                         throw ErrorClass("setCurrentJobCount: osresult objects falsely compare unequal!");
    02544
    02545                 ok &= osresult1->setTotalJobsSoFar(123);
    02546                 if (!ok)
    02547                         throw ErrorClass("Error during setTotalJobsSoFar!");
    02548                 ok &= (!osresult1->IsEqual(osresult2));
    02549                 if (!ok)
    02550                         throw ErrorClass("setTotalJobsSoFar: osresult objects falsely compare equal!");
    02551                 ok &= osresult2->setTotalJobsSoFar(123);
    02552                 if (!ok)
    02553                         throw ErrorClass("Error during setTotalJobsSoFar!");
    02554                 ok &= (osresult1->IsEqual(osresult2));
    02555                 if (!ok)
    02556                         throw ErrorClass("setTotalJobsSoFar: osresult objects falsely compare unequal!");
    02557
    02558                 ok &= osresult1->setTimeServiceStarted("2001-12-17T09:30:47.0Z");
    02559                 if (!ok)
    02560                         throw ErrorClass("Error during setTimeServiceStarted!");
    02561                 ok &= (!osresult1->IsEqual(osresult2));
    02562                 if (!ok)
    02563                         throw ErrorClass("setTimeServiceStarted: osresult objects falsely compare equal!");
    02564                 ok &= osresult2->setTimeServiceStarted("2001-12-17T09:30:47.0Z");
    02565                 if (!ok)
    02566                         throw ErrorClass("Error during setTimeServiceStarted!");
    02567                 ok &= (osresult1->IsEqual(osresult2));
    02568                 if (!ok)
    02569                         throw ErrorClass("setTimeServiceStarted: osresult objects falsely compare unequal!");
    02570
    02571                 ok &= osresult1->setServiceUtilization(0.8);
    02572                 if (!ok)
    02573                         throw ErrorClass("Error during setServiceUtilization!");
    02574                 ok &= (!osresult1->IsEqual(osresult2));
    02575                 if (!ok)
    02576                         throw ErrorClass("setServiceUtilization: osresult objects falsely compare equal!");
    02577                 ok &= osresult2->setServiceUtilization(0.8);
    02578                 if (!ok)
    02579                         throw ErrorClass("Error during setServiceUtilization!");
    02580                 ok &= (osresult1->IsEqual(osresult2));
    02581                 if (!ok)
    02582                         throw ErrorClass("setServiceUtilization: osresult objects falsely compare unequal!");
    02583
    02584                 ok &= osresult1->setNumberOfOtherServiceResults(3);
    02585                 if (!ok)
    02586                         throw ErrorClass("Error during setNumberOfOtherServiceResults!");
    02587                 ok &= (!osresult1->IsEqual(osresult2));
    02588                 if (!ok)
    02589                         throw ErrorClass("setNumberOfOtherServiceResults: osresult objects falsely compare equal!");
    02590                 ok &= osresult2->setNumberOfOtherServiceResults(3);
    02591                 if (!ok)
    02592                         throw ErrorClass("Error during setNumberOfOtherServiceResults!");
    02593                 ok &= (osresult1->IsEqual(osresult2));
    02594                 if (!ok)
    02595                         throw ErrorClass("setNumberOfOtherServiceResults: osresult objects falsely compare unequal!");
    02596
    02597                 for (int i=0; i < 3; ++i)
    02598                 {
    02599                         ok &= osresult1->setOtherServiceResultName(i,"some name");
    02600                         if (!ok)
    02601                                 throw ErrorClass("Error during setOtherServiceResultName!");
    02602                         ok &= (!osresult1->IsEqual(osresult2));
    02603                         if (!ok)
    02604                                 throw ErrorClass("setOtherServiceResultName: osresult objects falsely compare equal!");
    02605                         ok &= osresult2->setOtherServiceResultName(i,"some name");
    02606                         if (!ok)
    02607                                 throw ErrorClass("Error during setOtherServiceResultName!");
    02608                         ok &= (osresult1->IsEqual(osresult2));
    02609                         if (!ok)
    02610                                 throw ErrorClass("setOtherServiceResultName: osresult objects falsely compare unequal!");
    02611
    02612                         ok &= osresult1->setOtherServiceResultValue(i,"some value");
    02613                         if (!ok)
    02614                                 throw ErrorClass("Error during setOtherServiceResultValue!");
    02615                         ok &= (!osresult1->IsEqual(osresult2));
    02616                         if (!ok)
    02617                                 throw ErrorClass("setOtherServiceResultValue: osresult objects falsely compare equal!");
    02618                         ok &= osresult2->setOtherServiceResultValue(i,"some value");
    02619                         if (!ok)
    02620                                 throw ErrorClass("Error during setOtherServiceResultValue!");
    02621                         ok &= (osresult1->IsEqual(osresult2));
    02622                         if (!ok)
    02623                                 throw ErrorClass("setOtherServiceResultValue: osresult objects falsely compare unequal!");
    02624
    02625                         ok &= osresult1->setOtherServiceResultDescription(i,"ABC 123");
    02626                         if (!ok)
    02627                                 throw ErrorClass("Error during setOtherServiceResultDescription!");
    02628                         ok &= (!osresult1->IsEqual(osresult2));
    02629                         if (!ok)
    02630                                 throw ErrorClass("setOtherServiceResultDescription: osresult objects falsely compare equal!");
    02631                         ok &= osresult2->setOtherServiceResultDescription(i,"ABC 123");
    02632                         if (!ok)
    02633                                 throw ErrorClass("Error during setOtherServiceResultDescription!");
    02634                         ok &= (osresult1->IsEqual(osresult2));
    02635                         if (!ok)
    02636                                 throw ErrorClass("setOtherServiceResultDescription: osresult objects falsely compare unequal!");
    02637                 }
    02638 //======================
    02639 //      <job> element
    02640                 ok &= osresult1->setJobStatus("waiting");
    02641                 if (!ok)
    02642                         throw ErrorClass("Error during setJobStatus!");
    02643                 ok &= (!osresult1->IsEqual(osresult2));
    02644                 if (!ok)
    02645                         throw ErrorClass("setJobStatus: osresult objects falsely compare equal!");
    02646                 ok &= osresult2->setJobStatus("waiting");
    02647                 if (!ok)
    02648                         throw ErrorClass("Error during setJobStatus!");
    02649                 ok &= (osresult1->IsEqual(osresult2));
    02650                 if (!ok)
    02651                         throw ErrorClass("setJobStatus: osresult objects falsely compare unequal!");
    02652
    02653                 ok &= osresult1->setJobSubmitTime("2001-12-17T09:30:47.0Z");
    02654                 if (!ok)
    02655                         throw ErrorClass("Error during setJobSubmitTime!");
    02656                 ok &= (!osresult1->IsEqual(osresult2));
    02657                 if (!ok)
    02658                         throw ErrorClass("setJobSubmitTime: osresult objects falsely compare equal!");
    02659                 ok &= osresult2->setJobSubmitTime("2001-12-17T09:30:47.0Z");
    02660                 if (!ok)
    02661                         throw ErrorClass("Error during setJobSubmitTime!");
    02662                 ok &= (osresult1->IsEqual(osresult2));
    02663                 if (!ok)
    02664                         throw ErrorClass("setJobSubmitTime: osresult objects falsely compare unequal!");
    02665
    02666                 ok &= osresult1->setScheduledStartTime("2001-12-17T09:30:47.0Z");
    02667                 if (!ok)
    02668                         throw ErrorClass("Error during setScheduledStartTime!");
    02669                 ok &= (!osresult1->IsEqual(osresult2));
    02670                 if (!ok)
    02671                         throw ErrorClass("setScheduledStartTime: osresult objects falsely compare equal!");
    02672                 ok &= osresult2->setScheduledStartTime("2001-12-17T09:30:47.0Z");
    02673                 if (!ok)
    02674                         throw ErrorClass("Error during setScheduledStartTime!");
    02675                 ok &= (osresult1->IsEqual(osresult2));
    02676                 if (!ok)
    02677                         throw ErrorClass("setScheduledStartTime: osresult objects falsely compare unequal!");
    02678
    02679                 ok &= osresult1->setActualStartTime("2001-12-17T09:30:47.0Z");
    02680                 if (!ok)
    02681                         throw ErrorClass("Error during setActualStartTime!");
    02682                 ok &= (!osresult1->IsEqual(osresult2));
    02683                 if (!ok)
    02684                         throw ErrorClass("setActualStartTime: osresult objects falsely compare equal!");
    02685                 ok &= osresult2->setActualStartTime("2001-12-17T09:30:47.0Z");
    02686                 if (!ok)
    02687                         throw ErrorClass("Error during setActualStartTime!");
    02688                 ok &= (osresult1->IsEqual(osresult2));
    02689                 if (!ok)
    02690                         throw ErrorClass("setActualStartTime: osresult objects falsely compare unequal!");
    02691
    02692                 ok &= osresult1->setJobEndTime("2001-12-17T09:30:47.0Z");
    02693                 if (!ok)
    02694                         throw ErrorClass("Error during setJobEndTime!");
    02695                 ok &= (!osresult1->IsEqual(osresult2));
    02696                 if (!ok)
    02697                         throw ErrorClass("setJobEndTime: osresult objects falsely compare equal!");
    02698                 ok &= osresult2->setJobEndTime("2001-12-17T09:30:47.0Z");
    02699                 if (!ok)
    02700                         throw ErrorClass("Error during setJobEndTime!");
    02701                 ok &= (osresult1->IsEqual(osresult2));
    02702                 if (!ok)
    02703                         throw ErrorClass("setJobEndTime: osresult objects falsely compare unequal!");
    02704
    02705                 ok &= osresult1->setNumberOfTimes(3);
    02706                 if (!ok)
    02707                         throw ErrorClass("Error during setNumberOfTimes!");
    02708                 ok &= (!osresult1->IsEqual(osresult2));
    02709                 if (!ok)
    02710                         throw ErrorClass("setNumberOfTimes: osresult objects falsely compare equal!");
    02711                 ok &= osresult2->setNumberOfTimes(3);
    02712                 if (!ok)
    02713                         throw ErrorClass("Error during setNumberOfTimes!");
    02714                 ok &= (osresult1->IsEqual(osresult2));
    02715                 if (!ok)
    02716                         throw ErrorClass("setNumberOfTimes: osresult objects falsely compare unequal!");
    02717
    02718                 for (int i=0; i < 3; ++i)
    02719                 {
    02720                         ok &= osresult1->setTimingInformation(i,"cpuTime","other",/*"tick",*/"second","blabla",3.14);
    02721                         if (!ok)
    02722                                 throw ErrorClass("Error during setTimingInformation!");
    02723                         ok &= (!osresult1->IsEqual(osresult2));
    02724                         if (!ok)
    02725                                 throw ErrorClass("setTimingInformation: osresult objects falsely compare equal!");
    02726                         ok &= osresult2->setTimingInformation(i,"cpuTime","other",/*"tick",*/"second","blabla",3.14);
    02727                         if (!ok)
    02728                                 throw ErrorClass("Error during setTimingInformation!");
    02729                         ok &= (osresult1->IsEqual(osresult2));
    02730                         if (!ok)
    02731                                 throw ErrorClass("setTimingInformation: osresult objects falsely compare unequal!");
    02732
    02733                 }
    02734
    02735                 ok &= osresult1->setUsedDiskSpaceUnit("megabyte");
    02736                 if (!ok)
    02737                         throw ErrorClass("Error during setUsedDiskSpaceUnit!");
    02738                 ok &= (!osresult1->IsEqual(osresult2));
    02739                 if (!ok)
    02740                         throw ErrorClass("setUsedDiskSpaceUnit: osresult objects falsely compare equal!");
    02741                 ok &= osresult2->setUsedDiskSpaceUnit("megabyte");
    02742                 if (!ok)
    02743                         throw ErrorClass("Error during setUsedDiskSpaceUnit!");
    02744                 ok &= (osresult1->IsEqual(osresult2));
    02745                 if (!ok)
    02746                         throw ErrorClass("setUsedDiskSpaceUnit: osresult objects falsely compare unequal!");
    02747
    02748                 ok &= osresult1->setUsedDiskSpaceDescription("testing 123");
    02749                 if (!ok)
    02750                         throw ErrorClass("Error during setUsedDiskSpaceDescription!");
    02751                 ok &= (!osresult1->IsEqual(osresult2));
    02752                 if (!ok)
    02753                         throw ErrorClass("setUsedDiskSpaceDescription: osresult objects falsely compare equal!");
    02754                 ok &= osresult2->setUsedDiskSpaceDescription("testing 123");
    02755                 if (!ok)
    02756                         throw ErrorClass("Error during setUsedDiskSpaceDescription!");
    02757                 ok &= (osresult1->IsEqual(osresult2));
    02758                 if (!ok)
    02759                         throw ErrorClass("setUsedDiskSpaceDescription: osresult objects falsely compare unequal!");
    02760
    02761                 ok &= osresult1->setUsedDiskSpaceValue(100.0);
    02762                 if (!ok)
    02763                         throw ErrorClass("Error during setUsedDiskSpaceValue!");
    02764                 ok &= (!osresult1->IsEqual(osresult2));
    02765                 if (!ok)
    02766                         throw ErrorClass("setUsedDiskSpaceValue: osresult objects falsely compare equal!");
    02767                 ok &= osresult2->setUsedDiskSpaceValue(100.0);
    02768                 if (!ok)
    02769                         throw ErrorClass("Error during setUsedDiskSpaceValue!");
    02770                 ok &= (osresult1->IsEqual(osresult2));
    02771                 if (!ok)
    02772                         throw ErrorClass("setUsedDiskSpaceValue: osresult objects falsely compare unequal!");
    02773
    02774                 ok &= osresult1->setUsedMemoryUnit("megabyte");
    02775                 if (!ok)
    02776                         throw ErrorClass("Error during setUsedMemoryUnit!");
    02777                 ok &= (!osresult1->IsEqual(osresult2));
    02778                 if (!ok)
    02779                         throw ErrorClass("setUsedMemoryUnit: osresult objects falsely compare equal!");
    02780                 ok &= osresult2->setUsedMemoryUnit("megabyte");
    02781                 if (!ok)
    02782                         throw ErrorClass("Error during setUsedMemoryUnit!");
    02783                 ok &= (osresult1->IsEqual(osresult2));
    02784                 if (!ok)
    02785                         throw ErrorClass("setUsedMemoryUnit: osresult objects falsely compare unequal!");
    02786
    02787                 ok &= osresult1->setUsedMemoryDescription("testing 123");
    02788                 if (!ok)
    02789                         throw ErrorClass("Error during setUsedMemoryDescription!");
    02790                 ok &= (!osresult1->IsEqual(osresult2));
    02791                 if (!ok)
    02792                         throw ErrorClass("setUsedMemoryDescription: osresult objects falsely compare equal!");
    02793                 ok &= osresult2->setUsedMemoryDescription("testing 123");
    02794                 if (!ok)
    02795                         throw ErrorClass("Error during setUsedMemoryDescription!");
    02796                 ok &= (osresult1->IsEqual(osresult2));
    02797                 if (!ok)
    02798                         throw ErrorClass("setUsedMemoryDescription: osresult objects falsely compare unequal!");
    02799
    02800                 ok &= osresult1->setUsedMemoryValue(100.0);
    02801                 if (!ok)
    02802                         throw ErrorClass("Error during setUsedMemoryValue!");
    02803                 ok &= (!osresult1->IsEqual(osresult2));
    02804                 if (!ok)
    02805                         throw ErrorClass("setUsedMemoryValue: osresult objects falsely compare equal!");
    02806                 ok &= osresult2->setUsedMemoryValue(100.0);
    02807                 if (!ok)
    02808                         throw ErrorClass("Error during setUsedMemoryValue!");
    02809                 ok &= (osresult1->IsEqual(osresult2));
    02810                 if (!ok)
    02811                         throw ErrorClass("setUsedMemoryValue: osresult objects falsely compare unequal!");
    02812
    02813                 ok &= osresult1->setUsedCPUSpeedUnit("megahertz");
    02814                 if (!ok)
    02815                         throw ErrorClass("Error during setUsedCPUSpeedUnit!");
    02816                 ok &= (!osresult1->IsEqual(osresult2));
    02817                 if (!ok)
    02818                         throw ErrorClass("setUsedCPUSpeedUnit: osresult objects falsely compare equal!");
    02819                 ok &= osresult2->setUsedCPUSpeedUnit("megahertz");
    02820                 if (!ok)
    02821                         throw ErrorClass("Error during setUsedCPUSpeedUnit!");
    02822                 ok &= (osresult1->IsEqual(osresult2));
    02823                 if (!ok)
    02824                         throw ErrorClass("setUsedCPUSpeedUnit: osresult objects falsely compare unequal!");
    02825
    02826                 ok &= osresult1->setUsedCPUSpeedDescription("testing 123");
    02827                 if (!ok)
    02828                         throw ErrorClass("Error during setUsedCPUSpeedDescription!");
    02829                 ok &= (!osresult1->IsEqual(osresult2));
    02830                 if (!ok)
    02831                         throw ErrorClass("setUsedCPUSpeedDescription: osresult objects falsely compare equal!");
    02832                 ok &= osresult2->setUsedCPUSpeedDescription("testing 123");
    02833                 if (!ok)
    02834                         throw ErrorClass("Error during setUsedCPUSpeedDescription!");
    02835                 ok &= (osresult1->IsEqual(osresult2));
    02836                 if (!ok)
    02837                         throw ErrorClass("setUsedCPUSpeedDescription: osresult objects falsely compare unequal!");
    02838
    02839                 ok &= osresult1->setUsedCPUSpeedValue(100.0);
    02840                 if (!ok)
    02841                         throw ErrorClass("Error during setUsedCPUSpeedValue!");
    02842                 ok &= (!osresult1->IsEqual(osresult2));
    02843                 if (!ok)
    02844                         throw ErrorClass("setUsedCPUSpeedValue: osresult objects falsely compare equal!");
    02845                 ok &= osresult2->setUsedCPUSpeedValue(100.0);
    02846                 if (!ok)
    02847                         throw ErrorClass("Error during setUsedCPUSpeedValue!");
    02848                 ok &= (osresult1->IsEqual(osresult2));
    02849                 if (!ok)
    02850                         throw ErrorClass("setUsedCPUSpeedValue: osresult objects falsely compare unequal!");
    02851
    02852                 ok &= osresult1->setUsedCPUNumberDescription("testing 123");
    02853                 if (!ok)
    02854                         throw ErrorClass("Error during setUsedCPUNumberDescription!");
    02855                 ok &= (!osresult1->IsEqual(osresult2));
    02856                 if (!ok)
    02857                         throw ErrorClass("setUsedCPUNumberDescription: osresult objects falsely compare equal!");
    02858                 ok &= osresult2->setUsedCPUNumberDescription("testing 123");
    02859                 if (!ok)
    02860                         throw ErrorClass("Error during setUsedCPUNumberDescription!");
    02861                 ok &= (osresult1->IsEqual(osresult2));
    02862                 if (!ok)
    02863                         throw ErrorClass("setUsedCPUNumberDescription: osresult objects falsely compare unequal!");
    02864
    02865                 ok &= osresult1->setUsedCPUNumberValue(100);
    02866                 if (!ok)
    02867                         throw ErrorClass("Error during setUsedCPUNumberValue!");
    02868                 ok &= (!osresult1->IsEqual(osresult2));
    02869                 if (!ok)
    02870                         throw ErrorClass("setUsedCPUNumberValue: osresult objects falsely compare equal!");
    02871                 ok &= osresult2->setUsedCPUNumberValue(100);
    02872                 if (!ok)
    02873                         throw ErrorClass("Error during setUsedCPUNumberValue!");
    02874                 ok &= (osresult1->IsEqual(osresult2));
    02875                 if (!ok)
    02876                         throw ErrorClass("setUsedCPUNumberValue: osresult objects falsely compare unequal!");
    02877
    02878                 ok &= osresult1->setNumberOfOtherJobResults(3);
    02879                 if (!ok)
    02880                         throw ErrorClass("Error during setNumberOfOtherJobResults!");
    02881                 ok &= (!osresult1->IsEqual(osresult2));
    02882                 if (!ok)
    02883                         throw ErrorClass("setNumberOfOtherJobResults: osresult objects falsely compare equal!");
    02884                 ok &= osresult2->setNumberOfOtherJobResults(3);
    02885                 if (!ok)
    02886                         throw ErrorClass("Error during setNumberOfOtherJobResults!");
    02887                 ok &= (osresult1->IsEqual(osresult2));
    02888                 if (!ok)
    02889                         throw ErrorClass("setNumberOfOtherJobResults: osresult objects falsely compare unequal!");
    02890
    02891                 for (int i=0; i < 3; ++i)
    02892                 {
    02893                         ok &= osresult1->setOtherJobResultName(i,"some name");
    02894                         if (!ok)
    02895                                 throw ErrorClass("Error during setOtherJobResultName!");
    02896                         ok &= (!osresult1->IsEqual(osresult2));
    02897                         if (!ok)
    02898                                 throw ErrorClass("setOtherJobResultName: osresult objects falsely compare equal!");
    02899                         ok &= osresult2->setOtherJobResultName(i,"some name");
    02900                         if (!ok)
    02901                                 throw ErrorClass("Error during setOtherJobResultName!");
    02902                         ok &= (osresult1->IsEqual(osresult2));
    02903                         if (!ok)
    02904                                 throw ErrorClass("setOtherJobResultName: osresult objects falsely compare unequal!");
    02905
    02906                         ok &= osresult1->setOtherJobResultValue(i,"some value");
    02907                         if (!ok)
    02908                                 throw ErrorClass("Error during setOtherJobResultValue!");
    02909                         ok &= (!osresult1->IsEqual(osresult2));
    02910                         if (!ok)
    02911                                 throw ErrorClass("setOtherJobResultValue: osresult objects falsely compare equal!");
    02912                         ok &= osresult2->setOtherJobResultValue(i,"some value");
    02913                         if (!ok)
    02914                                 throw ErrorClass("Error during setOtherJobResultValue!");
    02915                         ok &= (osresult1->IsEqual(osresult2));
    02916                         if (!ok)
    02917                                 throw ErrorClass("setOtherJobResultValue: osresult objects falsely compare unequal!");
    02918
    02919                         ok &= osresult1->setOtherJobResultDescription(i,"ABC 123");
    02920                         if (!ok)
    02921                                 throw ErrorClass("Error during setOtherJobResultDescription!");
    02922                         ok &= (!osresult1->IsEqual(osresult2));
    02923                         if (!ok)
    02924                                 throw ErrorClass("setOtherJobResultDescription: osresult objects falsely compare equal!");
    02925                         ok &= osresult2->setOtherJobResultDescription(i,"ABC 123");
    02926                         if (!ok)
    02927                                 throw ErrorClass("Error during setOtherJobResultDescription!");
    02928                         ok &= (osresult1->IsEqual(osresult2));
    02929                         if (!ok)
    02930                                 throw ErrorClass("setOtherJobResultDescription: osresult objects falsely compare unequal!");
    02931                 }
    02932
    02933                 ok &= osresult1->setSolutionNumber(2);
    02934                 if (!ok)
    02935                         throw ErrorClass("Error during setSolutionNumber!");
    02936                 ok &= (!osresult1->IsEqual(osresult2));
    02937                 if (!ok)
    02938                         throw ErrorClass("setSolutionNumber: osresult objects falsely compare equal!");
    02939                 ok &= osresult2->setSolutionNumber(2);
    02940                 if (!ok)
    02941                         throw ErrorClass("Error during setSolutionNumber!");
    02942                 ok &= (osresult1->IsEqual(osresult2));
    02943                 if (!ok)
    02944                         throw ErrorClass("setSolutionNumber: osresult objects falsely compare unequal!");
    02945
    02946                 ok &= osresult1->setVariableNumber(4);
    02947                 if (!ok)
    02948                         throw ErrorClass("Error during setVariableNumber!");
    02949                 ok &= (!osresult1->IsEqual(osresult2));
    02950                 if (!ok)
    02951                         throw ErrorClass("setVariableNumber: osresult objects falsely compare equal!");
    02952                 ok &= osresult2->setVariableNumber(4);
    02953                 if (!ok)
    02954                         throw ErrorClass("Error during setVariableNumber!");
    02955                 ok &= (osresult1->IsEqual(osresult2));
    02956                 if (!ok)
    02957                         throw ErrorClass("setVariableNumber: osresult objects falsely compare unequal!");
    02958
    02959                 ok &= osresult1->setObjectiveNumber(2);
    02960                 if (!ok)
    02961                         throw ErrorClass("Error during setObjectiveNumber!");
    02962                 ok &= (!osresult1->IsEqual(osresult2));
    02963                 if (!ok)
    02964                         throw ErrorClass("setObjectiveNumber: osresult objects falsely compare equal!");
    02965                 ok &= osresult2->setObjectiveNumber(2);
    02966                 if (!ok)
    02967                         throw ErrorClass("Error during setObjectiveNumber!");
    02968                 ok &= (osresult1->IsEqual(osresult2));
    02969                 if (!ok)
    02970                         throw ErrorClass("setObjectiveNumber: osresult objects falsely compare unequal!");
    02971
    02972                 ok &= osresult1->setConstraintNumber(3);
    02973                 if (!ok)
    02974                         throw ErrorClass("Error during setConstraintNumber!");
    02975                 ok &= (!osresult1->IsEqual(osresult2));
    02976                 if (!ok)
    02977                         throw ErrorClass("setConstraintNumber: osresult objects falsely compare equal!");
    02978                 ok &= osresult2->setConstraintNumber(3);
    02979                 if (!ok)
    02980                         throw ErrorClass("Error during setConstraintNumber!");
    02981                 ok &= (osresult1->IsEqual(osresult2));
    02982                 if (!ok)
    02983                         throw ErrorClass("setConstraintNumber: osresult objects falsely compare unequal!");
    02984
    02985                 for (int i=0; i < 2; ++i)
    02986                 {
    02987                         ok &= osresult1->setSolutionTargetObjectiveIdx(i,-2);
    02988                         if (!ok)
    02989                                 throw ErrorClass("Error during setSolutionTargetObjectiveIdx!");
    02990                         ok &= (!osresult1->IsEqual(osresult2));
    02991                         if (!ok)
    02992                                 throw ErrorClass("setSolutionTargetObjectiveIdx: osresult objects falsely compare equal!");
    02993                         ok &= osresult2->setSolutionTargetObjectiveIdx(i,-2);
    02994                         if (!ok)
    02995                                 throw ErrorClass("Error during setSolutionTargetObjectiveIdx!");
    02996                         ok &= (osresult1->IsEqual(osresult2));
    02997                         if (!ok)
    02998                                 throw ErrorClass("setSolutionTargetObjectiveIdx: osresult objects falsely compare unequal!");
    02999
    03000                         ok &= osresult1->setSolutionWeightedObjectives(i,"true");
    03001                         if (!ok)
    03002                                 throw ErrorClass("Error during setSolutionWeightedObjectives!");
    03003                         ok &= (!osresult1->IsEqual(osresult2));
    03004                         if (!ok)
    03005                                 throw ErrorClass("setSolutionWeightedObjectives: osresult objects falsely compare equal!");
    03006                         ok &= osresult2->setSolutionWeightedObjectives(i,"true");
    03007                         if (!ok)
    03008                                 throw ErrorClass("Error during setSolutionWeightedObjectives!");
    03009                         ok &= (osresult1->IsEqual(osresult2));
    03010                         if (!ok)
    03011                                 throw ErrorClass("setSolutionWeightedObjectives: osresult objects falsely compare unequal!");
    03012
    03013                         ok &= osresult1->setSolutionStatusType(i,"locallyOptimal");
    03014                         if (!ok)
    03015                                 throw ErrorClass("Error during setSolutionStatusType!");
    03016                         ok &= (!osresult1->IsEqual(osresult2));
    03017                         if (!ok)
    03018                                 throw ErrorClass("setSolutionStatusType: osresult objects falsely compare equal!");
    03019                         ok &= osresult2->setSolutionStatusType(i,"locallyOptimal");
    03020                         if (!ok)
    03021                                 throw ErrorClass("Error during setSolutionStatusType!");
    03022                         ok &= (osresult1->IsEqual(osresult2));
    03023                         if (!ok)
    03024                                 throw ErrorClass("setSolutionStatusType: osresult objects falsely compare unequal!");
    03025
    03026                         ok &= osresult1->setSolutionStatusDescription(i,"ABC 123");
    03027                         if (!ok)
    03028                                 throw ErrorClass("Error during setSolutionStatusDescription!");
    03029                         ok &= (!osresult1->IsEqual(osresult2));
    03030                         if (!ok)
    03031                                 throw ErrorClass("setSolutionStatusDescription: osresult objects falsely compare equal!");
    03032                         ok &= osresult2->setSolutionStatusDescription(i,"ABC 123");
    03033                         if (!ok)
    03034                                 throw ErrorClass("Error during setSolutionStatusDescription!");
    03035                         ok &= (osresult1->IsEqual(osresult2));
    03036                         if (!ok)
    03037                                 throw ErrorClass("setSolutionStatusDescription: osresult objects falsely compare unequal!");
    03038
    03039                         ok &= osresult1->setNumberOfSolutionSubstatuses(i,3);
    03040                         if (!ok)
    03041                                 throw ErrorClass("Error during setNumberOfSolutionSubstatuses!");
    03042                         ok &= (!osresult1->IsEqual(osresult2));
    03043                         if (!ok)
    03044                                 throw ErrorClass("setNumberOfSolutionSubstatuses: osresult objects falsely compare equal!");
    03045                         ok &= osresult2->setNumberOfSolutionSubstatuses(i,3);
    03046                         if (!ok)
    03047                                 throw ErrorClass("Error during setNumberOfSolutionSubstatuses!");
    03048                         ok &= (osresult1->IsEqual(osresult2));
    03049                         if (!ok)
    03050                                 throw ErrorClass("setNumberOfSolutionSubstatuses: osresult objects falsely compare unequal!");
    03051
    03052                         for (int j=0; j < 3; ++j)
    03053                         {
    03054                                 ok &= osresult1->setSolutionSubstatusType(i,j,"other");
    03055                                 if (!ok)
    03056                                         throw ErrorClass("Error during setSolutionSubstatusType!");
    03057                                 ok &= (!osresult1->IsEqual(osresult2));
    03058                                 if (!ok)
    03059                                         throw ErrorClass("setSolutionSubstatusType: osresult objects falsely compare equal!");
    03060                                 ok &= osresult2->setSolutionSubstatusType(i,j,"other");
    03061                                 if (!ok)
    03062                                         throw ErrorClass("Error during setSolutionSubstatusType!");
    03063                                 ok &= (osresult1->IsEqual(osresult2));
    03064                                 if (!ok)
    03065                                         throw ErrorClass("setSolutionSubstatusType: osresult objects falsely compare unequal!");
    03066
    03067                                 ok &= osresult1->setSolutionSubstatusDescription(i,j,"whatever");
    03068                                 if (!ok)
    03069                                         throw ErrorClass("Error during setSolutionSubstatusDescription!");
    03070                                 ok &= (!osresult1->IsEqual(osresult2));
    03071                                 if (!ok)
    03072                                         throw ErrorClass("setSolutionSubstatusDescription: osresult objects falsely compare equal!");
    03073                                 ok &= osresult2->setSolutionSubstatusDescription(i,j,"whatever");
    03074                                 if (!ok)
    03075                                         throw ErrorClass("Error during setSolutionSubstatusDescription!");
    03076                                 ok &= (osresult1->IsEqual(osresult2));
    03077                                 if (!ok)
    03078                                         throw ErrorClass("setSolutionSubstatusDescription: osresult objects falsely compare unequal!");
    03079                         }
    03080
    03081                         ok &= osresult1->setSolutionMessage(i,"ABC 123");
    03082                         if (!ok)
    03083                                 throw ErrorClass("Error during setSolutionMessage!");
    03084                         ok &= (!osresult1->IsEqual(osresult2));
    03085                         if (!ok)
    03086                                 throw ErrorClass("setSolutionMessage: osresult objects falsely compare equal!");
    03087                         ok &= osresult2->setSolutionMessage(i,"ABC 123");
    03088                         if (!ok)
    03089                                 throw ErrorClass("Error during setSolutionMessage!");
    03090                         ok &= (osresult1->IsEqual(osresult2));
    03091                         if (!ok)
    03092                                 throw ErrorClass("setSolutionMessage: osresult objects falsely compare unequal!");
    03093
    03094                         ok &= osresult1->setNumberOfVarValues(i,3);
    03095                         if (!ok)
    03096                                 throw ErrorClass("Error during setNumberOfVarValues!");
    03097                         ok &= (!osresult1->IsEqual(osresult2));
    03098                         if (!ok)
    03099                                 throw ErrorClass("setNumberOfVarValues: osresult objects falsely compare equal!");
    03100                         ok &= osresult2->setNumberOfVarValues(i,3);
    03101                         if (!ok)
    03102                                 throw ErrorClass("Error during setNumberOfVarValues!");
    03103                         ok &= (osresult1->IsEqual(osresult2));
    03104                         if (!ok)
    03105                                 throw ErrorClass("setNumberOfVarValues: osresult objects falsely compare unequal!");
    03106
    03107                         for (int j=0; j < 3; ++j)
    03108                         {
    03109                                 ok &= osresult1->setVarValue(i,j,j,3.14);
    03110                                 if (!ok)
    03111                                         throw ErrorClass("Error during setVarValue!");
    03112                                 ok &= (!osresult1->IsEqual(osresult2));
    03113                                 if (!ok)
    03114                                         throw ErrorClass("setVarValue: osresult objects falsely compare equal!");
    03115                                 ok &= osresult2->setVarValue(i,j,j,3.14);
    03116                                 if (!ok)
    03117                                         throw ErrorClass("Error during setVarValue!");
    03118                                 ok &= (osresult1->IsEqual(osresult2));
    03119                                 if (!ok)
    03120                                         throw ErrorClass("setVarValue: osresult objects falsely compare unequal!");
    03121                         }
    03122
    03123                         ok &= osresult1->setNumberOfVarValuesString(i,3);
    03124                         if (!ok)
    03125                                 throw ErrorClass("Error during setNumberOfVarValuesString!");
    03126                         ok &= (!osresult1->IsEqual(osresult2));
    03127                         if (!ok)
    03128                                 throw ErrorClass("setNumberOfVarValuesString: osresult objects falsely compare equal!");
    03129                         ok &= osresult2->setNumberOfVarValuesString(i,3);
    03130                         if (!ok)
    03131                                 throw ErrorClass("Error during setNumberOfVarValuesString!");
    03132                         ok &= (osresult1->IsEqual(osresult2));
    03133                         if (!ok)
    03134                                 throw ErrorClass("setNumberOfVarValuesString: osresult objects falsely compare unequal!");
    03135
    03136                         for (int j=0; j < 3; ++j)
    03137                         {
    03138                                 ok &= osresult1->setVarValueString(i,j,j,"one");
    03139                                 if (!ok)
    03140                                         throw ErrorClass("Error during setVarValueString!");
    03141                                 ok &= (!osresult1->IsEqual(osresult2));
    03142                                 if (!ok)
    03143                                         throw ErrorClass("setVarValueString: osresult objects falsely compare equal!");
    03144                                 ok &= osresult2->setVarValueString(i,j,j,"one");
    03145                                 if (!ok)
    03146                                         throw ErrorClass("Error during setVarValueString!");
    03147                                 ok &= (osresult1->IsEqual(osresult2));
    03148                                 if (!ok)
    03149                                         throw ErrorClass("setVarValueString: osresult objects falsely compare unequal!");
    03150                         }
    03151
    03152                         intArray[0]=1000*i + 1100 + 10 + 1;
    03153                         intArray[1]=1000*i + 1100 + 10 + 2;
    03154                         intArray[2]=1000*i + 1100 + 10 + 3;
    03155
    03156                         ok &= osresult1->setBasisStatus(i, ENUM_PROBLEM_COMPONENT_variables, ENUM_BASIS_STATUS_basic, intArray, 3);
    03157                         if (!ok)
    03158                                 throw ErrorClass("Error during setBasisStatus (variables basic)!");
    03159                         ok &= (!osresult1->IsEqual(osresult2));
    03160                         if (!ok)
    03161                                 throw ErrorClass("setBasisStatus (variables basic): osresult objects falsely compare equal!");
    03162                         ok &= osresult2->setBasisStatus(i, ENUM_PROBLEM_COMPONENT_variables, ENUM_BASIS_STATUS_basic, intArray, 3);
    03163                         if (!ok)
    03164                                 throw ErrorClass("Error during setBasisStatus (variables basic)!");
    03165                         ok &= (osresult1->IsEqual(osresult2));
    03166                         if (!ok)
    03167                                 throw ErrorClass("setBasisStatus (variables basic): osresult objects falsely compare unequal!");
    03168
    03169                         intArray[0] = intArray[0] + 10;
    03170                         intArray[1] = intArray[1] + 10;
    03171                         intArray[2] = intArray[2] + 10;
    03172
    03173
    03174                         ok &= osresult1->setBasisStatus(i, ENUM_PROBLEM_COMPONENT_variables, ENUM_BASIS_STATUS_atLower, intArray, 3);
    03175                         if (!ok)
    03176                                 throw ErrorClass("Error during setBasisStatus (variables atLower)!");
    03177                         ok &= (!osresult1->IsEqual(osresult2));
    03178                         if (!ok)
    03179                                 throw ErrorClass("setBasisStatus (variables atLower): osresult objects falsely compare equal!");
    03180                         ok &= osresult2->setBasisStatus(i, ENUM_PROBLEM_COMPONENT_variables, ENUM_BASIS_STATUS_atLower, intArray, 3);
    03181                         if (!ok)
    03182                                 throw ErrorClass("Error during setBasisStatus (variables atLower)!");
    03183                         ok &= (osresult1->IsEqual(osresult2));
    03184                         if (!ok)
    03185                                 throw ErrorClass("setBasisStatus (variables atLower): osresult objects falsely compare unequal!");
    03186                         intArray[0] = intArray[0] + 10;
    03187                         intArray[1] = intArray[1] + 10;
    03188                         intArray[2] = intArray[2] + 10;
    03189
    03190
    03191                         ok &= osresult1->setBasisStatus(i, ENUM_PROBLEM_COMPONENT_variables, ENUM_BASIS_STATUS_atUpper, intArray, 3);
    03192                         if (!ok)
    03193                                 throw ErrorClass("Error during setBasisStatus (variables atUpper)!");
    03194                         ok &= (!osresult1->IsEqual(osresult2));
    03195                         if (!ok)
    03196                                 throw ErrorClass("setBasisStatus (variables atUpper): osresult objects falsely compare equal!");
    03197                         ok &= osresult2->setBasisStatus(i, ENUM_PROBLEM_COMPONENT_variables, ENUM_BASIS_STATUS_atUpper, intArray, 3);
    03198                         if (!ok)
    03199                                 throw ErrorClass("Error during setBasisStatus (variables atUpper)!");
    03200                         ok &= (osresult1->IsEqual(osresult2));
    03201                         if (!ok)
    03202                                 throw ErrorClass("setBasisStatus (variables atUpper): osresult objects falsely compare unequal!");
    03203
    03204                         intArray[0] = intArray[0] + 10;
    03205                         intArray[1] = intArray[1] + 10;
    03206                         intArray[2] = intArray[2] + 10;
    03207
    03208                         ok &= osresult1->setBasisStatus(i, ENUM_PROBLEM_COMPONENT_variables, ENUM_BASIS_STATUS_isFree, intArray, 3);
    03209                         if (!ok)
    03210                                 throw ErrorClass("Error during setBasisStatus (variables isFree)!");
    03211                         ok &= (!osresult1->IsEqual(osresult2));
    03212                         if (!ok)
    03213                                 throw ErrorClass("setBasisStatus (variables isFree): osresult objects falsely compare equal!");
    03214                         ok &= osresult2->setBasisStatus(i, ENUM_PROBLEM_COMPONENT_variables, ENUM_BASIS_STATUS_isFree, intArray, 3);
    03215                         if (!ok)
    03216                                 throw ErrorClass("Error during setBasisStatus (variables isFree)!");
    03217                         ok &= (osresult1->IsEqual(osresult2));
    03218                         if (!ok)
    03219                                 throw ErrorClass("setBasisStatus (variables isFree): osresult objects falsely compare unequal!");
    03220
    03221                         intArray[0] = intArray[0] + 10;
    03222                         intArray[1] = intArray[1] + 10;
    03223                         intArray[2] = intArray[2] + 10;
    03224
    03225                         ok &= osresult1->setBasisStatus(i, ENUM_PROBLEM_COMPONENT_variables, ENUM_BASIS_STATUS_superbasic, intArray, 3);
    03226                         if (!ok)
    03227                                 throw ErrorClass("Error during setBasisStatus (variables superbasic)!");
    03228                         ok &= (!osresult1->IsEqual(osresult2));
    03229                         if (!ok)
    03230                                 throw ErrorClass("setBasisStatus (variables superbasic): osresult objects falsely compare equal!");
    03231                         ok &= osresult2->setBasisStatus(i, ENUM_PROBLEM_COMPONENT_variables, ENUM_BASIS_STATUS_superbasic, intArray, 3);
    03232                         if (!ok)
    03233                                 throw ErrorClass("Error during setBasisStatus (variables superbasic)!");
    03234                         ok &= (osresult1->IsEqual(osresult2));
    03235                         if (!ok)
    03236                                 throw ErrorClass("setBasisStatus (variables superbasic): osresult objects falsely compare unequal!");
    03237
    03238                         intArray[0] = intArray[0] + 10;
    03239                         intArray[1] = intArray[1] + 10;
    03240                         intArray[2] = intArray[2] + 10;
    03241
    03242                         ok &= osresult1->setBasisStatus(i, ENUM_PROBLEM_COMPONENT_variables, ENUM_BASIS_STATUS_unknown, intArray, 3);
    03243                         if (!ok)
    03244                                 throw ErrorClass("Error during setBasisStatus (variables unknown)!");
    03245                         ok &= (!osresult1->IsEqual(osresult2));
    03246                         if (!ok)
    03247                                 throw ErrorClass("setBasisStatus (variables unknown): osresult objects falsely compare equal!");
    03248                         ok &= osresult2->setBasisStatus(i, ENUM_PROBLEM_COMPONENT_variables, ENUM_BASIS_STATUS_unknown, intArray, 3);
    03249                         if (!ok)
    03250                                 throw ErrorClass("Error during setBasisStatus (variables unknown)!");
    03251                         ok &= (osresult1->IsEqual(osresult2));
    03252                         if (!ok)
    03253                                 throw ErrorClass("setBasisStatus (variables unknown): osresult objects falsely compare unequal!");
    03254
    03255                         ok &= osresult1->setNumberOfOtherVariableResults(i,3);
    03256                         if (!ok)
    03257                                 throw ErrorClass("Error during setNumberOfOtherVariableResults!");
    03258                         ok &= (!osresult1->IsEqual(osresult2));
    03259                         if (!ok)
    03260                                 throw ErrorClass("setNumberOfOtherVariableResults: osresult objects falsely compare equal!");
    03261                         ok &= osresult2->setNumberOfOtherVariableResults(i,3);
    03262                         if (!ok)
    03263                                 throw ErrorClass("Error during setNumberOfOtherVariableResults!");
    03264                         ok &= (osresult1->IsEqual(osresult2));
    03265                         if (!ok)
    03266                                 throw ErrorClass("setNumberOfOtherVariableResults: osresult objects falsely compare unequal!");
    03267
    03268                         for (int j=0; j < 2; ++j)
    03269                         {
    03270                                 ok &= osresult1->setOtherVariableResultName(i,j,"other");
    03271                                 if (!ok)
    03272                                         throw ErrorClass("Error during setOtherVariableResultName!");
    03273                                 ok &= (!osresult1->IsEqual(osresult2));
    03274                                 if (!ok)
    03275                                         throw ErrorClass("setOtherVariableResultName: osresult objects falsely compare equal!");
    03276                                 ok &= osresult2->setOtherVariableResultName(i,j,"other");
    03277                                 if (!ok)
    03278                                         throw ErrorClass("Error during setOtherVariableResultName!");
    03279                                 ok &= (osresult1->IsEqual(osresult2));
    03280                                 if (!ok)
    03281                                         throw ErrorClass("setOtherVariableResultName: osresult objects falsely compare unequal!");
    03282
    03283                                 ok &= osresult1->setOtherVariableResultDescription(i,j,"other");
    03284                                 if (!ok)
    03285                                         throw ErrorClass("Error during setOtherVariableResultDescription!");
    03286                                 ok &= (!osresult1->IsEqual(osresult2));
    03287                                 if (!ok)
    03288                                         throw ErrorClass("setOtherVariableResultDescription: osresult objects falsely compare equal!");
    03289                                 ok &= osresult2->setOtherVariableResultDescription(i,j,"other");
    03290                                 if (!ok)
    03291                                         throw ErrorClass("Error during setOtherVariableResultDescription!");
    03292                                 ok &= (osresult1->IsEqual(osresult2));
    03293                                 if (!ok)
    03294                                         throw ErrorClass("setOtherVariableResultDescription: osresult objects falsely compare unequal!");
    03295
    03296                                 ok &= osresult1->setOtherVariableResultValue(i,j,"other");
    03297                                 if (!ok)
    03298                                         throw ErrorClass("Error during setOtherVariableResultValue!");
    03299                                 ok &= (!osresult1->IsEqual(osresult2));
    03300                                 if (!ok)
    03301                                         throw ErrorClass("setOtherVariableResultValue: osresult objects falsely compare equal!");
    03302                                 ok &= osresult2->setOtherVariableResultValue(i,j,"other");
    03303                                 if (!ok)
    03304                                         throw ErrorClass("Error during setOtherVariableResultValue!");
    03305                                 ok &= (osresult1->IsEqual(osresult2));
    03306                                 if (!ok)
    03307                                         throw ErrorClass("setOtherVariableResultValue: osresult objects falsely compare unequal!");
    03308
    03309                                 ok &= osresult1->setOtherVariableResultNumberOfVar(i,j,3);
    03310                                 if (!ok)
    03311                                         throw ErrorClass("Error during setOtherVariableResultNumberOfVar!");
    03312                                 ok &= (!osresult1->IsEqual(osresult2));
    03313                                 if (!ok)
    03314                                         throw ErrorClass("setOtherVariableResultNumberOfVar: osresult objects falsely compare equal!");
    03315                                 ok &= osresult2->setOtherVariableResultNumberOfVar(i,j,3);
    03316                                 if (!ok)
    03317                                         throw ErrorClass("Error during setOtherVariableResultNumberOfVar!");
    03318                                 ok &= (osresult1->IsEqual(osresult2));
    03319                                 if (!ok)
    03320                                         throw ErrorClass("setOtherVariableResultNumberOfVar: osresult objects falsely compare unequal!");
    03321
    03322                                 for (int k=0; k < 3; ++k)
    03323                                 {
    03324                                         ok &= osresult1->setOtherVariableResultVarIdx(i,j,k,k);
    03325                                         if (!ok)
    03326                                                 throw ErrorClass("Error during setOtherVariableResultVarIdx!");
    03327                                         ok &= (!osresult1->IsEqual(osresult2));
    03328                                         if (!ok)
    03329                                                 throw ErrorClass("setOtherVariableResultVarIdx: osresult objects falsely compare equal!");
    03330                                         ok &= osresult2->setOtherVariableResultVarIdx(i,j,k,k);
    03331                                         if (!ok)
    03332                                                 throw ErrorClass("Error during setOtherVariableResultVarIdx!");
    03333                                         ok &= (osresult1->IsEqual(osresult2));
    03334                                         if (!ok)
    03335                                                 throw ErrorClass("setOtherVariableResultVarIdx: osresult objects falsely compare unequal!");
    03336
    03337                                         ok &= osresult1->setOtherVariableResultVar(i,j,k,"value");
    03338                                         if (!ok)
    03339                                                 throw ErrorClass("Error during setOtherVariableResultVar!");
    03340                                         ok &= (!osresult1->IsEqual(osresult2));
    03341                                         if (!ok)
    03342                                                 throw ErrorClass("setOtherVariableResultVar: osresult objects falsely compare equal!");
    03343                                         ok &= osresult2->setOtherVariableResultVar(i,j,k,"value");
    03344                                         if (!ok)
    03345                                                 throw ErrorClass("Error during setOtherVariableResultVar!");
    03346                                         ok &= (osresult1->IsEqual(osresult2));
    03347                                         if (!ok)
    03348                                                 throw ErrorClass("setOtherVariableResultVar: osresult objects falsely compare unequal!");
    03349                                 }
    03350                         }
    03351
    03352 // The third <other> result uses enumerations
    03353
    03354                         ok &= osresult1->setOtherVariableResultName(i,2,"other");
    03355                         if (!ok)
    03356                                 throw ErrorClass("Error during setOtherVariableResultName!");
    03357                         ok &= (!osresult1->IsEqual(osresult2));
    03358                         if (!ok)
    03359                                 throw ErrorClass("setOtherVariableResultName: osresult objects falsely compare equal!");
    03360                         ok &= osresult2->setOtherVariableResultName(i,2,"other");
    03361                         if (!ok)
    03362                                 throw ErrorClass("Error during setOtherVariableResultName!");
    03363                         ok &= (osresult1->IsEqual(osresult2));
    03364                         if (!ok)
    03365                                 throw ErrorClass("setOtherVariableResultName: osresult objects falsely compare unequal!");
    03366
    03367                         ok &= osresult1->setOtherVariableResultDescription(i,2,"other");
    03368                         if (!ok)
    03369                                 throw ErrorClass("Error during setOtherVariableResultDescription!");
    03370                         ok &= (!osresult1->IsEqual(osresult2));
    03371                         if (!ok)
    03372                                 throw ErrorClass("setOtherVariableResultDescription: osresult objects falsely compare equal!");
    03373                         ok &= osresult2->setOtherVariableResultDescription(i,2,"other");
    03374                         if (!ok)
    03375                                 throw ErrorClass("Error during setOtherVariableResultDescription!");
    03376                         ok &= (osresult1->IsEqual(osresult2));
    03377                         if (!ok)
    03378                                 throw ErrorClass("setOtherVariableResultDescription: osresult objects falsely compare unequal!");
    03379
    03380                         ok &= osresult1->setOtherVariableResultValue(i,2,"other");
    03381                         if (!ok)
    03382                                 throw ErrorClass("Error during setOtherVariableResultValue!");
    03383                         ok &= (!osresult1->IsEqual(osresult2));
    03384                         if (!ok)
    03385                                 throw ErrorClass("setOtherVariableResultValue: osresult objects falsely compare equal!");
    03386                         ok &= osresult2->setOtherVariableResultValue(i,2,"other");
    03387                         if (!ok)
    03388                                 throw ErrorClass("Error during setOtherVariableResultValue!");
    03389                         ok &= (osresult1->IsEqual(osresult2));
    03390                         if (!ok)
    03391                                 throw ErrorClass("setOtherVariableResultValue: osresult objects falsely compare unequal!");
    03392
    03393
    03394                         ok &= osresult1->setOtherVariableResultNumberOfEnumerations(i,2,2);
    03395                         if (!ok)
    03396                                 throw ErrorClass("Error during setOtherVariableResultNumberOfEnumerations!");
    03397                         ok &= (!osresult1->IsEqual(osresult2));
    03398                         if (!ok)
    03399                                 throw ErrorClass("setOtherVariableResultNumberOfEnumerations: osresult objects falsely compare equal!");
    03400                         ok &= osresult2->setOtherVariableResultNumberOfEnumerations(i,2,2);
    03401                         if (!ok)
    03402                                 throw ErrorClass("Error during setOtherVariableResultNumberOfEnumerations!");
    03403                         ok &= (osresult1->IsEqual(osresult2));
    03404                         if (!ok)
    03405                                 throw ErrorClass("setOtherVariableResultNumberOfEnumerations: osresult objects falsely compare unequal!");
    03406
    03407                         for (int k=0; k < 2; ++k)
    03408                         {
    03409                         intArray[0] = 1000*i + 1130 + 10*k + 1;
    03410                         intArray[1] = 1000*i + 1130 + 10*k + 2;
    03411                         intArray[2] = 1000*i + 1130 + 10*k + 3;
    03412
    03413                                 ok &= osresult1->setOtherOptionEnumeration(i,2,ENUM_PROBLEM_COMPONENT_variables,k,"value","description",intArray,3);
    03414                                 if (!ok)
    03415                                         throw ErrorClass("Error during setOtherOptionEnumeration!");
    03416                                 ok &= (!osresult1->IsEqual(osresult2));
    03417                                 if (!ok)
    03418                                         throw ErrorClass("setOtherOptionEnumeration: osresult objects falsely compare equal!");
    03419                                 ok &= osresult2->setOtherOptionEnumeration(i,2,ENUM_PROBLEM_COMPONENT_variables,k,"value","description",intArray,3);
    03420                                 if (!ok)
    03421                                         throw ErrorClass("Error during setOtherOptionEnumeration!");
    03422                                 ok &= (osresult1->IsEqual(osresult2));
    03423                                 if (!ok)
    03424                                         throw ErrorClass("setOtherOptionEnumeration: osresult objects falsely compare unequal!");
    03425                         }
    03426
    03427
    03428 //==========================================================================================
    03429
    03430
    03431                         ok &= osresult1->setNumberOfObjValues(i,2);
    03432                         if (!ok)
    03433                                 throw ErrorClass("Error during setNumberOfObjValues!");
    03434                         ok &= (!osresult1->IsEqual(osresult2));
    03435                         if (!ok)
    03436                                 throw ErrorClass("setNumberOfObjValues: osresult objects falsely compare equal!");
    03437                         ok &= osresult2->setNumberOfObjValues(i,2);
    03438                         if (!ok)
    03439                                 throw ErrorClass("Error during setNumberOfObjValues!");
    03440                         ok &= (osresult1->IsEqual(osresult2));
    03441                         if (!ok)
    03442                                 throw ErrorClass("setNumberOfObjValues: osresult objects falsely compare unequal!");
    03443
    03444                         for (int j=0; j < 2; ++j)
    03445                         {
    03446                                 ok &= osresult1->setObjValue(i,j,-2,3.14);
    03447                                 if (!ok)
    03448                                         throw ErrorClass("Error during setObjValue!");
    03449                                 ok &= (!osresult1->IsEqual(osresult2));
    03450                                 if (!ok)
    03451                                         throw ErrorClass("setObjValue: osresult objects falsely compare equal!");
    03452                                 ok &= osresult2->setObjValue(i,j,-2,3.14);
    03453                                 if (!ok)
    03454                                         throw ErrorClass("Error during setObjValue!");
    03455                                 ok &= (osresult1->IsEqual(osresult2));
    03456                                 if (!ok)
    03457                                         throw ErrorClass("setObjValue: osresult objects falsely compare unequal!");
    03458                         }
    03459                         intArray[0] = -1000*i - 1200 - 10 - 1;
    03460                         intArray[1] = -1000*i - 1200 - 10 - 2;
    03461                         intArray[2] = -1000*i - 1200 - 10 - 3;
    03462
    03463 //===============================================
    03464                         ok &= osresult1->setBasisStatus(i, ENUM_PROBLEM_COMPONENT_objectives, ENUM_BASIS_STATUS_basic, intArray, 3);
    03465                         if (!ok)
    03466                                 throw ErrorClass("Error during setBasisStatus (objectives basic)!");
    03467                         ok &= (!osresult1->IsEqual(osresult2));
    03468                         if (!ok)
    03469                                 throw ErrorClass("setBasisStatus (objectives basic): osresult objects falsely compare equal!");
    03470                         ok &= osresult2->setBasisStatus(i, ENUM_PROBLEM_COMPONENT_objectives, ENUM_BASIS_STATUS_basic, intArray, 3);
    03471                         if (!ok)
    03472                                 throw ErrorClass("Error during setBasisStatus (objectives basic)!");
    03473                         ok &= (osresult1->IsEqual(osresult2));
    03474                         if (!ok)
    03475                                 throw ErrorClass("setBasisStatus (objectives basic): osresult objects falsely compare unequal!");
    03476
    03477                         intArray[0] = intArray[0] - 10;
    03478                         intArray[1] = intArray[1] - 10;
    03479                         intArray[2] = intArray[2] - 10;
    03480
    03481                         ok &= osresult1->setBasisStatus(i, ENUM_PROBLEM_COMPONENT_objectives, ENUM_BASIS_STATUS_atLower, intArray, 3);
    03482                         if (!ok)
    03483                                 throw ErrorClass("Error during setBasisStatus (objectives atLower)!");
    03484                         ok &= (!osresult1->IsEqual(osresult2));
    03485                         if (!ok)
    03486                                 throw ErrorClass("setBasisStatus (objectives atLower): osresult objects falsely compare equal!");
    03487                         ok &= osresult2->setBasisStatus(i, ENUM_PROBLEM_COMPONENT_objectives, ENUM_BASIS_STATUS_atLower, intArray, 3);
    03488                         if (!ok)
    03489                                 throw ErrorClass("Error during setBasisStatus (objectives atLower)!");
    03490                         ok &= (osresult1->IsEqual(osresult2));
    03491                         if (!ok)
    03492                                 throw ErrorClass("setBasisStatus (objectives atLower): osresult objects falsely compare unequal!");
    03493
    03494                         intArray[0] = intArray[0] - 10;
    03495                         intArray[1] = intArray[1] - 10;
    03496                         intArray[2] = intArray[2] - 10;
    03497
    03498                         ok &= osresult1->setBasisStatus(i, ENUM_PROBLEM_COMPONENT_objectives, ENUM_BASIS_STATUS_atUpper, intArray, 3);
    03499
    03500                         if (!ok)
    03501                                 throw ErrorClass("Error during setBasisStatus (objectives atUpper)!");
    03502                         ok &= (!osresult1->IsEqual(osresult2));
    03503                         if (!ok)
    03504                                 throw ErrorClass("setBasisStatus (objectives atUpper): osresult objects falsely compare equal!");
    03505                         ok &= osresult2->setBasisStatus(i, ENUM_PROBLEM_COMPONENT_objectives, ENUM_BASIS_STATUS_atUpper, intArray, 3);
    03506                         if (!ok)
    03507                                 throw ErrorClass("Error during setBasisStatus (objectives atUpper)!");
    03508                         ok &= (osresult1->IsEqual(osresult2));
    03509                         if (!ok)
    03510                                 throw ErrorClass("setBasisStatus (objectives atUpper): osresult objects falsely compare unequal!");
    03511
    03512
    03513                         intArray[0] = intArray[0] - 10;
    03514                         intArray[1] = intArray[1] - 10;
    03515                         intArray[2] = intArray[2] - 10;
    03516
    03517                         ok &= osresult1->setBasisStatus(i, ENUM_PROBLEM_COMPONENT_objectives, ENUM_BASIS_STATUS_isFree, intArray, 3);
    03518                         if (!ok)
    03519                                 throw ErrorClass("Error during setBasisStatus (objectives isFree)!");
    03520                         ok &= (!osresult1->IsEqual(osresult2));
    03521                         if (!ok)
    03522                                 throw ErrorClass("setBasisStatus (objectives isFree): osresult objects falsely compare equal!");
    03523                         ok &= osresult2->setBasisStatus(i, ENUM_PROBLEM_COMPONENT_objectives, ENUM_BASIS_STATUS_isFree, intArray, 3);
    03524                         if (!ok)
    03525                                 throw ErrorClass("Error during setBasisStatus (objectives isFree)!");
    03526                         ok &= (osresult1->IsEqual(osresult2));
    03527                         if (!ok)
    03528                                 throw ErrorClass("setBasisStatus (objectives isFree): osresult objects falsely compare unequal!");
    03529
    03530
    03531                         intArray[0] = intArray[0] - 10;
    03532                         intArray[1] = intArray[1] - 10;
    03533                         intArray[2] = intArray[2] - 10;
    03534
    03535                         ok &= osresult1->setBasisStatus(i, ENUM_PROBLEM_COMPONENT_objectives, ENUM_BASIS_STATUS_superbasic, intArray, 3);
    03536                         if (!ok)
    03537                                 throw ErrorClass("Error during setBasisStatus (objectives superbasic)!");
    03538                         ok &= (!osresult1->IsEqual(osresult2));
    03539                         if (!ok)
    03540                                 throw ErrorClass("setBasisStatus (objectives superbasic): osresult objects falsely compare equal!");
    03541                         ok &= osresult2->setBasisStatus(i, ENUM_PROBLEM_COMPONENT_objectives, ENUM_BASIS_STATUS_superbasic, intArray, 3);
    03542                         if (!ok)
    03543                                 throw ErrorClass("Error during setBasisStatus (objectives superbasic)!");
    03544                         ok &= (osresult1->IsEqual(osresult2));
    03545                         if (!ok)
    03546                                 throw ErrorClass("setBasisStatus (objectives superbasic): osresult objects falsely compare unequal!");
    03547
    03548
    03549                         intArray[0] = intArray[0] - 10;
    03550                         intArray[1] = intArray[1] - 10;
    03551                         intArray[2] = intArray[2] - 10;
    03552
    03553                         ok &= osresult1->setBasisStatus(i, ENUM_PROBLEM_COMPONENT_objectives, ENUM_BASIS_STATUS_unknown, intArray, 3);
    03554                         if (!ok)
    03555                                 throw ErrorClass("Error during setBasisStatus (objectives unknown)!");
    03556                         ok &= (!osresult1->IsEqual(osresult2));
    03557                         if (!ok)
    03558                                 throw ErrorClass("setBasisStatus (objectives unknown): osresult objects falsely compare equal!");
    03559                         ok &= osresult2->setBasisStatus(i, ENUM_PROBLEM_COMPONENT_objectives, ENUM_BASIS_STATUS_unknown, intArray, 3);
    03560                         if (!ok)
    03561                                 throw ErrorClass("Error during setBasisStatus (objectives unknown)!");
    03562                         ok &= (osresult1->IsEqual(osresult2));
    03563                         if (!ok)
    03564                                 throw ErrorClass("setBasisStatus (objectives unknown): osresult objects falsely compare unequal!");
    03565
    03566 //===============================================
    03567
    03568                         ok &= osresult1->setNumberOfOtherObjectiveResults(i,3);
    03569                         if (!ok)
    03570                                 throw ErrorClass("Error during setNumberOfOtherObjectiveResults!");
    03571                         ok &= (!osresult1->IsEqual(osresult2));
    03572                         if (!ok)
    03573                                 throw ErrorClass("setNumberOfOtherObjectiveResults: osresult objects falsely compare equal!");
    03574                         ok &= osresult2->setNumberOfOtherObjectiveResults(i,3);
    03575                         if (!ok)
    03576                                 throw ErrorClass("Error during setNumberOfOtherObjectiveResults!");
    03577                         ok &= (osresult1->IsEqual(osresult2));
    03578                         if (!ok)
    03579                                 throw ErrorClass("setNumberOfOtherObjectiveResults: osresult objects falsely compare unequal!");
    03580
    03581                         for (int j=0; j < 2; ++j)
    03582                         {
    03583                                 ok &= osresult1->setOtherObjectiveResultName(i,j,"other");
    03584                                 if (!ok)
    03585                                         throw ErrorClass("Error during setOtherObjectiveResultName!");
    03586                                 ok &= (!osresult1->IsEqual(osresult2));
    03587                                 if (!ok)
    03588                                         throw ErrorClass("setOtherObjectiveResultName: osresult objects falsely compare equal!");
    03589                                 ok &= osresult2->setOtherObjectiveResultName(i,j,"other");
    03590                                 if (!ok)
    03591                                         throw ErrorClass("Error during setOtherObjectiveResultName!");
    03592                                 ok &= (osresult1->IsEqual(osresult2));
    03593                                 if (!ok)
    03594                                         throw ErrorClass("setOtherObjectiveResultName: osresult objects falsely compare unequal!");
    03595
    03596                                 ok &= osresult1->setOtherObjectiveResultDescription(i,j,"other");
    03597                                 if (!ok)
    03598                                         throw ErrorClass("Error during setOtherObjectiveResultDescription!");
    03599                                 ok &= (!osresult1->IsEqual(osresult2));
    03600                                 if (!ok)
    03601                                         throw ErrorClass("setOtherObjectiveResultDescription: osresult objects falsely compare equal!");
    03602                                 ok &= osresult2->setOtherObjectiveResultDescription(i,j,"other");
    03603                                 if (!ok)
    03604                                         throw ErrorClass("Error during setOtherObjectiveResultDescription!");
    03605                                 ok &= (osresult1->IsEqual(osresult2));
    03606                                 if (!ok)
    03607                                         throw ErrorClass("setOtherObjectiveResultDescription: osresult objects falsely compare unequal!");
    03608
    03609                                 ok &= osresult1->setOtherObjectiveResultValue(i,j,"other");
    03610                                 if (!ok)
    03611                                         throw ErrorClass("Error during setOtherObjectiveResultValue!");
    03612                                 ok &= (!osresult1->IsEqual(osresult2));
    03613                                 if (!ok)
    03614                                         throw ErrorClass("setOtherObjectiveResultValue: osresult objects falsely compare equal!");
    03615                                 ok &= osresult2->setOtherObjectiveResultValue(i,j,"other");
    03616                                 if (!ok)
    03617                                         throw ErrorClass("Error during setOtherObjectiveResultValue!");
    03618                                 ok &= (osresult1->IsEqual(osresult2));
    03619                                 if (!ok)
    03620                                         throw ErrorClass("setOtherObjectiveResultValue: osresult objects falsely compare unequal!");
    03621
    03622                                 ok &= osresult1->setOtherObjectiveResultNumberOfObj(i,j,2);
    03623                                 if (!ok)
    03624                                         throw ErrorClass("Error during setOtherObjectiveResultNumberOfObj!");
    03625                                 ok &= (!osresult1->IsEqual(osresult2));
    03626                                 if (!ok)
    03627                                         throw ErrorClass("setOtherObjectiveResultNumberOfObj: osresult objects falsely compare equal!");
    03628                                 ok &= osresult2->setOtherObjectiveResultNumberOfObj(i,j,2);
    03629                                 if (!ok)
    03630                                         throw ErrorClass("Error during setOtherObjectiveResultNumberOfObj!");
    03631                                 ok &= (osresult1->IsEqual(osresult2));
    03632                                 if (!ok)
    03633                                         throw ErrorClass("setOtherObjectiveResultNumberOfObj: osresult objects falsely compare unequal!");
    03634
    03635                                 for (int k=0; k < 2; ++k)
    03636                                 {
    03637                                         ok &= osresult1->setOtherObjectiveResultObjIdx(i,j,k,-2);
    03638                                         if (!ok)
    03639                                                 throw ErrorClass("Error during setOtherObjectiveResultObjIdx!");
    03640                                         ok &= (!osresult1->IsEqual(osresult2));
    03641                                         if (!ok)
    03642                                                 throw ErrorClass("setOtherObjectiveResultObjIdx: osresult objects falsely compare equal!");
    03643                                         ok &= osresult2->setOtherObjectiveResultObjIdx(i,j,k,-2);
    03644                                         if (!ok)
    03645                                                 throw ErrorClass("Error during setOtherObjectiveResultObjIdx!");
    03646                                         ok &= (osresult1->IsEqual(osresult2));
    03647                                         if (!ok)
    03648                                                 throw ErrorClass("setOtherObjectiveResultObjIdx: osresult objects falsely compare unequal!");
    03649
    03650                                         ok &= osresult1->setOtherObjectiveResultObj(i,j,k,"value");
    03651                                         if (!ok)
    03652                                                 throw ErrorClass("Error during setOtherObjectiveResultObj!");
    03653                                         ok &= (!osresult1->IsEqual(osresult2));
    03654                                         if (!ok)
    03655                                                 throw ErrorClass("setOtherObjectiveResultObj: osresult objects falsely compare equal!");
    03656                                         ok &= osresult2->setOtherObjectiveResultObj(i,j,k,"value");
    03657                                         if (!ok)
    03658                                                 throw ErrorClass("Error during setOtherObjectiveResultObj!");
    03659                                         ok &= (osresult1->IsEqual(osresult2));
    03660                                         if (!ok)
    03661                                                 throw ErrorClass("setOtherObjectiveResultObj: osresult objects falsely compare unequal!");
    03662                                 }
    03663                         }
    03664 // The third <other> result uses enumerations
    03665
    03666                         ok &= osresult1->setOtherObjectiveResultName(i,2,"other");
    03667                         if (!ok)
    03668                                 throw ErrorClass("Error during setOtherObjectiveResultName!");
    03669                         ok &= (!osresult1->IsEqual(osresult2));
    03670                         if (!ok)
    03671                                 throw ErrorClass("setOtherObjectiveResultName: osresult objects falsely compare equal!");
    03672                         ok &= osresult2->setOtherObjectiveResultName(i,2,"other");
    03673                         if (!ok)
    03674                                 throw ErrorClass("Error during setOtherObjectiveResultName!");
    03675                         ok &= (osresult1->IsEqual(osresult2));
    03676                         if (!ok)
    03677                                 throw ErrorClass("setOtherObjectiveResultName: osresult objects falsely compare unequal!");
    03678
    03679                         ok &= osresult1->setOtherObjectiveResultDescription(i,2,"other");
    03680                         if (!ok)
    03681                                 throw ErrorClass("Error during setOtherObjectiveResultDescription!");
    03682                         ok &= (!osresult1->IsEqual(osresult2));
    03683                         if (!ok)
    03684                                 throw ErrorClass("setOtherObjectiveResultDescription: osresult objects falsely compare equal!");
    03685                         ok &= osresult2->setOtherObjectiveResultDescription(i,2,"other");
    03686                         if (!ok)
    03687                                 throw ErrorClass("Error during setOtherObjectiveResultDescription!");
    03688                         ok &= (osresult1->IsEqual(osresult2));
    03689                         if (!ok)
    03690                                 throw ErrorClass("setOtherObjectiveResultDescription: osresult objects falsely compare unequal!");
    03691
    03692                         ok &= osresult1->setOtherObjectiveResultValue(i,2,"other");
    03693                         if (!ok)
    03694                                 throw ErrorClass("Error during setOtherObjectiveResultValue!");
    03695                         ok &= (!osresult1->IsEqual(osresult2));
    03696                         if (!ok)
    03697                                 throw ErrorClass("setOtherObjectiveResultValue: osresult objects falsely compare equal!");
    03698                         ok &= osresult2->setOtherObjectiveResultValue(i,2,"other");
    03699                         if (!ok)
    03700                                 throw ErrorClass("Error during setOtherObjectiveResultValue!");
    03701                         ok &= (osresult1->IsEqual(osresult2));
    03702                         if (!ok)
    03703                                 throw ErrorClass("setOtherObjectiveResultValue: osresult objects falsely compare unequal!");
    03704
    03705                         ok &= osresult1->setOtherObjectiveResultNumberOfEnumerations(i,2,2);
    03706                         if (!ok)
    03707                                 throw ErrorClass("Error during setOtherObjectiveResultNumberOfEnumerations!");
    03708                         ok &= (!osresult1->IsEqual(osresult2));
    03709                         if (!ok)
    03710                                 throw ErrorClass("setOtherObjectiveResultNumberOfEnumerations: osresult objects falsely compare equal!");
    03711                         ok &= osresult2->setOtherObjectiveResultNumberOfEnumerations(i,2,2);
    03712                         if (!ok)
    03713                                 throw ErrorClass("Error during setOtherObjectiveResultNumberOfEnumerations!");
    03714                         ok &= (osresult1->IsEqual(osresult2));
    03715                         if (!ok)
    03716                                 throw ErrorClass("setOtherObjectiveResultNumberOfEnumerations: osresult objects falsely compare unequal!");
    03717
    03718                         for (int k=0; k < 2; ++k)
    03719                         {
    03720
    03721                         intArray[0] = -(1000*i + 1230 + 10*k + 1);
    03722                         intArray[1] = -(1000*i + 1230 + 10*k + 2);
    03723                         intArray[2] = -(1000*i + 1230 + 10*k + 3);
    03724
    03725                                 ok &= osresult1->setOtherOptionEnumeration(i,2,ENUM_PROBLEM_COMPONENT_objectives,k,"value","description",intArray,3);
    03726                                 if (!ok)
    03727                                         throw ErrorClass("Error during setOtherOptionEnumeration (objective)!");
    03728                                 ok &= (!osresult1->IsEqual(osresult2));
    03729                                 if (!ok)
    03730                                         throw ErrorClass("setOtherOptionEnumeration: osresult objects falsely compare equal!");
    03731                                 ok &= osresult2->setOtherOptionEnumeration(i,2,ENUM_PROBLEM_COMPONENT_objectives,k,"value","description",intArray,3);
    03732                                 if (!ok)
    03733                                         throw ErrorClass("Error during setOtherOptionEnumeration (objective)!");
    03734                                 ok &= (osresult1->IsEqual(osresult2));
    03735                                 if (!ok)
    03736                                         throw ErrorClass("setOtherOptionEnumeration: osresult objects falsely compare unequal!");
    03737                         }
    03738
    03739
    03740 //==========================================================================================
    03741                         ok &= osresult1->setNumberOfDualValues(i,3);
    03742                         if (!ok)
    03743                                 throw ErrorClass("Error during setNumberOfDualValues!");
    03744                         ok &= (!osresult1->IsEqual(osresult2));
    03745                         if (!ok)
    03746                                 throw ErrorClass("setNumberOfDualValues: osresult objects falsely compare equal!");
    03747                         ok &= osresult2->setNumberOfDualValues(i,3);
    03748                         if (!ok)
    03749                                 throw ErrorClass("Error during setNumberOfDualValues!");
    03750                         ok &= (osresult1->IsEqual(osresult2));
    03751                         if (!ok)
    03752                                 throw ErrorClass("setNumberOfDualValues: osresult objects falsely compare unequal!");
    03753
    03754                         for (int j=0; j < 3; ++j)
    03755                         {
    03756                                 ok &= osresult1->setDualValue(i,j,j,3.14);
    03757                                 if (!ok)
    03758                                         throw ErrorClass("Error during setDualValue!");
    03759                                 ok &= (!osresult1->IsEqual(osresult2));
    03760                                 if (!ok)
    03761                                         throw ErrorClass("setDualValue: osresult objects falsely compare equal!");
    03762                                 ok &= osresult2->setDualValue(i,j,j,3.14);
    03763                                 if (!ok)
    03764                                         throw ErrorClass("Error during setDualValue!");
    03765                                 ok &= (osresult1->IsEqual(osresult2));
    03766                                 if (!ok)
    03767                                         throw ErrorClass("setDualValue: osresult objects falsely compare unequal!");
    03768                         }
    03769 //==============================
    03770
    03771
    03772                         intArray[0] = 1000*i + 1300 + 10 + 1;
    03773                         intArray[1] = 1000*i + 1300 + 10 + 2;
    03774                         intArray[2] = 1000*i + 1300 + 10 + 3;
    03775
    03776                         ok &= osresult1->setBasisStatus(i, ENUM_PROBLEM_COMPONENT_constraints, ENUM_BASIS_STATUS_basic, intArray, 3);
    03777                         if (!ok)
    03778                                 throw ErrorClass("Error during setBasisStatus (constraints basic)!");
    03779                         ok &= (!osresult1->IsEqual(osresult2));
    03780                         if (!ok)
    03781                                 throw ErrorClass("setBasisStatus (constraints basic): osresult objects falsely compare equal!");
    03782                         ok &= osresult2->setBasisStatus(i, ENUM_PROBLEM_COMPONENT_constraints, ENUM_BASIS_STATUS_basic, intArray, 3);
    03783                         if (!ok)
    03784                                 throw ErrorClass("Error during setBasisStatus (constraints basic)!");
    03785                         ok &= (osresult1->IsEqual(osresult2));
    03786                         if (!ok)
    03787                                 throw ErrorClass("setBasisStatus (constraints basic): osresult objects falsely compare unequal!");
    03788
    03789                         intArray[0] = intArray[0] + 10;
    03790                         intArray[1] = intArray[1] + 10;
    03791                         intArray[2] = intArray[2] + 10;
    03792
    03793                         ok &= osresult1->setBasisStatus(i, ENUM_PROBLEM_COMPONENT_constraints, ENUM_BASIS_STATUS_atLower, intArray, 3);
    03794                         if (!ok)
    03795                                 throw ErrorClass("Error during setBasisStatus (constraints atLower)!");
    03796                         ok &= (!osresult1->IsEqual(osresult2));
    03797                         if (!ok)
    03798                                 throw ErrorClass("setBasisStatus (constraints atLower): osresult objects falsely compare equal!");
    03799                         ok &= osresult2->setBasisStatus(i, ENUM_PROBLEM_COMPONENT_constraints, ENUM_BASIS_STATUS_atLower, intArray, 3);
    03800                         if (!ok)
    03801                                 throw ErrorClass("Error during setBasisStatus (constraints atLower)!");
    03802                         ok &= (osresult1->IsEqual(osresult2));
    03803                         if (!ok)
    03804                                 throw ErrorClass("setBasisStatus (constraints atLower): osresult objects falsely compare unequal!");
    03805
    03806                         intArray[0] = intArray[0] + 10;
    03807                         intArray[1] = intArray[1] + 10;
    03808                         intArray[2] = intArray[2] + 10;
    03809
    03810
    03811                         ok &= osresult1->setBasisStatus(i, ENUM_PROBLEM_COMPONENT_constraints, ENUM_BASIS_STATUS_atUpper, intArray, 3);
    03812                         if (!ok)
    03813                                 throw ErrorClass("Error during setBasisStatus (constraints atUpper)!");
    03814                         ok &= (!osresult1->IsEqual(osresult2));
    03815                         if (!ok)
    03816                                 throw ErrorClass("setBasisStatus (constraints atUpper): osresult objects falsely compare equal!");
    03817                         ok &= osresult2->setBasisStatus(i, ENUM_PROBLEM_COMPONENT_constraints, ENUM_BASIS_STATUS_atUpper, intArray, 3);
    03818                         if (!ok)
    03819                                 throw ErrorClass("Error during setBasisStatus (constraints atUpper)!");
    03820                         ok &= (osresult1->IsEqual(osresult2));
    03821                         if (!ok)
    03822                                 throw ErrorClass("setBasisStatus (constraints atUpper): osresult objects falsely compare unequal!");
    03823
    03824
    03825                         intArray[0] = intArray[0] + 10;
    03826                         intArray[1] = intArray[1] + 10;
    03827                         intArray[2] = intArray[2] + 10;
    03828
    03829                         ok &= osresult1->setBasisStatus(i, ENUM_PROBLEM_COMPONENT_constraints, ENUM_BASIS_STATUS_isFree, intArray, 3);
    03830                         if (!ok)
    03831                                 throw ErrorClass("Error during setBasisStatus (constraints isFree)!");
    03832                         ok &= (!osresult1->IsEqual(osresult2));
    03833                         if (!ok)
    03834                                 throw ErrorClass("setBasisStatus (constraints isFree): osresult objects falsely compare equal!");
    03835                         ok &= osresult2->setBasisStatus(i, ENUM_PROBLEM_COMPONENT_constraints, ENUM_BASIS_STATUS_isFree, intArray, 3);
    03836                         if (!ok)
    03837                                 throw ErrorClass("Error during setBasisStatus (constraints isFree)!");
    03838                         ok &= (osresult1->IsEqual(osresult2));
    03839                         if (!ok)
    03840                                 throw ErrorClass("setBasisStatus (constraints isFree): osresult objects falsely compare unequal!");
    03841
    03842
    03843                         intArray[0] = intArray[0] + 10;
    03844                         intArray[1] = intArray[1] + 10;
    03845                         intArray[2] = intArray[2] + 10;
    03846
    03847                         ok &= osresult1->setBasisStatus(i, ENUM_PROBLEM_COMPONENT_constraints, ENUM_BASIS_STATUS_superbasic, intArray, 3);
    03848                         if (!ok)
    03849                                 throw ErrorClass("Error during setBasisStatus (constraints superbasic)!");
    03850                         ok &= (!osresult1->IsEqual(osresult2));
    03851                         if (!ok)
    03852                                 throw ErrorClass("setBasisStatus (constraints superbasic): osresult objects falsely compare equal!");
    03853                         ok &= osresult2->setBasisStatus(i, ENUM_PROBLEM_COMPONENT_constraints, ENUM_BASIS_STATUS_superbasic, intArray, 3);
    03854                         if (!ok)
    03855                                 throw ErrorClass("Error during setBasisStatus (constraints superbasic)!");
    03856                         ok &= (osresult1->IsEqual(osresult2));
    03857                         if (!ok)
    03858                                 throw ErrorClass("setBasisStatus (constraints superbasic): osresult objects falsely compare unequal!");
    03859
    03860                         intArray[0] = intArray[0] + 10;
    03861                         intArray[1] = intArray[1] + 10;
    03862                         intArray[2] = intArray[2] + 10;
    03863
    03864
    03865                         ok &= osresult1->setBasisStatus(i, ENUM_PROBLEM_COMPONENT_constraints, ENUM_BASIS_STATUS_unknown, intArray, 3);
    03866                         if (!ok)
    03867                                 throw ErrorClass("Error during setBasisStatus (constraints unknown)!");
    03868                         ok &= (!osresult1->IsEqual(osresult2));
    03869                         if (!ok)
    03870                                 throw ErrorClass("setBasisStatus (constraints unknown): osresult objects falsely compare equal!");
    03871                         ok &= osresult2->setBasisStatus(i, ENUM_PROBLEM_COMPONENT_constraints, ENUM_BASIS_STATUS_unknown, intArray, 3);
    03872                         if (!ok)
    03873                                 throw ErrorClass("Error during setBasisStatus (constraints unknown)!");
    03874                         ok &= (osresult1->IsEqual(osresult2));
    03875                         if (!ok)
    03876                                 throw ErrorClass("setBasisStatus (constraints unknown): osresult objects falsely compare unequal!");
    03877 //=================================
    03878                         ok &= osresult1->setNumberOfOtherConstraintResults(i,3);
    03879                         if (!ok)
    03880                                 throw ErrorClass("Error during setNumberOfOtherConstraintResults!");
    03881                         ok &= (!osresult1->IsEqual(osresult2));
    03882                         if (!ok)
    03883                                 throw ErrorClass("setNumberOfOtherConstraintResults: osresult objects falsely compare equal!");
    03884                         ok &= osresult2->setNumberOfOtherConstraintResults(i,3);
    03885                         if (!ok)
    03886                                 throw ErrorClass("Error during setNumberOfOtherConstraintResults!");
    03887                         ok &= (osresult1->IsEqual(osresult2));
    03888                         if (!ok)
    03889                                 throw ErrorClass("setNumberOfOtherConstraintResults: osresult objects falsely compare unequal!");
    03890
    03891                         for (int j=0; j < 2; ++j)
    03892                         {
    03893                                 ok &= osresult1->setOtherConstraintResultName(i,j,"other");
    03894                                 if (!ok)
    03895                                         throw ErrorClass("Error during setOtherConstraintResultName!");
    03896                                 ok &= (!osresult1->IsEqual(osresult2));
    03897                                 if (!ok)
    03898                                         throw ErrorClass("setOtherConstraintResultName: osresult objects falsely compare equal!");
    03899                                 ok &= osresult2->setOtherConstraintResultName(i,j,"other");
    03900                                 if (!ok)
    03901                                         throw ErrorClass("Error during setOtherConstraintResultName!");
    03902                                 ok &= (osresult1->IsEqual(osresult2));
    03903                                 if (!ok)
    03904                                         throw ErrorClass("setOtherConstraintResultName: osresult objects falsely compare unequal!");
    03905
    03906                                 ok &= osresult1->setOtherConstraintResultDescription(i,j,"other");
    03907                                 if (!ok)
    03908                                         throw ErrorClass("Error during setOtherConstraintResultDescription!");
    03909                                 ok &= (!osresult1->IsEqual(osresult2));
    03910                                 if (!ok)
    03911                                         throw ErrorClass("setOtherConstraintResultDescription: osresult objects falsely compare equal!");
    03912                                 ok &= osresult2->setOtherConstraintResultDescription(i,j,"other");
    03913                                 if (!ok)
    03914                                         throw ErrorClass("Error during setOtherConstraintResultDescription!");
    03915                                 ok &= (osresult1->IsEqual(osresult2));
    03916                                 if (!ok)
    03917                                         throw ErrorClass("setOtherConstraintResultDescription: osresult objects falsely compare unequal!");
    03918
    03919                                 ok &= osresult1->setOtherConstraintResultValue(i,j,"other");
    03920                                 if (!ok)
    03921                                         throw ErrorClass("Error during setOtherConstraintResultValue!");
    03922                                 ok &= (!osresult1->IsEqual(osresult2));
    03923                                 if (!ok)
    03924                                         throw ErrorClass("setOtherConstraintResultValue: osresult objects falsely compare equal!");
    03925                                 ok &= osresult2->setOtherConstraintResultValue(i,j,"other");
    03926                                 if (!ok)
    03927                                         throw ErrorClass("Error during setOtherConstraintResultValue!");
    03928                                 ok &= (osresult1->IsEqual(osresult2));
    03929                                 if (!ok)
    03930                                         throw ErrorClass("setOtherConstraintResultValue: osresult objects falsely compare unequal!");
    03931
    03932                                 ok &= osresult1->setOtherConstraintResultNumberOfCon(i,j,3);
    03933                                 if (!ok)
    03934                                         throw ErrorClass("Error during setOtherConstraintResultNumberOfCon!");
    03935                                 ok &= (!osresult1->IsEqual(osresult2));
    03936                                 if (!ok)
    03937                                         throw ErrorClass("setOtherConstraintResultNumberOfCon: osresult objects falsely compare equal!");
    03938                                 ok &= osresult2->setOtherConstraintResultNumberOfCon(i,j,3);
    03939                                 if (!ok)
    03940                                         throw ErrorClass("Error during setOtherConstraintResultNumberOfCon!");
    03941                                 ok &= (osresult1->IsEqual(osresult2));
    03942                                 if (!ok)
    03943                                         throw ErrorClass("setOtherConstraintResultNumberOfCon: osresult objects falsely compare unequal!");
    03944
    03945                                 for (int k=0; k < 3; ++k)
    03946                                 {
    03947                                         ok &= osresult1->setOtherConstraintResultConIdx(i,j,k,k);
    03948                                         if (!ok)
    03949                                                 throw ErrorClass("Error during setOtherConstraintResultConIdx!");
    03950                                         ok &= (!osresult1->IsEqual(osresult2));
    03951                                         if (!ok)
    03952                                                 throw ErrorClass("setOtherConstraintResultConIdx: osresult objects falsely compare equal!");
    03953                                         ok &= osresult2->setOtherConstraintResultConIdx(i,j,k,k);
    03954                                         if (!ok)
    03955                                                 throw ErrorClass("Error during setOtherConstraintResultConIdx!");
    03956                                         ok &= (osresult1->IsEqual(osresult2));
    03957                                         if (!ok)
    03958                                                 throw ErrorClass("setOtherConstraintResultConIdx: osresult objects falsely compare unequal!");
    03959
    03960                                         ok &= osresult1->setOtherConstraintResultCon(i,j,k,"value");
    03961                                         if (!ok)
    03962                                                 throw ErrorClass("Error during setOtherConstraintResultCon!");
    03963                                         ok &= (!osresult1->IsEqual(osresult2));
    03964                                         if (!ok)
    03965                                                 throw ErrorClass("setOtherConstraintResultCon: osresult objects falsely compare equal!");
    03966                                         ok &= osresult2->setOtherConstraintResultCon(i,j,k,"value");
    03967                                         if (!ok)
    03968                                                 throw ErrorClass("Error during setOtherConstraintResultCon!");
    03969                                         ok &= (osresult1->IsEqual(osresult2));
    03970                                         if (!ok)
    03971                                                 throw ErrorClass("setOtherConstraintResultCon: osresult objects falsely compare unequal!");
    03972                                 }
    03973                         }
    03974
    03975
    03976 // The third <other> result uses enumerations
    03977
    03978                         ok &= osresult1->setOtherConstraintResultName(i,2,"other");
    03979                         if (!ok)
    03980                                 throw ErrorClass("Error during setOtherConstraintResultName!");
    03981                         ok &= (!osresult1->IsEqual(osresult2));
    03982                         if (!ok)
    03983                                 throw ErrorClass("setOtherConstraintResultName: osresult objects falsely compare equal!");
    03984                         ok &= osresult2->setOtherConstraintResultName(i,2,"other");
    03985                         if (!ok)
    03986                                 throw ErrorClass("Error during setOtherConstraintResultName!");
    03987                         ok &= (osresult1->IsEqual(osresult2));
    03988                         if (!ok)
    03989                                 throw ErrorClass("setOtherConstraintResultName: osresult objects falsely compare unequal!");
    03990
    03991                         ok &= osresult1->setOtherConstraintResultDescription(i,2,"other");
    03992                         if (!ok)
    03993                                 throw ErrorClass("Error during setOtherConstraintResultDescription!");
    03994                         ok &= (!osresult1->IsEqual(osresult2));
    03995                         if (!ok)
    03996                                 throw ErrorClass("setOtherConstraintResultDescription: osresult objects falsely compare equal!");
    03997                         ok &= osresult2->setOtherConstraintResultDescription(i,2,"other");
    03998                         if (!ok)
    03999                                 throw ErrorClass("Error during setOtherConstraintResultDescription!");
    04000                         ok &= (osresult1->IsEqual(osresult2));
    04001                         if (!ok)
    04002                                 throw ErrorClass("setOtherConstraintResultDescription: osresult objects falsely compare unequal!");
    04003
    04004                         ok &= osresult1->setOtherConstraintResultValue(i,2,"other");
    04005                         if (!ok)
    04006                                 throw ErrorClass("Error during setOtherConstraintResultValue!");
    04007                         ok &= (!osresult1->IsEqual(osresult2));
    04008                         if (!ok)
    04009                                 throw ErrorClass("setOtherConstraintResultValue: osresult objects falsely compare equal!");
    04010                         ok &= osresult2->setOtherConstraintResultValue(i,2,"other");
    04011                         if (!ok)
    04012                                 throw ErrorClass("Error during setOtherConstraintResultValue!");
    04013                         ok &= (osresult1->IsEqual(osresult2));
    04014                         if (!ok)
    04015                                 throw ErrorClass("setOtherConstraintResultValue: osresult objects falsely compare unequal!");
    04016
    04017                         ok &= osresult1->setOtherConstraintResultNumberOfEnumerations(i,2,2);
    04018                         if (!ok)
    04019                                 throw ErrorClass("Error during setOtherConstraintResultNumberOfEnumerations!");
    04020                         ok &= (!osresult1->IsEqual(osresult2));
    04021                         if (!ok)
    04022                                 throw ErrorClass("setOtherConstraintResultNumberOfEnumerations: osresult objects falsely compare equal!");
    04023                         ok &= osresult2->setOtherConstraintResultNumberOfEnumerations(i,2,2);
    04024                         if (!ok)
    04025                                 throw ErrorClass("Error during setOtherConstraintResultNumberOfEnumerations!");
    04026                         ok &= (osresult1->IsEqual(osresult2));
    04027                         if (!ok)
    04028                                 throw ErrorClass("setOtherConstraintResultNumberOfEnumerations: osresult objects falsely compare unequal!");
    04029
    04030                         for (int k=0; k < 2; ++k)
    04031                         {
    04032                         intArray[0] = 1000*i + 1330 + 10*k + 1;
    04033                         intArray[1] = 1000*i + 1330 + 10*k + 2;
    04034                         intArray[2] = 1000*i + 1330 + 10*k + 3;
    04035
    04036                                 ok &= osresult1->setOtherOptionEnumeration(i,2,ENUM_PROBLEM_COMPONENT_constraints,k,"value","description",intArray,3);
    04037                                 if (!ok)
    04038                                         throw ErrorClass("Error during setOtherOptionEnumeration (constraint)!");
    04039                                 ok &= (!osresult1->IsEqual(osresult2));
    04040                                 if (!ok)
    04041                                         throw ErrorClass("setOtherOptionEnumeration: osresult objects falsely compare equal!");
    04042                                 ok &= osresult2->setOtherOptionEnumeration(i,2,ENUM_PROBLEM_COMPONENT_constraints,k,"value","description",intArray,3);
    04043                                 if (!ok)
    04044                                         throw ErrorClass("Error during setOtherOptionEnumeration (constraint)!");
    04045                                 ok &= (osresult1->IsEqual(osresult2));
    04046                                 if (!ok)
    04047                                         throw ErrorClass("setOtherOptionEnumeration: osresult objects falsely compare unequal!");
    04048                         }
    04049
    04050
    04051 //==========================================================================================
    04052
    04053                         ok &= osresult1->setNumberOfOtherSolutionResults(i,3);
    04054                         if (!ok)
    04055                                 throw ErrorClass("Error during setNumberOfOtherSolutionResults!");
    04056                         ok &= (!osresult1->IsEqual(osresult2));
    04057                         if (!ok)
    04058                                 throw ErrorClass("setNumberOfOtherSolutionResults: osresult objects falsely compare equal!");
    04059                         ok &= osresult2->setNumberOfOtherSolutionResults(i,3);
    04060                         if (!ok)
    04061                                 throw ErrorClass("Error during setNumberOfOtherSolutionResults!");
    04062                         ok &= (osresult1->IsEqual(osresult2));
    04063                         if (!ok)
    04064                                 throw ErrorClass("setNumberOfOtherSolutionResults: osresult objects falsely compare unequal!");
    04065
    04066                         for (int j=0; j < 3; ++j)
    04067                         {
    04068                                 ok &= osresult1->setOtherSolutionResultName(i,j,"other");
    04069                                 if (!ok)
    04070                                         throw ErrorClass("Error during setOtherSolutionResultName!");
    04071                                 ok &= (!osresult1->IsEqual(osresult2));
    04072                                 if (!ok)
    04073                                         throw ErrorClass("setOtherSolutionResultName: osresult objects falsely compare equal!");
    04074                                 ok &= osresult2->setOtherSolutionResultName(i,j,"other");
    04075                                 if (!ok)
    04076                                         throw ErrorClass("Error during setOtherSolutionResultName!");
    04077                                 ok &= (osresult1->IsEqual(osresult2));
    04078                                 if (!ok)
    04079                                         throw ErrorClass("setOtherSolutionResultName: osresult objects falsely compare unequal!");
    04080
    04081                                 ok &= osresult1->setOtherSolutionResultCategory(i,j,"other");
    04082                                 if (!ok)
    04083                                         throw ErrorClass("Error during setOtherSolutionResultCategory!");
    04084                                 ok &= (!osresult1->IsEqual(osresult2));
    04085                                 if (!ok)
    04086                                         throw ErrorClass("setOtherSolutionResultCategory: osresult objects falsely compare equal!");
    04087                                 ok &= osresult2->setOtherSolutionResultCategory(i,j,"other");
    04088                                 if (!ok)
    04089                                         throw ErrorClass("Error during setOtherSolutionResultCategory!");
    04090                                 ok &= (osresult1->IsEqual(osresult2));
    04091                                 if (!ok)
    04092                                         throw ErrorClass("setOtherSolutionResultCategory: osresult objects falsely compare unequal!");
    04093
    04094                                 ok &= osresult1->setOtherSolutionResultDescription(i,j,"other");
    04095                                 if (!ok)
    04096                                         throw ErrorClass("Error during setOtherSolutionResultDescription!");
    04097                                 ok &= (!osresult1->IsEqual(osresult2));
    04098                                 if (!ok)
    04099                                         throw ErrorClass("setOtherSolutionResultDescription: osresult objects falsely compare equal!");
    04100                                 ok &= osresult2->setOtherSolutionResultDescription(i,j,"other");
    04101                                 if (!ok)
    04102                                         throw ErrorClass("Error during setOtherSolutionResultDescription!");
    04103                                 ok &= (osresult1->IsEqual(osresult2));
    04104                                 if (!ok)
    04105                                         throw ErrorClass("setOtherSolutionResultDescription: osresult objects falsely compare unequal!");
    04106
    04107                                 ok &= osresult1->setOtherSolutionResultNumberOfItems(i,j,3);
    04108                                 if (!ok)
    04109                                         throw ErrorClass("Error during setOtherSolutionResultNumberOfItems!");
    04110                                 ok &= (!osresult1->IsEqual(osresult2));
    04111                                 if (!ok)
    04112                                         throw ErrorClass("setOtherSolutionResultNumberOfItems: osresult objects falsely compare equal!");
    04113                                 ok &= osresult2->setOtherSolutionResultNumberOfItems(i,j,3);
    04114                                 if (!ok)
    04115                                         throw ErrorClass("Error during setOtherSolutionResultNumberOfItems!");
    04116                                 ok &= (osresult1->IsEqual(osresult2));
    04117                                 if (!ok)
    04118                                         throw ErrorClass("setOtherSolutionResultNumberOfItems: osresult objects falsely compare unequal!");
    04119
    04120                                 for (int k=0; k < 3; ++k)
    04121                                 {
    04122                                         ok &= osresult1->setOtherSolutionResultItem(i,j,k,"blabla");
    04123                                         if (!ok)
    04124                                                 throw ErrorClass("Error during setOtherSolutionResultItem!");
    04125                                         ok &= (!osresult1->IsEqual(osresult2));
    04126                                         if (!ok)
    04127                                                 throw ErrorClass("setOtherSolutionResultItem: osresult objects falsely compare equal!");
    04128                                         ok &= osresult2->setOtherSolutionResultItem(i,j,k,"blabla");
    04129                                         if (!ok)
    04130                                                 throw ErrorClass("Error during setOtherSolutionResultItem!");
    04131                                         ok &= (osresult1->IsEqual(osresult2));
    04132                                         if (!ok)
    04133                                                 throw ErrorClass("setOtherSolutionResultItem: osresult objects falsely compare unequal!");
    04134                                 }
    04135                         }
    04136                 }
    04137
    04138                 ok &= osresult1->setNumberOfSolverOutputs(3);
    04139                 if (!ok)
    04140                         throw ErrorClass("Error during setNumberOfSolverOutputs!");
    04141                 ok &= (!osresult1->IsEqual(osresult2));
    04142                 if (!ok)
    04143                         throw ErrorClass("setNumberOfSolverOutputs: osresult objects falsely compare equal!");
    04144                 ok &= osresult2->setNumberOfSolverOutputs(3);
    04145                 if (!ok)
    04146                         throw ErrorClass("Error during setNumberOfSolverOutputs!");
    04147                 ok &= (osresult1->IsEqual(osresult2));
    04148                 if (!ok)
    04149                         throw ErrorClass("setNumberOfSolverOutputs: osresult objects falsely compare unequal!");
    04150
    04151                 for (int i=0; i < 3; ++i)
    04152                 {
    04153                         ok &= osresult1->setSolverOutputName(i,"some name");
    04154                         if (!ok)
    04155                                 throw ErrorClass("Error during setSolverOutputName!");
    04156                         ok &= (!osresult1->IsEqual(osresult2));
    04157                         if (!ok)
    04158                                 throw ErrorClass("setSolverOutputName: osresult objects falsely compare equal!");
    04159                         ok &= osresult2->setSolverOutputName(i,"some name");
    04160                         if (!ok)
    04161                                 throw ErrorClass("Error during setSolverOutputName!");
    04162                         ok &= (osresult1->IsEqual(osresult2));
    04163                         if (!ok)
    04164                                 throw ErrorClass("setSolverOutputName: osresult objects falsely compare unequal!");
    04165
    04166                         ok &= osresult1->setSolverOutputCategory(i,"some name");
    04167                         if (!ok)
    04168                                 throw ErrorClass("Error during setSolverOutputCategory!");
    04169                         ok &= (!osresult1->IsEqual(osresult2));
    04170                         if (!ok)
    04171                                 throw ErrorClass("setSolverOutputCategory: osresult objects falsely compare equal!");
    04172                         ok &= osresult2->setSolverOutputCategory(i,"some name");
    04173                         if (!ok)
    04174                                 throw ErrorClass("Error during setSolverOutputCategory!");
    04175                         ok &= (osresult1->IsEqual(osresult2));
    04176                         if (!ok)
    04177                                 throw ErrorClass("setSolverOutputCategory: osresult objects falsely compare unequal!");
    04178
    04179                         ok &= osresult1->setSolverOutputDescription(i,"some name");
    04180                         if (!ok)
    04181                                 throw ErrorClass("Error during setSolverOutputDescription!");
    04182                         ok &= (!osresult1->IsEqual(osresult2));
    04183                         if (!ok)
    04184                                 throw ErrorClass("setSolverOutputDescription: osresult objects falsely compare equal!");
    04185                         ok &= osresult2->setSolverOutputDescription(i,"some name");
    04186                         if (!ok)
    04187                                 throw ErrorClass("Error during setSolverOutputDescription!");
    04188                         ok &= (osresult1->IsEqual(osresult2));
    04189                         if (!ok)
    04190                                 throw ErrorClass("setSolverOutputDescription: osresult objects falsely compare unequal!");
    04191
    04192                         ok &= osresult1->setSolverOutputNumberOfItems(i,3);
    04193                         if (!ok)
    04194                                 throw ErrorClass("Error during setSolverOutputNumberOfItems!");
    04195                         ok &= (!osresult1->IsEqual(osresult2));
    04196                         if (!ok)
    04197                                 throw ErrorClass("setSolverOutputNumberOfItems: osresult objects falsely compare equal!");
    04198                         ok &= osresult2->setSolverOutputNumberOfItems(i,3);
    04199                         if (!ok)
    04200                                 throw ErrorClass("Error during setSolverOutputNumberOfItems!");
    04201                         ok &= (osresult1->IsEqual(osresult2));
    04202                         if (!ok)
    04203                                 throw ErrorClass("setSolverOutputNumberOfItems: osresult objects falsely compare unequal!");
    04204
    04205                         for (int j=0; j < 3; ++j)
    04206                         {
    04207                                 ok &= osresult1->setSolverOutputItem(i,j,"other");
    04208                                 if (!ok)
    04209                                         throw ErrorClass("Error during setSolverOutputItem!");
    04210                                 ok &= (!osresult1->IsEqual(osresult2));
    04211                                 if (!ok)
    04212                                         throw ErrorClass("setSolverOutputItem: osresult objects falsely compare equal!");
    04213                                 ok &= osresult2->setSolverOutputItem(i,j,"other");
    04214                                 if (!ok)
    04215                                         throw ErrorClass("Error during setSolverOutputItem!");
    04216                                 ok &= (osresult1->IsEqual(osresult2));
    04217                                 if (!ok)
    04218                                         throw ErrorClass("setSolverOutputItem: osresult objects falsely compare unequal!");
    04219                         }
    04220                 }
    04221
    04222                 if (!ok)
    04223                         throw ErrorClass("Unspecified error while testing set() methods");
    04224
    04225                 unitTestResult << "TEST " << nOfTest << ": Successful test of OSrL set() tools" << std::endl;
    04226                 cout << endl << "TEST " << nOfTest << ": Completed successfully" << endl << endl;
    04227
    04228                 cout << endl << "TEST " << ++nOfTest << ": OSrLWriter and OSrLReader " << endl << endl;
    04229
    04230
    04231                 osrlwriter = new OSrLWriter();
    04232                 osrlreader = new OSrLReader();
    04233                 std::string tempOSrL;
    04234
    04235                 tempOSrL = osrlwriter->writeOSrL( osresult1);
    04236
    04237                 std::cout << "Here is the temporary OSrL string produced from OSrLWriter" << std::endl << tempOSrL << std::endl;
    04238
    04239                 osresult3 = osrlreader->readOSrL( tempOSrL);
    04240
    04241                 tempOSrL = osrlwriter->writeOSrL( osresult3);
    04242
    04243                 std::cout << "Here is the temporary OSrL string produced from OSrLReader" << std::endl << tempOSrL << std::endl;
    04244
    04245
    04246                 ok &= (osresult1->IsEqual(osresult3));
    04247                 if (!ok)
    04248                         throw ErrorClass("Writing an osresult then reading leads to loss of data");
    04249
    04250                 unitTestResult << "TEST " << nOfTest << ": Successful test of OSrLWriter and OSrLReader" << std::endl;
    04251                 cout << endl << "TEST " << nOfTest << ": Completed successfully" << endl << endl;
    04252
    04258                 cout << endl << "TEST " << ++nOfTest << ": OSrL get() methods" << endl << endl;
    04259 //#ifdef TEMP   //---------------------------for the time being----------------------------------
    04260
    04261                 if (osresult2  != NULL) delete osresult2;
    04262                 osresult2 = new OSResult();
    04263
    04264                 std::string tempStr;
    04265                 double tempDbl;
    04266                 int tempInt;
    04267
    04268                 tempStr = osresult1->getGeneralStatusType();
    04269                 ok &= osresult2->setGeneralStatusType(tempStr);
    04270                 if (!ok)
    04271                         throw ErrorClass("Error during setGeneralStatusType!");
    04272                 tempStr = osresult1->getGeneralStatusDescription();
    04273                 ok &= osresult2->setGeneralStatusDescription(tempStr);
    04274                 if (!ok)
    04275                         throw ErrorClass("Error during setGeneralStatusDescription!");
    04276
    04277                 tempInt = osresult1->getNumberOfGeneralSubstatuses();
    04278                 ok &= osresult2->setNumberOfGeneralSubstatuses(tempInt);
    04279                 if (!ok)
    04280                         throw ErrorClass("Error during setNumberOfGeneralSubstatuses!");
    04281                 for (int i=0; i < tempInt; i++)
    04282                 {
    04283                         tempStr = osresult1->getGeneralSubstatusName(i);
    04284                         ok &= osresult2->setGeneralSubstatusName(i,tempStr);
    04285                         if (!ok)
    04286                                 throw ErrorClass("Error during setGeneralSubstatusName!");
    04287                         tempStr = osresult1->getGeneralSubstatusDescription(i);
    04288                         ok &= osresult2->setGeneralSubstatusDescription(i,tempStr);
    04289                         if (!ok)
    04290                                 throw ErrorClass("Error during setGeneralSubstatusDescription!");
    04291                 }
    04292
    04293                 tempStr = osresult1->getGeneralMessage();
    04294                 ok &= osresult2->setGeneralMessage(tempStr);
    04295                 if (!ok)
    04296                         throw ErrorClass("Error during setGeneralMessage!");
    04297                 tempStr = osresult1->getServiceURI();
    04298                 ok &= osresult2->setServiceURI(tempStr);
    04299                 if (!ok)
    04300                         throw ErrorClass("Error during setServiceURI!");
    04301                 tempStr = osresult1->getServiceName();
    04302                 ok &= osresult2->setServiceName(tempStr);
    04303                 if (!ok)
    04304                         throw ErrorClass("Error during setServiceName!");
    04305                 tempStr = osresult1->getInstanceName();
    04306                 ok &= osresult2->setInstanceName(tempStr);
    04307                 if (!ok)
    04308                         throw ErrorClass("Error during setInstanceName!");
    04309                 tempStr = osresult1->getJobID();
    04310                 ok &= osresult2->setJobID(tempStr);
    04311                 if (!ok)
    04312                         throw ErrorClass("Error during setJobID!");
    04313                 tempStr = osresult1->getSolverInvoked();
    04314                 ok &= osresult2->setSolverInvoked(tempStr);
    04315                 if (!ok)
    04316                         throw ErrorClass("Error during setSolverInvoked!");
    04317                 tempStr = osresult1->getTimeStamp();
    04318                 ok &= osresult2->setTimeStamp(tempStr);
    04319                 if (!ok)
    04320                         throw ErrorClass("Error during setTimeStamp!");
    04321
    04322                 tempInt = osresult1->getNumberOfOtherGeneralResults();
    04323                 ok &= osresult2->setNumberOfOtherGeneralResults(tempInt);
    04324                 if (!ok)
    04325                         throw ErrorClass("Error during setNumberOfOtherGeneralResults!");
    04326                 for (int i=0; i < tempInt; i++)
    04327                 {
    04328                         tempStr = osresult1->getOtherGeneralResultName(i);
    04329                         ok &= osresult2->setOtherGeneralResultName(i,tempStr);
    04330                         if (!ok)
    04331                                 throw ErrorClass("Error during setOtherGeneralResultName!");
    04332                         tempStr = osresult1->getOtherGeneralResultValue(i);
    04333                         ok &= osresult2->setOtherGeneralResultValue(i,tempStr);
    04334                         if (!ok)
    04335                                 throw ErrorClass("Error during setOtherGeneralResultValue!");
    04336                         tempStr = osresult1->getOtherGeneralResultDescription(i);
    04337                         ok &= osresult2->setOtherGeneralResultDescription(i,tempStr);
    04338                         if (!ok)
    04339                                 throw ErrorClass("Error during setOtherGeneralResultDescription!");
    04340                 }
    04341
    04342                 tempStr = osresult1->getSystemInformation();
    04343                 ok &= osresult2->setSystemInformation(tempStr);
    04344                 if (!ok)
    04345                         throw ErrorClass("Error during setSystemInformation!");
    04346                 tempStr = osresult1->getAvailableDiskSpaceUnit();
    04347                 ok &= osresult2->setAvailableDiskSpaceUnit(tempStr);
    04348                 if (!ok)
    04349                         throw ErrorClass("Error during setAvailableDiskSpaceUnit!");
    04350                 tempStr = osresult1->getAvailableDiskSpaceDescription();
    04351                 ok &= osresult2->setAvailableDiskSpaceDescription(tempStr);
    04352                 if (!ok)
    04353                         throw ErrorClass("Error during setAvailableDiskSpaceDescription!");
    04354                 tempDbl = osresult1->getAvailableDiskSpaceValue();
    04355                 ok &= osresult2->setAvailableDiskSpaceValue(tempDbl);
    04356                 if (!ok)
    04357                         throw ErrorClass("Error during setAvailableDiskSpaceValue!");
    04358                 tempStr = osresult1->getAvailableMemoryUnit();
    04359                 ok &= osresult2->setAvailableMemoryUnit(tempStr);
    04360                 if (!ok)
    04361                         throw ErrorClass("Error during setAvailableMemoryUnit!");
    04362                 tempStr = osresult1->getAvailableMemoryDescription();
    04363                 ok &= osresult2->setAvailableMemoryDescription(tempStr);
    04364                 if (!ok)
    04365                         throw ErrorClass("Error during setAvailableMemoryDescription!");
    04366                 tempDbl = osresult1->getAvailableMemoryValue();
    04367                 ok &= osresult2->setAvailableMemoryValue(tempDbl);
    04368                 if (!ok)
    04369                         throw ErrorClass("Error during setAvailableMemoryValue!");
    04370                 tempStr = osresult1->getAvailableCPUSpeedUnit();
    04371                 ok &= osresult2->setAvailableCPUSpeedUnit(tempStr);
    04372                 if (!ok)
    04373                         throw ErrorClass("Error during setAvailableCPUSpeedUnit!");
    04374                 tempStr = osresult1->getAvailableCPUSpeedDescription();
    04375                 ok &= osresult2->setAvailableCPUSpeedDescription(tempStr);
    04376                 if (!ok)
    04377                         throw ErrorClass("Error during setAvailableCPUSpeedDescription!");
    04378                 tempDbl = osresult1->getAvailableCPUSpeedValue();
    04379                 ok &= osresult2->setAvailableCPUSpeedValue(tempDbl);
    04380                 if (!ok)
    04381                         throw ErrorClass("Error during setAvailableCPUSpeedValue!");
    04382                 tempStr = osresult1->getAvailableCPUNumberDescription();
    04383                 ok &= osresult2->setAvailableCPUNumberDescription(tempStr);
    04384                 if (!ok)
    04385                         throw ErrorClass("Error during setAvailableCPUNumberDescription!");
    04386                 tempInt = osresult1->getAvailableCPUNumberValue();
    04387                 ok &= osresult2->setAvailableCPUNumberValue(tempInt);
    04388                 if (!ok)
    04389                         throw ErrorClass("Error during setAvailableCPUNumberValue!");
    04390
    04391                 tempInt = osresult1->getNumberOfOtherSystemResults();
    04392                 ok &= osresult2->setNumberOfOtherSystemResults(tempInt);
    04393                 if (!ok)
    04394                         throw ErrorClass("Error during setNumberOfOtherSystemResults!");
    04395                 for (int i=0; i < tempInt; i++)
    04396                 {
    04397                         tempStr = osresult1->getOtherSystemResultName(i);
    04398                         ok &= osresult2->setOtherSystemResultName(i,tempStr);
    04399                         if (!ok)
    04400                                 throw ErrorClass("Error during setOtherSystemResultName!");
    04401                         tempStr = osresult1->getOtherSystemResultValue(i);
    04402                         ok &= osresult2->setOtherSystemResultValue(i,tempStr);
    04403                         if (!ok)
    04404                                 throw ErrorClass("Error during setOtherSystemResultValue!");
    04405                         tempStr = osresult1->getOtherSystemResultDescription(i);
    04406                         ok &= osresult2->setOtherSystemResultDescription(i,tempStr);
    04407                         if (!ok)
    04408                                 throw ErrorClass("Error during setOtherSystemResultDescription!");
    04409                 }
    04410
    04411                 tempStr = osresult1->getCurrentState();
    04412                 ok &= osresult2->setCurrentState(tempStr);
    04413                 if (!ok)
    04414                         throw ErrorClass("Error during setCurrentState!");
    04415                 tempInt = osresult1->getCurrentJobCount();
    04416                 ok &= osresult2->setCurrentJobCount(tempInt);
    04417                 if (!ok)
    04418                         throw ErrorClass("Error during setCurrentJobCount!");
    04419                 tempInt = osresult1->getTotalJobsSoFar();
    04420                 ok &= osresult2->setTotalJobsSoFar(tempInt);
    04421                 if (!ok)
    04422                         throw ErrorClass("Error during setTotalJobsSoFar!");
    04423                 tempStr = osresult1->getTimeServiceStarted();
    04424                 ok &= osresult2->setTimeServiceStarted(tempStr);
    04425                 if (!ok)
    04426                         throw ErrorClass("Error during setTimeServiceStarted!");
    04427                 tempDbl = osresult1->getServiceUtilization();
    04428                 ok &= osresult2->setServiceUtilization(tempDbl);
    04429                 if (!ok)
    04430                         throw ErrorClass("Error during setServiceUtilization!");
    04431
    04432                 tempInt = osresult1->getNumberOfOtherServiceResults();
    04433                 ok &= osresult2->setNumberOfOtherServiceResults(tempInt);
    04434                 if (!ok)
    04435                         throw ErrorClass("Error during setNumberOfOtherServiceResults!");
    04436                 for (int i=0; i < tempInt; i++)
    04437                 {
    04438                         tempStr = osresult1->getOtherServiceResultName(i);
    04439                         ok &= osresult2->setOtherServiceResultName(i,tempStr);
    04440                         if (!ok)
    04441                                 throw ErrorClass("Error during setOtherServiceResultName!");
    04442                         tempStr = osresult1->getOtherServiceResultValue(i);
    04443                         ok &= osresult2->setOtherServiceResultValue(i,tempStr);
    04444                         if (!ok)
    04445                                 throw ErrorClass("Error during setOtherServiceResultValue!");
    04446                         tempStr = osresult1->getOtherServiceResultDescription(i);
    04447                         ok &= osresult2->setOtherServiceResultDescription(i,tempStr);
    04448                         if (!ok)
    04449                                 throw ErrorClass("Error during setOtherServiceResultDescription!");
    04450                 }
    04451
    04452                 tempStr = osresult1->getJobStatus();
    04453                 ok &= osresult2->setJobStatus(tempStr);
    04454                 if (!ok)
    04455                         throw ErrorClass("Error during setJobStatus!");
    04456                 tempStr = osresult1->getJobSubmitTime();
    04457                 ok &= osresult2->setJobSubmitTime(tempStr);
    04458                 if (!ok)
    04459                         throw ErrorClass("Error during setJobSubmitTime!");
    04460                 tempStr = osresult1->getScheduledStartTime();
    04461                 ok &= osresult2->setScheduledStartTime(tempStr);
    04462                 if (!ok)
    04463                         throw ErrorClass("Error during setScheduledStartTime!");
    04464                 tempStr = osresult1->getActualStartTime();
    04465                 ok &= osresult2->setActualStartTime(tempStr);
    04466                 if (!ok)
    04467                         throw ErrorClass("Error during setActualStartTime!");
    04468                 tempStr = osresult1->getJobEndTime();
    04469                 ok &= osresult2->setJobEndTime(tempStr);
    04470                 if (!ok)
    04471                         throw ErrorClass("Error during setJobEndTime!");
    04472
    04473                 tempInt = osresult1->getNumberOfTimes();
    04474                 ok &= osresult2->setNumberOfTimes(tempInt);
    04475                 if (!ok)
    04476                         throw ErrorClass("Error during setNumberOfTimes!");
    04477                 for (int i=0; i < tempInt; i++)
    04478                 {
    04479                         string tempStr1,tempStr2,tempStr3,tempStr4;
    04480                         tempStr1 = osresult1->getTimingInfoType(i);
    04481                         tempStr2 = osresult1->getTimingInfoCategory(i);
    04482                         tempStr3 = osresult1->getTimingInfoUnit(i);
    04483                         tempStr4 = osresult1->getTimingInfoDescription(i);
    04484                         tempDbl  = osresult1->getTimingInfoValue(i);
    04485                         ok &= osresult2->setTimingInformation(i,tempStr1,tempStr2,tempStr3,tempStr4,tempDbl);
    04486                         if (!ok)
    04487                                 throw ErrorClass("Error during setTimingInformation!");
    04488                 }
    04489
    04490                 tempStr = osresult1->getUsedDiskSpaceUnit();
    04491                 ok &= osresult2->setUsedDiskSpaceUnit(tempStr);
    04492                 if (!ok)
    04493                         throw ErrorClass("Error during setUsedDiskSpaceUnit!");
    04494                 tempStr = osresult1->getUsedDiskSpaceDescription();
    04495                 ok &= osresult2->setUsedDiskSpaceDescription(tempStr);
    04496                 if (!ok)
    04497                         throw ErrorClass("Error during setUsedDiskSpaceDescription!");
    04498                 tempDbl = osresult1->getUsedDiskSpaceValue();
    04499                 ok &= osresult2->setUsedDiskSpaceValue(tempDbl);
    04500                 if (!ok)
    04501                         throw ErrorClass("Error during setUsedDiskSpaceValue!");
    04502                 tempStr = osresult1->getUsedMemoryUnit();
    04503                 ok &= osresult2->setUsedMemoryUnit(tempStr);
    04504                 if (!ok)
    04505                         throw ErrorClass("Error during setUsedMemoryUnit!");
    04506                 tempStr = osresult1->getUsedMemoryDescription();
    04507                 ok &= osresult2->setUsedMemoryDescription(tempStr);
    04508                 if (!ok)
    04509                         throw ErrorClass("Error during setUsedMemoryDescription!");
    04510                 tempDbl = osresult1->getUsedMemoryValue();
    04511                 ok &= osresult2->setUsedMemoryValue(tempDbl);
    04512                 if (!ok)
    04513                         throw ErrorClass("Error during setUsedMemoryValue!");
    04514                 tempStr = osresult1->getUsedCPUSpeedUnit();
    04515                 ok &= osresult2->setUsedCPUSpeedUnit(tempStr);
    04516                 if (!ok)
    04517                         throw ErrorClass("Error during setUsedCPUSpeedUnit!");
    04518                 tempStr = osresult1->getUsedCPUSpeedDescription();
    04519                 ok &= osresult2->setUsedCPUSpeedDescription(tempStr);
    04520                 if (!ok)
    04521                         throw ErrorClass("Error during setUsedCPUSpeedDescription!");
    04522                 tempDbl = osresult1->getUsedCPUSpeedValue();
    04523                 ok &= osresult2->setUsedCPUSpeedValue(tempDbl);
    04524                 if (!ok)
    04525                         throw ErrorClass("Error during setUsedCPUSpeedValue!");
    04526                 tempStr = osresult1->getUsedCPUNumberDescription();
    04527                 ok &= osresult2->setUsedCPUNumberDescription(tempStr);
    04528                 if (!ok)
    04529                         throw ErrorClass("Error during setUsedCPUNumberDescription!");
    04530                 tempInt = osresult1->getUsedCPUNumberValue();
    04531                 ok &= osresult2->setUsedCPUNumberValue(tempInt);
    04532                 if (!ok)
    04533                         throw ErrorClass("Error during setUsedCPUNumberValue!");
    04534
    04535                 tempInt = osresult1->getNumberOfOtherJobResults();
    04536                 ok &= osresult2->setNumberOfOtherJobResults(tempInt);
    04537                 if (!ok)
    04538                         throw ErrorClass("Error during setNumberOfOtherJobResults!");
    04539                 for (int i=0; i < tempInt; i++)
    04540                 {
    04541                         tempStr = osresult1->getOtherJobResultName(i);
    04542                         ok &= osresult2->setOtherJobResultName(i,tempStr);
    04543                         if (!ok)
    04544                                 throw ErrorClass("Error during setOtherJobResultName!");
    04545                         tempStr = osresult1->getOtherJobResultValue(i);
    04546                         ok &= osresult2->setOtherJobResultValue(i,tempStr);
    04547                         if (!ok)
    04548                                 throw ErrorClass("Error during setOtherJobResultValue!");
    04549                         tempStr = osresult1->getOtherJobResultDescription(i);
    04550                         ok &= osresult2->setOtherJobResultDescription(i,tempStr);
    04551                         if (!ok)
    04552                                 throw ErrorClass("Error during setOtherJobResultDescription!");
    04553                 }
    04554
    04555                 tempInt = osresult1->getSolutionNumber();
    04556                 ok &= osresult2->setSolutionNumber(tempInt);
    04557                 if (!ok)
    04558                         throw ErrorClass("Error during setSolutionNumber!");
    04559                 int nSoln = tempInt;
    04560                 int nVar, nObj, nCon, nOther, nItem;
    04561
    04562                 tempInt = osresult1->getVariableNumber();
    04563                 ok &= osresult2->setVariableNumber(tempInt);
    04564                 if (!ok)
    04565                         throw ErrorClass("Error during setVariableNumber!");
    04566                 tempInt = osresult1->getObjectiveNumber();
    04567                 ok &= osresult2->setObjectiveNumber(tempInt);
    04568                 if (!ok)
    04569                         throw ErrorClass("Error during setObjectiveNumber!");
    04570                 tempInt = osresult1->getConstraintNumber();
    04571                 ok &= osresult2->setConstraintNumber(tempInt);
    04572                 if (!ok)
    04573                         throw ErrorClass("Error during setConstraintNumber!");
    04574
    04575                 for (int i=0; i < nSoln; ++i)
    04576                 {
    04577                         tempInt = osresult1->getSolutionTargetObjectiveIdx(i);
    04578                         ok &= osresult2->setSolutionTargetObjectiveIdx(i,tempInt);
    04579                         if (!ok)
    04580                                 throw ErrorClass("Error during setSolutionTargetObjectiveIdx!");
    04581                         bool tempLog = osresult1->getSolutionWeightedObjectives(i);
    04582                         ok &= osresult2->setSolutionWeightedObjectives(i,tempLog);
    04583                         if (!ok)
    04584                                 throw ErrorClass("Error during setSolutionWeightedObjectives!");
    04585                         tempStr = osresult1->getSolutionStatusType(i);
    04586                         ok &= osresult2->setSolutionStatusType(i,tempStr);
    04587                         if (!ok)
    04588                                 throw ErrorClass("Error during setSolutionStatusType!");
    04589                         tempStr = osresult1->getSolutionStatusDescription(i);
    04590                         ok &= osresult2->setSolutionStatusDescription(i,tempStr);
    04591                         if (!ok)
    04592                                 throw ErrorClass("Error during setSolutionStatusDescription!");
    04593
    04594                         tempInt = osresult1->getNumberOfSolutionSubstatuses(i);
    04595                         ok &= osresult2->setNumberOfSolutionSubstatuses(i,tempInt);
    04596                         if (!ok)
    04597                                 throw ErrorClass("Error during setNumberOfSolutionSubstatuses!");
    04598
    04599                         for (int j=0; j < tempInt; ++j)
    04600                         {
    04601                                 tempStr = osresult1->getSolutionSubstatusType(i,j);
    04602                                 ok &= osresult2->setSolutionSubstatusType(i,j,tempStr);
    04603                                 if (!ok)
    04604                                         throw ErrorClass("Error during setSolutionSubstatusType!");
    04605                                 tempStr = osresult1->getSolutionSubstatusDescription(i,j);
    04606                                 ok &= osresult2->setSolutionSubstatusDescription(i,j,tempStr);
    04607                                 if (!ok)
    04608                                         throw ErrorClass("Error during setSolutionSubstatusDescription!");
    04609                         }
    04610
    04611                         tempStr = osresult1->getSolutionMessage(i);
    04612                         ok &= osresult2->setSolutionMessage(i,tempStr);
    04613                         if (!ok)
    04614                                 throw ErrorClass("Error during setSolutionMessage!");
    04615
    04616                         tempInt = osresult1->getNumberOfVarValues(i);
    04617                         ok &= osresult2->setNumberOfVarValues(i,tempInt);
    04618                         if (!ok)
    04619                                 throw ErrorClass("Error during setNumberOfVarValues!");
    04620                         nVar = tempInt;
    04621                         for (int j=0; j < nVar; ++j)
    04622                         {
    04623                                 tempInt = osresult1->getVarValueIdx(i,j);
    04624                                 tempDbl = osresult1->getVarValue(i,j);
    04625                                 ok &= osresult2->setVarValue(i,j,tempInt,tempDbl);
    04626                                 if (!ok)
    04627                                         throw ErrorClass("Error during setVarValue!");
    04628                         }
    04629
    04630                         tempInt = osresult1->getNumberOfVarValuesString(i);
    04631                         ok &= osresult2->setNumberOfVarValuesString(i,tempInt);
    04632                         if (!ok)
    04633                                 throw ErrorClass("Error during setNumberOfVarValuesString!");
    04634                         nVar = tempInt;
    04635                         for (int j=0; j < nVar; ++j)
    04636                         {
    04637                                 tempInt = osresult1->getVarValueStringIdx(i,j);
    04638                                 tempStr = osresult1->getVarValueString(i,j);
    04639                                 ok &= osresult2->setVarValueString(i,j,tempInt,tempStr);
    04640                                 if (!ok)
    04641                                         throw ErrorClass("Error during setVarValueString!");
    04642                         }
    04643
    04644 //                      int* tempArray = new int[3];
    04645                         tempInt = osresult1->getBasisStatusNumberOfEl(i,ENUM_PROBLEM_COMPONENT_variables,ENUM_BASIS_STATUS_basic);
    04646                         for (int j=0; j<tempInt; ++j)
    04647                                 tempArray[j] = osresult1->getBasisStatusEl(i,ENUM_PROBLEM_COMPONENT_variables,ENUM_BASIS_STATUS_basic,j);
    04648                         ok &= osresult2->setBasisStatus(i,ENUM_PROBLEM_COMPONENT_variables,ENUM_BASIS_STATUS_basic,tempArray,tempInt);
    04649                         if (!ok)
    04650                                 throw ErrorClass("Error during setBasisStatus (variables basic)!");
    04651
    04652                         tempInt = osresult1->getBasisStatusNumberOfEl(i,ENUM_PROBLEM_COMPONENT_variables,ENUM_BASIS_STATUS_atLower);
    04653                         for (int j=0; j<tempInt; ++j)
    04654                                 tempArray[j] = osresult1->getBasisStatusEl(i,ENUM_PROBLEM_COMPONENT_variables,ENUM_BASIS_STATUS_atLower,j);
    04655                         ok &= osresult2->setBasisStatus(i,ENUM_PROBLEM_COMPONENT_variables,ENUM_BASIS_STATUS_atLower,tempArray,tempInt);
    04656                         if (!ok)
    04657                                 throw ErrorClass("Error during setBasisStatus (variables atLower)!");
    04658
    04659                         tempInt = osresult1->getBasisStatusNumberOfEl(i,ENUM_PROBLEM_COMPONENT_variables,ENUM_BASIS_STATUS_atUpper);
    04660                         for (int j=0; j<tempInt; ++j)
    04661                                 tempArray[j] = osresult1->getBasisStatusEl(i,ENUM_PROBLEM_COMPONENT_variables,ENUM_BASIS_STATUS_atUpper,j);
    04662                         ok &= osresult2->setBasisStatus(i,ENUM_PROBLEM_COMPONENT_variables,ENUM_BASIS_STATUS_atUpper,tempArray,tempInt);
    04663                         if (!ok)
    04664                                 throw ErrorClass("Error during setBasisStatus (variables atUpper)!");
    04665
    04666                         tempInt = osresult1->getBasisStatusNumberOfEl(i,ENUM_PROBLEM_COMPONENT_variables,ENUM_BASIS_STATUS_isFree);
    04667                         for (int j=0; j<tempInt; ++j)
    04668                                 tempArray[j] = osresult1->getBasisStatusEl(i,ENUM_PROBLEM_COMPONENT_variables,ENUM_BASIS_STATUS_isFree,j);
    04669                         ok &= osresult2->setBasisStatus(i,ENUM_PROBLEM_COMPONENT_variables,ENUM_BASIS_STATUS_isFree,tempArray,tempInt);
    04670                         if (!ok)
    04671                                 throw ErrorClass("Error during setBasisStatus (variables isFree)!");
    04672
    04673                         tempInt = osresult1->getBasisStatusNumberOfEl(i,ENUM_PROBLEM_COMPONENT_variables,ENUM_BASIS_STATUS_superbasic);
    04674                         for (int j=0; j<tempInt; ++j)
    04675                                 tempArray[j] = osresult1->getBasisStatusEl(i,ENUM_PROBLEM_COMPONENT_variables,ENUM_BASIS_STATUS_superbasic,j);
    04676                         ok &= osresult2->setBasisStatus(i,ENUM_PROBLEM_COMPONENT_variables,ENUM_BASIS_STATUS_superbasic,tempArray,tempInt);
    04677                         if (!ok)
    04678                                 throw ErrorClass("Error during setBasisStatus (variables superbasic)!");
    04679
    04680                         tempInt = osresult1->getBasisStatusNumberOfEl(i,ENUM_PROBLEM_COMPONENT_variables,ENUM_BASIS_STATUS_unknown);
    04681                         for (int j=0; j<tempInt; ++j)
    04682                                 tempArray[j] = osresult1->getBasisStatusEl(i,ENUM_PROBLEM_COMPONENT_variables,ENUM_BASIS_STATUS_unknown,j);
    04683                         ok &= osresult2->setBasisStatus(i,ENUM_PROBLEM_COMPONENT_variables,ENUM_BASIS_STATUS_unknown,tempArray,tempInt);
    04684                         if (!ok)
    04685                                 throw ErrorClass("Error during setBasisStatus (variables unknown)!");
    04686
    04687
    04688                         tempInt = osresult1->getNumberOfOtherVariableResults(i);
    04689                         ok &= osresult2->setNumberOfOtherVariableResults(i,tempInt);
    04690                         if (!ok)
    04691                                 throw ErrorClass("Error during setNumberOfOtherVariableResults!");
    04692                         nOther = tempInt;
    04693                         for (int j=0; j < nOther; ++j)
    04694                         {
    04695                                 tempStr = osresult1->getOtherVariableResultName(i,j);
    04696                                 ok &= osresult2->setOtherVariableResultName(i,j,tempStr);
    04697                                 if (!ok)
    04698                                         throw ErrorClass("Error during setOtherVariableResultName!");
    04699                                 tempStr = osresult1->getOtherVariableResultDescription(i,j);
    04700                                 ok &= osresult2->setOtherVariableResultDescription(i,j,tempStr);
    04701                                 if (!ok)
    04702                                         throw ErrorClass("Error during setOtherVariableResultDescription!");
    04703                                 tempStr = osresult1->getOtherVariableResultValue(i,j);
    04704                                 ok &= osresult2->setOtherVariableResultValue(i,j,tempStr);
    04705                                 if (!ok)
    04706                                         throw ErrorClass("Error during setOtherVariableResultValue!");
    04707
    04708                                 tempInt = osresult1->getOtherVariableResultNumberOfVar(i,j);
    04709                                 ok &= osresult2->setOtherVariableResultNumberOfVar(i,j,tempInt);
    04710                                 if (!ok)
    04711                                         throw ErrorClass("Error during setOtherVariableResultNumberOfVar!");
    04712
    04713                                 int nVar = tempInt;
    04714                                 for (int k=0; k < nVar; ++k)
    04715                                 {
    04716                                         tempInt = osresult1->getOtherVariableResultVarIdx(i,j,k);
    04717                                         ok &= osresult2->setOtherVariableResultVarIdx(i,j,k,tempInt);
    04718                                         if (!ok)
    04719                                                 throw ErrorClass("Error during setOtherVariableResultVarIdx!");
    04720                                         tempStr = osresult1->getOtherVariableResultVar(i,j,k);
    04721                                         ok &= osresult2->setOtherVariableResultVar(i,j,k,tempStr);
    04722                                         if (!ok)
    04723                                                 throw ErrorClass("Error during setOtherVariableResultVar!");
    04724                                 }
    04725
    04726                                 int nEnum = osresult1->getOtherVariableResultNumberOfEnumerations(i,j);
    04727                                 ok &= osresult2->setOtherVariableResultNumberOfEnumerations(i,j,nEnum);
    04728                                 if (!ok)
    04729                                         throw ErrorClass("Error during setOtherVariableResultNumberOfEnumerations!");
    04730
    04731                                 std::string tempStr1, tempStr2;
    04732
    04733                                 for (int k=0; k < nEnum; ++k)
    04734                                 {
    04735 //                      if (tempArray != NULL) delete[] tempArray;
    04736                                         tempStr1  = osresult1->getOtherVariableResultEnumerationValue(i,j,k);
    04737                                         tempStr2  = osresult1->getOtherVariableResultEnumerationDescription(i,j,k);
    04738                                         tempInt   = osresult1->getOtherVariableResultEnumerationNumberOfEl(i,j,k);
    04739                                         for (int l=0; l<tempInt; ++l)
    04740                                                 tempArray[l] = osresult1->getOtherVariableResultEnumerationEl(i,j,k,l);
    04741                                         ok &= osresult2->setOtherOptionEnumeration(i,j,ENUM_PROBLEM_COMPONENT_variables,k,tempStr1,tempStr2,tempArray,tempInt);
    04742                                         if (!ok)
    04743                                                 throw ErrorClass("Error during setOtherVariableResultEnumeration!");
    04744                                 }
    04745                         }
    04746
    04747                         tempInt = osresult1->getNumberOfObjValues(i);
    04748                         ok &= osresult2->setNumberOfObjValues(i,tempInt);
    04749                         if (!ok)
    04750                                 throw ErrorClass("Error during setNumberOfObjValues!");
    04751                         nObj = tempInt;
    04752                         for (int j=0; j < nObj; ++j)
    04753                         {
    04754                                 tempInt = osresult1->getObjValueIdx(i,j);
    04755                                 tempDbl = osresult1->getObjValue(i,j);
    04756                                 ok &= osresult2->setObjValue(i,j,tempInt,tempDbl);
    04757                                 if (!ok)
    04758                                         throw ErrorClass("Error during setObjValue!");
    04759                         }
    04760
    04761
    04762                         tempInt = osresult1->getBasisStatusNumberOfEl(i,ENUM_PROBLEM_COMPONENT_objectives,ENUM_BASIS_STATUS_basic);
    04763                         for (int j=0; j<tempInt; ++j)
    04764                                 tempArray[j] = osresult1->getBasisStatusEl(i,ENUM_PROBLEM_COMPONENT_objectives,ENUM_BASIS_STATUS_basic,j);
    04765                         ok &= osresult2->setBasisStatus(i,ENUM_PROBLEM_COMPONENT_objectives,ENUM_BASIS_STATUS_basic,tempArray,tempInt);
    04766                         if (!ok)
    04767                                 throw ErrorClass("Error during setBasisStatus (objectives basic)!");
    04768
    04769                         tempInt = osresult1->getBasisStatusNumberOfEl(i,ENUM_PROBLEM_COMPONENT_objectives,ENUM_BASIS_STATUS_atLower);
    04770                         for (int j=0; j<tempInt; ++j)
    04771                                 tempArray[j] = osresult1->getBasisStatusEl(i,ENUM_PROBLEM_COMPONENT_objectives,ENUM_BASIS_STATUS_atLower,j);
    04772                         ok &= osresult2->setBasisStatus(i,ENUM_PROBLEM_COMPONENT_objectives,ENUM_BASIS_STATUS_atLower,tempArray,tempInt);
    04773                         if (!ok)
    04774                                 throw ErrorClass("Error during setBasisStatus (objectives atLower)!");
    04775
    04776                         tempInt = osresult1->getBasisStatusNumberOfEl(i,ENUM_PROBLEM_COMPONENT_objectives,ENUM_BASIS_STATUS_atUpper);
    04777                         for (int j=0; j<tempInt; ++j)
    04778                                 tempArray[j] = osresult1->getBasisStatusEl(i,ENUM_PROBLEM_COMPONENT_objectives,ENUM_BASIS_STATUS_atUpper,j);
    04779                         ok &= osresult2->setBasisStatus(i,ENUM_PROBLEM_COMPONENT_objectives,ENUM_BASIS_STATUS_atUpper,tempArray,tempInt);
    04780                         if (!ok)
    04781                                 throw ErrorClass("Error during setBasisStatus (objectives atUpper)!");
    04782
    04783                         tempInt = osresult1->getBasisStatusNumberOfEl(i,ENUM_PROBLEM_COMPONENT_objectives,ENUM_BASIS_STATUS_isFree);
    04784                         for (int j=0; j<tempInt; ++j)
    04785                                 tempArray[j] = osresult1->getBasisStatusEl(i,ENUM_PROBLEM_COMPONENT_objectives,ENUM_BASIS_STATUS_isFree,j);
    04786                         ok &= osresult2->setBasisStatus(i,ENUM_PROBLEM_COMPONENT_objectives,ENUM_BASIS_STATUS_isFree,tempArray,tempInt);
    04787                         if (!ok)
    04788                                 throw ErrorClass("Error during setBasisStatus (objectives isFree)!");
    04789
    04790                         tempInt = osresult1->getBasisStatusNumberOfEl(i,ENUM_PROBLEM_COMPONENT_objectives,ENUM_BASIS_STATUS_superbasic);
    04791                         for (int j=0; j<tempInt; ++j)
    04792                                 tempArray[j] = osresult1->getBasisStatusEl(i,ENUM_PROBLEM_COMPONENT_objectives,ENUM_BASIS_STATUS_superbasic,j);
    04793                         ok &= osresult2->setBasisStatus(i,ENUM_PROBLEM_COMPONENT_objectives,ENUM_BASIS_STATUS_superbasic,tempArray,tempInt);
    04794                         if (!ok)
    04795                                 throw ErrorClass("Error during setBasisStatus (objectives superbasic)!");
    04796
    04797                         tempInt = osresult1->getBasisStatusNumberOfEl(i,ENUM_PROBLEM_COMPONENT_objectives,ENUM_BASIS_STATUS_unknown);
    04798                         for (int j=0; j<tempInt; ++j)
    04799                                 tempArray[j] = osresult1->getBasisStatusEl(i,ENUM_PROBLEM_COMPONENT_objectives,ENUM_BASIS_STATUS_unknown,j);
    04800                         ok &= osresult2->setBasisStatus(i,ENUM_PROBLEM_COMPONENT_objectives,ENUM_BASIS_STATUS_unknown,tempArray,tempInt);
    04801                         if (!ok)
    04802                                 throw ErrorClass("Error during setBasisStatus (objectives unknown)!");
    04803
    04804
    04805
    04806                         tempInt = osresult1->getNumberOfOtherObjectiveResults(i);
    04807                         ok &= osresult2->setNumberOfOtherObjectiveResults(i,tempInt);
    04808                         if (!ok)
    04809                                 throw ErrorClass("Error during setNumberOfOtherObjectiveResults!");
    04810                         nOther = tempInt;
    04811                         for (int j=0; j < nOther; ++j)
    04812                         {
    04813                                 tempStr = osresult1->getOtherObjectiveResultName(i,j);
    04814                                 ok &= osresult2->setOtherObjectiveResultName(i,j,tempStr);
    04815                                 if (!ok)
    04816                                         throw ErrorClass("Error during setOtherObjectiveResultName!");
    04817                                 tempStr = osresult1->getOtherObjectiveResultDescription(i,j);
    04818                                 ok &= osresult2->setOtherObjectiveResultDescription(i,j,tempStr);
    04819                                 if (!ok)
    04820                                         throw ErrorClass("Error during setOtherObjectiveResultDescription!");
    04821                                 tempStr = osresult1->getOtherObjectiveResultValue(i,j);
    04822                                 ok &= osresult2->setOtherObjectiveResultValue(i,j,tempStr);
    04823                                 if (!ok)
    04824                                         throw ErrorClass("Error during setOtherObjectiveResultValue!");
    04825
    04826                                 tempInt = osresult1->getOtherObjectiveResultNumberOfObj(i,j);
    04827                                 ok &= osresult2->setOtherObjectiveResultNumberOfObj(i,j,tempInt);
    04828                                 if (!ok)
    04829                                         throw ErrorClass("Error during setOtherObjectiveResultNumberOfObj!");
    04830
    04831                                 nObj = tempInt;
    04832                                 for (int k=0; k < nObj; ++k)
    04833                                 {
    04834                                         tempInt = osresult1->getOtherObjectiveResultObjIdx(i,j,k);
    04835                                         ok &= osresult2->setOtherObjectiveResultObjIdx(i,j,k,tempInt);
    04836                                         if (!ok)
    04837                                                 throw ErrorClass("Error during setOtherObjectiveResultObjIdx!");
    04838                                         tempStr = osresult1->getOtherObjectiveResultObj(i,j,k);
    04839                                         ok &= osresult2->setOtherObjectiveResultObj(i,j,k,tempStr);
    04840                                         if (!ok)
    04841                                                 throw ErrorClass("Error during setOtherObjectiveResultObj!");
    04842                                 }
    04843
    04844                                 int nEnum = osresult1->getOtherObjectiveResultNumberOfEnumerations(i,j);
    04845                                 ok &= osresult2->setOtherObjectiveResultNumberOfEnumerations(i,j,nEnum);
    04846                                 if (!ok)
    04847                                         throw ErrorClass("Error during setOtherObjectiveResultNumberOfEnumerations!");
    04848                                 std::string tempStr1, tempStr2;
    04849
    04850                                 for (int k=0; k < nEnum; ++k)
    04851                                 {
    04852 //                      if (tempArray != NULL) delete[] tempArray;
    04853                                         tempStr1  = osresult1->getOtherObjectiveResultEnumerationValue(i,j,k);
    04854                                         tempStr2  = osresult1->getOtherObjectiveResultEnumerationDescription(i,j,k);
    04855                                         tempInt   = osresult1->getOtherObjectiveResultEnumerationNumberOfEl(i,j,k);
    04856                                         for (int l=0; l<tempInt; ++l)
    04857                                                 tempArray[l] = osresult1->getOtherObjectiveResultEnumerationEl(i,j,k,l);
    04858                                         ok &= osresult2->setOtherOptionEnumeration(i,j,ENUM_PROBLEM_COMPONENT_objectives,k,tempStr1,tempStr2,tempArray,tempInt);
    04859                                         if (!ok)
    04860                                                 throw ErrorClass("Error during setOtherObjectiveResultEnumeration!");
    04861                                 }
    04862                         }
    04863
    04864
    04865                         tempInt = osresult1->getNumberOfDualValues(i);
    04866                         ok &= osresult2->setNumberOfDualValues(i,tempInt);
    04867                         if (!ok)
    04868                                 throw ErrorClass("Error during setNumberOfDualValues!");
    04869                         nCon = tempInt;
    04870                         for (int j=0; j < nCon; ++j)
    04871                         {
    04872                                 tempInt = osresult1->getDualValueIdx(i,j);
    04873                                 tempDbl = osresult1->getDualValue(i,j);
    04874                                 ok &= osresult2->setDualValue(i,j,tempInt,tempDbl);
    04875                                 if (!ok)
    04876                                         throw ErrorClass("Error during setDualValue!");
    04877                         }
    04878
    04879
    04880                         tempInt = osresult1->getBasisStatusNumberOfEl(i,ENUM_PROBLEM_COMPONENT_constraints,ENUM_BASIS_STATUS_basic);
    04881                         for (int j=0; j<tempInt; ++j)
    04882                                 tempArray[j] = osresult1->getBasisStatusEl(i,ENUM_PROBLEM_COMPONENT_constraints,ENUM_BASIS_STATUS_basic,j);
    04883                         ok &= osresult2->setBasisStatus(i,ENUM_PROBLEM_COMPONENT_constraints,ENUM_BASIS_STATUS_basic,tempArray,tempInt);
    04884                         if (!ok)
    04885                                 throw ErrorClass("Error during setBasisStatus (constraints basic)!");
    04886
    04887                         tempInt = osresult1->getBasisStatusNumberOfEl(i,ENUM_PROBLEM_COMPONENT_constraints,ENUM_BASIS_STATUS_atLower);
    04888                         for (int j=0; j<tempInt; ++j)
    04889                                 tempArray[j] = osresult1->getBasisStatusEl(i,ENUM_PROBLEM_COMPONENT_constraints,ENUM_BASIS_STATUS_atLower,j);
    04890                         ok &= osresult2->setBasisStatus(i,ENUM_PROBLEM_COMPONENT_constraints,ENUM_BASIS_STATUS_atLower,tempArray,tempInt);
    04891                         if (!ok)
    04892                                 throw ErrorClass("Error during setBasisStatus (constraints atLower)!");
    04893
    04894                         tempInt = osresult1->getBasisStatusNumberOfEl(i,ENUM_PROBLEM_COMPONENT_constraints,ENUM_BASIS_STATUS_atUpper);
    04895                         for (int j=0; j<tempInt; ++j)
    04896                                 tempArray[j] = osresult1->getBasisStatusEl(i,ENUM_PROBLEM_COMPONENT_constraints,ENUM_BASIS_STATUS_atUpper,j);
    04897                         ok &= osresult2->setBasisStatus(i,ENUM_PROBLEM_COMPONENT_constraints,ENUM_BASIS_STATUS_atUpper,tempArray,tempInt);
    04898                         if (!ok)
    04899                                 throw ErrorClass("Error during setBasisStatus (constraints atUpper)!");
    04900
    04901                         tempInt = osresult1->getBasisStatusNumberOfEl(i,ENUM_PROBLEM_COMPONENT_constraints,ENUM_BASIS_STATUS_isFree);
    04902                         for (int j=0; j<tempInt; ++j)
    04903                                 tempArray[j] = osresult1->getBasisStatusEl(i,ENUM_PROBLEM_COMPONENT_constraints,ENUM_BASIS_STATUS_isFree,j);
    04904                         ok &= osresult2->setBasisStatus(i,ENUM_PROBLEM_COMPONENT_constraints,ENUM_BASIS_STATUS_isFree,tempArray,tempInt);
    04905                         if (!ok)
    04906                                 throw ErrorClass("Error during setBasisStatus (constraints isFree)!");
    04907
    04908                         tempInt = osresult1->getBasisStatusNumberOfEl(i,ENUM_PROBLEM_COMPONENT_constraints,ENUM_BASIS_STATUS_superbasic);
    04909                         for (int j=0; j<tempInt; ++j)
    04910                                 tempArray[j] = osresult1->getBasisStatusEl(i,ENUM_PROBLEM_COMPONENT_constraints,ENUM_BASIS_STATUS_superbasic,j);
    04911                         ok &= osresult2->setBasisStatus(i,ENUM_PROBLEM_COMPONENT_constraints,ENUM_BASIS_STATUS_superbasic,tempArray,tempInt);
    04912                         if (!ok)
    04913                                 throw ErrorClass("Error during setBasisStatus (constraints superbasic)!");
    04914
    04915                         tempInt = osresult1->getBasisStatusNumberOfEl(i,ENUM_PROBLEM_COMPONENT_constraints,ENUM_BASIS_STATUS_unknown);
    04916                         for (int j=0; j<tempInt; ++j)
    04917                                 tempArray[j] = osresult1->getBasisStatusEl(i,ENUM_PROBLEM_COMPONENT_constraints,ENUM_BASIS_STATUS_unknown,j);
    04918                         ok &= osresult2->setBasisStatus(i,ENUM_PROBLEM_COMPONENT_constraints,ENUM_BASIS_STATUS_unknown,tempArray,tempInt);
    04919                         if (!ok)
    04920                                 throw ErrorClass("Error during setBasisStatus (constraints unknown)!");
    04921
    04922
    04923
    04924
    04925                         tempInt = osresult1->getNumberOfOtherConstraintResults(i);
    04926                         ok &= osresult2->setNumberOfOtherConstraintResults(i,tempInt);
    04927                         if (!ok)
    04928                                 throw ErrorClass("Error during setNumberOfOtherConstraintResults!");
    04929                         nOther = tempInt;
    04930                         for (int j=0; j < nOther; ++j)
    04931                         {
    04932                                 tempStr = osresult1->getOtherConstraintResultName(i,j);
    04933                                 ok &= osresult2->setOtherConstraintResultName(i,j,tempStr);
    04934                                 if (!ok)
    04935                                         throw ErrorClass("Error during setOtherConstraintResultName!");
    04936                                 tempStr = osresult1->getOtherConstraintResultDescription(i,j);
    04937                                 ok &= osresult2->setOtherConstraintResultDescription(i,j,tempStr);
    04938                                 if (!ok)
    04939                                         throw ErrorClass("Error during setOtherConstraintResultDescription!");
    04940                                 tempStr = osresult1->getOtherConstraintResultValue(i,j);
    04941                                 ok &= osresult2->setOtherConstraintResultValue(i,j,tempStr);
    04942                                 if (!ok)
    04943                                         throw ErrorClass("Error during setOtherConstraintResultValue!");
    04944                                 tempInt = osresult1->getOtherConstraintResultNumberOfCon(i,j);
    04945                                 ok &= osresult2->setOtherConstraintResultNumberOfCon(i,j,tempInt);
    04946                                 if (!ok)
    04947                                         throw ErrorClass("Error during setOtherConstraintResultNumberOfCon!");
    04948
    04949                                 nCon = tempInt;
    04950                                 for (int k=0; k < nCon; ++k)
    04951                                 {
    04952                                         tempInt = osresult1->getOtherConstraintResultConIdx(i,j,k);
    04953                                         ok &= osresult2->setOtherConstraintResultConIdx(i,j,k,tempInt);
    04954                                         if (!ok)
    04955                                                 throw ErrorClass("Error during setOtherConstraintResultConIdx!");
    04956                                         tempStr = osresult1->getOtherConstraintResultCon(i,j,k);
    04957                                         ok &= osresult2->setOtherConstraintResultCon(i,j,k,tempStr);
    04958                                         if (!ok)
    04959                                                 throw ErrorClass("Error during setOtherConstraintResultCon!");
    04960                                 }
    04961
    04962
    04963
    04964                                 int nEnum = osresult1->getOtherConstraintResultNumberOfEnumerations(i,j);
    04965                                 ok &= osresult2->setOtherConstraintResultNumberOfEnumerations(i,j,nEnum);
    04966                                 if (!ok)
    04967                                         throw ErrorClass("Error during setOtherConstraintResultNumberOfEnumerations!");
    04968                                 std::string tempStr1, tempStr2;
    04969
    04970                                 for (int k=0; k < nEnum; ++k)
    04971                                 {
    04972 //                      if (tempArray != NULL) delete[] tempArray;
    04973                                         tempStr1  = osresult1->getOtherConstraintResultEnumerationValue(i,j,k);
    04974                                         tempStr2  = osresult1->getOtherConstraintResultEnumerationDescription(i,j,k);
    04975                                         tempInt   = osresult1->getOtherConstraintResultEnumerationNumberOfEl(i,j,k);
    04976                                         for (int l=0; l<tempInt; ++l)
    04977                                                 tempArray[l] = osresult1->getOtherConstraintResultEnumerationEl(i,j,k,l);
    04978                                         ok &= osresult2->setOtherOptionEnumeration(i,j,ENUM_PROBLEM_COMPONENT_constraints,k,tempStr1,tempStr2,tempArray,tempInt);
    04979                                         if (!ok)
    04980                                                 throw ErrorClass("Error during setOtherConstraintResultEnumeration!");
    04981                                 }
    04982                         }
    04983
    04984
    04985                         tempInt = osresult1->getNumberOfOtherSolutionResults(i);
    04986                         ok &= osresult2->setNumberOfOtherSolutionResults(i,tempInt);
    04987                         if (!ok)
    04988                                 throw ErrorClass("Error during setNumberOfOtherSolutionResults!");
    04989                         nOther = tempInt;
    04990                         for (int j=0; j < nOther; ++j)
    04991                         {
    04992                                 tempStr = osresult1->getOtherSolutionResultName(i,j);
    04993                                 ok &= osresult2->setOtherSolutionResultName(i,j,tempStr);
    04994                                 if (!ok)
    04995                                         throw ErrorClass("Error during setOtherSolutionResultName!");
    04996                                 tempStr = osresult1->getOtherSolutionResultCategory(i,j);
    04997                                 ok &= osresult2->setOtherSolutionResultCategory(i,j,tempStr);
    04998                                 if (!ok)
    04999                                         throw ErrorClass("Error during setOtherSolutionResultCategory!");
    05000                                 tempStr = osresult1->getOtherSolutionResultDescription(i,j);
    05001                                 ok &= osresult2->setOtherSolutionResultDescription(i,j,tempStr);
    05002                                 if (!ok)
    05003                                         throw ErrorClass("Error during setOtherSolutionResultDescription!");
    05004                                 tempInt = osresult1->getOtherSolutionResultNumberOfItems(i,j);
    05005                                 ok &= osresult2->setOtherSolutionResultNumberOfItems(i,j,tempInt);
    05006                                 if (!ok)
    05007                                         throw ErrorClass("Error during setOtherSolutionResultNumberOfItems!");
    05008
    05009                                 nItem = tempInt;
    05010                                 for (int k=0; k < nItem; ++k)
    05011                                 {
    05012                                         tempStr = osresult1->getOtherSolutionResultItem(i,j,k);
    05013                                         ok &= osresult2->setOtherSolutionResultItem(i,j,k,tempStr);
    05014                                         if (!ok)
    05015                                                 throw ErrorClass("Error during setSolutionResultItem!");
    05016                                 }
    05017                         }
    05018                 }
    05019
    05020                 tempInt = osresult1->getNumberOfSolverOutputs();
    05021                 ok &= osresult2->setNumberOfSolverOutputs(tempInt);
    05022                 if (!ok)
    05023                         throw ErrorClass("Error during setNumberOfSolverOutputs!");
    05024                 nOther = tempInt;
    05025                 for (int i=0; i < nOther; ++i)
    05026                 {
    05027                         tempStr = osresult1->getSolverOutputName(i);
    05028                         ok &= osresult2->setSolverOutputName(i,tempStr);
    05029                         if (!ok)
    05030                                 throw ErrorClass("Error during setSolverOutputName!");
    05031                         tempStr = osresult1->getSolverOutputCategory(i);
    05032                         ok &= osresult2->setSolverOutputCategory(i,tempStr);
    05033                         if (!ok)
    05034                                 throw ErrorClass("Error during setSolverOutputCategory!");
    05035                         tempStr = osresult1->getSolverOutputDescription(i);
    05036                         ok &= osresult2->setSolverOutputDescription(i,tempStr);
    05037                         if (!ok)
    05038                                 throw ErrorClass("Error during setSolverOutputDescription!");
    05039                         tempInt = osresult1->getSolverOutputNumberOfItems(i);
    05040                         ok &= osresult2->setSolverOutputNumberOfItems(i,tempInt);
    05041                         if (!ok)
    05042                                 throw ErrorClass("Error during setSolverOutputNumberOfItems!");
    05043                         for (int j=0; j < tempInt; ++j)
    05044                         {
    05045                                 tempStr = osresult1->getSolverOutputItem(i,j);
    05046                                 ok &= osresult2->setSolverOutputItem(i,j,tempStr);
    05047                                 if (!ok)
    05048                                         throw ErrorClass("Error during setSolverOutputItem!");
    05049                         }
    05050                 }
    05051
    05052
    05053                 ok &= osresult1->IsEqual(osresult2);
    05054                 if (!ok)
    05055                         throw ErrorClass("Error duplicating OSResult object using get() and set() methods");
    05056
    05057                 if (osrlwriter != NULL) delete osrlwriter;
    05058                 osrlwriter = NULL;
    05059                 if (osrlreader != NULL) delete osrlreader;
    05060                 osrlreader = NULL;
    05061                 if (osresult1  != NULL) delete osresult1;
    05062                 osresult1 = NULL;
    05063                 if (osresult2  != NULL) delete osresult2;
    05064                 osresult2 = NULL;
    05065 //              if (osresult   != NULL) delete osresult;
    05066 //              osresult = NULL;
    05067                 if (tempArray  != NULL) delete[] tempArray;
    05068                 tempArray = NULL;
    05069 //#endif    //#ifdef TEMP   //---------------------------for the time being----------------------------------
    05070
    05071                 unitTestResult << "TEST " << nOfTest << ": Successful test of OSrL tools" << std::endl;
    05072                 cout << endl << "TEST " << nOfTest << ": Completed successfully" << endl << endl;
    05073         }
    05074
    05075         catch(const ErrorClass& eclass){
    05076                 cout << endl << endl << endl;
    05077                 if (osrlwriter != NULL) delete osrlwriter;
    05078                 osrlwriter = NULL;
    05079                 if (osrlreader != NULL) delete osrlreader;
    05080                 osrlreader = NULL;
    05081                 if (osresult1  != NULL) delete osresult1;
    05082                 osresult1 = NULL;
    05083                 if (osresult2  != NULL) delete osresult2;
    05084                 osresult2 = NULL;
    05085 //              if (osresult   != NULL) delete osresult;
    05086 //              osresult = NULL;
    05087                 if (tempArray  != NULL) delete[] tempArray;
    05088                 tempArray = NULL;
    05089                 // " Problem with the test reading OSoL data";
    05090                 unitTestResultFailure << eclass.errormsg << endl;
    05091                 unitTestResultFailure << "There was a failure in the test of OSrL get() methods" << endl;
    05092         }
    05093 //#endif    //#ifdef TEMP   //---------------------------for the time being----------------------------------
    05094
    05095         // Now test the OSrL parser
    05096         try{
    05107                 cout << endl << "TEST " << ++nOfTest << ": OSrL parser" << endl << endl;
    05108                 std::string tmpOSrL;
    05109                 clock_t start, finish;
    05110                 double duration;
    05111                 std::string osrl;
    05112                 osrlwriter = new OSrLWriter();
    05113                 osrlreader = new OSrLReader();
    05114                 cout << "Test parsing an OSrL file" << endl;
    05115                 cout << "First read the OSrL file into a string" << endl;
    05116                 osrlFileName = dataDir  + "osrlFiles" + dirsep + "parserTest.osrl";
    05117                 start = clock();
    05118                 osrl = fileUtil->getFileAsString( osrlFileName.c_str() );
    05119                 finish = clock();
    05120                 duration = (double) (finish - start) / CLOCKS_PER_SEC;
    05121                 cout << "Reading the file into a string took (seconds): "<< duration << endl;
    05122                 cout << osrl << endl;
    05123                 start = clock();
    05124                 cout << "PARSE THE OSRL STRING INTO AN OSRESULT OBJECT" << endl;
    05125                 osresult = osrlreader->readOSrL( osrl);
    05126                 cout << "Finished read; write OSResult object to temporary string" << endl;
    05127
    05128                 tmpOSrL = osrlwriter->writeOSrL( osresult);
    05129
    05130                 cout << tmpOSrL << endl;
    05131
    05132
    05133                 // make sure we can parse without error
    05134                 delete osrlreader;
    05135                 osrlreader = new OSrLReader();
    05136                 osrlreader->readOSrL( tmpOSrL);
    05137
    05138                 delete osrlwriter;
    05139                 osrlwriter = NULL;
    05140                 delete osrlreader;
    05141                 osrlreader = NULL;
    05142
    05143
    05144 /*              // now a second example
    05145                 cout << endl << "Test parsing another OSrL file" << endl;
    05146                 osrlwriter = new OSrLWriter();
    05147                 osrlreader = new OSrLReader();
    05148                 cout << "FIRST READ THE OSrL FILE INTO A STRING" << endl;
    05149                 //errorExample.osrl -- check to see if we read an error message correctly;
    05150                 osrlFileName = dataDir  + "osrlFiles" + dirsep + "errorExample.osrl";
    05151                 osrl = fileUtil->getFileAsString( osrlFileName.c_str() );
    05152                 finish = clock();
    05153                 duration = (double) (finish - start) / CLOCKS_PER_SEC;
    05154                 cout << "Reading the file into a string took (seconds): "<< duration << endl;
    05155                 cout << "PARSE THE OSRL STRING INTO AN OSRESULT OBJECT" << endl;
    05156                 osresult = osrlreader->readOSrL( osrl);
    05157                 tmpOSrL = osrlwriter->writeOSrL( osresult) ;
    05158                 delete osrlreader;
    05159                 osrlreader = new OSrLReader();
    05160                 osrlreader->readOSrL( tmpOSrL);
    05161                 delete osrlwriter;
    05162                 osrlwriter = NULL;
    05163                 delete osrlreader;
    05164                 osrlreader = NULL;
    05165
    05166                 // ... and another
    05167                 cout << endl << "parserTest1.osrl" << endl;
    05168                 osrlwriter = new OSrLWriter();
    05169                 osrlreader = new OSrLReader();
    05170                 cout << "FIRST READ THE OSrL FILE INTO A STRING" << endl;
    05171                 //errorExample.osrl -- check to see if we read an error message correctly;
    05172                 osrlFileName = dataDir  + "osrlFiles" + dirsep + "parserTest1.osrl";
    05173                 osrl = fileUtil->getFileAsString( osrlFileName.c_str() );
    05174                 finish = clock();
    05175                 duration = (double) (finish - start) / CLOCKS_PER_SEC;
    05176                 cout << "Reading the file into a string took (seconds): "<< duration << endl;
    05177                 cout << "PARSE THE OSRL STRING INTO AN OSRESULT OBJECT" << endl;
    05178                 osresult = osrlreader->readOSrL( osrl);
    05179                 tmpOSrL = osrlwriter->writeOSrL( osresult) ;
    05180                 delete osrlreader;
    05181                 osrlreader = new OSrLReader();
    05182                 osrlreader->readOSrL( tmpOSrL);
    05183                 delete osrlwriter;
    05184                 osrlwriter = NULL;
    05185                 delete osrlreader;
    05186                 osrlreader = NULL;
    05187
    05188                 // ... and another
    05189                 cout << endl << "parserTest2.osrl" << endl;
    05190                 osrlwriter = new OSrLWriter();
    05191                 osrlreader = new OSrLReader();
    05192                 cout << "FIRST READ THE OSrL FILE INTO A STRING" << endl;
    05193                 //errorExample.osrl -- check to see if we read an error message correctly;
    05194                 osrlFileName = dataDir  + "osrlFiles" + dirsep + "parserTest2.osrl";
    05195                 osrl = fileUtil->getFileAsString( osrlFileName.c_str() );
    05196                 finish = clock();
    05197                 duration = (double) (finish - start) / CLOCKS_PER_SEC;
    05198                 cout << "Reading the file into a string took (seconds): "<< duration << endl;
    05199                 cout << "PARSE THE OSRL STRING INTO AN OSRESULT OBJECT" << endl;
    05200                 osresult = osrlreader->readOSrL( osrl);
    05201                 cout << "WRITE THE OSRESULT OBJECT INTO A NEW OSRL STRING" << endl;
    05202                 tmpOSrL = osrlwriter->writeOSrL( osresult) ;
    05203                 delete osrlreader;
    05204                 osrlreader = new OSrLReader();
    05205                 cout << "PARSE THE NEW OSRL STRING INTO AN OSRESULT OBJECT" << endl;
    05206                 osrlreader->readOSrL( tmpOSrL);
    05207                 delete osrlwriter;
    05208                 osrlwriter = NULL;
    05209                 delete osrlreader;
    05210                 osrlreader = NULL;
    05211
    05212                 // ... and another
    05213                 cout << endl << "parserTest3.osrl" << endl;
    05214                 osrlwriter = new OSrLWriter();
    05215                 osrlreader = new OSrLReader();
    05216                 cout << "FIRST READ THE OSrL FILE INTO A STRING" << endl;
    05217                 //errorExample.osrl -- check to see if we read an error message correctly;
    05218                 osrlFileName = dataDir  + "osrlFiles" + dirsep + "parserTest3.osrl";
    05219                 osrl = fileUtil->getFileAsString( osrlFileName.c_str() );
    05220                 finish = clock();
    05221                 duration = (double) (finish - start) / CLOCKS_PER_SEC;
    05222                 cout << "Reading the file into a string took (seconds): "<< duration << endl;
    05223                 cout << "PARSE THE OSRL STRING INTO AN OSRESULT OBJECT" << endl;
    05224                 osresult = osrlreader->readOSrL( osrl);
    05225                 cout << "WRITE THE OSRESULT OBJECT INTO A NEW OSRL STRING" << endl;
    05226                 tmpOSrL = osrlwriter->writeOSrL( osresult) ;
    05227                 delete osrlreader;
    05228                 osrlreader = new OSrLReader();
    05229                 cout << "PARSE THE NEW OSRL STRING INTO AN OSRESULT OBJECT" << endl;
    05230                 osrlreader->readOSrL( tmpOSrL);
    05231                 delete osrlwriter;
    05232                 osrlwriter = NULL;
    05233                 delete osrlreader;
    05234                 osrlreader = NULL;
    05235
    05236                 // ... and another
    05237                 cout << endl << "parserTest4.osrl" << endl;
    05238                 osrlwriter = new OSrLWriter();
    05239                 osrlreader = new OSrLReader();
    05240                 cout << "FIRST READ THE OSrL FILE INTO A STRING" << endl;
    05241                 //errorExample.osrl -- check to see if we read an error message correctly;
    05242                 osrlFileName = dataDir  + "osrlFiles" + dirsep + "parserTest4.osrl";
    05243                 start = clock();
    05244                 osrl = fileUtil->getFileAsString( osrlFileName.c_str() );
    05245                 finish = clock();
    05246                 duration = (double) (finish - start) / CLOCKS_PER_SEC;
    05247                 cout << "Reading the file into a string took (seconds): "<< duration << endl;
    05248                 cout << "PARSE THE OSRL STRING INTO AN OSRESULT OBJECT" << endl;
    05249                 osresult = osrlreader->readOSrL( osrl);
    05250                 cout << "WRITE THE OSRESULT OBJECT INTO A NEW OSRL STRING" << endl;
    05251                 tmpOSrL = osrlwriter->writeOSrL( osresult) ;
    05252                 delete osrlreader;
    05253                 osrlreader = new OSrLReader();
    05254                 cout << "PARSE THE NEW OSRL STRING INTO AN OSRESULT OBJECT" << endl;
    05255                 osrlreader->readOSrL( tmpOSrL);
    05256                 delete osrlwriter;
    05257                 osrlwriter = NULL;
    05258                 delete osrlreader;
    05259                 osrlreader = NULL;
    05260
    05261                 // ... and another
    05262                 cout << endl << "parserTest5.osrl" << endl;
    05263                 osrlwriter = new OSrLWriter();
    05264                 osrlreader = new OSrLReader();
    05265                 cout << "FIRST READ THE OSrL FILE INTO A STRING" << endl;
    05266                 //errorExample.osrl -- check to see if we read an error message correctly;
    05267                 osrlFileName = dataDir  + "osrlFiles" + dirsep + "parserTest5.osrl";
    05268                 osrl = fileUtil->getFileAsString( osrlFileName.c_str() );
    05269                 finish = clock();
    05270                 duration = (double) (finish - start) / CLOCKS_PER_SEC;
    05271                 cout << "Reading the file into a string took (seconds): "<< duration << endl;
    05272                 cout << "PARSE THE OSRL STRING INTO AN OSRESULT OBJECT" << endl;
    05273                 osresult = osrlreader->readOSrL( osrl);
    05274                 cout << "WRITE THE OSRESULT OBJECT INTO A NEW OSRL STRING" << endl;
    05275                 tmpOSrL = osrlwriter->writeOSrL( osresult) ;
    05276                 delete osrlreader;
    05277                 osrlreader = new OSrLReader();
    05278                 cout << "PARSE THE NEW OSRL STRING INTO AN OSRESULT OBJECT" << endl;
    05279                 osrlreader->readOSrL( tmpOSrL);
    05280                 delete osrlwriter;
    05281                 osrlwriter = NULL;
    05282                 delete osrlreader;
    05283                 osrlreader = NULL;
    05284
    05285                 // ... and another
    05286                 cout << endl << "parserTest6.osrl" << endl;
    05287                 osrlwriter = new OSrLWriter();
    05288                 osrlreader = new OSrLReader();
    05289                 cout << "FIRST READ THE OSrL FILE INTO A STRING" << endl;
    05290                 //errorExample.osrl -- check to see if we read an error message correctly;
    05291                 osrlFileName = dataDir  + "osrlFiles" + dirsep + "parserTest6.osrl";
    05292                 osrl = fileUtil->getFileAsString( osrlFileName.c_str() );
    05293                 finish = clock();
    05294                 duration = (double) (finish - start) / CLOCKS_PER_SEC;
    05295                 cout << "Reading the file into a string took (seconds): "<< duration << endl;
    05296                 cout << "PARSE THE OSRL STRING INTO AN OSRESULT OBJECT" << endl;
    05297                 osresult = osrlreader->readOSrL( osrl);
    05298                 cout << "WRITE THE OSRESULT OBJECT INTO A NEW OSRL STRING" << endl;
    05299                 tmpOSrL = osrlwriter->writeOSrL( osresult) ;
    05300                 delete osrlreader;
    05301                 osrlreader = new OSrLReader();
    05302                 cout << "PARSE THE NEW OSRL STRING INTO AN OSRESULT OBJECT" << endl;
    05303                 osrlreader->readOSrL( tmpOSrL);
    05304                 delete osrlwriter;
    05305                 osrlwriter = NULL;
    05306                 delete osrlreader;
    05307                 osrlreader = NULL;
    05308
    05309                 // ... and another
    05310                 cout << endl << "parserTest7.osrl" << endl;
    05311                 osrlwriter = new OSrLWriter();
    05312                 osrlreader = new OSrLReader();
    05313                 cout << "FIRST READ THE OSrL FILE INTO A STRING" << endl;
    05314                 //errorExample.osrl -- check to see if we read an error message correctly;
    05315                 osrlFileName = dataDir  + "osrlFiles" + dirsep + "parserTest7.osrl";
    05316                 osrl = fileUtil->getFileAsString( osrlFileName.c_str() );
    05317                 finish = clock();
    05318                 duration = (double) (finish - start) / CLOCKS_PER_SEC;
    05319                 cout << "Reading the file into a string took (seconds): "<< duration << endl;
    05320                 cout << "PARSE THE OSRL STRING INTO AN OSRESULT OBJECT" << endl;
    05321                 osresult = osrlreader->readOSrL( osrl);
    05322                 cout << "WRITE THE OSRESULT OBJECT INTO A NEW OSRL STRING" << endl;
    05323                 tmpOSrL = osrlwriter->writeOSrL( osresult) ;
    05324                 delete osrlreader;
    05325                 osrlreader = new OSrLReader();
    05326                 cout << "PARSE THE NEW OSRL STRING INTO AN OSRESULT OBJECT" << endl;
    05327                 osrlreader->readOSrL( tmpOSrL);
    05328                 delete osrlwriter;
    05329                 osrlwriter = NULL;
    05330                 delete osrlreader;
    05331                 osrlreader = NULL;
    05332
    05333                 // ... and another
    05334                 cout << endl << "parserTest8.osrl" << endl;
    05335                 osrlwriter = new OSrLWriter();
    05336                 osrlreader = new OSrLReader();
    05337                 cout << "FIRST READ THE OSrL FILE INTO A STRING" << endl;
    05338                 //errorExample.osrl -- check to see if we read an error message correctly;
    05339                 osrlFileName = dataDir  + "osrlFiles" + dirsep + "parserTest8.osrl";
    05340                 osrl = fileUtil->getFileAsString( osrlFileName.c_str() );
    05341                 finish = clock();
    05342                 duration = (double) (finish - start) / CLOCKS_PER_SEC;
    05343                 cout << "Reading the file into a string took (seconds): "<< duration << endl;
    05344                 cout << "PARSE THE OSRL STRING INTO AN OSRESULT OBJECT" << endl;
    05345                 osresult = osrlreader->readOSrL( osrl);
    05346                 cout << "WRITE THE OSRESULT OBJECT INTO A NEW OSRL STRING" << endl;
    05347                 tmpOSrL = osrlwriter->writeOSrL( osresult) ;
    05348                 delete osrlreader;
    05349                 osrlreader = new OSrLReader();
    05350                 cout << "PARSE THE NEW OSRL STRING INTO AN OSRESULT OBJECT" << endl;
    05351                 osrlreader->readOSrL( tmpOSrL);
    05352                 delete osrlwriter;
    05353                 osrlwriter = NULL;
    05354                 delete osrlreader;
    05355                 osrlreader = NULL;
    05356
    05357                 // ... and another
    05358                 cout << endl << "parserTest9.osrl" << endl;
    05359                 osrlwriter = new OSrLWriter();
    05360                 osrlreader = new OSrLReader();
    05361                 cout << "FIRST READ THE OSrL FILE INTO A STRING" << endl;
    05362                 //errorExample.osrl -- check to see if we read an error message correctly;
    05363                 osrlFileName = dataDir  + "osrlFiles" + dirsep + "parserTest9.osrl";
    05364                 osrl = fileUtil->getFileAsString( osrlFileName.c_str() );
    05365                 finish = clock();
    05366                 duration = (double) (finish - start) / CLOCKS_PER_SEC;
    05367                 cout << "Reading the file into a string took (seconds): "<< duration << endl;
    05368                 cout << "PARSE THE OSRL STRING INTO AN OSRESULT OBJECT" << endl;
    05369                 osresult = osrlreader->readOSrL( osrl);
    05370                 cout << "WRITE THE OSRESULT OBJECT INTO A NEW OSRL STRING" << endl;
    05371                 tmpOSrL = osrlwriter->writeOSrL( osresult) ;
    05372                 delete osrlreader;
    05373                 osrlreader = new OSrLReader();
    05374                 cout << "PARSE THE NEW OSRL STRING INTO AN OSRESULT OBJECT" << endl;
    05375                 osrlreader->readOSrL( tmpOSrL);
    05376                 delete osrlwriter;
    05377                 osrlwriter = NULL;
    05378                 delete osrlreader;
    05379                 osrlreader = NULL;
    05380
    05381
    05382                 // ... last file...
    05383                 cout << endl << "parserTest10.osrl" << endl;
    05384                 osrlwriter = new OSrLWriter();
    05385                 osrlreader = new OSrLReader();
    05386                 cout << "FIRST READ THE OSrL FILE INTO A STRING" << endl;
    05387                 //errorExample.osrl -- check to see if we read an error message correctly;
    05388                 osrlFileName = dataDir  + "osrlFiles" + dirsep + "parserTest10.osrl";
    05389                 osrl = fileUtil->getFileAsString( osrlFileName.c_str() );
    05390                 finish = clock();
    05391                 duration = (double) (finish - start) / CLOCKS_PER_SEC;
    05392                 cout << "Reading the file into a string took (seconds): "<< duration << endl;
    05393                 cout << "PARSE THE OSRL STRING INTO AN OSRESULT OBJECT" << endl;
    05394                 osresult = osrlreader->readOSrL( osrl);
    05395                 cout << "WRITE THE OSRESULT OBJECT INTO A NEW OSRL STRING" << endl;
    05396                 tmpOSrL = osrlwriter->writeOSrL( osresult) ;
    05397                 delete osrlreader;
    05398                 osrlreader = new OSrLReader();
    05399                 cout << "PARSE THE NEW OSRL STRING INTO AN OSRESULT OBJECT" << endl;
    05400                 osrlreader->readOSrL( tmpOSrL);
    05401                 delete osrlwriter;
    05402                 osrlwriter = NULL;
    05403                 delete osrlreader;
    05404                 osrlreader = NULL;
    05405 */
    05406                 unitTestResult <<
    05407                      "TEST " << nOfTest << ": Successful test of OSrL parser on file parserTest.osrl"
    05408                       << std::endl;
    05409                 cout << endl << "TEST " << nOfTest << ": Completed successfully" << endl << endl;
    05410         }
    05411         catch(const ErrorClass& eclass){
    05412
    05413                 cout << endl << endl << endl;
    05414                 if(osrlwriter != NULL) delete osrlwriter;
    05415                 osrlwriter = NULL;
    05416                 if(osrlreader != NULL) delete osrlreader;
    05417                 osrlreader = NULL;
    05418                 // " Problem with the test reading OSrL data";
    05419                 unitTestResultFailure << eclass.errormsg << endl;
    05420                 unitTestResultFailure << "There was a failure in the test for reading OSrL" << endl;
    05421         }
    05422
    05423         if (intArray !=NULL)
    05424         {
    05425                 delete[] intArray;
    05426                 intArray = NULL;
    05427         }
    05428
    05429 }       // PARSER_TESTS
    05430
    05431
    05432 if (SOLVER_TESTS){
    05433         try{
    05434                 cout << endl << "TEST " << ++nOfTest << ": Clp solver on parincLinearByRow.osil" << endl << endl;
    05435                 ok = true;
    05436                 std::cout << "create a new COIN Clp for OSiL string solution" << std::endl;
    05437                 osilFileName = dataDir  + "osilFiles" + dirsep + "parincLinearByRow.osil";
    05438                 osolFileName = dataDir  + "osolFiles" + dirsep + "parincLinearByRow_clp.osol";
    05439                 osil = fileUtil->getFileAsString( osilFileName.c_str());
    05440                 osol = fileUtil->getFileAsString( osolFileName.c_str());
    05441
    05442                 std::cout << "create a new Solver object" << std::endl;
    05443                 osilreader = new OSiLReader();
    05444                 osolreader = new OSoLReader();
    05445                 solver = new CoinSolver();
    05446                 solver->sSolverName = "clp";
    05447                 solver->osinstance = osilreader->readOSiL( osil);
    05448                 std::cout << " Done reading the OSiL" << std::endl;
    05449                 // now write it again as a string
    05450                 OSiLWriter *osilwriter;
    05451                 osilwriter = new OSiLWriter();
    05452                 osilwriter->m_bWhiteSpace = true;
    05453                 std::cout << " Write the OSiL" << std::endl;
    05454                 osil = osilwriter->writeOSiL( solver->osinstance) ;
    05455                 //std::cout <<  osil  << std::endl;
    05456                 std::cout << " Done writing the OSiL" << std::endl;
    05457                 solver->osoption   = osolreader->readOSoL( osol);
    05458                 cout << "call the COIN - clp Solver for parincLinearbyRow" << endl;
    05459                 //solver->buildSolverInstance();
    05460                 std::cout << "call solver" << std::endl;
    05461                 solver->solve();
    05462                 std::cout << "returned from solver" << std::endl;
    05463                 check = 7668;
    05464                 ok = ( fabs(check - getObjVal( solver->osrl) )/(fabs( check) + OS_NEAR_EQUAL) <= OS_NEAR_EQUAL) ? true : false;
    05465                 if (ok)
    05466                 {
    05467 #ifdef DEBUG
    05468                         cout << solver->osrl << endl;
    05469 #endif
    05470                         cout << "COIN clp solver solution for parincLinearByRow checks." << endl;
    05471                 }
    05472                 else
    05473                 {       cout << "COIN clp solver solution for parincLinearByRow in error:" << endl;
    05474                         cout << solver->osrl << endl;
    05475                 }
    05476                 if(ok == false) throw ErrorClass(" Fail unit test with clp on parincLinearByRow.osil");
    05477                 // parse the osrl file
    05478                 osrlreader =  new OSrLReader();
    05479 #ifdef DEBUG
    05480                 cout << "\nThe osrl file:\n" << solver->osrl << endl;
    05481                 cout << "Start parsing the file" << endl;
    05482 #endif
    05483                 osrlreader->readOSrL( solver->osrl);
    05484 #ifdef DEBUG
    05485                 cout << "read successfully" << endl;
    05486 #endif
    05487                 delete osilreader;
    05488                 osilreader = NULL;
    05489 #ifdef DEBUG
    05490                 cout << "osilreader successfully deleted" << endl;
    05491 #endif
    05492                 delete osolreader;
    05493                 osolreader = NULL;
    05494 #ifdef DEBUG
    05495                 cout << "osolreader successfully deleted" << endl;
    05496 #endif
    05497                 delete solver;
    05498                 solver = NULL;
    05499 #ifdef DEBUG
    05500                 cout << "solver successfully deleted" << endl;
    05501 #endif
    05502                 delete osilwriter;
    05503                 osilwriter = NULL;
    05504 #ifdef DEBUG
    05505                 cout << "osilwriter successfully deleted" << endl;
    05506 #endif
    05507                 delete osrlreader;
    05508                 osrlreader = NULL;
    05509 #ifdef DEBUG
    05510                 cout << "osrlreader successfully deleted" << endl;
    05511 #endif
    05512                 unitTestResult << "TEST " << nOfTest << ": Solved problem parincLinearByRow.osil with Clp" << std::endl;
    05513                 cout << endl << "TEST " << nOfTest << ": Completed successfully" << endl << endl;
    05514         }
    05515         catch(const ErrorClass& eclass){
    05516                 unitTestResultFailure << "Sorry Unit Test Failed Testing Clp Solver:"  + eclass.errormsg<< endl;
    05517
    05518                 if (osilreader != NULL)
    05519                         delete osilreader;
    05520                 osilreader = NULL;
    05521                 if (osolreader != NULL)
    05522                         delete osolreader;
    05523                 osolreader = NULL;
    05524                 if (solver != NULL)
    05525                         delete solver;
    05526                 solver = NULL;
    05527                 if (osilwriter != NULL)
    05528                         delete osilwriter;
    05529                 osilwriter = NULL;
    05530                 if (osrlreader != NULL)
    05531                         delete osrlreader;
    05532                 osrlreader = NULL;
    05533         }
    05534
    05535         // now solve another problem -- try an integer program
    05536         try{
    05537                 cout << endl << "TEST " << ++nOfTest << ": Cbc solver on p0033.osil" << endl << endl;
    05538                 std::cout << "create a new COIN Cbc for OSiL string solution" << std::endl;
    05539                 ok = true;
    05540                 osilFileName = dataDir  + "osilFiles" + dirsep + "p0033.osil";
    05541                 //osolFileName = dataDir  + "osolFiles" + dirsep + "p0033_cbc.osol";
    05542                 osil = fileUtil->getFileAsString( osilFileName.c_str());
    05543                 //osol = fileUtil->getFileAsString( osolFileName.c_str());
    05544                 osol = "";
    05545                 osilreader = new OSiLReader();
    05546                 osolreader = new OSoLReader();
    05547                 solver = new CoinSolver();
    05548                 solver->sSolverName ="cbc";
    05549                 solver->osil = osil;
    05550                 solver->osol = osol;
    05551                 solver->osinstance = NULL;
    05552                 solver->osoption   = NULL;
    05553                 cout << "call the COIN - Cbc Solver for p0033" << endl;
    05554                 solver->buildSolverInstance();
    05555                 solver->solve();
    05556                 check = 3089;
    05557                 ok = ( fabs(check - getObjVal( solver->osrl) )/(fabs( check) + OS_NEAR_EQUAL) <= OS_NEAR_EQUAL) ? true : false;
    05558                 if (ok)
    05559                 {
    05560 #ifdef DEBUG
    05561                         cout << solver->osrl << endl;
    05562 #endif
    05563                         cout << "Coin cbc solution for p0033 checks" << endl;
    05564                 }
    05565                 else
    05566                 {       cout << "Coin cbc solution for p0033 in error:" << endl;
    05567                         cout << solver->osrl << endl;
    05568                 }
    05569                 if (ok == false) throw ErrorClass(" Fail unit test with Cbc on p0033.osil");
    05570                 delete solver;
    05571                 solver = NULL;
    05572                 delete osilreader;
    05573                 osilreader = NULL;
    05574                 delete osolreader;
    05575                 osolreader = NULL;
    05576                 unitTestResult << "TEST " << nOfTest << ": Solved problem p0033.osil with Cbc" << std::endl;
    05577                 cout << endl << "TEST " << nOfTest << ": Completed successfully" << endl << endl;
    05578         }
    05579         catch(const ErrorClass& eclass){
    05580                 unitTestResultFailure << "Sorry Unit Test Failed Testing Cbc Solver:"  + eclass.errormsg<< endl;
    05581                 if (solver != NULL)
    05582                         delete solver;
    05583                 solver = NULL;
    05584                 if (osilreader != NULL)
    05585                         delete osilreader;
    05586                 osilreader = NULL;
    05587                 if (osolreader != NULL)
    05588                         delete osolreader;
    05589                 osolreader = NULL;
    05590         }
    05591
    05592 if( THOROUGH == true){
    05593
    05594         // now solve the same problem with a different instance representation --- using mult and incr
    05595         try{
    05596                 cout << endl << "TEST " << ++nOfTest << ": Cbc solver on p0033MULT.osil" << endl << endl;
    05597                 std::cout << "create a new COIN Cbc for OSiL string solution" << std::endl;
    05598                 ok = true;
    05599                 osilFileName = dataDir  + "osilFiles" + dirsep + "p0033MULT.osil";
    05600                 //osolFileName = dataDir  + "osolFiles" + dirsep + "p0033_cbc.osol";
    05601                 osil = fileUtil->getFileAsString( osilFileName.c_str());
    05602                 //osol = fileUtil->getFileAsString( osolFileName.c_str());
    05603                 osol = "";
    05604                 osilreader = new OSiLReader();
    05605                 osolreader = new OSoLReader();
    05606                 solver = new CoinSolver();
    05607                 solver->sSolverName ="cbc";
    05608                 solver->osil = osil;
    05609                 solver->osol = osol;
    05610                 solver->osinstance = NULL;
    05611                 solver->osoption   = NULL;
    05612                 cout << "call the COIN - Cbc Solver for p0033MULT" << endl;
    05613                 solver->buildSolverInstance();
    05614                 solver->solve();
    05615                 check = 3089;
    05616                 ok = ( fabs(check - getObjVal( solver->osrl) )/(fabs( check) + OS_NEAR_EQUAL) <= OS_NEAR_EQUAL) ? true : false;
    05617                 if (ok)
    05618                 {
    05619 #ifdef DEBUG
    05620                         cout << solver->osrl << endl;
    05621 #endif
    05622                         cout << "Coin cbc solution for p0033MULT checks" << endl;
    05623                 }
    05624                 else
    05625                 {       cout << "Coin cbc solution for p0033MULT in error:" << endl;
    05626                         cout << solver->osrl << endl;
    05627                 }
    05628                 if (ok == false) throw ErrorClass(" Fail unit test with Cbc on p0033MULT.osil");
    05629                 delete solver;
    05630                 solver = NULL;
    05631                 delete osilreader;
    05632                 osilreader = NULL;
    05633                 delete osolreader;
    05634                 osolreader = NULL;
    05635                 unitTestResult << "TEST " << nOfTest << ": Solved problem p0033MULT.osil with Cbc" << std::endl;
    05636                 cout << endl << "TEST " << nOfTest << ": Completed successfully" << endl << endl;
    05637         }
    05638         catch(const ErrorClass& eclass){
    05639                 unitTestResultFailure << "Sorry Unit Test Failed Testing Cbc Solver:"  + eclass.errormsg<< endl;
    05640                 if (solver != NULL)
    05641                         delete solver;
    05642                 solver = NULL;
    05643                 if (osilreader != NULL)
    05644                         delete osilreader;
    05645                 osilreader = NULL;
    05646                 if (osolreader != NULL)
    05647                         delete osolreader;
    05648                 osolreader = NULL;
    05649         }
    05650
    05651
    05652         // now test p0201.osil
    05653         try{
    05654                 cout << endl << "TEST " << ++nOfTest << ": Cbc solver on p0033.osil - node limit set" << endl << endl;
    05655                 //std::cout << "create a new COIN Cbc for OSiL string solution" << std::endl;
    05656                 ok = true;
    05657                 osilFileName = dataDir  + "osilFiles" + dirsep + "p0033.osil";
    05658                 osolFileName = dataDir  + "osolFiles" + dirsep + "p0033_cbc.osol";
    05659                 osil = fileUtil->getFileAsString( osilFileName.c_str());
    05660                 osol = fileUtil->getFileAsString( osolFileName.c_str());
    05661                 osilreader = new OSiLReader();
    05662                 osolreader = new OSoLReader();
    05663                 solver = new CoinSolver();
    05664                 solver->sSolverName ="cbc";
    05665                 solver->osil = osil;
    05666                 solver->osol = osol;
    05667                 solver->osinstance = NULL;
    05668                 solver->osoption   = NULL;
    05669                 cout << "call the COIN - Cbc Solver for p0033" << endl;
    05670                 solver->buildSolverInstance();
    05671                 solver->solve();
    05672                 //cout << "Here is the COIN Cbc solver solution for p0033" << endl;
    05673                 //cout << solver->osrl << endl;
    05674                 if( solver->osrl.find("node limit reached") != std::string::npos)
    05675                         ok = true;
    05676                 else
    05677                         ok = false;
    05678                 if (ok == false) throw ErrorClass(" node limit option on p0033.osil not processed properly");
    05679                 delete solver;
    05680                 solver = NULL;
    05681                 delete osilreader;
    05682                 osilreader = NULL;
    05683                 delete osolreader;
    05684                 osolreader = NULL;
    05685                 unitTestResult << "TEST " << nOfTest << ": Solved problem p0033.osil with Cbc node limit" << std::endl;
    05686                 cout << endl << "TEST " << nOfTest << ": Completed successfully" << endl << endl;
    05687         }
    05688         catch(const ErrorClass& eclass){
    05689                 unitTestResultFailure << "Sorry Unit Test Failed Testing Cbc Solver:"  + eclass.errormsg<< endl;
    05690                 if (solver != NULL)
    05691                         delete solver;
    05692                 solver = NULL;
    05693                 if (osilreader != NULL)
    05694                         delete osilreader;
    05695                 osilreader = NULL;
    05696                 if (osolreader != NULL)
    05697                         delete osolreader;
    05698                 osolreader = NULL;
    05699         }
    05700
    05701
    05702         try{
    05703                 cout << endl << "TEST " << ++nOfTest << ": Cbc solver on p0201.osil" << endl << endl;
    05704                 ok = true;
    05705                 osilFileName = dataDir  + "osilFiles" + dirsep + "p0201.osil";
    05706                 osolFileName = dataDir  + "osolFiles" + dirsep + "p0201_cbc.osol";
    05707                 osil = fileUtil->getFileAsString( osilFileName.c_str());
    05708                 osol = fileUtil->getFileAsString( osolFileName.c_str());
    05709                 solver = new CoinSolver();
    05710                 solver->sSolverName ="cbc";
    05711                 solver->osil = osil;
    05712                 osilreader = new OSiLReader();
    05713                 osolreader = new OSoLReader();
    05714                 solver->osol = osol;
    05715                 solver->osinstance = NULL;
    05716                 solver->osoption   = NULL;
    05717                 cout << "call the COIN - Cbc Solver for p0201" << endl;
    05718                 solver->solve();
    05719                 cout << "Here is the COIN Cbc solver solution for p0201" << endl;
    05720                 std::cout << solver->osrl << std::endl;
    05721                 check = 7615;
    05722                 // we put a node limit in, so we should not find 7615
    05723                 // check that the node limit was found
    05724                 string::size_type pos;
    05725                 pos = solver->osrl.find( "node limit");
    05726                 if(pos == std::string::npos)  throw ErrorClass(" Error with p0201 on Cbc");
    05727                 //ok &= NearEqual(getObjVal( solver->osrl) , check,  1e-10 , 1e-10);
    05728                 //ok = ( fabs(check - getObjVal( solver->osrl) )/(fabs( check) + OS_NEAR_EQUAL) <= OS_NEAR_EQUAL) ? true : false;
    05729                 //if(ok == false) throw ErrorClass(" Fail unit test with Cbc on p0201.osil");
    05730                 delete solver;
    05731                 solver = NULL;
    05732                 delete osilreader;
    05733                 osilreader = NULL;
    05734                 delete osolreader;
    05735                 osolreader = NULL;
    05736                 unitTestResult << "TEST " << nOfTest << ": Solved problem p0201.osil with Cbc" << std::endl;
    05737                 cout << endl << "TEST " << nOfTest << ": Completed successfully" << endl << endl;
    05738         }
    05739         catch(const ErrorClass& eclass){
    05740                 unitTestResultFailure << "Sorry Unit Test Failed Testing Cbc Solver:"  + eclass.errormsg<< endl;
    05741                 if (solver != NULL)
    05742                         delete solver;
    05743                 solver = NULL;
    05744                 if (osilreader != NULL)
    05745                         delete osilreader;
    05746                 osilreader = NULL;
    05747                 if (osolreader != NULL)
    05748                         delete osolreader;
    05749                 osolreader = NULL;
    05750         }
    05751
    05752         try{
    05753                 cout << endl << "TEST " << ++nOfTest << ": Cbc solver on parincInteger.osil" << endl << endl;
    05754                 ok = true;
    05755                 osilFileName = dataDir  + "osilFiles" + dirsep + "parincInteger.osil";
    05756                 osolFileName = dataDir  + "osolFiles" + dirsep + "parincInteger_cbc.osol";
    05757                 osil = fileUtil->getFileAsString( osilFileName.c_str());
    05758                 osol = fileUtil->getFileAsString( osolFileName.c_str());
    05759                 osilreader = new OSiLReader();
    05760                 osolreader = new OSoLReader();
    05761
    05762                 solver = new CoinSolver();
    05763                 solver->sSolverName ="cbc";
    05764                 cout << "parse OSiL file" << endl;
    05765                 solver->osinstance = osilreader->readOSiL( osil);
    05766                 solver->osol = osol;
    05767                 cout << "call the COIN - Cbc Solver for parincInteger" << endl;
    05768 //              solver->buildSolverInstance();
    05769                 solver->solve();
    05770                 check = 7668;
    05771                 ok = ( fabs(check - getObjVal( solver->osrl) )/(fabs( check) + OS_NEAR_EQUAL) <= OS_NEAR_EQUAL) ? true : false;
    05772                 if (ok)
    05773                 {
    05774 #ifdef DEBUG
    05775                         cout << solver->osrl << endl;
    05776 #endif
    05777                         cout << "COIN cbc solver solution for parincInteger checks." << endl;
    05778                 }
    05779                 else
    05780                 {       cout << "COIN cbc solver solution for parincInteger in error:" << endl;
    05781                         cout << solver->osrl << endl;
    05782                 }
    05783                 if(ok == false) throw ErrorClass(" Fail unit test with Cbc on parincInteger.osil");
    05784                 delete osilreader;
    05785                 osilreader = NULL;
    05786                 delete osolreader;
    05787                 osolreader = NULL;
    05788                 delete solver;
    05789                 solver = NULL;
    05790                 unitTestResult << "TEST " << nOfTest << ": Solved problem parincInteger.osil with Cbc" << std::endl;
    05791                 cout << endl << "TEST " << nOfTest << ": Completed successfully" << endl << endl;
    05792         }
    05793         catch(const ErrorClass& eclass){
    05794                 unitTestResultFailure << "Sorry Unit Test Failed Testing Cbc Solver:"  + eclass.errormsg<< endl;
    05795                 if (solver != NULL)
    05796                         delete solver;
    05797                 solver = NULL;
    05798                 if (osilreader != NULL)
    05799                         delete osilreader;
    05800                 osilreader = NULL;
    05801                 if (osolreader != NULL)
    05802                         delete osolreader;
    05803                 osolreader = NULL;
    05804         }
    05805 }       // end of if(THOROUGH)
    05806
    05807 #ifdef COIN_HAS_SYMPHONY
    05808         try{
    05809                 cout << endl << "TEST " << ++nOfTest << ": SYMPHONY solver on p0033.osil" << endl << endl;
    05810                 ok = true;
    05811                 osilFileName = dataDir  + "osilFiles" + dirsep + "p0033.osil";
    05812                 osolFileName = dataDir  + "osolFiles" + dirsep + "p0033_sym.osol";
    05813                 osil = fileUtil->getFileAsString( osilFileName.c_str());
    05814                 osol = fileUtil->getFileAsString( osolFileName.c_str());
    05815                 osolreader = new OSoLReader();
    05816                 solver = new CoinSolver();
    05817                 solver->sSolverName = "symphony";
    05818                 solver->osil = osil;
    05819                 solver->osinstance = NULL;
    05820                 solver->osoption   = osolreader->readOSoL( osol);
    05821                 cout << "build the solver instance for COIN - SYMPHONY" << endl;
    05822                 solver->buildSolverInstance();
    05823 //              cout << "call the COIN - SYMPHONY Solver for p0033" << endl;
    05824                 solver->solve();
    05825                 check = 3089;
    05826                 //ok &= NearEqual(getObjVal( solver->osrl) , check,  1e-10 , 1e-10);
    05827                 ok = ( fabs(check - getObjVal( solver->osrl) )/(fabs( check) + OS_NEAR_EQUAL) <= OS_NEAR_EQUAL) ? true : false;
    05828                 if (ok)
    05829                 {
    05830 #ifdef DEBUG
    05831                         cout << solver->osrl << endl;
    05832 #endif
    05833                         cout << "COIN SYMPHONY solver solution for p0033 checks." << endl;
    05834                 }
    05835                 else
    05836                 {       cout << "COIN SYMPHONY solver solution for p0033 in error:" << endl;
    05837                         cout << solver->osrl << endl;
    05838                 }
    05839                 if(ok == false) throw ErrorClass(" Fail unit test with SYMPHONY on p0033.osil");
    05840                 delete solver;
    05841                 solver = NULL;
    05842                 delete osolreader;
    05843                 osolreader = NULL;
    05844                 unitTestResult << "TEST " << nOfTest << ": Solved problem p0033.osil with SYMPHONY" << std::endl;
    05845                 cout << endl << "TEST " << nOfTest << ": Completed successfully" << endl << endl;
    05846         }
    05847         catch(const ErrorClass& eclass){
    05848                 unitTestResultFailure  << "Sorry Unit Test Failed Testing the SYMPHONY Solver:"  + eclass.errormsg << endl;
    05849                 if (solver != NULL)
    05850                         delete solver;
    05851                 solver = NULL;
    05852                 if (osolreader != NULL)
    05853                         delete osolreader;
    05854                 osolreader = NULL;
    05855         }
    05856 #endif
    05857
    05858
    05859
    05860 #ifdef COIN_HAS_DYLP
    05861         try{
    05862                 cout << endl << "TEST " << ++nOfTest << ": DyLP solver on parincLinear.osil" << endl << endl;
    05863                 ok = true;
    05864                 osilFileName = dataDir  + "osilFiles" + dirsep + "parincLinear.osil";
    05865                 osolFileName = dataDir  + "osolFiles" + dirsep + "parincLinear_dylp.osol";
    05866                 osil = fileUtil->getFileAsString( osilFileName.c_str());
    05867                 osol = fileUtil->getFileAsString( osolFileName.c_str());
    05868                 osilreader = new OSiLReader();
    05869                 solver = new CoinSolver();
    05870                 solver->sSolverName = "dylp";
    05871                 solver->osol = osol;
    05872                 solver->osinstance = osilreader->readOSiL( osil);
    05873                 cout << "call the COIN - DyLP solver for parincLinear" << endl;
    05874                 solver->buildSolverInstance();
    05875                 solver->solve();
    05876                 check = 7668;
    05877                 //ok &= NearEqual(getObjVal( solver->osrl) , check,  1e-1 , 1e-1);
    05878                 ok = ( fabs(check - getObjVal( solver->osrl) )/(fabs( check) + OS_NEAR_EQUAL) <= OS_NEAR_EQUAL) ? true : false;
    05879                 if (ok)
    05880                 {
    05881 #ifdef DEBUG
    05882                         cout << solver->osrl << endl;
    05883 #endif
    05884                         cout << "COIN DyLP solver solution for parincLinear checks." << endl;
    05885                 }
    05886                 else
    05887                 {       cout << "COIN DyLP solver solution for parincLinear in error:" << endl;
    05888                         cout << solver->osrl << endl;
    05889                 }
    05890                 if(ok == false) throw ErrorClass(" Fail unit test with DyLP on parincLinear.osil");
    05891                 delete solver;
    05892                 solver = NULL;
    05893                 delete osilreader;
    05894                 osilreader = NULL;
    05895                 unitTestResult << "TEST " << nOfTest << ": Solved problem parincLinear.osil with DyLP" << std::endl;
    05896                 cout << endl << "TEST " << nOfTest << ": Completed successfully" << endl << endl;
    05897         }
    05898         catch(const ErrorClass& eclass){
    05899                 cout << "OSrL =  " <<  solver->osrl <<  endl;
    05900                 cout << endl << endl << endl;
    05901                 unitTestResultFailure  <<"Sorry Unit Test Failed Testing the DyLP Solver:"  + eclass.errormsg << endl;
    05902                 if (solver != NULL)
    05903                         delete solver;
    05904                 solver = NULL;
    05905                 if (osilreader != NULL)
    05906                         delete osilreader;
    05907                 osilreader = NULL;
    05908         }
    05909 #endif
    05910
    05911
    05912 #ifdef COIN_HAS_VOL
    05913         try{
    05914                 cout << endl << "TEST " << ++nOfTest << ": Vol solver on volumeTest.osil" << endl << endl;
    05915                 ok = true;
    05916                 osilFileName = dataDir  + "osilFiles" + dirsep + "volumeTest.osil";
    05917                 osolFileName = dataDir  + "osolFiles" + dirsep + "volumeTest_vol.osol";
    05918                 osil = fileUtil->getFileAsString( osilFileName.c_str());
    05919                 osol = fileUtil->getFileAsString( osolFileName.c_str());
    05920                 osolreader = new OSoLReader();
    05921                 solver = new CoinSolver();
    05922                 solver->sSolverName = "vol";
    05923                 solver->osil = osil;
    05924                 solver->osinstance = NULL;
    05925                 solver->osoption = osolreader->readOSoL( osol);
    05926                 cout << "call the COIN - Vol solver for volumeTest" << endl;
    05927                 solver->buildSolverInstance();
    05928                 solver->solve();
    05929                 check = 7;
    05930                 //ok &= NearEqual(getObjVal( solver->osrl) , check,  1e-1 , 1e-1);
    05931                 ok = ( fabs(check - getObjVal( solver->osrl) )/(fabs( check) + OS_NEAR_EQUAL) <= OS_NEAR_EQUAL) ? true : false;
    05932                 if (ok)
    05933                 {
    05934 #ifdef DEBUG
    05935                         cout << solver->osrl << endl;
    05936 #endif
    05937                         cout << "COIN Vol solver solution for parincLinear checks." << endl;
    05938                 }
    05939                 else
    05940                 {       cout << "COIN Vol solver solution for parincLinear in error:" << endl;
    05941                         cout << solver->osrl << endl;
    05942                 }
    05943                 if(ok == false) throw ErrorClass(" Fail unit test with Vol on volumeTest.osil");
    05944                 delete solver;
    05945                 solver = NULL;
    05946                 delete osolreader;
    05947                 osolreader = NULL;
    05948                 unitTestResult << "TEST " << nOfTest << ": Solved problem volumeTest.osil with Vol" << std::endl;
    05949                 cout << endl << "TEST " << nOfTest << ": Completed successfully" << endl << endl;
    05950         }
    05951         catch(const ErrorClass& eclass){
    05952                 cout << "OSrL =  " <<  solver->osrl <<  endl;
    05953                 cout << endl << endl << endl;
    05954                 unitTestResultFailure  <<"Sorry Unit Test Failed Testing the Vol Solver:"  + eclass.errormsg << endl;
    05955                 if (solver != NULL)
    05956                         delete solver;
    05957                 solver = NULL;
    05958                 if (osolreader != NULL)
    05959                         delete osolreader;
    05960                 osolreader = NULL;
    05961         }
    05962 #endif
    05963
    05964 #ifdef COIN_HAS_GLPK
    05965         try{
    05966                 cout << endl << "TEST " << ++nOfTest << ": GLPK solver on p0033.osil" << endl << endl;
    05967                 ok = true;
    05968                 osilFileName = dataDir  + "osilFiles" + dirsep + "p0033.osil";
    05969                 osolFileName = dataDir  + "osolFiles" + dirsep + "p0033_glpk.osol";
    05970                 osil = fileUtil->getFileAsString( osilFileName.c_str());
    05971                 osol = fileUtil->getFileAsString( osolFileName.c_str());
    05972                 osilreader = new OSiLReader();
    05973                 osolreader = new OSoLReader();
    05974                 solver = new CoinSolver();
    05975                 solver->sSolverName = "glpk";
    05976                 solver->osinstance = osilreader->readOSiL( osil);
    05977                 solver->osoption   = osolreader->readOSoL( osol);
    05978                 cout << "call the GLPK Solver for p0033" << endl;
    05979                 solver->buildSolverInstance();
    05980                 solver->solve();
    05981                 check = 3089;
    05982                 //ok &= NearEqual(getObjVal( solver->osrl) , check,  1e-10 , 1e-10);
    05983                 ok = ( fabs(check - getObjVal( solver->osrl) )/(fabs( check) + OS_NEAR_EQUAL) <= OS_NEAR_EQUAL) ? true : false;
    05984                 if (ok)
    05985                 {
    05986 #ifdef DEBUG
    05987                         cout << solver->osrl << endl;
    05988 #endif
    05989                         cout << "GLPK solver solution for p0033 checks." << endl;
    05990                 }
    05991                 else
    05992                 {       cout << "GLPK solver solution for p0033 in error:" << endl;
    05993                         cout << solver->osrl << endl;
    05994                 }
    05995                 if(ok == false) throw ErrorClass(" Fail unit test with GLPK on p0033.osil");
    05996                 delete solver;
    05997                 solver = NULL;
    05998                 delete osilreader;
    05999                 osilreader = NULL;
    06000                 delete osolreader;
    06001                 osolreader = NULL;
    06002                 unitTestResult << "TEST " << nOfTest << ": Solved problem p0033.osil with GLPK" << std::endl;
    06003                 cout << endl << "TEST " << nOfTest << ": Completed successfully" << endl << endl;
    06004         }
    06005         catch(const ErrorClass& eclass){
    06006                 cout << "OSrL =  " <<  solver->osrl <<  endl;
    06007                 cout << endl << endl << endl;
    06008                 unitTestResultFailure  <<"Sorry Unit Test Failed Testing the Glpk Solver:"  + eclass.errormsg << endl;
    06009                 if (solver != NULL)
    06010                         delete solver;
    06011                 solver = NULL;
    06012                 if (osilreader != NULL)
    06013                         delete osilreader;
    06014                 osilreader = NULL;
    06015                 if (osolreader != NULL)
    06016                         delete osolreader;
    06017                 osolreader = NULL;
    06018         }
    06019 #endif
    06020
    06021
    06022
    06023 #ifdef COIN_HAS_CPX
    06024         try{
    06025                 cout << endl << "TEST " << ++nOfTest << ": Cplex solver on p0033.osil" << endl << endl;
    06026                 ok = true;
    06027                 osilFileName = dataDir  + "osilFiles" + dirsep + "p0033.osil";
    06028                 osolFileName = dataDir  + "osolFiles" + dirsep + "p0033_cpx.osol";
    06029                 osil = fileUtil->getFileAsString( osilFileName.c_str());
    06030                 osol = fileUtil->getFileAsString( osolFileName.c_str());
    06031                 solver = new CoinSolver();
    06032                 solver->sSolverName = "cplex";
    06033                 solver->osil = osil;
    06034                 solver->osol = osol;
    06035                 solver->osinstance = NULL;
    06036                 cout << "call the CPLEX Solver for p0033" << endl;
    06037                 solver->buildSolverInstance();
    06038                 solver->solve();
    06039                 check = 3089;
    06040                 //ok &= NearEqual(getObjVal( solver->osrl) , check,  1e-10 , 1e-10);
    06041                 ok = ( fabs(check - getObjVal( solver->osrl) )/(fabs( check) + OS_NEAR_EQUAL) <= OS_NEAR_EQUAL) ? true : false;
    06042                 if (ok)
    06043                 {
    06044 #ifdef DEBUG
    06045                         cout << solver->osrl << endl;
    06046 #endif
    06047                         cout << "CPLEX solver solution for p0033 checks." << endl;
    06048                 }
    06049                 else
    06050                 {       cout << "CPLEX solver solution for p0033 in error:" << endl;
    06051                         cout << solver->osrl << endl;
    06052                 }
    06053                 if(ok == false) throw ErrorClass(" Fail unit test with CPLEX on p0033.osil");
    06054                 delete solver;
    06055                 solver = NULL;
    06056                 unitTestResult << "TEST " << nOfTest << ": Solved problem p0033.osil with CPLEX" << std::endl;
    06057                 cout << endl << "TEST " << nOfTest << ": Completed successfully" << endl << endl;
    06058         }
    06059         catch(const ErrorClass& eclass){
    06060                 cout << "OSrL =  " <<  solver->osrl <<  endl;
    06061                 cout << endl << endl << endl;
    06062                 unitTestResultFailure  <<"Sorry Unit Test Failed Testing the Cplex Solver:"  + eclass.errormsg << endl;
    06063                 if (solver != NULL)
    06064                         delete solver;
    06065                 solver = NULL;
    06066         }
    06067 #endif
    06068
    06069
    06070
    06071 #ifdef COIN_HAS_IPOPT
    06072         IpoptSolver *ipoptSolver  =  NULL;
    06073         try{
    06074                 cout << endl << "TEST " << ++nOfTest << ": Ipopt solver with avion2.osil" << endl << endl;
    06075             ipoptSolver  = new IpoptSolver();
    06076                 cout << "create a new IPOPT Solver for OSiL string solution" << endl;
    06077                 ok = true;
    06078                 // avion does not work with Mumps on AIX xlC compiler
    06079 #ifndef XLC_
    06080                 osilFileName =  dataDir  + "osilFiles" + dirsep +  "avion2.osil";
    06081                 osolFileName = dataDir  + "osolFiles" + dirsep + "avion2_ipopt.osol";
    06082                 osil = fileUtil->getFileAsString( osilFileName.c_str());
    06083                 osol = fileUtil->getFileAsString( osolFileName.c_str());
    06084                 cout << "IPOPT Solver created for OSiL string solution" << endl;
    06085                 ipoptSolver->osol = osol;
    06086                 osilreader = new OSiLReader();
    06087                 osolreader = new OSoLReader();
    06088                 ipoptSolver->osinstance = osilreader->readOSiL( osil);
    06089                 ipoptSolver->osol = osol;
    06090                 cout << "call the IPOPT Solver" << endl;
    06091                 ipoptSolver->buildSolverInstance();
    06092                 ipoptSolver->solve();
    06093                 check = 9.46801e+07;
    06094                 //ok &= NearEqual(getObjVal( ipoptSolver->osrl) , check,  1e-10 , 1e-10);
    06095                 ok = ( fabs(check - getObjVal( ipoptSolver->osrl) )/(fabs( check) + OS_NEAR_EQUAL) <= OS_NEAR_EQUAL) ? true : false;
    06096                 if (ok)
    06097                 {
    06098 #ifdef DEBUG
    06099                         cout << ipoptSolver->osrl << endl;
    06100 #endif
    06101                         cout << "IPOPT solver solution for avion2 checks." << endl;
    06102                 }
    06103                 else
    06104                 {       cout << "IPOPT solver solution for avion2 in error:" << endl;
    06105                         cout << ipoptSolver->osrl << endl;
    06106                 }
    06107                 if(ok == false) throw ErrorClass(" Fail unit test with Ipopt on avion2.osil");
    06108                 delete osilreader;
    06109                 osilreader = NULL;
    06110                 delete osolreader;
    06111                 osolreader = NULL;
    06112                 delete ipoptSolver;
    06113                 ipoptSolver = NULL;
    06114                 unitTestResult << "TEST " << nOfTest << ": Solved problem avion2.osil with Ipopt" << std::endl;
    06115                 cout << endl << "TEST " << nOfTest << ": Completed successfully" << endl << endl;
    06116 #endif
    06117         }
    06118         catch(const ErrorClass& eclass){
    06119                 unitTestResultFailure << "Sorry Unit Test Failed Testing the Ipopt Solver:"  + eclass.errormsg<< endl;
    06120                 if (osilreader != NULL)
    06121                         delete osilreader;
    06122                 osilreader = NULL;
    06123                 if (osolreader != NULL)
    06124                         delete osolreader;
    06125                 osolreader = NULL;
    06126                 if (ipoptSolver != NULL)
    06127                         delete ipoptSolver;
    06128                 ipoptSolver = NULL;
    06129         }
    06130
    06131 if(THOROUGH == true){
    06132         // solve another problem
    06133         try{
    06134                 cout << endl << "TEST " << ++nOfTest << ": Ipopt solver with HS071_NLPMod.osil" << endl << endl;
    06135                 cout << "create a new IPOPT Solver for OSiL string solution" << endl;
    06136                 ipoptSolver  = new IpoptSolver();
    06137                 // a problem with all nonlinear terms no linear terms
    06138                 osilFileName = dataDir  + "osilFiles" + dirsep + "HS071_NLPMod.osil";
    06139                 osolFileName = dataDir  + "osolFiles" + dirsep + "HS071_NLPMod_ipopt.osol";
    06140                 osil = fileUtil->getFileAsString( osilFileName.c_str());
    06141                 osol = fileUtil->getFileAsString( osolFileName.c_str());
    06142                 cout << "IPOPT Solver created for OSiL string solution" << endl;
    06143 //              osol = "<osol></osol>";
    06144                 osilreader = new OSiLReader();
    06145                 osolreader = new OSoLReader();
    06146                 ipoptSolver->osinstance = osilreader->readOSiL( osil);
    06147                 ipoptSolver->osoption   = osolreader->readOSoL( osol);
    06148                 ipoptSolver->osol = osol;
    06149                 ipoptSolver->buildSolverInstance();
    06150                 ipoptSolver->solve();
    06151                 cout << "Here is the IPOPT solver solution for HS071_NLP" << endl;
    06152                 check = 17.014;
    06153                 //ok &= NearEqual(getObjVal( ipoptSolver->osrl) , check,  1e-10 , 1e-10);
    06154                 ok = ( fabs(check - getObjVal( ipoptSolver->osrl) )/(fabs( check) + OS_NEAR_EQUAL) <= OS_NEAR_EQUAL) ? true : false;
    06155                 if (ok)
    06156                 {
    06157 #ifdef DEBUG
    06158                         cout << ipoptSolver->osrl << endl;
    06159 #endif
    06160                         cout << "IPOPT solver solution for HS071_NLP checks." << endl;
    06161                 }
    06162                 else
    06163                 {       cout << "IPOPT solver solution for HS071_NLP in error:" << endl;
    06164                         cout << ipoptSolver->osrl << endl;
    06165                 }
    06166                 delete osilreader;
    06167                 osilreader = NULL;
    06168                 delete osolreader;
    06169                 osolreader = NULL;
    06170                 delete ipoptSolver;
    06171                 ipoptSolver = NULL;
    06172                 if(ok == false) throw ErrorClass(" Fail unit test with Ipopt on HS071_NLP.osil");
    06173                 unitTestResult << "TEST " << nOfTest << ": Solved problem HS071.osil with Ipopt" << std::endl;
    06174                 cout << endl << "TEST " << nOfTest << ": Completed successfully" << endl << endl;
    06175         }
    06176         catch(const ErrorClass& eclass){
    06177                 unitTestResultFailure << "Sorry Unit Test Failed Testing the Ipopt Solver:"  + eclass.errormsg<< endl;
    06178                 if (osilreader != NULL)
    06179                         delete osilreader;
    06180                 osilreader = NULL;
    06181                 if (osolreader != NULL)
    06182                         delete osolreader;
    06183                 osolreader = NULL;
    06184                 if (ipoptSolver != NULL)
    06185                         delete ipoptSolver;
    06186                 ipoptSolver = NULL;
    06187         }
    06188
    06189         try{
    06190                 cout << endl << "TEST " << ++nOfTest << ": Ipopt solver on rosenbrockmod.osil" << endl << endl;
    06191                 cout << "create a new IPOPT Solver for OSiL string solution" << endl;
    06192                 ipoptSolver  = new IpoptSolver();
    06193                 // solve another problem
    06194                 // a problem with both quadratic terms and general nonlinear terms
    06195                 osilFileName = dataDir  + "osilFiles" + dirsep + "rosenbrockmod.osil";
    06196                 osolFileName = dataDir  + "osolFiles" + dirsep + "rosenbrockmod_ipopt.osol";
    06197                 osil = fileUtil->getFileAsString( osilFileName.c_str());
    06198                 osol = fileUtil->getFileAsString( osolFileName.c_str());
    06199                 cout << "IPOPT Solver created for OSiL string solution" << endl;
    06200                 osilreader = new OSiLReader();
    06201                 osolreader = new OSoLReader();
    06202                 ipoptSolver->osil     = osil;
    06203                 ipoptSolver->osoption = osolreader->readOSoL( osol);
    06204                 cout << "call the IPOPT Solver" << endl;
    06205                 ipoptSolver->buildSolverInstance();
    06206                 ipoptSolver->solve();
    06207                 check = 6.7279;
    06208                 //ok &= NearEqual(getObjVal( ipoptSolver->osrl) , check,  1e-10 , 1e-10);
    06209                 ok = ( fabs(check - getObjVal( ipoptSolver->osrl) )/(fabs( check) + OS_NEAR_EQUAL) <= OS_NEAR_EQUAL) ? true : false;
    06210                 if (ok)
    06211                 {
    06212 #ifdef DEBUG
    06213                         cout << ipoptSolver->osrl << endl;
    06214 #endif
    06215                         cout << "Ipopt solver solution for rosenbrockmod checks." << endl;
    06216                 }
    06217                 else
    06218                 {       cout << "Ipopt solver solution for rosenbrockmod in error:" << endl;
    06219                         cout << ipoptSolver->osrl << endl;
    06220                 }
    06221                 if(ok == false)
    06222                         throw ErrorClass(" Fail unit test with Ipopt on rosenbrockmod.osil");
    06223                 delete osilreader;
    06224                 osilreader = NULL;
    06225                 delete osolreader;
    06226                 osolreader = NULL;
    06227                 delete ipoptSolver;
    06228                 ipoptSolver = NULL;
    06229                 unitTestResult << "TEST " << nOfTest << ": Solved problem rosenbrockmod.osil with Ipopt" << std::endl;
    06230                 cout << endl << "TEST " << nOfTest << ": Completed successfully" << endl << endl;
    06231                 //return 0;
    06232         }
    06233         catch(const ErrorClass& eclass){
    06234                 unitTestResultFailure << "Sorry Unit Test Failed Testing the Ipopt Solver:"  + eclass.errormsg<< endl;
    06235                 if (osilreader != NULL)
    06236                         delete osilreader;
    06237                 osilreader = NULL;
    06238                 if (osolreader != NULL)
    06239                         delete osolreader;
    06240                 osolreader = NULL;
    06241                 if (ipoptSolver != NULL)
    06242                         delete ipoptSolver;
    06243                 ipoptSolver = NULL;
    06244         }
    06245
    06246         try{
    06247                 cout << endl << "TEST " << ++nOfTest << ": Ipopt solver on parincQuadratic.osil" << endl << endl;
    06248                 cout << "create a new IPOPT Solver for OSiL string solution" << endl;
    06249                 ipoptSolver  = new IpoptSolver();
    06250                 // solve another problem
    06251                 // a problem that is a pure quadratic
    06252                 osilFileName = dataDir  + "osilFiles" + dirsep + "parincQuadratic.osil";
    06253                 osolFileName = dataDir  + "osolFiles" + dirsep + "parincQuadratic_ipopt.osol";
    06254                 osil = fileUtil->getFileAsString( osilFileName.c_str());
    06255                 osol = fileUtil->getFileAsString( osolFileName.c_str());
    06256                 cout << "IPOPT Solver created for OSiL string solution" << endl;
    06257                 osilreader = new OSiLReader();
    06258                 osolreader = new OSoLReader();
    06259                 ipoptSolver->osinstance = osilreader->readOSiL( osil);
    06260                 ipoptSolver->osil = osil;
    06261                 ipoptSolver->osol = osol;
    06262                 cout << "call the IPOPT Solver" << endl;
    06263                 ipoptSolver->buildSolverInstance();
    06264                 ipoptSolver->solve();
    06265                 check = 49920.5;
    06266                 //ok &= NearEqual(getObjVal( ipoptSolver->osrl) , check,  1e-10 , 1e-10);
    06267                 ok = ( fabs(check - getObjVal( ipoptSolver->osrl) )/(fabs( check) + OS_NEAR_EQUAL) <= OS_NEAR_EQUAL) ? true : false;
    06268                 if (ok)
    06269                 {
    06270 #ifdef DEBUG
    06271                         cout << ipoptSolver->osrl << endl;
    06272 #endif
    06273                         cout << "IPOPT solver solution for parincQuadratic checks." << endl;
    06274                 }
    06275                 else
    06276                 {       cout << "IPOPT solver solution for parincQuadratic in error:" << endl;
    06277                         cout << ipoptSolver->osrl << endl;
    06278                 }
    06279                 if(ok == false) throw ErrorClass(" Fail unit test with Ipopt on parincQuadradic.osil");
    06280                 delete osilreader;
    06281                 osilreader = NULL;
    06282                 delete osolreader;
    06283                 osolreader = NULL;
    06284                 delete ipoptSolver;
    06285                 ipoptSolver = NULL;
    06286                 unitTestResult << "TEST " << nOfTest << ": Solved problem parincQuadratic.osil with Ipopt" << std::endl;
    06287                 cout << endl << "TEST " << nOfTest << ": Completed successfully" << endl << endl;
    06288         }
    06289         catch(const ErrorClass& eclass){
    06290                 unitTestResultFailure << "Sorry Unit Test Failed Testing the Ipopt Solver:"  + eclass.errormsg<< endl;
    06291                 if (osilreader != NULL)
    06292                         delete osilreader;
    06293                 osilreader = NULL;
    06294                 if (osolreader != NULL)
    06295                         delete osolreader;
    06296                 osolreader = NULL;
    06297                 if (ipoptSolver != NULL)
    06298                         delete ipoptSolver;
    06299                 ipoptSolver = NULL;
    06300         }
    06301
    06302         try{
    06303                 cout << endl << "TEST " << ++nOfTest << ": Ipopt solver on parincLinear.osil" << endl << endl;
    06304                 cout << "create a new IPOPT Solver for OSiL string solution" << endl;
    06305                 ipoptSolver  = new IpoptSolver();
    06306                 // solve another problem
    06307                 // try a pure linear program
    06308                 osilFileName = dataDir  + "osilFiles" + dirsep + "parincLinear.osil";
    06309                 osolFileName = dataDir  + "osolFiles" + dirsep + "parincLinear_ipopt.osol";
    06310                 osil = fileUtil->getFileAsString( osilFileName.c_str());
    06311                 osol = fileUtil->getFileAsString( osolFileName.c_str());
    06312                 cout << "IPOPT Solver created for OSiL string solution" << endl;
    06313                 osilreader = new OSiLReader();
    06314                 osolreader = new OSoLReader();
    06315                 ipoptSolver->osinstance = osilreader->readOSiL( osil);
    06316                 ipoptSolver->osoption   = NULL;
    06317                 ipoptSolver->osol = "";
    06318                 cout << "call the IPOPT Solver" << endl;
    06319                 ipoptSolver->buildSolverInstance();
    06320                 ipoptSolver->solve();
    06321                 check = 7668;
    06322                 //ok &= NearEqual(getObjVal( ipoptSolver->osrl) , check,  1e-1 , 1e-1);
    06323                 ok = ( fabs(check - getObjVal( ipoptSolver->osrl) )/(fabs( check) + OS_NEAR_EQUAL) <= OS_NEAR_EQUAL) ? true : false;
    06324                 if (ok)
    06325                 {
    06326 #ifdef DEBUG
    06327                         cout << ipoptSolver->osrl << endl;
    06328 #endif
    06329                         cout << "IPOPT solver solution for parincLinear checks." << endl;
    06330                 }
    06331                 else
    06332                 {       cout << "IPOPT solver solution for parincLinear in error:" << endl;
    06333                         cout << ipoptSolver->osrl << endl;
    06334                 }
    06335                 if(ok == false) throw ErrorClass(" Fail unit test with Ipopt on parincLinear.osil");
    06336                 delete osilreader;
    06337                 osilreader = NULL;
    06338                 delete osolreader;
    06339                 osolreader = NULL;
    06340                 delete ipoptSolver;
    06341                 ipoptSolver = NULL;
    06342                 unitTestResult << "TEST " << nOfTest << ": Solved problem parincLinear.osil with Ipopt" << std::endl;
    06343                 cout << endl << "TEST " << nOfTest << ": Completed successfully" << endl << endl;
    06344         }
    06345         catch(const ErrorClass& eclass){
    06346                 unitTestResultFailure << "Sorry Unit Test Failed Testing the Ipopt Solver:"  + eclass.errormsg<< endl;
    06347                 if (osilreader != NULL)
    06348                         delete osilreader;
    06349                 osilreader = NULL;
    06350                 if (osolreader != NULL)
    06351                         delete osolreader;
    06352                 osolreader = NULL;
    06353                 if (ipoptSolver != NULL)
    06354                         delete ipoptSolver;
    06355                 ipoptSolver = NULL;
    06356         }
    06357
    06358         try{
    06359                 cout << endl << "TEST " << ++nOfTest << ": Ipopt solver on callBackTest.osil" << endl << endl;
    06360                 cout << "create a new IPOPT Solver for OSiL string solution" << endl;
    06361                 ipoptSolver  = new IpoptSolver();
    06362                 // solve another problem
    06363                 // callBackTest.osil
    06364                 osilFileName = dataDir  + "osilFiles" + dirsep + "callBackTest.osil";
    06365                 osolFileName = dataDir  + "osolFiles" + dirsep + "callBackTest_ipopt.osol";
    06366                 osil = fileUtil->getFileAsString( osilFileName.c_str());
    06367                 osol = fileUtil->getFileAsString( osolFileName.c_str());
    06368                 cout << "IPOPT Solver created for OSiL string solution" << endl;
    06369                 osilreader = new OSiLReader();
    06370                 osolreader = new OSoLReader();
    06371                 ipoptSolver->osinstance = osilreader->readOSiL( osil);
    06372                 ipoptSolver->osoption   = osolreader->readOSoL( osol);
    06373                 ipoptSolver->osol = osol;
    06374                 cout << "call the IPOPT Solver" << endl;
    06375                 ipoptSolver->buildSolverInstance();
    06376                 ipoptSolver->solve();
    06377                 check = 1.00045e+06;
    06378                 //ok &= NearEqual(getObjVal( ipoptSolver->osrl) , check,  1e-10 , 1e-10);
    06379                 ok = ( fabs(check - getObjVal( ipoptSolver->osrl) )/(fabs( check) + OS_NEAR_EQUAL) <= OS_NEAR_EQUAL) ? true : false;
    06380                 if (ok)
    06381                 {
    06382 #ifdef DEBUG
    06383                         cout << ipoptSolver->osrl << endl;
    06384 #endif
    06385                         cout << "IPOPT solver solution for callBackTest checks." << endl;
    06386                 }
    06387                 else
    06388                 {       cout << "IPOPT solver solution for callBackTest in error:" << endl;
    06389                         cout << ipoptSolver->osrl << endl;
    06390                 }
    06391                 if(ok == false) throw ErrorClass(" Fail unit test with Ipopt on callBackTest.osil");
    06392                 delete osilreader;
    06393                 osilreader = NULL;
    06394                 delete osolreader;
    06395                 osolreader = NULL;
    06396                 delete ipoptSolver;
    06397                 ipoptSolver = NULL;
    06398                 unitTestResult << "TEST " << nOfTest << ": Solved problem callBackTest.osil with Ipopt" << std::endl;
    06399                 cout << endl << "TEST " << nOfTest << ": Completed successfully" << endl << endl;
    06400         }
    06401         catch(const ErrorClass& eclass){
    06402                 unitTestResultFailure << "Sorry Unit Test Failed Testing the Ipopt Solver:"  + eclass.errormsg<< endl;
    06403                 if (osilreader != NULL)
    06404                         delete osilreader;
    06405                 osilreader = NULL;
    06406                 if (osolreader != NULL)
    06407                         delete osolreader;
    06408                 osolreader = NULL;
    06409                 if (ipoptSolver != NULL)
    06410                         delete ipoptSolver;
    06411                 ipoptSolver = NULL;
    06412         }
    06413
    06414         try{
    06415                 cout << endl << "TEST " << ++nOfTest << ": Ipopt solver on callBackTestRowMajor.osil" << endl << endl;
    06416                 cout << "create a new IPOPT Solver for OSiL string solution" << endl;
    06417                 ipoptSolver  = new IpoptSolver();
    06418                 // solve another problem
    06419                 // callBackTest.osil
    06420                 osilFileName =  dataDir  + "osilFiles" + dirsep + "callBackTestRowMajor.osil";
    06421                 osolFileName = dataDir  + "osolFiles" + dirsep + "callBackTestRowMajor_ipopt.osol";
    06422                 osil = fileUtil->getFileAsString( osilFileName.c_str());
    06423                 osol = fileUtil->getFileAsString( osolFileName.c_str());
    06424                 cout << "IPOPT Solver created for OSiL string solution" << endl;
    06425                 osilreader = new OSiLReader();
    06426                 osolreader = new OSoLReader();
    06427                 ipoptSolver->osinstance = NULL;
    06428                 ipoptSolver->osoption   = NULL;
    06429                 ipoptSolver->osil = osil;
    06430                 ipoptSolver->osol = osol;
    06431                 cout << "call the IPOPT Solver" << endl;
    06432 //              ipoptSolver->buildSolverInstance();
    06433                 ipoptSolver->solve();
    06434                 check = 1.00045e+06;
    06435                 //ok &= NearEqual(getObjVal( ipoptSolver->osrl) , check,  1e-10 , 1e-10);
    06436                 ok = ( fabs(check - getObjVal( ipoptSolver->osrl) )/(fabs( check) + OS_NEAR_EQUAL) <= OS_NEAR_EQUAL) ? true : false;
    06437                 if (ok)
    06438                 {
    06439 #ifdef DEBUG
    06440                         cout << ipoptSolver->osrl << endl;
    06441 #endif
    06442                         cout << "IPOPT solver solution for callBackTestRowMajor checks." << endl;
    06443                 }
    06444                 else
    06445                 {       cout << "IPOPT solver solution for callBackTestRowMajor in error:" << endl;
    06446                         cout << ipoptSolver->osrl << endl;
    06447                 }
    06448                 if(ok == false) throw ErrorClass(" Fail unit test with Ipopt on callBackTestRowMajor.osil");
    06449                 delete osilreader;
    06450                 osilreader = NULL;
    06451                 delete osolreader;
    06452                 osolreader = NULL;
    06453                 delete ipoptSolver;
    06454                 ipoptSolver = NULL;
    06455                 unitTestResult << "TEST " << nOfTest << ": Solved problem callBackRowMajor.osil with Ipopt" << std::endl;
    06456                 cout << endl << "TEST " << nOfTest << ": Completed successfully" << endl << endl;
    06457         }
    06458         catch(const ErrorClass& eclass){
    06459                 unitTestResultFailure << "Sorry Unit Test Failed Testing the Ipopt Solver:"  + eclass.errormsg<< endl;
    06460                 if (osilreader != NULL)
    06461                         delete osilreader;
    06462                 osilreader = NULL;
    06463                 if (osolreader != NULL)
    06464                         delete osolreader;
    06465                 osolreader = NULL;
    06466                 if (ipoptSolver != NULL)
    06467                         delete ipoptSolver;
    06468                 ipoptSolver = NULL;
    06469         }
    06470
    06471         try{
    06472                 cout << endl << "TEST " << ++nOfTest << ": Ipopt solver on rosenbrockorig.osil" << endl << endl;
    06473 //              OSiLReader *osilreader = NULL;
    06474                 osilreader = new OSiLReader();
    06475                 osolreader = new OSoLReader();
    06476                 ok = true;
    06477                 osilFileName = dataDir  + "osilFiles" + dirsep + "rosenbrockorig.osil";
    06478 //              osolFileName = dataDir  + "osolFiles" + dirsep + "rosenbrockorig_Ipopt.osol";
    06479                 osil = fileUtil->getFileAsString( osilFileName.c_str());
    06480 //              osol = fileUtil->getFileAsString( osolFileName.c_str());
    06481                 osol = "";
    06482                 ipoptSolver = new IpoptSolver();
    06483                 ipoptSolver->sSolverName = "ipopt";
    06484                 ipoptSolver->osil = osil;
    06485                 ipoptSolver->osol = osol;
    06486 //              ipoptSolver->osinstance = osilreader->readOSiL( osil);
    06487 //              ipoptSolver->osoption   = osolreader->readOSoL( osol);
    06488                 cout << "call the COIN - Ipopt Solver for rosenbrockorig" << endl;
    06489                 cout << endl << endl << osil << endl << endl;
    06490                 ipoptSolver->buildSolverInstance();
    06491
    06492                 cout << ipoptSolver->osinstance->printModel() << endl << endl;
    06493                 //cout << osilreader->m_osinstance->printModel() << endl << endl;
    06494
    06495                 std::cout << " CALL SOLVE " << std::endl;
    06496                 ipoptSolver->solve();
    06497                 check = 0;
    06498                 ok = ( fabs(check - getObjVal( ipoptSolver->osrl) )/(fabs( check) + OS_NEAR_EQUAL) <= OS_NEAR_EQUAL) ? true : false;
    06499                 if (ok)
    06500                 {
    06501 #ifdef DEBUG
    06502                         cout << ipoptSolver->osrl << endl;
    06503 #endif
    06504                         cout << "Ipopt solver solution for rosenbrockorig checks." << endl;
    06505                 }
    06506                 else
    06507                 {       cout << "Ipopt solver solution for rosenbrockorig in error:" << endl;
    06508                         cout << ipoptSolver->osrl << endl;
    06509                 }
    06510                 if(ok == false) throw ErrorClass(" Fail unit test with Ipopt on rosenbrockorig.osil");
    06511
    06512                 delete ipoptSolver;
    06513                 ipoptSolver = NULL;
    06514                 delete osilreader;
    06515                 osilreader = NULL;
    06516                 delete osolreader;
    06517                 osolreader = NULL;
    06518                 unitTestResult << "TEST " << nOfTest << ": Solved problem rosenbrockorig.osil with Ipopt" << std::endl;
    06519                 cout << endl << "TEST " << nOfTest << ": Completed successfully" << endl << endl;
    06520         }
    06521         catch(const ErrorClass& eclass){
    06522                 unitTestResultFailure << "Sorry Unit Test Failed Testing the Ipopt Solver:"  + eclass.errormsg<< endl;
    06523                 if (osilreader != NULL)
    06524                         delete osilreader;
    06525                 osilreader = NULL;
    06526                 if (osolreader != NULL)
    06527                         delete osolreader;
    06528                 osolreader = NULL;
    06529                 if (ipoptSolver != NULL)
    06530                         delete ipoptSolver;
    06531                 ipoptSolver = NULL;
    06532         }
    06533
    06534         try{
    06535                 cout << endl << "TEST " << ++nOfTest << ": Ipopt solver on HS071_feas.osil" << endl << endl;
    06536                 try {
    06537                         //osilreader = new OSiLReader();
    06538                         //osolreader = new OSoLReader();
    06539                         ok = true;
    06540                         osilFileName = dataDir  + "osilFiles" + dirsep + "HS071_feas.osil";
    06541 //                      osolFileName = dataDir  + "osolFiles" + dirsep + "HS071_feas_Ipopt.osol";
    06542                         osil = fileUtil->getFileAsString( osilFileName.c_str());
    06543 //                      osol = fileUtil->getFileAsString( osolFileName.c_str());
    06544                         osol = "";
    06545                         ipoptSolver = new IpoptSolver();
    06546                         ipoptSolver->sSolverName = "ipopt";
    06547                         ipoptSolver->osil = osil;
    06548                         ipoptSolver->osol = osol;
    06549 //                      ipoptSolver->osinstance = osilreader->readOSiL( osil);
    06550 //                      ipoptSolver->osoption   = osolreader->readOSoL( osol);
    06551                         ipoptSolver->buildSolverInstance();
    06552
    06553                         cout << "call the COIN - Ipopt Solver for HS071_feas.osil" << endl;
    06554                         ipoptSolver->solve();
    06555                 }
    06556                 catch(const ErrorClass& eclass)
    06557                 {
    06558                         ok = (ipoptSolver->osresult->getGeneralMessage() == "Ipopt NEEDS AN OBJECTIVE FUNCTION");
    06559                         if(ok == false)
    06560                         {       cout << "Ipopt solver returns:" << endl;
    06561                                 cout << ipoptSolver->osrl << endl;
    06562                                 throw ErrorClass(" Fail unit test with Ipopt on HS071_feas.osil");
    06563                         }
    06564                 }
    06565
    06566                 cout << "Received error message from Ipopt: \"Ipopt NEEDS AN OBJECTIVE FUNCTION\"" << endl;
    06567
    06568                 delete ipoptSolver;
    06569                 ipoptSolver = NULL;
    06570                 //delete osilreader;
    06571                 osilreader = NULL;
    06572                 //delete osolreader;
    06573                 osolreader = NULL;
    06574
    06575                 unitTestResult << "TEST " << nOfTest << ": Correctly diagnosed problem HS071_feas with Ipopt" << std::endl;
    06576                 cout << endl << "TEST " << nOfTest << ": Completed successfully" << endl << endl;
    06577         }
    06578         catch(const ErrorClass& eclass){
    06579                 unitTestResultFailure << "Sorry Unit Test Failed Testing the Ipopt Solver:"  + eclass.errormsg<< endl;
    06580                 if (osilreader != NULL)
    06581                         delete osilreader;
    06582                 osilreader = NULL;
    06583                 if (osolreader != NULL)
    06584                         delete osolreader;
    06585                 osolreader = NULL;
    06586                 if (ipoptSolver != NULL)
    06587                         delete ipoptSolver;
    06588                 ipoptSolver = NULL;
    06589         }
    06590 } // end of if( THOROUGH)
    06591 #endif // end of #ifdef COIN_HAS_IPOPT
    06592
    06593
    06594 #ifdef COIN_HAS_BONMIN
    06595         try{
    06596                 cout << endl << "TEST " << ++nOfTest << ": Bonmin solver on bonminEx1.osil" << endl << endl;
    06597 //              OSiLReader *osilreader = NULL;
    06598                 osilreader = new OSiLReader();
    06599                 osolreader = new OSoLReader();
    06600                 ok = true;
    06601                 osilFileName = dataDir  + "osilFiles" + dirsep + "bonminEx1.osil";
    06602                 osolFileName = dataDir  + "osolFiles" + dirsep + "bonminEx1_Bonmin.osol";
    06603                 osil = fileUtil->getFileAsString( osilFileName.c_str());
    06604                 osol = fileUtil->getFileAsString( osolFileName.c_str());
    06605                 solver = new BonminSolver();
    06606                 //solver->sSolverName = "bonmin";
    06607 //              solver->osinstance = osilreader->readOSiL( osil);
    06608                 solver->osil = osil;
    06609                 solver->osoption = osolreader->readOSoL( osol);
    06610                 cout << "call the COIN - Bonmin Solver for bonminEx1" << endl;
    06611 //              solver->buildSolverInstance();
    06612                 solver->solve();
    06613                 check = -17.07106795327683;
    06614                 //ok &= NearEqual(getObjVal( solver->osrl) , check,  1e-10 , 1e-10);
    06615                 ok = ( fabs(check - getObjVal( solver->osrl) )/(fabs( check) + OS_NEAR_EQUAL) <= OS_NEAR_EQUAL) ? true : false;
    06616                 if (ok)
    06617                 {
    06618 #ifdef DEBUG
    06619                         cout << solver->osrl << endl;
    06620 #endif
    06621                         cout << "Bonmin solver solution for bonminEx1 checks." << endl;
    06622                 }
    06623                 else
    06624                 {       cout << "Bonmin solver solution for bonminEx1 in error:" << endl;
    06625                         cout << solver->osrl << endl;
    06626                 }
    06627                 if(ok == false) throw ErrorClass(" Fail unit test with Bonmin on bonminEx1.osil");
    06628                 delete solver;
    06629                 solver = NULL;
    06630                 delete osilreader;
    06631                 osilreader = NULL;
    06632                 delete osolreader;
    06633                 osolreader = NULL;
    06634                 unitTestResult << "TEST " << nOfTest << ": Solved problem bonminEx1.osil with Bonmin" << std::endl;
    06635                 cout << endl << "TEST " << nOfTest << ": Completed successfully" << endl << endl;
    06636         }
    06637         catch(const ErrorClass& eclass){
    06638                 unitTestResultFailure  << "Sorry Unit Test Failed Testing the Bonmin Solver:"  + eclass.errormsg << endl;
    06639                 if (solver != NULL)
    06640                         delete solver;
    06641                 solver = NULL;
    06642                 if (osilreader != NULL)
    06643                         delete osilreader;
    06644                 osilreader = NULL;
    06645                 if (osolreader != NULL)
    06646                         delete osolreader;
    06647                 osolreader = NULL;
    06648         }
    06649
    06650 if (THOROUGH == true){
    06651         try{
    06652                 cout << endl << "TEST " << ++nOfTest << ": Bonmin solver on wayneQuadratic.osil" << endl << endl;
    06653                 ok = true;
    06654                 osilFileName = dataDir  + "osilFiles" + dirsep + "wayneQuadratic.osil";
    06655                 osolFileName = dataDir  + "osolFiles" + dirsep + "wayneQuadratic_Bonmin1.osol";
    06656                 osil = fileUtil->getFileAsString( osilFileName.c_str());
    06657                 osol = fileUtil->getFileAsString( osolFileName.c_str());
    06658                 osilreader = new OSiLReader();
    06659                 solver = new BonminSolver();
    06660                 solver->osol = osol;
    06661                 solver->osinstance = osilreader->readOSiL( osil);
    06662                 cout << "call the Bonmin Solver for wayneQuadratic" << endl;
    06663                 solver->buildSolverInstance();
    06664                 // Do this one with two different osol files!!!
    06665                 solver->solve();
    06666                 check = 2.925;
    06667                 //ok &= NearEqual(getObjVal( solver->osrl) , check,  1e-10 , 1e-10);
    06668                 ok = ( fabs(check - getObjVal( solver->osrl) )/(fabs( check) + OS_NEAR_EQUAL) <= OS_NEAR_EQUAL) ? true : false;
    06669                 if (ok)
    06670                 {
    06671 #ifdef DEBUG
    06672                         cout << solver->osrl << endl;
    06673 #endif
    06674                         cout << "Bonmin solver solution for wayneQuadratic checks." << endl;
    06675                 }
    06676                 else
    06677                 {       cout << "Bonmin solver solution for wayneQuadratic in error:" << endl;
    06678                         cout << solver->osrl << endl;
    06679                 }
    06680                 if(ok == false) throw ErrorClass(" Fail unit test with Bonmin on wayneQuadratic.osil");
    06681                 delete solver;
    06682                 solver = NULL;
    06683                 delete osilreader;
    06684                 osilreader = NULL;
    06685                 unitTestResult << "TEST " << nOfTest << ": Solved problem wayneQuadratic.osil with Bonmin" << std::endl;
    06686                 cout << endl << "TEST " << nOfTest << ": Completed successfully" << endl << endl;
    06687         }
    06688         catch(const ErrorClass& eclass){
    06689                 unitTestResultFailure  << "Sorry Unit Test Failed Testing the Bonmin Solver:"  + eclass.errormsg << endl;
    06690                 if (solver != NULL)
    06691                         delete solver;
    06692                 solver = NULL;
    06693                 if (osilreader != NULL)
    06694                         delete osilreader;
    06695                 osilreader = NULL;
    06696         }
    06697
    06698         try{
    06699                 cout << endl << "TEST " << ++nOfTest << ": Bonmin solver on wayneQuadratic.osil" << endl << endl;
    06700                 ok = true;
    06701                 osilFileName = dataDir  + "osilFiles" + dirsep + "wayneQuadratic.osil";
    06702                 osolFileName = dataDir  + "osolFiles" + dirsep + "wayneQuadratic_Bonmin2.osol";
    06703                 osil = fileUtil->getFileAsString( osilFileName.c_str());
    06704                 osol = fileUtil->getFileAsString( osolFileName.c_str());
    06705                 osilreader = new OSiLReader();
    06706                 osolreader = new OSoLReader();
    06707                 solver = new BonminSolver();
    06708                 solver->osol = osol;
    06709                 solver->osinstance = osilreader->readOSiL( osil);
    06710                 solver->osoption   = osolreader->readOSoL( osol);
    06711                 cout << "call the Bonmin Solver for wayneQuadratic" << endl;
    06712                 solver->buildSolverInstance();
    06713                 // Do this one with two different osol files!!!
    06714                 solver->solve();
    06715                 check = 2.925;
    06716                 //ok &= NearEqual(getObjVal( solver->osrl) , check,  1e-10 , 1e-10);
    06717                 ok = ( fabs(check - getObjVal( solver->osrl) )/(fabs( check) + OS_NEAR_EQUAL) <= OS_NEAR_EQUAL) ? true : false;
    06718                 if (ok)
    06719                 {
    06720 #ifdef DEBUG
    06721                         cout << solver->osrl << endl;
    06722 #endif
    06723                         cout << "Bonmin solver solution for wayneQuadratic checks." << endl;
    06724                 }
    06725                 else
    06726                 {       cout << "Bonmin solver solution for wayneQuadratic in error:" << endl;
    06727                         cout << solver->osrl << endl;
    06728                 }
    06729                 if(ok == false) throw ErrorClass(" Fail unit test with Bonmin on wayneQuadratic.osil");
    06730                 delete solver;
    06731                 solver = NULL;
    06732                 delete osilreader;
    06733                 osilreader = NULL;
    06734                 delete osolreader;
    06735                 osolreader = NULL;
    06736                 unitTestResult << "TEST " << nOfTest << ": Solved problem wayneQuadratic.osil with Bonmin" << std::endl;
    06737                 cout << endl << "TEST " << nOfTest << ": Completed successfully" << endl << endl;
    06738         }
    06739         catch(const ErrorClass& eclass){
    06740                 unitTestResultFailure  << "Sorry Unit Test Failed Testing the Bonmin Solver:"  + eclass.errormsg << endl;
    06741                 if (solver != NULL)
    06742                         delete solver;
    06743                 solver = NULL;
    06744                 if (osilreader != NULL)
    06745                         delete osilreader;
    06746                 osilreader = NULL;
    06747                 if (osolreader != NULL)
    06748                         delete osolreader;
    06749                 osolreader = NULL;
    06750         }
    06751
    06752         try{
    06753                 cout << endl << "TEST " << ++nOfTest << ": Bonmin solver on rosenbrockorig.osil" << endl << endl;
    06754                 ok = true;
    06755                 osilFileName = dataDir  + "osilFiles" + dirsep + "rosenbrockorig.osil";
    06756                 osil = fileUtil->getFileAsString( osilFileName.c_str());
    06757 //              osol = fileUtil->getFileAsString( osolFileName.c_str());
    06758                 osilreader = new OSiLReader();
    06759 //              osolreader = new OSoLReader();
    06760                 solver = new BonminSolver();
    06761                 solver->osol = "";
    06762                 solver->osinstance = osilreader->readOSiL( osil);
    06763 //              solver->osoption   = osolreader->readOSoL( osol);
    06764                 cout << "build solver instance" << endl;
    06765                 solver->buildSolverInstance();
    06766                 cout << "call the Bonmin Solver for rosenbrockorig" << endl;
    06767                 solver->solve();
    06768                 check = 0;
    06769                 cout << "Verify solution" <<endl;
    06770                 //ok &= NearEqual(getObjVal( solver->osrl) , check,  1e-10 , 1e-10);
    06771                 ok = ( fabs(check - getObjVal( solver->osrl) )/(fabs( check) + OS_NEAR_EQUAL) <= OS_NEAR_EQUAL) ? true : false;
    06772                 if (ok)
    06773                 {
    06774 #ifdef DEBUG
    06775                         cout << solver->osrl << endl;
    06776 #endif
    06777                         cout << "Bonmin solver solution for rosenbrockorig checks." << endl;
    06778                 }
    06779                 else
    06780                 {       cout << "Bonmin solver solution for rosenbrockorig in error:" << endl;
    06781                         cout << solver->osrl << endl;
    06782                 }
    06783                 if(ok == false) throw ErrorClass(" Fail unit test with Bonmin on rosenbrockorig.osil");
    06784                 delete solver;
    06785                 solver = NULL;
    06786                 delete osilreader;
    06787                 osilreader = NULL;
    06788                 delete osolreader;
    06789                 osolreader = NULL;
    06790                 unitTestResult << "TEST " << nOfTest << ": Solved problem rosenbrockorig.osil with Bonmin" << std::endl;
    06791                 cout << endl << "TEST " << nOfTest << ": Completed successfully" << endl << endl;
    06792         }
    06793         catch(const ErrorClass& eclass){
    06794                 unitTestResultFailure  << "Sorry Unit Test Failed Testing the Bonmin Solver:"  + eclass.errormsg << endl;
    06795                 if (solver != NULL)
    06796                         delete solver;
    06797                 solver = NULL;
    06798                 if (osilreader != NULL)
    06799                         delete osilreader;
    06800                 osilreader = NULL;
    06801                 if (osolreader != NULL)
    06802                         delete osolreader;
    06803                 osolreader = NULL;
    06804         }
    06805
    06806         try{
    06807                 cout << endl << "TEST " << ++nOfTest << ": Bonmin solver on rosenbrockorigInt.osil" << endl << endl;
    06808                 ok = true;
    06809                 osilFileName = dataDir  + "osilFiles" + dirsep + "rosenbrockorigInt.osil";
    06810 //              osolFileName = dataDir  + "osolFiles" + dirsep + "wayneQuadratic_Bonmin2.osol";
    06811                 osil = fileUtil->getFileAsString( osilFileName.c_str());
    06812 //              osol = fileUtil->getFileAsString( osolFileName.c_str());
    06813                 osilreader = new OSiLReader();
    06814 //              osolreader = new OSoLReader();
    06815                 solver = new BonminSolver();
    06816                 solver->osol = "";
    06817                 solver->osinstance = osilreader->readOSiL( osil);
    06818 //              solver->osoption   = osolreader->readOSoL( osol);
    06819                 cout << "call the Bonmin Solver for rosenbrockinteger" << endl;
    06820                 solver->buildSolverInstance();
    06821                 solver->solve();
    06822                 check = 0;
    06823                 ok = ( fabs(check - getObjVal( solver->osrl) )/(fabs( check) + OS_NEAR_EQUAL) <= OS_NEAR_EQUAL) ? true : false;
    06824                 if (ok)
    06825                 {
    06826 #ifdef DEBUG
    06827                         cout << solver->osrl << endl;
    06828 #endif
    06829                         cout << "Bonmin solver solution for rosenbrockorigInt checks." << endl;
    06830                 }
    06831                 else
    06832                 {       cout << "Bonmin solver solution for rosenbrockorigInt in error:" << endl;
    06833                         cout << solver->osrl << endl;
    06834                 }
    06835                 if(ok == false) throw ErrorClass(" Fail unit test with Bonmin on rosenbrockorigInt.osil");
    06836                 delete solver;
    06837                 solver = NULL;
    06838                 delete osilreader;
    06839                 osilreader = NULL;
    06840                 delete osolreader;
    06841                 osolreader = NULL;
    06842                 unitTestResult << "TEST " << nOfTest << ": Solved problem rosenbrockorigInt.osil with Bonmin" << std::endl;
    06843                 cout << endl << "TEST " << nOfTest << ": Completed successfully" << endl << endl;
    06844         }
    06845         catch(const ErrorClass& eclass){
    06846                 unitTestResultFailure  << "Sorry Unit Test Failed Testing the Bonmin Solver:"  + eclass.errormsg << endl;
    06847                 if (solver != NULL)
    06848                         delete solver;
    06849                 solver = NULL;
    06850                 if (osilreader != NULL)
    06851                         delete osilreader;
    06852                 osilreader = NULL;
    06853                 if (osolreader != NULL)
    06854                         delete osolreader;
    06855                 osolreader = NULL;
    06856         }
    06857 }   // end of if( THOROUGH )
    06858 #endif   // end of #ifdef COIN_HAS_BONMIN
    06859
    06860
    06861
    06862 #ifdef COIN_HAS_COUENNE
    06863         try{
    06864                 cout << endl << "TEST " << ++nOfTest << ": Couenne solver on bonminEx1.osil" << endl << endl;
    06865                 CouenneSolver *solver = NULL;
    06866
    06867 //              OSiLReader *osilreader = NULL;
    06868                 osilreader = new OSiLReader();
    06869                 osolreader = new OSoLReader();
    06870                 ok = true;
    06871                 osilFileName = dataDir  + "osilFiles" + dirsep + "bonminEx1.osil";
    06872                 osolFileName = dataDir  + "osolFiles" + dirsep + "bonminEx1_Couenne.osol";
    06873                 osil = fileUtil->getFileAsString( osilFileName.c_str());
    06874                 osol = fileUtil->getFileAsString( osolFileName.c_str());
    06875                 solver = new CouenneSolver();
    06876                 solver->sSolverName = "bonmin";
    06877                 solver->osil = osil;
    06878                 solver->osol = osol;
    06879 //              solver->osinstance = osilreader->readOSiL( osil);
    06880 //              solver->osoption   = osolreader->readOSoL( osol);
    06881                 cout << "call the COIN - Couenne Solver for bonminEx1" << endl;
    06882                 solver->buildSolverInstance();
    06883
    06884                 std::cout << " CALL SOLVE " << std::endl;
    06885                 solver->solve();
    06886
    06887                 check = -17.07106795327683;
    06888                 //ok &= NearEqual(getObjVal( solver->osrl) , check,  1e-10 , 1e-10);
    06889                 ok = ( fabs(check - getObjVal( solver->osrl) )/(fabs( check) + OS_NEAR_EQUAL) <= OS_NEAR_EQUAL) ? true : false;
    06890                 if (ok)
    06891                 {
    06892 #ifdef DEBUG
    06893                         cout << solver->osrl << endl;
    06894 #endif
    06895                         cout << "Couenne solver solution for bonminEx1 checks." << endl;
    06896                 }
    06897                 else
    06898                 {       cout << "Couenne solver solution for bonminEx1 in error:" << endl;
    06899                         cout << solver->osrl << endl;
    06900                 }
    06901                 if(ok == false) throw ErrorClass(" Fail unit test with Couenne on bonminEx1.osil");
    06902
    06903                 delete solver;
    06904                 solver = NULL;
    06905                 delete osilreader;
    06906                 osilreader = NULL;
    06907                 delete osolreader;
    06908                 osolreader = NULL;
    06909                 unitTestResult << "TEST " << nOfTest << ": Solved problem bonminEx1.osil with Couenne" << std::endl;
    06910                 cout << endl << "TEST " << nOfTest << ": Completed successfully" << endl << endl;
    06911         }
    06912         catch(const ErrorClass& eclass){
    06913                 cout << "OSrL =  " <<  solver->osrl <<  endl;
    06914                 cout << endl << endl << endl;
    06915                 unitTestResultFailure  << "Sorry Unit Test Failed Testing the Couenne Solver:"  + eclass.errormsg << endl;
    06916                 if (solver != NULL)
    06917                         delete solver;
    06918
    06919                 solver = NULL;
    06920                 if (osilreader != NULL)
    06921                         delete osilreader;
    06922                 osilreader = NULL;
    06923                 if (osolreader != NULL)
    06924                         delete osolreader;
    06925                 osolreader = NULL;
    06926         }
    06927
    06928 if( THOROUGH == true){
    06929         try{
    06930                 cout << endl << "TEST " << ++nOfTest << ": Couenne solver on bonminEx1_Nonlinear.osil" << endl << endl;
    06931 //              OSiLReader *osilreader = NULL;
    06932                 osilreader = new OSiLReader();
    06933                 osolreader = new OSoLReader();
    06934                 ok = true;
    06935                 osilFileName = dataDir  + "osilFiles" + dirsep + "bonminEx1_Nonlinear.osil";
    06936 //              osolFileName = dataDir  + "osolFiles" + dirsep + "bonminEx1_Couenne.osol";
    06937                 osil = fileUtil->getFileAsString( osilFileName.c_str());
    06938 //              osol = fileUtil->getFileAsString( osolFileName.c_str());
    06939                 osol = "";
    06940                 solver = new CouenneSolver();
    06941                 solver->osil = osil;
    06942                 solver->osol = osol;
    06943 //              solver->osinstance = osilreader->readOSiL( osil);
    06944 //              solver->osoption   = osolreader->readOSoL( osol);
    06945                 cout << "call the COIN - Couenne Solver for bonminEx1_Nonlinear" << endl;
    06946                 solver->buildSolverInstance();
    06947
    06948                 std::cout << " CALL SOLVE " << std::endl;
    06949                 solver->solve();
    06950
    06951                 check = -1.707107;
    06952                 //ok &= NearEqual(getObjVal( solver->osrl) , check,  1e-10 , 1e-10);
    06953                 ok = ( fabs(check - getObjVal( solver->osrl) )/(fabs( check) + OS_NEAR_EQUAL) <= OS_NEAR_EQUAL) ? true : false;
    06954                 if (ok)
    06955                 {
    06956 #ifdef DEBUG
    06957                         cout << solver->osrl << endl;
    06958 #endif
    06959                         cout << "Couenne solver solution for bonminEx1_Nonlinear checks." << endl;
    06960                 }
    06961                 else
    06962                 {       cout << "Couenne solver solution for bonminEx1_Nonlinear in error:" << endl;
    06963                         cout << solver->osrl << endl;
    06964                 }
    06965                 if(ok == false) throw ErrorClass(" Fail unit test with Couenne on bonminEx1_Nonlinear.osil");
    06966
    06967                 delete solver;
    06968                 solver = NULL;
    06969                 delete osilreader;
    06970                 osilreader = NULL;
    06971                 delete osolreader;
    06972                 osolreader = NULL;
    06973                 unitTestResult << "TEST " << nOfTest << ": Solved problem bonminEx1_Nonlinear with Couenne" << std::endl;
    06974                 cout << endl << "TEST " << nOfTest << ": Completed successfully" << endl << endl;
    06975         }
    06976         catch(const ErrorClass& eclass){
    06977                 unitTestResultFailure  << "Sorry Unit Test Failed Testing the Couenne Solver:"  + eclass.errormsg << endl;
    06978                 if (solver != NULL)
    06979                         delete solver;
    06980                 solver = NULL;
    06981                 if (osilreader != NULL)
    06982                         delete osilreader;
    06983                 osilreader = NULL;
    06984                 if (osolreader != NULL)
    06985                         delete osolreader;
    06986                 osolreader = NULL;
    06987         }
    06988
    06989         try{
    06990                 cout << endl << "TEST " << ++nOfTest << ": Couenne solver on nonconvex.osil" << endl << endl;
    06991 //              OSiLReader *osilreader = NULL;
    06992                 osilreader = new OSiLReader();
    06993                 osolreader = new OSoLReader();
    06994                 ok = true;
    06995                 osilFileName = dataDir  + "osilFiles" + dirsep + "nonconvex.osil";
    06996 //              osolFileName = dataDir  + "osolFiles" + dirsep + "bonminEx1_Couenne.osol";
    06997                 osil = fileUtil->getFileAsString( osilFileName.c_str());
    06998 //              osol = fileUtil->getFileAsString( osolFileName.c_str());
    06999                 osol = "";
    07000                 solver = new CouenneSolver();
    07001                 solver->osil = osil;
    07002                 solver->osol = osol;
    07003 //              solver->osinstance = osilreader->readOSiL( osil);
    07004 //              solver->osoption   = osolreader->readOSoL( osol);
    07005                 cout << "call the COIN - Couenne Solver for nonconvex.osil" << endl;
    07006                 solver->buildSolverInstance();
    07007
    07008                 std::cout << " CALL SOLVE " << std::endl;
    07009                 solver->solve();
    07010
    07011                 check = -6.551133;
    07012                 //ok &= NearEqual(getObjVal( solver->osrl) , check,  1e-10 , 1e-10);
    07013                 ok = ( fabs(check - getObjVal( solver->osrl) )/(fabs( check) + OS_NEAR_EQUAL) <= OS_NEAR_EQUAL) ? true : false;
    07014                 if (ok)
    07015                 {
    07016 #ifdef DEBUG
    07017                         cout << solver->osrl << endl;
    07018 #endif
    07019                         cout << "Couenne solver solution for nonconvex.osil checks." << endl;
    07020                 }
    07021                 else
    07022                 {       cout << "Couenne solver solution for nonconvex.osil in error:" << endl;
    07023                         cout << solver->osrl << endl;
    07024                 }
    07025                 if(ok == false) throw ErrorClass(" Fail unit test with Couenne on nonconvex.osil");
    07026
    07027                 delete solver;
    07028                 solver = NULL;
    07029                 delete osilreader;
    07030                 osilreader = NULL;
    07031                 delete osolreader;
    07032                 osolreader = NULL;
    07033                 unitTestResult << "TEST " << nOfTest << ": Solved problem nonconvex.osil with Couenne" << std::endl;
    07034                 cout << endl << "TEST " << nOfTest << ": Completed successfully" << endl << endl;
    07035         }
    07036         catch(const ErrorClass& eclass){
    07037                 unitTestResultFailure  << "Sorry Unit Test Failed Testing the Couenne Solver:"  + eclass.errormsg << endl;
    07038                 if (solver != NULL)
    07039                         delete solver;
    07040                 solver = NULL;
    07041                 if (osilreader != NULL)
    07042                         delete osilreader;
    07043                 osilreader = NULL;
    07044                 if (osolreader != NULL)
    07045                         delete osolreader;
    07046                 osolreader = NULL;
    07047         }
    07048
    07049         try{
    07050                 cout << endl << "TEST " << ++nOfTest << ": Couenne solver on rosenbrockorig.osil" << endl << endl;
    07051 //              OSiLReader *osilreader = NULL;
    07052                 osilreader = new OSiLReader();
    07053                 osolreader = new OSoLReader();
    07054                 ok = true;
    07055                 osilFileName = dataDir  + "osilFiles" + dirsep + "rosenbrockorig.osil";
    07056 //              osolFileName = dataDir  + "osolFiles" + dirsep + "rosenbrockorig_Couenne.osol";
    07057                 osil = fileUtil->getFileAsString( osilFileName.c_str());
    07058 //              osol = fileUtil->getFileAsString( osolFileName.c_str());
    07059                 osol = "";
    07060                 solver = new CouenneSolver();
    07061                 solver->osil = osil;
    07062                 solver->osol = osol;
    07063 //              solver->osinstance = osilreader->readOSiL( osil);
    07064 //              solver->osoption   = osolreader->readOSoL( osol);
    07065                 cout << "call the COIN - Couenne Solver for rosenbrockorig" << endl;
    07066                 solver->buildSolverInstance();
    07067
    07068                 std::cout << " CALL SOLVE " << std::endl;
    07069                 solver->solve();
    07070
    07071                 check = 0;
    07072                 //ok &= NearEqual(getObjVal( solver->osrl) , check,  1e-10 , 1e-10);
    07073                 ok = ( fabs(check - getObjVal( solver->osrl) )/(fabs( check) + OS_NEAR_EQUAL) <= OS_NEAR_EQUAL) ? true : false;
    07074                 if (ok)
    07075                 {
    07076 #ifdef DEBUG
    07077                         cout << solver->osrl << endl;
    07078 #endif
    07079                         cout << "Couenne solver solution for rosenbrockorig checks." << endl;
    07080                 }
    07081                 else
    07082                 {       cout << "Couenne solver solution for rosenbrockorig in error:" << endl;
    07083                         cout << solver->osrl << endl;
    07084                 }
    07085                 if(ok == false) throw ErrorClass(" Fail unit test with Couenne on rosenbrockorig.osil");
    07086
    07087                 delete solver;
    07088                 solver = NULL;
    07089                 delete osilreader;
    07090                 osilreader = NULL;
    07091                 delete osolreader;
    07092                 osolreader = NULL;
    07093                 unitTestResult << "TEST " << nOfTest << ": Solved problem rosenbrockorig.osil with Couenne" << std::endl;
    07094                 cout << endl << "TEST " << nOfTest << ": Completed successfully" << endl << endl;
    07095         }
    07096         catch(const ErrorClass& eclass){
    07097                 unitTestResultFailure  << "Sorry Unit Test Failed Testing the Couenne Solver:"  + eclass.errormsg << endl;
    07098                 if (solver != NULL)
    07099                         delete solver;
    07100                 solver = NULL;
    07101                 if (osilreader != NULL)
    07102                         delete osilreader;
    07103                 osilreader = NULL;
    07104                 if (osolreader != NULL)
    07105                         delete osolreader;
    07106                 osolreader = NULL;
    07107         }
    07108
    07109         try{
    07110                 cout << endl << "TEST " << ++nOfTest << ": Couenne solver on wayneQuadratic.osil" << endl << endl;
    07111 //              OSiLReader *osilreader = NULL;
    07112                 osilreader = new OSiLReader();
    07113                 osolreader = new OSoLReader();
    07114                 ok = true;
    07115                 osilFileName = dataDir  + "osilFiles" + dirsep + "wayneQuadratic.osil";
    07116
    07117 //              osolFileName = dataDir  + "osolFiles" + dirsep + "rosenbrockinteger_Couenne.osol";
    07118                 osil = fileUtil->getFileAsString( osilFileName.c_str());
    07119 //              osol = fileUtil->getFileAsString( osolFileName.c_str());
    07120                 osol = "";
    07121                 solver = new CouenneSolver();
    07122                 solver->osinstance = NULL;
    07123                 solver->osil = osil;
    07124                 solver->osol = osol;
    07125 //              solver->osinstance = osilreader->readOSiL( osil);
    07126 //              solver->osoption   = osolreader->readOSoL( osol);
    07127                 cout << "call the COIN - Couenne Solver for wayneQuadraticr" << endl;
    07128                 //solver->buildSolverInstance();
    07129                 std::cout << " CALL SOLVE " << std::endl;
    07130                 solver->buildSolverInstance();
    07131                 solver->setSolverOptions();
    07132                 solver->solve();
    07133                 check = 2.925;
    07134                 //ok &= NearEqual(getObjVal( solver->osrl) , check,  1e-10 , 1e-10);
    07135                 ok = ( fabs(check - getObjVal( solver->osrl) )/(fabs( check) + OS_NEAR_EQUAL) <= OS_NEAR_EQUAL) ? true : false;
    07136                 if (ok)
    07137                 {
    07138 #ifdef DEBUG
    07139                         cout << solver->osrl << endl;
    07140 #endif
    07141                         cout << "Couenne solver solution for wayneQuadratic checks." << endl;
    07142                 }
    07143                 else
    07144                 {       cout << "Couenne solver solution for wayneQuadratic in error:" << endl;
    07145                         cout << solver->osrl << endl;
    07146                 }
    07147                 if(ok == false) throw ErrorClass(" Fail unit test with Couenne on rosenbrockinteger.osil");
    07148
    07149                 delete solver;
    07150                 solver = NULL;
    07151                 delete osilreader;
    07152                 osilreader = NULL;
    07153                 delete osolreader;
    07154                 osolreader = NULL;
    07155                 unitTestResult << "TEST " << nOfTest << ": Solved problem wayneQuadratic.osil with Couenne" << std::endl;
    07156                 cout << endl << "TEST " << nOfTest << ": Completed successfully" << endl << endl;
    07157         }
    07158         catch(const ErrorClass& eclass){
    07159                 unitTestResultFailure  << "Sorry Unit Test Failed Testing the Couenne Solver:"  + eclass.errormsg << endl;
    07160                 if (solver != NULL)
    07161                         delete solver;
    07162                 solver = NULL;
    07163                 if (osilreader != NULL)
    07164                         delete osilreader;
    07165                 osilreader = NULL;
    07166                 if (osolreader != NULL)
    07167                         delete osolreader;
    07168                 osolreader = NULL;
    07169         }
    07170
    07171         OSrLWriter *tmp_writer = NULL;
    07172         try{
    07173                 cout << endl << "TEST " << ++nOfTest << ": Couenne solver on wayneQuadratic.osil" << endl << endl;
    07174 //              OSiLReader *osilreader = NULL;
    07175                 osilreader = new OSiLReader();
    07176                 osolreader = new OSoLReader();
    07177                 ok = true;
    07178                 osilFileName = dataDir  + "osilFiles" + dirsep + "wayneQuadratic.osil";
    07179                 osolFileName = dataDir  + "osolFiles" + dirsep + "wayneQuadratic_Couenne.osol";
    07180                 osil = fileUtil->getFileAsString( osilFileName.c_str());
    07181                 osol = fileUtil->getFileAsString( osolFileName.c_str());
    07182                 solver = new CouenneSolver();
    07183                 solver->osil = osil;
    07184                 solver->osol = osol;
    07185                 cout << "call the COIN - Couenne Solver for wayneQuadratic.osil" << endl;
    07186                 solver->buildSolverInstance();
    07187
    07188                 std::cout << " CALL SOLVE " << std::endl;
    07189                 solver->solve();
    07190
    07191                 cout << "Here is the Couenne solver solution for wayneQuadratic" << endl;
    07192
    07193 //              OSrLWriter *tmp_writer;
    07194                 tmp_writer = new OSrLWriter();
    07195                 solver->osrl = tmp_writer->writeOSrL(solver->osresult);
    07196                 delete tmp_writer;
    07197                 tmp_writer = NULL;
    07198
    07199                 string::size_type pos;
    07200                 pos = solver->osrl.find( "LIMIT_EXCEEDED[COUENNE]");
    07201                 if(pos == std::string::npos)
    07202                 {
    07203                         cout << solver->osrl << endl << endl;
    07204                         throw ErrorClass(" Error with wayneQuadratic running on Couenne");
    07205                 }
    07206 #ifdef DEBUG
    07207                 else
    07208                 {
    07209                         cout << solver->osrl << endl << endl;
    07210                 }
    07211 #endif
    07212                 delete solver;
    07213                 solver = NULL;
    07214                 delete osilreader;
    07215                 osilreader = NULL;
    07216                 delete osolreader;
    07217                 osolreader = NULL;
    07218                 unitTestResult << "TEST " << nOfTest << ": Solved problem wayneQuadratic with Couenne" << std::endl;
    07219                 cout << endl << "TEST " << nOfTest << ": Completed successfully" << endl << endl;
    07220         }
    07221         catch(const ErrorClass& eclass){
    07222                 unitTestResultFailure  << "Sorry Unit Test Failed Testing the Couenne Solver:"  + eclass.errormsg << endl;
    07223                 if (solver != NULL)
    07224                         delete solver;
    07225                 solver = NULL;
    07226                 if (osilreader != NULL)
    07227                         delete osilreader;
    07228                 osilreader = NULL;
    07229                 if (osolreader != NULL)
    07230                         delete osolreader;
    07231                 osolreader = NULL;
    07232         }
    07233 } //end of if (THOROUGH)
    07234 #endif // end of #ifdef COIN_HAS_COUENNE
    07235
    07236
    07237
    07238 #ifdef COIN_HAS_LINDO
    07239         try{
    07240                 cout << endl << "TEST " << ++nOfTest << ": Lindo solver on lindoapiaddins.osil" << endl << endl;
    07241                 ok = true;
    07242                 osilFileName = dataDir  + "osilFiles" + dirsep + "lindoapiaddins.osil";
    07243                 osolFileName = dataDir  + "osolFiles" + dirsep + "lindoapiaddins_lindo.osol";
    07244                 osil = fileUtil->getFileAsString( osilFileName.c_str());
    07245                 osol = fileUtil->getFileAsString( osolFileName.c_str());
    07246                 osilreader = new OSiLReader();
    07247                 cout << "create a new LINDO Solver for OSiL string solution" << endl;
    07248                 solver = new LindoSolver();
    07249                 solver->osinstance = osilreader->readOSiL( osil);
    07250                 solver->osol = osol;
    07251                 cout << "call the LINDO Solver" << endl;
    07252                 solver->buildSolverInstance();
    07253                 solver->solve();
    07254                 check = 99;
    07255                 //ok &= NearEqual(getObjVal( solver->osrl) , check,  1e-10 , 1e-10);
    07256                 ok = ( fabs(check - getObjVal( solver->osrl) )/(fabs( check) + OS_NEAR_EQUAL) <= OS_NEAR_EQUAL) ? true : false;
    07257                 if (ok)
    07258                 {
    07259 #ifdef DEBUG
    07260                         cout << solver->osrl << endl;
    07261 #endif
    07262                         cout << "LINDO solver solution for lindoapiaddins checks." << endl;
    07263                 }
    07264                 else
    07265                 {       cout << "LINDO solver solution for lindoapiaddins in error:" << endl;
    07266                         cout << solver->osrl << endl;
    07267                 }
    07268                 if(ok == false) throw ErrorClass(" Fail unit test with LINDO on lindoapiaddins.osil");
    07269                 solver->osinstance = NULL;
    07270                 delete solver;
    07271                 solver = NULL;
    07272                 delete osilreader;
    07273                 osilreader = NULL;
    07274                 unitTestResult << "TEST " << nOfTest << ": Solved problem lindoapiaddins.osil with Lindo" << std::endl;
    07275                 cout << endl << "TEST " << nOfTest << ": Completed successfully" << endl << endl;
    07276         }
    07277         catch(const ErrorClass& eclass){
    07278                 //cout << "OSrL =  " <<  solver->osrl <<  endl;
    07279                 cout << endl << endl << endl;
    07280                 unitTestResultFailure  <<"Sorry Unit Test Failed Testing the LINDO Solver:"  + eclass.errormsg << endl << endl;
    07281                 if (solver != NULL)
    07282                         delete solver;
    07283                 solver = NULL;
    07284                 if (osilreader != NULL)
    07285                         delete osilreader;
    07286                 osilreader = NULL;
    07287         }
    07288
    07289 if (THOROUGH == true){
    07290         try{
    07291                 // now solve the rosenbrock problem from the OSiL paper
    07292                 cout << endl << "TEST " << ++nOfTest << ": Lindo solver on rosenbrockmod.osil" << endl << endl;
    07293                 osilFileName = dataDir  + "osilFiles" + dirsep + "rosenbrockmod.osil";
    07294                 osolFileName = dataDir  + "osolFiles" + dirsep + "rosenbrockmod_lindo.osol";
    07295                 osil = fileUtil->getFileAsString( osilFileName.c_str());
    07296                 osol = fileUtil->getFileAsString( osolFileName.c_str());
    07297                 solver = new LindoSolver();
    07298                 solver->osil = osil;
    07299                 solver->osol = osol;
    07300                 solver->osinstance = NULL;
    07301                 cout << "call the LINDO Solver" << endl;
    07302                 solver->buildSolverInstance();
    07303                 solver->solve();
    07304                 check = 6.7279;
    07305                 //ok &= NearEqual(getObjVal( solver->osrl) , check,  1e-10 , 1e-10);
    07306                 ok = ( fabs(check - getObjVal( solver->osrl) )/(fabs( check) + OS_NEAR_EQUAL) <= OS_NEAR_EQUAL) ? true : false;
    07307                 if (ok)
    07308                 {
    07309 #ifdef DEBUG
    07310                         cout << solver->osrl << endl;
    07311 #endif
    07312                         cout << "LINDO solver solution for rosenbrockmod checks." << endl;
    07313                 }
    07314                 else
    07315                 {       cout << "LINDO solver solution for rosenbrockmod in error:" << endl;
    07316                         cout << solver->osrl << endl;
    07317                 }
    07318                 if(ok == false) throw ErrorClass(" Fail unit test with LINDO on rosenbrockmod.osil");
    07319                 solver->osinstance = NULL;
    07320                 delete solver;
    07321                 solver = NULL;
    07322                 unitTestResult << "TEST " << nOfTest << ": Solved problem rosenbrockmod.osil with Lindo" << std::endl;
    07323                 cout << endl << "TEST " << nOfTest << ": Completed successfully" << endl << endl;
    07324         }
    07325         catch(const ErrorClass& eclass){
    07326                 unitTestResultFailure  << "Sorry Unit Test Failed Testing the Lindo Solver:"  + eclass.errormsg << endl;
    07327                 if (solver != NULL)
    07328                         delete solver;
    07329                 solver = NULL;
    07330         }
    07331
    07332         try{
    07333                 // now solve a pure quadratic
    07334                 cout << endl << "TEST " << ++nOfTest << ": Lindo solver on parincQuadratic.osil" << endl << endl;
    07335                 osilFileName = dataDir  + "osilFiles" + dirsep + "parincQuadratic.osil";
    07336                 osolFileName = dataDir  + "osolFiles" + dirsep + "parincQuadratic_lindo.osol";
    07337                 osil = fileUtil->getFileAsString( osilFileName.c_str());
    07338                 osol = fileUtil->getFileAsString( osolFileName.c_str());
    07339                 osolreader = new OSoLReader();
    07340                 solver = new LindoSolver();
    07341                 solver->osil = osil;
    07342                 solver->osol = osol;
    07343                 solver->osinstance = NULL;
    07344                 solver->osoption   = osolreader->readOSoL( osol);
    07345                 cout << "call the LINDO Solver" << endl;
    07346                 solver->buildSolverInstance();
    07347                 solver->solve();
    07348                 check = 49920.5;
    07349                 //ok &= NearEqual(getObjVal( solver->osrl) , check,  1e-10 , 1e-10);
    07350                 ok = ( fabs(check - getObjVal( solver->osrl) )/(fabs( check) + OS_NEAR_EQUAL) <= OS_NEAR_EQUAL) ? true : false;
    07351                 if (ok)
    07352                 {
    07353 #ifdef DEBUG
    07354                         cout << solver->osrl << endl;
    07355 #endif
    07356                         cout << "LINDO solver solution for parincQuadratic checks." << endl;
    07357                 }
    07358                 else
    07359                 {       cout << "LINDO solver solution for parincQuadratic in error:" << endl;
    07360                         cout << solver->osrl << endl;
    07361                 }
    07362                 if(ok == false) throw ErrorClass(" Fail unit test with LINDO on parincQuadratic.osil");
    07363                 delete solver;
    07364                 solver = NULL;
    07365                 delete osolreader;
    07366                 osolreader = NULL;
    07367                 unitTestResult << "TEST " << nOfTest << ": Solved problem parincQuadratic.osil with Lindo" << std::endl;
    07368                 cout << endl << "TEST " << nOfTest << ": Completed successfully" << endl << endl;
    07369         }
    07370         catch(const ErrorClass& eclass){
    07371                 unitTestResultFailure  << "Sorry Unit Test Failed Testing the LINDO Solver:"  + eclass.errormsg << endl;
    07372                 if (solver != NULL)
    07373                         delete solver;
    07374                 solver = NULL;
    07375                 if (osolreader != NULL)
    07376                         delete osolreader;
    07377                 osolreader = NULL;
    07378         }
    07379
    07380         try{
    07381                 // now solve a quadratic binary problem
    07382                 // wayneQuadratic.osil
    07383                 /*
    07384                 cout << endl << "TEST " << ++nOfTest << ": Lindo solver on wayneQuadratic.osil" << endl << endl;
    07385                 osilFileName = dataDir  + "osilFiles" + dirsep + "wayneQuadratic.osil";
    07386                 osolFileName = dataDir  + "osolFiles" + dirsep + "wayneQuadratic_lindo.osol";
    07387                 osil = fileUtil->getFileAsString( osilFileName.c_str());
    07388                 osol = fileUtil->getFileAsString( osolFileName.c_str());
    07389                 osilreader = new OSiLReader();
    07390                 solver = new LindoSolver();
    07391                 solver->osil = osil;
    07392                 solver->osol = osol;
    07393                 solver->osinstance = osilreader->readOSiL( osil);
    07394                 cout << "call the LINDO Solver" << endl;
    07395                 solver->buildSolverInstance();
    07396                 solver->solve();
    07397                 check = 2.925;
    07398                 //ok &= NearEqual(getObjVal( solver->osrl) , check,  1e-10 , 1e-10);
    07399                 ok = ( fabs(check - getObjVal( solver->osrl) )/(fabs( check) + OS_NEAR_EQUAL) <= OS_NEAR_EQUAL) ? true : false;
    07400                 if (ok)
    07401                 {
    07402 #ifdef DEBUG
    07403                         cout << solver->osrl << endl;
    07404 #endif
    07405                         cout << "LINDO solver solution for wayneQuadratic checks." << endl;
    07406                 }
    07407                 else
    07408                 {       cout << "LINDO solver solution for wayneQuadratic in error:" << endl;
    07409                         cout << solver->osrl << endl;
    07410                 }
    07411                 if(ok == false) throw ErrorClass(" Fail unit test with LINDO on wayneQuadratic.osil");
    07412                 delete solver;
    07413                 solver = NULL;
    07414                 delete osolreader;
    07415                 osolreader = NULL;
    07416                 unitTestResult << "TEST " << nOfTest << ": Solved problem wayneQuadratic.osil with Lindo" << std::endl;
    07417                 cout << endl << "TEST " << nOfTest << ": Completed successfully" << endl << endl;
    07418         }
    07419         catch(const ErrorClass& eclass){
    07420                 unitTestResultFailure  << "Sorry Unit Test Failed Testing the LINDO Solver:"  + eclass.errormsg << endl;
    07421                 if (solver != NULL)
    07422                         delete solver;
    07423                 solver = NULL;
    07424                 if (osilreader != NULL)
    07425                         delete osilreader;
    07426                 osilreader = NULL;
    07427                 if (osolreader != NULL)
    07428                         delete osolreader;
    07429                 osolreader = NULL;
    07430         }
    07431                 */
    07432 } // end of if( THOROUGH)
    07433 #endif // end of #ifdef COIN_HAS_LINDO
    07434 } // end of if(SOLVER_TESTS)
    07435
    07436
    07437
    07438 // now solve with an OSInstance created from an MPS file
    07439 if (OTHER_TESTS){
    07440         try{
    07441                 cout << endl << "TEST " << ++nOfTest << ": Cbc solver using MPS file" << endl << endl;
    07442                 ok = true;
    07443 //              cout << endl;
    07444 //              cout << "Start testing MPS file conversion" << endl << endl;
    07445                 cout << "create a COIN Solver for MPS - OSInstance solution" << endl;
    07446                 solver = new CoinSolver();
    07447                 solver->sSolverName = "cbc";
    07448                 mpsFileName = dataDir +  "mpsFiles" + dirsep + "parinc.mps";
    07449                 mps2osil = new OSmps2osil( mpsFileName);
    07450                 mps2osil->createOSInstance() ;
    07451                 solver->osinstance = mps2osil->osinstance;
    07452                 osol = "<osol></osol>";
    07453                 solver->osol = osol;
    07454                 cout << "call COIN Solve" << endl;
    07455                 solver->buildSolverInstance();
    07456                 solver->solve();
    07457                 check = -7668;
    07458                 //ok &= NearEqual(getObjVal( solver->osrl) , check,  1e-1 , 1e-1);
    07459                 ok = ( fabs(check - getObjVal( solver->osrl) )/(fabs( check) + OS_NEAR_EQUAL) <= OS_NEAR_EQUAL) ? true : false;
    07460                 if (ok)
    07461                 {
    07462 #ifdef DEBUG
    07463                         cout << solver->osrl << endl;
    07464 #endif
    07465                         cout << "COIN solver solution for parinc.mps checks." << endl;
    07466                 }
    07467                 else
    07468                 {       cout << "COIN solver solution for parinc.mps in error:" << endl;
    07469                         cout << solver->osrl << endl;
    07470                 }
    07471                 if(ok == false) throw ErrorClass(" Fail unit test with COIN Solver on MPS test problem parincLinear.mps");
    07472                 delete solver;
    07473                 solver = NULL;
    07474                 delete mps2osil;
    07475                 mps2osil = NULL;
    07476 //              cout << endl;
    07477 //              cout << "Done with MPS testing" << endl;
    07478                 unitTestResult << "TEST " << nOfTest << ": Test the MPS -> OSiL converter on parinc.mps using Cbc" << std::endl;
    07479                 cout << endl << "TEST " << nOfTest << ": Completed successfully" << endl << endl;
    07480         }
    07481         catch(const ErrorClass& eclass){
    07482                 cout << "OSrL =  " <<  solver->osrl <<  endl;
    07483                 cout << endl << endl << endl;
    07484                 unitTestResultFailure  <<"Sorry Unit Test Failed Testing the MPS converter:"  + eclass.errormsg << endl;
    07485
    07486                 if (solver != NULL)
    07487                         delete solver;
    07488                 solver = NULL;
    07489                 if (mps2osil != NULL)
    07490                         delete mps2osil;
    07491                 mps2osil = NULL;
    07492         }
    07493
    07494
    07495 // test reading a GAMS file
    07496
    07497 #if  0
    07498 #ifdef COIN_HAS_GAMSUTILS
    07499         try{
    07500                 std::cout  << "Working with GAMSIO " << std::endl;
    07501
    07502                 std::string gmsControlFile = "/home/kmartin/bin/gams/23.2/225a/gamscntr.dat";
    07503
    07504
    07505                 OSgams2osil *gams2osil;
    07506                 gams2osil = new OSgams2osil( gmsControlFile);
    07507                 gams2osil->createOSInstance();
    07508                 std::cout << gams2osil->osinstance->printModel() << std::endl;
    07509                 std::cout  << "Done Working with GAMSIO " << std::endl;
    07510                 delete gams2osil;
    07511                 gams2osil = NULL;
    07512         }
    07513         catch(const ErrorClass& eclass){
    07514                 unitTestResultFailure  << "Sorry Unit Test Failed Testing the GAMS interface:"  + eclass.errormsg << endl;
    07515                 if (gams2osil != NULL)
    07516                         delete gams2osil;
    07517                 gams2osil = NULL;
    07518         }
    07519 #endif
    07520 #endif
    07521
    07522 // now solve with an OSInstance created from an AMPL nl file
    07523 #ifdef COIN_HAS_ASL
    07524         try{
    07525                 cout << endl << "TEST " << ++nOfTest << ": AMPL solver interface" << endl << endl;
    07526                 ok = true;
    07527                 cout << "create a cbc Solver for AMPL nl - OSInstance solution" << endl;
    07528                 solver = new CoinSolver();
    07529                 solver->sSolverName = "cbc";
    07530                 nlFileName  = dataDir + "amplFiles" + dirsep + "parinc.nl";
    07531                 nl2osil = new OSnl2osil( nlFileName);
    07532                 nl2osil->createOSInstance() ;
    07533                 solver->osinstance = nl2osil->osinstance;
    07534
    07535                 OSiLWriter tmp_osil_writer;
    07536                 tmp_osil_writer.m_bWhiteSpace = true;
    07537                 //std::cout << tmp_osil_writer.writeOSiL( solver->osinstance) << std::endl;
    07538
    07539                 osol = "";  //<osol></osol>";
    07540                 solver->osol = osol;
    07541                 cout << "call Cbc Solve" << endl;
    07542                 solver->buildSolverInstance();
    07543                 solver->solve();
    07544                 check = 7668;
    07545                 //ok &= NearEqual(getObjVal( solver->osrl) , check,  1e-1 , 1e-1);
    07546                 ok = ( fabs(check - getObjVal( solver->osrl) )/(fabs( check) + OS_NEAR_EQUAL) <= OS_NEAR_EQUAL) ? true : false;
    07547                 if (ok)
    07548                 {
    07549 #ifdef DEBUG
    07550                         cout << solver->osrl << endl;
    07551 #endif
    07552                         cout << "COIN cbc solver solution for parinc.nl checks." << endl;
    07553                 }
    07554                 else
    07555                 {       cout << "COIN cbc solver solution for parinc.nl in error:" << endl;
    07556                         cout << solver->osrl << endl;
    07557                 }
    07558                 if(ok == false) throw ErrorClass(" Fail unit test with OSnl2osil on problem parinc.nl");
    07559                 solver->osinstance = NULL;
    07560                 delete solver;
    07561                 solver = NULL;
    07562                 //cout << "call delete nl2osil" << endl;
    07563                 delete nl2osil;
    07564                 nl2osil = NULL;
    07565                 unitTestResult << "TEST " << nOfTest << ": Test the AMPL nl -> OSiL converter on parinc.nl using Cbc" << std::endl;
    07566                 cout << endl << "TEST " << nOfTest << ": Completed successfully" << endl << endl;
    07567         }
    07568         catch(const ErrorClass& eclass){
    07569                 cout << "OSrL =  " <<  solver->osrl <<  endl;
    07570                 cout << endl << endl << endl;
    07571                 unitTestResultFailure  <<"Sorry Unit Test Failed Testing AMPL:"  + eclass.errormsg << endl;
    07572
    07573                 if (solver != NULL)
    07574                         delete solver;
    07575                 solver = NULL;
    07576                 if (nl2osil != NULL)
    07577                         delete nl2osil;
    07578                 nl2osil = NULL;
    07579         }
    07580 #endif
    07581
    07582         //
    07583         // Now read an mps file and write in b64 format to test the b64 feature
    07584         //
    07585         try{
    07586                 cout << endl << "TEST " << ++nOfTest << ": b64 operations" << endl << endl;
    07587                 ok = true;
    07588                 OSiLWriter osilwriter;
    07589                 osilwriter.m_bWriteBase64 = true;
    07590                 solver = new CoinSolver();
    07591                 solver->sSolverName = "cbc";
    07592                 mpsFileName = dataDir +  "mpsFiles" + dirsep + "parinc.mps";
    07593                 mps2osil = new OSmps2osil( mpsFileName);
    07594                 solver->osinstance = NULL;
    07595                 osol = "<osol></osol>";
    07596                 solver->osol = osol;
    07597                 mps2osil->createOSInstance() ;
    07598                 solver->osil = osilwriter.writeOSiL( mps2osil->osinstance) ;
    07599                 //std::cout << solver->osil << std::endl;
    07600                 solver->buildSolverInstance();
    07601                 solver->solve();
    07602                 cout << endl << endl;
    07603                 check = -7668;
    07604                 //ok &= NearEqual(getObjVal( solver->osrl) , check,  1e-1 , 1e-1);
    07605                 ok = ( fabs(check - getObjVal( solver->osrl) )/(fabs( check) + OS_NEAR_EQUAL) <= OS_NEAR_EQUAL) ? true : false;
    07606                 if (ok)
    07607                 {       cout << "COIN solution of an OSiL string in b64 format." << endl;
    07608 #ifdef DEBUG
    07609                         cout << solver->osrl << endl;
    07610 #endif
    07611                 }
    07612                 else
    07613                 {       cout << "COIN solution of a OSiL string in b64 format:" << endl;
    07614                         cout << solver->osrl << endl;
    07615                 }
    07616                 if(ok == false) throw ErrorClass(" Fail unit test with COIN Cbc Solver on b64 test problem parincLinear.mps");
    07617                 solver->osinstance = NULL;
    07618                 delete solver;
    07619                 solver = NULL;
    07620                 delete mps2osil;
    07621                 mps2osil = NULL;
    07622                 unitTestResult << "TEST " << nOfTest << ": Test a problem written in b64 and then converted to OSInstance" << std::endl;
    07623                 cout << endl << "TEST " << nOfTest << ": Completed successfully" << endl << endl;
    07624         }
    07625         catch(const ErrorClass& eclass){
    07626                 cout << endl << endl;
    07627                 cout << eclass.errormsg <<  endl << endl;
    07628                 cout << "OSrL =  " <<  solver->osrl <<  endl;
    07629                 cout << endl << endl << endl;
    07630                 unitTestResultFailure   << "Sorry Unit Test Failed Testing Use of Base 64" << endl;
    07631
    07632                 if (solver != NULL)
    07633                         delete solver;
    07634                 solver = NULL;
    07635                 if (mps2osil != NULL)
    07636                         delete mps2osil;
    07637                 mps2osil = NULL;
    07638         }
    07639
    07640
    07641         // now test postfix and prefix routines
    07642         try{
    07643                 cout << endl << "TEST " << ++nOfTest << ": postfix and prefix routines" << endl << endl;
    07644                 std::string expTreeTest =  dataDir  + "osilFiles" + dirsep + "rosenbrockmod.osil";
    07645                 osil = fileUtil->getFileAsString( expTreeTest.c_str() ) ;
    07646                 OSInstance *osinstance = NULL;
    07647                 //osinstance = new OSInstance();
    07648                 OSiLReader *osilreader = NULL;
    07649                 osilreader = new OSiLReader();
    07650                 //create an osinstance
    07651                 osinstance = osilreader->readOSiL( osil);
    07652                 OSExpressionTree* expTree = osinstance->getNonlinearExpressionTree( -1);
    07653                 if(expTree == NULL) throw ErrorClass(" Null expression tree when testing prefix and postfix routines");
    07654                 std::vector<OSnLNode*> postfixVec;
    07655                 //postfixVec = expTree->m_treeRoot->getPostfixFromExpressionTree();
    07656                 postfixVec = osinstance->getNonlinearExpressionTreeInPostfix( -1);
    07657
    07658                 unsigned int n = postfixVec.size();
    07659                 unsigned int i;
    07660                 nodeNames1 = new std::string[ n];
    07661                 nodeNames2 = new std::string[ n];
    07662                 for (i = 0 ; i < n; i++){
    07663                         //std::cout << postfixVec[i]->getTokenName() << std::endl;
    07664                         nodeNames1[i] = postfixVec[i]->getTokenName();
    07665                 }
    07666
    07667                 // now create back the expression tree
    07668                 expTree->m_treeRoot = postfixVec[ n - 1]->createExpressionTreeFromPostfix( postfixVec);
    07669
    07670                 // now get in prefix
    07671                 std::vector<OSnLNode*> prefixVec;
    07672                 //prefixVec = expTree->m_treeRoot->getPrefixFromExpressionTree();
    07673                 prefixVec = osinstance->getNonlinearExpressionTreeInPrefix( -1);
    07674
    07675                 // now create back the expression tree
    07676                 expTree->m_treeRoot = prefixVec[ 0]->createExpressionTreeFromPrefix( prefixVec);
    07677
    07678                 // now get postfix vector again and compare with original
    07679                 postfixVec = expTree->m_treeRoot->getPostfixFromExpressionTree();
    07680                 //postfixVec = osinstance->getNonlinearExpressionTreeInPostfix( -1);
    07681                 if(postfixVec.size() != n) throw ErrorClass(" Problem with creating expression trees");
    07682                 //std::cout << std::endl << std::endl;
    07683                 for (i = 0 ; i < n; i++){
    07684                         //std::cout << postfixVec[i]->getTokenName() << std::endl;
    07685                         nodeNames2[i] = postfixVec[i]->getTokenName();
    07686                         if( nodeNames1[i] != nodeNames2[ i]) throw ErrorClass(" Problem with creating expression trees");
    07687                 }
    07688
    07689                 //delete osinstance;
    07690                 delete[] nodeNames1;
    07691                 nodeNames1 = NULL;
    07692                 delete[] nodeNames2;
    07693                 nodeNames2 = NULL;
    07694
    07695                 delete osilreader;
    07696                 osilreader = NULL;
    07697                 osinstance = NULL;
    07698                 unitTestResult << "TEST " << nOfTest << ": Successful test of prefix and postfix conversion routines" << std::endl;
    07699                 cout << endl << "TEST " << nOfTest << ": Completed successfully" << endl << endl;
    07700
    07701         }
    07702         catch(const ErrorClass& eclass){
    07703                 cout << endl << endl << endl;
    07704                 unitTestResultFailure << eclass.errormsg << endl;
    07705                 if (osilreader != NULL)
    07706                         delete osilreader;
    07707                 osilreader = NULL;
    07708                 if (nodeNames1 != NULL)
    07709                         delete[] nodeNames1;
    07710                 nodeNames1 = NULL;
    07711                 if (nodeNames2 != NULL)
    07712                         delete[] nodeNames2;
    07713                 nodeNames2 = NULL;
    07714         }
    07715
    07716 } //end of if (OTHER_TESTS)
    07717
    07718         delete fileUtil;
    07719         fileUtil = NULL;
    07720
    07721         if(unitTestResultFailure.str().length() > 0){
    07722                 cout << endl << "THE UNIT TEST PASSED THE FOLLOWING:" << endl << endl;
    07723                 cout << unitTestResult.str() << endl << endl;
    07724                 cout << "UNFORTUNATELY, YOU FAILED ON THE FOLLOWING:" << endl << endl;
    07725                 cout << unitTestResultFailure.str() << endl << endl;
    07726                 cout << "Conclusion: FAILURE" << endl;
    07727                 return 1;
    07728         }
    07729         else{
    07730                 cout << endl << "THE UNIT TEST PASSED THE FOLLOWING:" << endl << endl;
    07731                 cout << unitTestResult.str() << endl << endl;
    07732                 cout << "All tests completed successfully" <<  endl <<  endl;
    07733 #ifdef GUS_DEBUG
    07734                 cout << "Make sure to #undef GUS_DEBUG before committing!!!" <<  endl <<  endl;
    07735 #endif
    07736                 return 0;
    07737         }
    07738 }//end main
    07739
    07740 double getObjVal( std::string osrl){
    07741         std::string sObjVal;
    07742         double dObjVal;
    07743         string::size_type pos2;
    07744         string::size_type pos1 = osrl.find( "<obj ");
    07745         if(pos1 != std::string::npos){
    07746                 // get the end of the obj start tag
    07747                 pos1 = osrl.find(">", pos1 + 1);
    07748                 if(pos1 != std::string::npos){
    07749                         // get the start of obj end tag
    07750                         pos2 = osrl.find( "</obj", pos1 + 1);
    07751                         if( pos2 != std::string::npos){
    07752                                 // get the substring
    07753                                 sObjVal = osrl.substr( pos1 + 1, pos2 - pos1 - 1);
    07754                                 //std::cout << "HERE IS THE OBJECTIVE FUNCTION VALUE SUBSTRING  " << sObjVal<< std::endl;
    07755                                 // return dObjVal = strtod(sObjVal.c_str(), NULL);
    07756                                 return dObjVal = os_strtod(sObjVal.c_str(), NULL);
    07757                         }
    07758                         else return OSNAN;
    07759                 }
    07760                 else return OSNAN;
    07761         }
    07762         else return OSNAN;
    07763 }
    07764
    07765
    07766 void tempPrintArrays(OSResult* os)
    07767 {
    07768         std::cout << "Print out array content" << std::endl;
    07769         for (int i=0; i < os->optimization->numberOfSolutions; ++i)
    07770         {
    07771                 std::cout << "solution " << i << std::endl << std::endl;
    07772                 std::cout << "variables   basic      ";
    07773                 std::cout << os->optimization->solution[i]->variables->basisStatus->basic->el[0] << "  ";
    07774                 std::cout << os->optimization->solution[i]->variables->basisStatus->basic->el[1] << "  ";
    07775                 std::cout << os->optimization->solution[i]->variables->basisStatus->basic->el[2] << endl;
    07776                 std::cout << "variables   atLower    ";
    07777                 std::cout << os->optimization->solution[i]->variables->basisStatus->atLower->el[0] << "  ";
    07778                 std::cout << os->optimization->solution[i]->variables->basisStatus->atLower->el[1] << "  ";
    07779                 std::cout << os->optimization->solution[i]->variables->basisStatus->atLower->el[2] << endl;
    07780                 std::cout << "variables   atUpper    ";
    07781                 std::cout << os->optimization->solution[i]->variables->basisStatus->atUpper->el[0] << "  ";
    07782                 std::cout << os->optimization->solution[i]->variables->basisStatus->atUpper->el[1] << "  ";
    07783                 std::cout << os->optimization->solution[i]->variables->basisStatus->atUpper->el[2] << endl;
    07784                 std::cout << "variables   isFree     ";
    07785                 std::cout << os->optimization->solution[i]->variables->basisStatus->isFree->el[0] << "  ";
    07786                 std::cout << os->optimization->solution[i]->variables->basisStatus->isFree->el[1] << "  ";
    07787                 std::cout << os->optimization->solution[i]->variables->basisStatus->isFree->el[2] << endl;
    07788                 std::cout << "variables   superbasic ";
    07789                 std::cout << os->optimization->solution[i]->variables->basisStatus->superbasic->el[0] << "  ";
    07790                 std::cout << os->optimization->solution[i]->variables->basisStatus->superbasic->el[1] << "  ";
    07791                 std::cout << os->optimization->solution[i]->variables->basisStatus->superbasic->el[2] << endl;
    07792                 std::cout << "variables   unknown    ";
    07793                 std::cout << os->optimization->solution[i]->variables->basisStatus->unknown->el[0] << "  ";
    07794                 std::cout << os->optimization->solution[i]->variables->basisStatus->unknown->el[1] << "  ";
    07795                 std::cout << os->optimization->solution[i]->variables->basisStatus->unknown->el[2] << endl;
    07796
    07797                 std::cout << std::endl;
    07798
    07799
    07800                 std::cout << "objectives  basic      ";
    07801                 std::cout << os->optimization->solution[i]->objectives->basisStatus->basic->el[0] << "  ";
    07802                 std::cout << os->optimization->solution[i]->objectives->basisStatus->basic->el[1] << "  ";
    07803                 std::cout << os->optimization->solution[i]->objectives->basisStatus->basic->el[2] << endl;
    07804                 std::cout << "objectives  atLower    ";
    07805                 std::cout << os->optimization->solution[i]->objectives->basisStatus->atLower->el[0] << "  ";
    07806                 std::cout << os->optimization->solution[i]->objectives->basisStatus->atLower->el[1] << "  ";
    07807                 std::cout << os->optimization->solution[i]->objectives->basisStatus->atLower->el[2] << endl;
    07808                 std::cout << "objectives  atUpper    ";
    07809                 std::cout << os->optimization->solution[i]->objectives->basisStatus->atUpper->el[0] << "  ";
    07810                 std::cout << os->optimization->solution[i]->objectives->basisStatus->atUpper->el[1] << "  ";
    07811                 std::cout << os->optimization->solution[i]->objectives->basisStatus->atUpper->el[2] << endl;
    07812                 std::cout << "objectives  isFree     ";
    07813                 std::cout << os->optimization->solution[i]->objectives->basisStatus->isFree->el[0] << "  ";
    07814                 std::cout << os->optimization->solution[i]->objectives->basisStatus->isFree->el[1] << "  ";
    07815                 std::cout << os->optimization->solution[i]->objectives->basisStatus->isFree->el[2] << endl;
    07816                 std::cout << "objectives  superbasic ";
    07817                 std::cout << os->optimization->solution[i]->objectives->basisStatus->superbasic->el[0] << "  ";
    07818                 std::cout << os->optimization->solution[i]->objectives->basisStatus->superbasic->el[1] << "  ";
    07819                 std::cout << os->optimization->solution[i]->objectives->basisStatus->superbasic->el[2] << endl;
    07820                 std::cout << "objectives  unknown    ";
    07821                 std::cout << os->optimization->solution[i]->objectives->basisStatus->unknown->el[0] << "  ";
    07822                 std::cout << os->optimization->solution[i]->objectives->basisStatus->unknown->el[1] << "  ";
    07823                 std::cout << os->optimization->solution[i]->objectives->basisStatus->unknown->el[2] << endl;
    07824
    07825                 std::cout << std::endl;
    07826
    07827                 std::cout << "constraints basic      ";
    07828                 std::cout << os->optimization->solution[i]->constraints->basisStatus->basic->el[0] << "  ";
    07829                 std::cout << os->optimization->solution[i]->constraints->basisStatus->basic->el[1] << "  ";
    07830                 std::cout << os->optimization->solution[i]->constraints->basisStatus->basic->el[2] << endl;
    07831                 std::cout << "constraints atLower    ";
    07832                 std::cout << os->optimization->solution[i]->constraints->basisStatus->atLower->el[0] << "  ";
    07833                 std::cout << os->optimization->solution[i]->constraints->basisStatus->atLower->el[1] << "  ";
    07834                 std::cout << os->optimization->solution[i]->constraints->basisStatus->atLower->el[2] << endl;
    07835                 std::cout << "constraints atUpper    ";
    07836                 std::cout << os->optimization->solution[i]->constraints->basisStatus->atUpper->el[0] << "  ";
    07837                 std::cout << os->optimization->solution[i]->constraints->basisStatus->atUpper->el[1] << "  ";
    07838                 std::cout << os->optimization->solution[i]->constraints->basisStatus->atUpper->el[2] << endl;
    07839                 std::cout << "constraints isFree     ";
    07840                 std::cout << os->optimization->solution[i]->constraints->basisStatus->isFree->el[0] << "  ";
    07841                 std::cout << os->optimization->solution[i]->constraints->basisStatus->isFree->el[1] << "  ";
    07842                 std::cout << os->optimization->solution[i]->constraints->basisStatus->isFree->el[2] << endl;
    07843                 std::cout << "constraints superbasic ";
    07844                 std::cout << os->optimization->solution[i]->constraints->basisStatus->superbasic->el[0] << "  ";
    07845                 std::cout << os->optimization->solution[i]->constraints->basisStatus->superbasic->el[1] << "  ";
    07846                 std::cout << os->optimization->solution[i]->constraints->basisStatus->superbasic->el[2] << endl;
    07847                 std::cout << "constraints unknown    ";
    07848                 std::cout << os->optimization->solution[i]->constraints->basisStatus->unknown->el[0] << "  ";
    07849                 std::cout << os->optimization->solution[i]->constraints->basisStatus->unknown->el[1] << "  ";
    07850                 std::cout << os->optimization->solution[i]->constraints->basisStatus->unknown->el[2] << endl;
    07851
    07852                 std::cout << std::endl;
    07853
    07854                 for (int k=0; k < os->optimization->solution[i]->variables->other[2]->numberOfEnumerations; k++)
    07855                 {
    07856                         std::cout << "other variable results --- enum " << k;
    07857                         std::cout << "  " << os->optimization->solution[i]->variables->other[2]->enumeration[k]->el[0];
    07858                         std::cout << "  " << os->optimization->solution[i]->variables->other[2]->enumeration[k]->el[1];
    07859                         std::cout << "  " << os->optimization->solution[i]->variables->other[2]->enumeration[k]->el[2];
    07860
    07861                         std::cout << std::endl;
    07862                 }
    07863
    07864                 std::cout << std::endl;
    07865
    07866                 for (int k=0; k < os->optimization->solution[i]->objectives->other[2]->numberOfEnumerations; k++)
    07867                 {
    07868                         std::cout << "other objective results --- enum " << k;
    07869                         std::cout << "  " << os->optimization->solution[i]->objectives->other[2]->enumeration[k]->el[0];
    07870                         std::cout << "  " << os->optimization->solution[i]->objectives->other[2]->enumeration[k]->el[1];
    07871                         std::cout << "  " << os->optimization->solution[i]->objectives->other[2]->enumeration[k]->el[2];
    07872
    07873                         std::cout << std::endl;
    07874                 }
    07875
    07876                 std::cout << std::endl;
    07877
    07878                 for (int k=0; k < os->optimization->solution[i]->constraints->other[2]->numberOfEnumerations; k++)
    07879                 {
    07880                         std::cout << "other constraint results --- enum " << k;
    07881                         std::cout << "  " << os->optimization->solution[i]->constraints->other[2]->enumeration[k]->el[0];
    07882                         std::cout << "  " << os->optimization->solution[i]->constraints->other[2]->enumeration[k]->el[1];
    07883                         std::cout << "  " << os->optimization->solution[i]->constraints->other[2]->enumeration[k]->el[2];
    07884
    07885                         std::cout << std::endl;
    07886                 }
    07887                 return;
    07888         }
    07889 }
    07890