Esempio n. 1
0
void NodeCom::run(const LIGraph &LG, float y){
	//traverse all the node until all node join in at least one community
	vector<bool > inthis;      //if  in this community

	for(int i=0;i< LG.getV();i++){
		//v is the max influence node
		int v = InfluencePair[i].node;
		
		if(inflag[v]==0){
			//find the core

			//initialize
			inthis.assign(LG.getV(),false);

			create_Community(LG, v);
			int tempnode;
		//	int flag;
			int  runt = 2;
			//begin a round
			while(runt>=0){
		//		flag = 0;
				position = LG.getV();
			
				while(true){
				
					tempnode = get_NextNode(LG , y);
					if(tempnode == -1)break;
					if(inthis[tempnode] == true) continue;
					inthis[tempnode] = true;
		//			flag = 1;
					join_Node(LG, tempnode);
					
				}
		//		if(flag == 0) break;
				runt--;
			}
		}

	}
}
Esempio n. 2
0
Node *
newList_CallNode(char *name, Node * exprlist)
{
   char *s;

   NEWVAR(CallNode, ret);

   init_Node(ret, pass_CallNode, "call");
   join_Node((Node *) ret, exprlist);
   ret->name = name;
   for (s = ret->name; *s; ++s)
      *s = toupper(*s);
   ret->hash = hashstr(name);
   ret->argc = getCount_Node((Node *) ret);
   ret->isC = 1;
   ret->cfunc = curFunction;
   ins_name(name);
   curFunction->goto_trap_of_Function++;

   gettext_CallNode(ret);
   return (Node *) ret;
}