當前位置: 首頁>>代碼示例>>C++>>正文


C++ ProgramState::setMolloyReedGraph方法代碼示例

本文整理匯總了C++中ProgramState::setMolloyReedGraph方法的典型用法代碼示例。如果您正苦於以下問題:C++ ProgramState::setMolloyReedGraph方法的具體用法?C++ ProgramState::setMolloyReedGraph怎麽用?C++ ProgramState::setMolloyReedGraph使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ProgramState的用法示例。


在下文中一共展示了ProgramState::setMolloyReedGraph方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: main


//.........這裏部分代碼省略.........
			if (!args_info->r_given) {
				usageErrorMessage("Extended Hot graph generation requires the parameter user to selected the edges in the graph after connecting a vertex.");
				ERROR_EXIT;
			}

			if (!args_info->t_given) {
				usageErrorMessage("Extended Hot graph generation requires the parameter user select between how many loops the core is recalculated.");
				ERROR_EXIT;
			}

 			int n = args_info->n_arg;
 			int m = args_info->m_arg;
 			float xi = args_info->xi_arg;
 			int q = args_info->q_arg;
 			float r = args_info->r_arg;
 			int t = args_info->t_arg;
 			VALIDATE_POS(n);
 			VALIDATE_POS(m);
 			VALIDATE_POS(q);
 			VALIDATE_POS(xi);
 			VALIDATE_POS(r);
 			VALIDATE_POS(t);

 			state->setExtendedHotGraph(m, n, xi, q, r, t);
 			cout << "Succesfully created an Extended Hot graph with " + to_string(n) + " nodes.\n";

		} else if (args_info->molloy_given) {
			if (!args_info->ks_given) {
				usageErrorMessage("A file with Ks and its nodes is needed to create a Molloy Reed graph.");
				ERROR_EXIT;
			}

			string path = args_info->ks_arg;
			state->setMolloyReedGraph(path);
		} else if (args_info->hyperbolic_given) {
			if (!args_info->n_given) {
				usageErrorMessage("Hiperbolic graph generation requires a number of nodes.");
				ERROR_EXIT;
			}
			if (!args_info->a_given) {
				usageErrorMessage("Hiperbolic graph generation requires a radial density.");
				ERROR_EXIT;
			}
			if (!args_info->deg_given) {
				usageErrorMessage("Hiperbolic graph generation requires an average node degree.");
				ERROR_EXIT;
			}
			int n = args_info->n_arg;
			float a = args_info->a_arg;
			float c  = args_info->deg_arg;
			state->setHiperbolicGraph(n, a, c);
			
		} else {
			usageErrorMessage("A network must be specified in order to work.");
			ERROR_EXIT;
		}
		
		if (args_info->betweenness_given) {
			//if (state->isWeighted()) {
			//	errorMessage("Betweenness for weighted graphs is not supported.");
			//	ERROR_EXIT;
			//}else{
			printf("Weighted Betweenness");
				int vertex_id = args_info->betweenness_arg;
				double ret = state->betweenness((unsigned int)args_info->betweenness_arg);
				if(ret != -1) {
開發者ID:alemedve,項目名稱:complexnets,代碼行數:67,代碼來源:main.cpp


注:本文中的ProgramState::setMolloyReedGraph方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。