My Project
|
00001 #ifndef SLPA_H 00002 #define SLPA_H 00003 00004 #include "cluster.h" 00005 00012 template <typename R> 00013 class SLPA: public ClusterAlg<R>{ 00014 public: 00015 00022 SLPA(string a){ 00023 this->args = a; 00024 00025 vector <string> aa; 00026 string extendArg = ("SLPAParam " + this->args); 00027 boost::split(aa, extendArg, boost::is_any_of(" ")); 00028 00029 char** av = new char*[aa.size()]; 00030 for (sui r = 0; r < aa.size();r++){ 00031 av[r] = (char*)(malloc((aa[r].size() + 1) * sizeof(char))); 00032 strcpy(av[r], aa[r].c_str()); 00033 } 00034 map <string, vector < string > > subParam = getParameters(aa.size(), av); 00035 map <string, vector < string > >::iterator it_sub; 00036 if ((it_sub = subParam.find("r")) != subParam.end()){ 00037 threshold = it_sub->second[0]; 00038 } 00039 00040 this->dens = new complex_density<bidirected_t>(0); 00041 }; 00042 00047 ~SLPA(){}; 00048 00052 void calculate(); 00053 00054 private: 00055 string threshold, runs, iterations; 00056 }; 00057 00058 #endif