Main Page   Compound List   File List   Compound Members   File Members   Related Pages  

graph.cpp

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*/
00016 /*---------------------------------------------------------------------------*/
00017 
00018 #include <iostream>
00019 #include <string>  
00020 #include <vector>
00021 #include <fstream>
00022 
00023 #include <cstdio>
00024 #include <cstdlib>
00025 #include <cmath>
00026 #include <cassert>
00027 #include <ctime>
00028 
00029 #include "graphCharac.hh"
00030 
00031 using namespace std;
00032  
00033 
00036 void usage(std::string argv0) {
00037     std::cout <<"\nAuthor : Patrick HEAS        \n";
00038     std::cout << "\nusage: " << ">"
00039               << argv0 <<std::endl; 
00040     std::cout << "TLs_FileName\tMT_FileName\tFSDimension\tlines\trows\tGraphOutPutFormat\tIntegrationResolutionFactor (default:10.)\tIntensiveComputation (1= yes/0= no)\n" << std::endl;     
00041     std::cout <<"for the GraphOutPutFormat:\n\t1:standard\n\t2:adapted to the actual learning algorithms and visualisation by the GUI\n\t3:adapted to the actual learning algorithms and visualisation without edges by the GUI"<<std::endl; 
00042     std::cout << "\n*****************************************************************************************************************************************\n";
00043   }
00044 
00062 int main(int argc, char *argv [])
00063 {   
00064  
00065         std::string ifn1;
00066         std::string ifn2;
00067         unsigned long   int         nb_bands             = 0;
00068         unsigned long   int         dimx                 = 0;
00069         unsigned long   int         dimy                 = 0;
00070         int                         format               = 2;
00071         float                       PrecisionFactor      = 10.;
00072         int                         intensiveCalculus    =0;
00073         switch (argc-1) {
00074                 case 8:  intensiveCalculus      = atoi(argv[8]);
00075                 case 7:  PrecisionFactor        = atof(argv[7]);
00076                 case 6:  format                 = atoi(argv[6]);
00077                 case 5:  dimy                   = atoi(argv[5]); 
00078                 case 4:  dimx                   = atoi(argv[4]);
00079                 case 3:  nb_bands               = atoi(argv[3]);
00080                 case 2:  ifn2                   = std::string(argv[2]);
00081                 case 1:  ifn1                   = std::string(argv[1]); break;
00082                 case 0:
00083                 default: usage(argv[0]); return -1;
00084         }
00085         if ((argc-1) < 5) { usage(argv[0]); return -1;}
00086         std::cout << "> " << argv[0] 
00087               << " " << ifn1 
00088               << " " << ifn2
00089               << " " << nb_bands 
00090               << " " << dimx 
00091               << " " << dimy
00092               << " " << format
00093               << " " << PrecisionFactor
00094               << " " << intensiveCalculus<< std::endl;
00095              
00096         srand((unsigned)time(NULL));
00097         time_t tdeb, t1,t2;
00098         time(&tdeb);
00099         t1=tdeb;
00100         
00101 /*****************Building the Graph*****************************************************************/
00103         GraphDynaCluster graph;
00105         graph.Initialise((char *)ifn1.c_str(),(char *)ifn2.c_str(),dimx,dimy,nb_bands);
00107         graph.Build(PrecisionFactor);
00108         
00109 /*****************Mutual Information in consecutive time for each MT class **************************/
00110         std::cout<<"MI"<<std::endl;
00112         graph.MIEstimation();
00113         
00114 /*****************OutPutSaving***********************************************************************/          
00115         std::cout<<"OutPut..."<<std::endl;
00116         bool aux=false;
00117         if (intensiveCalculus==1){aux=true;}
00119         graph.Out_Evolutions(format, aux);
00120 /****************************************************************************************************/
00121         
00122         time(&t2);
00123         cout<< "Processing time duration : "<<t2-t1<<" seconds."<<endl;
00124         return 0;
00125 }

Generated on Thu Feb 17 11:01:55 2005 for Inference of a Graph of Dynamic Cluster Trajectories by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002