/home/coin/SVN-release/OS-2.4.0/OS/applications/columnGen/code/OSColGenMain.cpp

Go to the documentation of this file.
00001 //===========================================================================//
00002 //Id: OSColGenMain.cpp 3561 2010-06-24 19:27:07Z kmartin $                                               //
00015 //===========================================================================//
00016 
00017 
00018 //===========================================================================//
00019 #include "OSColGenApp.h"
00020 #include "OSFileUtil.h" 
00021 #include "CoinTime.hpp"
00022 #include "OSGeneral.h"
00023 
00024 
00025 
00026 #ifdef HAVE_CTIME
00027 # include <ctime>
00028 #else
00029 # ifdef HAVE_TIME_H
00030 #  include <time.h>
00031 # else
00032 #  error "don't have header file for time"
00033 # endif
00034 #endif 
00035 //===========================================================================//
00036 
00037 //===========================================================================//
00038 int main(int argc, char ** argv){
00039    try{
00040            
00041         
00042            OSColGenApp *colgenApp;
00043            OSOption *osoption = NULL;
00044            OSoLReader *osolreader = NULL;
00045            
00046            FileUtil *fileUtil = NULL;
00047            std::string osolFileName;
00048            std::string osol;
00049 
00050            //there should be 1 argument which is the option file
00051                 if (argc > 2) {
00052                         std::cout << "Too Many Input Parameters" << std::endl;
00053                         return 1;
00054                 }
00055 
00056                 if (argc < 2) {
00057                         std::cout << "usage: parsingtest <filename> " << std::endl;
00058                         return 1;
00059                 }
00060                 
00061                 
00062                 // define the classes
00063                 double cpuTime;
00064                 double masterCpuTime;
00065                 double start = CoinCpuTime();
00066                 fileUtil = new FileUtil();
00067                 osolFileName = argv[1];
00068                 osol = fileUtil->getFileAsString( osolFileName.c_str());
00069                 
00070                 // get the option object
00071                 osolreader = new OSoLReader();
00072                 osoption = osolreader->readOSoL( osol) ;
00073                 
00074                 
00075                 //now create the column generation object
00076                 colgenApp = new OSColGenApp( osoption);
00077                 
00078                  
00079                 //now generate the restriced master
00080                 //colgenApp->getInitialRestrictedMaster( );
00081                 
00082                 colgenApp->getInitialRestrictedMaster( );
00083                 
00084                 
00085                 masterCpuTime = CoinCpuTime() - start;
00086                 
00087                 //exit( 1);
00088                 //now solve the problem
00089                 colgenApp->solve();
00090                 
00091                 //garbage collection
00092                 delete fileUtil;
00093                 delete osolreader;
00094                 delete colgenApp;
00095                 
00096                 cpuTime = CoinCpuTime() - start;
00097                 
00098                 std::cout << "CPU TIME FOR GETTING INITIAL SOLUTION " << masterCpuTime << std::endl;
00099                 
00100                 std::cout << "CPU TIME  " << cpuTime << std::endl;
00101    }
00102         catch(const ErrorClass& eclass){
00103                 std::cout << "Something went wrong:" << std::endl;
00104                 std::cout << eclass.errormsg << std::endl;
00105                 
00106       return 1;
00107    }
00108    return 0;
00109 }
00110 

Generated on Thu Sep 22 03:06:00 2011 by  doxygen 1.4.7