My Project
CliqPerc.h
Go to the documentation of this file.
00001 #ifndef CLIQPERC_H
00002 #define CLIQPERC_H
00003 
00004 #include "cluster.h"
00005 
00015  template <typename R>
00016  class CliqueCluster: public ClusterAlg<R>
00017  {
00018   public:
00024     CliqueCluster(string a){
00025         this->args = "CliqueParams " + a;
00026         /*Get the clique size to percolate */
00027         vector <string> aa;
00028         boost::split(aa, this->args, boost::is_any_of(" "));
00029         
00030         char** av = new char*[aa.size()];
00031         for (sui r = 0; r < aa.size();r++){
00032           av[r] = (char*)(malloc((aa[r].size() + 1) * sizeof(char)));
00033           strcpy(av[r], aa[r].c_str());
00034         }
00035         map <string, vector < string > > subParam = getParameters(aa.size(), av);
00036         map <string, vector < string > >::iterator it_sub;
00037         
00038         if ((it_sub = subParam.find("k")) != subParam.end()){
00039           ks = it_sub->second[0];
00040         } else {
00041           cerr << "Invalid Clique Percolation Params (need size (-k))" << endl;
00042           exit(2);
00043         }
00044         
00045         this->dens = new complex_density<bidirected_t>(0);
00046     };
00047     
00053     ~CliqueCluster(){};
00054     
00058     void calculate();
00059   private:
00060     string ks;
00061   };
00062 #endif
 All Classes Files Functions Variables Typedefs