/home/coin/SVN-release/OS-2.3.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 
00023 
00024 #ifdef HAVE_CTIME
00025 # include <ctime>
00026 #else
00027 # ifdef HAVE_TIME_H
00028 #  include <time.h>
00029 # else
00030 #  error "don't have header file for time"
00031 # endif
00032 #endif 
00033 //===========================================================================//
00034 
00035 //===========================================================================//
00036 int main(int argc, char ** argv){
00037    try{
00038            OSColGenApp *colgenApp;
00039            OSOption *osoption = NULL;
00040            OSoLReader *osolreader = NULL;
00041            
00042            FileUtil *fileUtil = NULL;
00043            std::string osolFileName;
00044            std::string osol;
00045 
00046            //there should be 1 argument which is the option file
00047                 if (argc > 2) {
00048                         std::cout << "Too Many Input Parameters" << std::endl;
00049                         return 1;
00050                 }
00051 
00052                 if (argc < 2) {
00053                         std::cout << "usage: parsingtest <filename> " << std::endl;
00054                         return 1;
00055                 }
00056                 
00057                 
00058                 // define the classes
00059                 double cpuTime;
00060                 double start = CoinCpuTime();
00061                 fileUtil = new FileUtil();
00062                 osolFileName = argv[1];
00063                 osol = fileUtil->getFileAsString( osolFileName.c_str());
00064                 
00065                 // get the option object
00066                 osolreader = new OSoLReader();
00067                 osoption = osolreader->readOSoL( osol) ;
00068                 
00069                 
00070                 //now create the column generation object
00071                 colgenApp = new OSColGenApp( osoption);
00072                 
00073                 //now generate the restriced master
00074                 colgenApp->getInitialRestrictedMaster( );
00075                 //now solve the master
00076                 colgenApp->solveRestrictedMasterRelaxation();
00077                 
00078                 //garbage collection
00079                 delete fileUtil;
00080                 delete osolreader;
00081                 delete colgenApp;
00082                 
00083                 cpuTime = CoinCpuTime() - start;
00084                 
00085                 std::cout << "CPU TIME  " << cpuTime << std::endl;
00086    }
00087         catch(const ErrorClass& eclass){
00088                 std::cout << "Something went wrong:" << std::endl;
00089                 std::cout << eclass.errormsg << std::endl;
00090                 
00091       return 1;
00092    }
00093    return 0;
00094 }
00095 

Generated on Fri Nov 19 13:31:04 2010 by  doxygen 1.4.7