00001
00002
00003
00004
00005 #if defined(_MSC_VER)
00006
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
00032
00033
00034
00035 void testingMessage( const char * const msg );
00036
00037
00038
00039
00040 int main (int argc, const char *argv[])
00041 {
00042
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
00076
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
00104
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
00137
00138 }
00139
00140 #endif
00141 testingMessage( "All tests completed successfully\n" );
00142 return 0;
00143 }
00144
00145
00146
00147 void testingMessage( const char * const msg )
00148 {
00149 std::cerr <<msg;
00150
00151
00152 }
00153