Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

unitTest.cpp

00001 // Copyright (C) 2000, International Business Machines
00002 // Corporation and others.  All Rights Reserved.
00003 // Test individual classes or groups of classes
00004 
00005 #if defined(_MSC_VER)
00006 // Turn off compiler warning about long names
00007 #  pragma warning(disable:4786)
00008 #endif
00009 
00010 #include <string>
00011 #include <cstring>
00012 #include <cassert>
00013 #include <iostream>
00014 #include <cstdlib>
00015 
00016 #ifdef COIN_USE_OSL
00017 #include <OsiOslSolverInterface.hpp>
00018 #endif
00019 #ifdef COIN_USE_CLP
00020 #include <OsiClpSolverInterface.hpp>
00021 #endif
00022 #ifdef COIN_USE_XPR
00023 #include <OsiXprSolverInterface.hpp>
00024 #endif
00025 
00026 #include "CglSimpleRounding.hpp"
00027 #include "CglKnapsackCover.hpp"
00028 #include "CglOddHole.hpp"
00029 #include "CglProbing.hpp"
00030 #include "CglGomory.hpp"
00031 //#include "CglFlowCover.hpp"
00032 
00033 
00034 // Function Prototypes. Function definitions is in this file.
00035 void testingMessage( const char * const msg );
00036 
00037 // Command line parameter is directory containing data files.
00038 // If not specified, then "../Mps/Sample/" is used.
00039 
00040 int main (int argc, const char *argv[])
00041 {
00042   // Set directory containing data files.
00043   std::string mpsDir;
00044   if ( argc >= 2 ) mpsDir = argv[1];
00045   else mpsDir ="../Mps/Sample/";
00046 
00047 #ifdef COIN_USE_OSL
00048   {
00049     OsiOslSolverInterface oslSi;
00050     testingMessage( "Testing CglGomory with OsiOslSolverInterface\n" );
00051     CglGomoryUnitTest(&oslSi,mpsDir);
00052   }  
00053   {
00054     OsiOslSolverInterface oslSi;
00055     testingMessage( "Testing CglSimpleRounding with OsiOslSolverInterface\n" );
00056     CglSimpleRoundingUnitTest(&oslSi,mpsDir);
00057   } 
00058   {
00059     OsiOslSolverInterface oslSi;
00060     testingMessage( "Testing CglKnapsackCover with OsiOslSolverInterface\n" );
00061     CglKnapsackCoverUnitTest(&oslSi,mpsDir);
00062   }  
00063   {
00064     OsiOslSolverInterface oslSi;
00065     testingMessage( "Testing CglOddHole with OsiOslSolverInterface\n" );
00066     CglOddHoleUnitTest(&oslSi,mpsDir);
00067   }  
00068   {
00069     OsiOslSolverInterface oslSi;
00070     testingMessage( "Testing CglProbing with OsiOslSolverInterface\n" );
00071     CglProbingUnitTest(&oslSi,mpsDir);
00072   }  
00073   {
00074     OsiOslSolverInterface oslSi;
00075     //    testingMessage( "Testing CglFlowCover with OsiOslSolverInterface\n" );
00076     //    CglFlowCoverUnitTest(&oslSi,mpsDir);
00077   }
00078 
00079 #endif
00080 #ifdef COIN_USE_XPR
00081   {
00082     OsiXprSolverInterface xprSi;
00083     testingMessage( "Testing CglSimpleRounding with OsiXprSolverInterface\n" );
00084     CglSimpleRoundingUnitTest(&xprSi,mpsDir);
00085   } 
00086   {
00087     OsiXprSolverInterface xprSi;
00088     testingMessage( "Testing CglKnapsackCover with OsiXprSolverInterface\n" );
00089     CglKnapsackCoverUnitTest(&xprSi,mpsDir);
00090   }  
00091   {
00092     OsiXprSolverInterface xprSi;
00093     testingMessage( "Testing CglOddHole with OsiXprSolverInterface\n" );
00094     CglOddHoleUnitTest(&xprSi,mpsDir);
00095   }  
00096   {
00097     OsiXprSolverInterface xprSi;
00098     testingMessage( "Testing CglProbing with OsiXprSolverInterface\n" );
00099     CglProbingUnitTest(&xprSi,mpsDir);
00100   }  
00101   {
00102     OsiXprSolverInterface xprSi;
00103     //    testingMessage( "Testing CglFlowCover with OsiXprSolverInterface\n" );
00104     //    CglFlowCoverUnitTest(&xprSi,mpsDir);
00105   }
00106 
00107 #endif
00108 #ifdef COIN_USE_CLP
00109   {
00110     OsiClpSolverInterface clpSi;
00111     testingMessage( "Testing CglGomory with OsiClpSolverInterface\n" );
00112     CglGomoryUnitTest(&clpSi,mpsDir);
00113   }  
00114   {
00115     OsiClpSolverInterface clpSi;
00116     testingMessage( "Testing CglSimpleRounding with OsiClpSolverInterface\n" );
00117     CglSimpleRoundingUnitTest(&clpSi,mpsDir);
00118   } 
00119   {
00120     OsiClpSolverInterface clpSi;
00121     testingMessage( "Testing CglKnapsackCover with OsiClpSolverInterface\n" );
00122     CglKnapsackCoverUnitTest(&clpSi,mpsDir);
00123   }  
00124   {
00125     OsiClpSolverInterface clpSi;
00126     testingMessage( "Testing CglOddHole with OsiClpSolverInterface\n" );
00127     CglOddHoleUnitTest(&clpSi,mpsDir);
00128   }  
00129   {
00130     OsiClpSolverInterface clpSi;
00131     testingMessage( "Testing CglProbing with OsiClpSolverInterface\n" );
00132     CglProbingUnitTest(&clpSi,mpsDir);
00133   }  
00134   {
00135     OsiClpSolverInterface clpSi;
00136     //    testingMessage( "Testing CglFlowCover with OsiClpSolverInterface\n" );
00137     //    CglFlowCoverUnitTest(&clpSi,mpsDir);
00138   }
00139 
00140 #endif
00141   testingMessage( "All tests completed successfully\n" );
00142   return 0;
00143 }
00144 
00145  
00146 // Display message on stdout and stderr
00147 void testingMessage( const char * const msg )
00148 {
00149    std::cerr <<msg;
00150    //cout <<endl <<"*****************************************"
00151    //     <<endl <<msg <<endl;
00152 }
00153 

Generated on Wed Dec 3 14:34:56 2003 for Cgl by doxygen 1.3.5