?? analyzer_degree.cpp
字號:
#include "analyzer_degree.h"void analyze_degree(string topologyDirectory, int nodi, map<int, int> & degree_id, map<int, int> & degree_degree, map<int, int> & degree_altro){ Graph graph; degree_id.clear(); degree_degree.clear(); int tmp1, tmp2, i; for (i = 0; i < 300; i++) { string tmpFile; ostringstream fileName(tmpFile, ios::out); fileName << topologyDirectory << "/" << nodi << "/graphS" << i << "N" << nodi; // Carica il file di topologia dalla directory di topologia. loadFromFile(fileName.str().c_str(), graph); for (Graph::iterator n = graph.begin(); n != graph.end(); n++) { tmp1 = 0; tmp2 = 0; // Conta tutti i vicini maggiori di un nodo a seconda del // criterio di maggioranza. for (NodeList::iterator nn = n->second.begin(); nn != n->second.end(); nn++) { if ((*nn) > (n->first)) tmp1++; if ((graph[*nn].size() > n->second.size()) || ((graph[*nn].size() == n->second.size()) && ((*nn) > n->first))) tmp2++; } degree_id[tmp1]++; degree_degree[tmp2]++; degree_altro[tmp2 - tmp1]++; } }}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -