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


C++ CMol::Count_All_Atoms_Connected方法代码示例

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


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

示例1: Get_Representative_14_Atoms

void Get_Representative_14_Atoms(int iDih)
{
	int ia, ib, ic, id, i, Idx, nAtom_Connected, nAtom_Connected_Max=0;

	ib = Dih_Bond[iDih][1];
	ic = Dih_Bond[iDih][2];

	//start	to find the representative atom for the left side, ia
	nAtom_Connected_Max=-100;
	ia = -1;
	for(i=0; i<Bond_Count[ib]; i++)	{
		Idx = Bond_List[ib][i];
		if(Idx == ic)	{
			continue;
		}
		nAtom_Connected = Mol.Count_All_Atoms_Connected(Idx, ib);
		if(nAtom_Connected > nAtom_Connected_Max)	{
			nAtom_Connected_Max = nAtom_Connected;
			ia = Idx;
		}
		else if( (i!=0) && (nAtom_Connected == nAtom_Connected_Max) && (Mol.mass[Idx] > Mol.mass[ia]) )	{
			ia = Idx;
		}
	}
	if(ia>=0)	{
		Dih_Bond[iDih][0] = ia;
	}
	else	{
		Quit_With_Error_Msg("Fail to find the representative atom (heavy atom), ia, in dihedral.\nQuit\n");
	}
	//end	to find the representative atom for the left side, ia


	//start	to find the representative atom for the left side, ia
	nAtom_Connected_Max=-100;
	id = -1;
	for(i=0; i<Bond_Count[ic]; i++)	{
		Idx = Bond_List[ic][i];
		if(Idx == ib)	{
			continue;
		}
		nAtom_Connected = Mol.Count_All_Atoms_Connected(Idx, ic);
		if(nAtom_Connected > nAtom_Connected_Max)	{
			nAtom_Connected_Max = nAtom_Connected;
			id = Idx;
		}
		else if( (i!=0) && (nAtom_Connected == nAtom_Connected_Max) && (Mol.mass[Idx] > Mol.mass[id]) )	{
			id = Idx;
		}
	}
	if(id>=0)	{
		Dih_Bond[iDih][3] = id;
	}
	else	{
		Quit_With_Error_Msg("Fail to find the representative atom (heavy atom), id, in dihedral.\nQuit\n");
	}
	//end	to find the representative atom for the left side, ia

	return;
}
开发者ID:mj-harvey,项目名称:gaamp-local,代码行数:60,代码来源:gen_soft_list-org.cpp


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