当前位置: 首页>>代码示例>>C++>>正文


C++ OptionParser::getDoubleVector方法代码示例

本文整理汇总了C++中OptionParser::getDoubleVector方法的典型用法代码示例。如果您正苦于以下问题:C++ OptionParser::getDoubleVector方法的具体用法?C++ OptionParser::getDoubleVector怎么用?C++ OptionParser::getDoubleVector使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OptionParser的用法示例。


在下文中一共展示了OptionParser::getDoubleVector方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: setupOptions

Options setupOptions(int theArgc, char * theArgv[]){
	Options opt;

	OptionParser OP;

	OP.readArgv(theArgc, theArgv);
	OP.setRequired(opt.required);
	OP.setAllowed(opt.optional);

	if (OP.countOptions() == 0){
		cout << "Usage:" << endl;
		cout << endl;
		cout << "generateCoiledBundles --symmetry SYM --superHelicalRadius LOW HIGH STEP --alphaHelicalPhaseAngle LOW HIGH STEP --superHelicalPitchAngle LOW HIGH STEP --numberOfResidues NUM [ --d2zTranslation LOW HIGH STEP --superHelicalPhaseAngle LOW HIGH STEP --name OUTFILE]\n";
		cout << "Recommended parameters:" << endl;
		cout << "--symmetry: C2, C3, D2, D3, etc." << endl;
		cout << "--superHelicalRadius: radius from center in Angstroms" << endl;
		cout << "--alphaHelicalPhaseAngle: phase angle of the helices (0-360 degrees)" << endl;
		cout << "--superHelicalPitchAngle: often 5-20 degrees, but depends on the coil (average around 12)" << endl;
		cout << "--d2zTranslation: z offset between D_N symmetric coils, usually small" << endl;
		cout << "--superHelicalPhaseAngle: angle in degrees.  Value of 90/N for D_N typically works well, but larger and smaller values are possible" << endl;
		exit(0);
	}

	opt.symmetry = OP.getString("symmetry");
	if (OP.fail()){
		cerr << "ERROR 1111 symmetry not specified.\n";
		exit(1111);
	}
	opt.superHelicalRadius = OP.getDoubleVector("superHelicalRadius");
	if (OP.fail()){		   
		cerr << "ERROR 1111 superHelicalRadius not specified.\n";
		exit(1111);
	}

	opt.alphaHelicalPhaseAngle = OP.getDoubleVector("alphaHelicalPhaseAngle");
	if (OP.fail()){		   
		cerr << "ERROR 1111 alphaHelicalPhaseAngle not specified.\n";
		exit(1111);
	}

	opt.superHelicalPitchAngle = OP.getDoubleVector("superHelicalPitchAngle");
	if (OP.fail()){		   
		cerr << "ERROR 1111 superHelicalPitchAngle not specified.\n";
		exit(1111);
	}

	opt.numberOfResidues = OP.getInt("numberOfResidues");
	if (OP.fail()){		   
		cerr << "ERROR 1111 numberOfResidues not specified.\n";
		exit(1111);
	}

	opt.d2zTranslation         = OP.getDoubleVector("d2zTranslation");
	opt.superHelicalPhaseAngle = OP.getDoubleVector("superHelicalPhaseAngle");
	if (opt.d2zTranslation.size() == 0) { vector<double> tmp; tmp.push_back(0.0); tmp.push_back(1.0); tmp.push_back(100.0); opt.d2zTranslation = tmp; cerr << "Warning,  d2zTranslation not defined (required for D2, D3)" << endl; }
	if (opt.superHelicalPhaseAngle.size() == 0) {
		int _N = atoi(opt.symmetry.substr(1,(opt.symmetry.length()-1)).c_str());
		double recommendedValue = 90./double(_N);
		vector<double> tmp; tmp.push_back(recommendedValue); tmp.push_back((recommendedValue + 1.)); tmp.push_back(100.0); opt.superHelicalPhaseAngle = tmp; cerr << "Warning,  superHelicalPhaseAngle not defined (required for D2, D3)" << endl;
	}

	opt.name = OP.getString("name");
	if (OP.fail()){
		opt.name = "CoiledBundle";
	}

	return opt;
}
开发者ID:Suncuss,项目名称:mslib,代码行数:68,代码来源:generateCoiledCoils.cpp


注:本文中的OptionParser::getDoubleVector方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。