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


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

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


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

示例1: Read_Soft_DihedralList

int Read_Soft_DihedralList(void)
{
    FILE *fIn;
    int ReadItem;
    char szLine[256], *ReadLine, ErrorMsg[256], szFlag[256];

    n_Phi = 0;

    fIn = fopen(szPhiToScan, "r");

    while(1)	{
        if(feof(fIn))	{
            sprintf(ErrorMsg, "Fail to open file: %s\nQuit\n", szPhiToScan);
            Quit_With_Error_Msg(ErrorMsg);
        }
        ReadLine = fgets(szLine, 128, fIn);
        if(ReadLine == NULL)	{
            break;
        }

        ReadItem = sscanf(szLine, "%d %d %d %d %s",
                          &(DihList[n_Phi][0]), &(DihList[n_Phi][1]), &(DihList[n_Phi][2]), &(DihList[n_Phi][3]), szFlag);

        if(ReadItem >= 4)	{
            DihList[n_Phi][0]--;
            DihList[n_Phi][1]--;
            DihList[n_Phi][2]--;
            DihList[n_Phi][3]--;
            IdxDihSelect[n_Phi] = Mol_ESP.Query_Dihedral_Index(DihList[n_Phi][0], DihList[n_Phi][1], DihList[n_Phi][2], DihList[n_Phi][3]);

            if(IdxDihSelect[n_Phi] < 0)	{
                Quit_With_Error_Msg("Fail to identify the index of one soft dihedral.\n");
            }

            Is_Dih_Fixed[n_Phi] = 0;
            if(ReadItem==5)	{
                if( (strcmp(szFlag, "F")==0) || (strcmp(szFlag, "f")==0) )	{
                    Is_Dih_Fixed[n_Phi] = 1;
                }
            }

            n_Phi++;
        }
        else	{
            break;
        }
    }

    fclose(fIn);

    Setup_Phi_Constraint_List();

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

示例2: Read_Soft_DihedralList

int Read_Soft_DihedralList(void)
{
	FILE *fIn;
	int ReadItem;
	char szLine[256], *ReadLine;

	n_Phi = 0;

	fIn = fopen(szPhiToScan, "r");

	while(1)	{
		if(feof(fIn))	{
			break;
		}
		ReadLine = fgets(szLine, 128, fIn);
		if(ReadLine == NULL)	{
			break;
		}

		ReadItem = sscanf(szLine, "%d %d %d %d %lf %lf %lf %lf %lf %lf", 
			&(DihList[n_Phi][0]), &(DihList[n_Phi][1]), &(DihList[n_Phi][2]), &(DihList[n_Phi][3]), 
			&(Phi_Set[n_Phi][0]), &(Phi_Set[n_Phi][1]), &(Phi_Set[n_Phi][2]), &(Phi_Set[n_Phi][3]), &(Phi_Set[n_Phi][4]), &(Phi_Set[n_Phi][5]));

		if(ReadItem > 4)	{
			DihList[n_Phi][0]--;
			DihList[n_Phi][1]--;
			DihList[n_Phi][2]--;
			DihList[n_Phi][3]--;
			IdxDihSelect[n_Phi] = Mol.Query_Dihedral_Index(DihList[n_Phi][0], DihList[n_Phi][1], DihList[n_Phi][2], DihList[n_Phi][3]);

			if(IdxDihSelect[n_Phi] < 0)	{
				Quit_With_Error_Msg("Fail to identify the index of one soft dihedral.\n");
			}
			Mol.BuildSegmentList_Dihedrals(IdxDihSelect[n_Phi]);

			n_State_List[n_Phi] = ReadItem - 4;
			n_Phi++;
		}
		else	{
			break;
		}
	}

	fclose(fIn);

	memcpy(Phi_Set_Save, Phi_Set, sizeof(double)*N_MAX_DIH*MAX_N_STATE);
	memcpy(n_State_List_Save, n_State_List, sizeof(int)*N_MAX_DIH);

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

示例3: Read_Soft_DihedralList

int Read_Soft_DihedralList(void)
{
	FILE *fIn;
	int ReadItem;
	char szLine[256], *ReadLine;

	n_Phi = 0;

	fIn = fopen(szPhiToScan, "r");

	while(1)	{
		if(feof(fIn))	{
			break;
		}
		ReadLine = fgets(szLine, 128, fIn);
		if(ReadLine == NULL)	{
			break;
		}

		ReadItem = sscanf(szLine, "%d %d %d %d", 
			&(DihList[n_Phi][0]), &(DihList[n_Phi][1]), &(DihList[n_Phi][2]), &(DihList[n_Phi][3]));

		if(ReadItem == 4)	{
			DihList[n_Phi][0]--;
			DihList[n_Phi][1]--;
			DihList[n_Phi][2]--;
			DihList[n_Phi][3]--;
			IdxDihSelect[n_Phi] = Mol_ESP.Query_Dihedral_Index(DihList[n_Phi][0], DihList[n_Phi][1], DihList[n_Phi][2], DihList[n_Phi][3]);

			if(IdxDihSelect[n_Phi] < 0)	{
				Quit_With_Error_Msg("Fail to identify the index of one soft dihedral.\n");
			}
			n_Phi++;
		}
		else	{
			break;
		}
	}

	fclose(fIn);

	Setup_Phi_Constraint_List();

	return n_Phi;
}
开发者ID:PabloHN,项目名称:htmd,代码行数:45,代码来源:1d_fitting_asymmetric.cpp


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