本文整理汇总了C++中Conformer::getNumAtoms方法的典型用法代码示例。如果您正苦于以下问题:C++ Conformer::getNumAtoms方法的具体用法?C++ Conformer::getNumAtoms怎么用?C++ Conformer::getNumAtoms使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Conformer
的用法示例。
在下文中一共展示了Conformer::getNumAtoms方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: computeConfBox
void computeConfBox(const Conformer &conf, RDGeom::Point3D &leftBottom,
RDGeom::Point3D &rightTop, const RDGeom::Transform3D *trans,
double padding) {
double xmin, xmax, ymin, ymax, zmin, zmax;
xmin = ymin = zmin = 1.e8;
xmax = ymax = zmax = -1.e8;
unsigned int i, nAtms = conf.getNumAtoms();
for (i = 0; i < nAtms; ++i) {
RDGeom::Point3D loc = conf.getAtomPos(i);
if (trans) {
trans->TransformPoint(loc);
}
xmax = std::max(xmax, loc.x);
xmin = std::min(xmin, loc.x);
ymax = std::max(ymax, loc.y);
ymin = std::min(ymin, loc.y);
zmax = std::max(zmax, loc.z);
zmin = std::min(zmin, loc.z);
}
RDGeom::Point3D padPt(padding, padding, padding);
leftBottom.x = xmin;
leftBottom.y = ymin;
leftBottom.z = zmin;
rightTop.x = xmax;
rightTop.y = ymax;
rightTop.z = zmax;
leftBottom -= padPt;
rightTop += padPt;
}
示例2: _fillAtomPositions
void _fillAtomPositions(RDGeom::Point3DConstPtrVect &pts, const Conformer &conf,
const std::vector<unsigned int> *atomIds = 0) {
unsigned int na = conf.getNumAtoms();
pts.clear();
if (atomIds == 0) {
unsigned int ai;
pts.reserve(na);
for (ai = 0; ai < na; ++ai) {
pts.push_back(&conf.getAtomPos(ai));
}
} else {
pts.reserve(atomIds->size());
std::vector<unsigned int>::const_iterator cai;
for (cai = atomIds->begin(); cai != atomIds->end(); cai++) {
pts.push_back(&conf.getAtomPos(*cai));
}
}
}
示例3: CalcAllMORSE
std::vector<double> CalcAllMORSE(const ROMol &mol, const Conformer &conf){
int numAtoms = conf.getNumAtoms();
int confId = conf.getId();
std::vector<double> R = getG(32);
std::vector<double> R1;
std::vector<double> R2;
std::vector<double> R3;
std::vector<double> R4;
std::vector<double> R5;
std::vector<double> R6;
std::vector<double> R7;
double *DM = MolOps::get3DDistanceMat(mol,confId);
std::vector<double> Mass = moldata3D.GetRelativeMW(mol);
std::vector<double> RelativePol = moldata3D.GetRelativePol(mol);
std::vector<double> IonPol = moldata3D.GetRelativeIonPol(mol);
std::vector<double> RelativeElectroNeg = moldata3D.GetRelativeENeg(mol);
std::vector<double> RelativeVdW = moldata3D.GetRelativeVdW(mol);
double p;
for (int i = 0; i < R.size(); i++) {
double res1=0.0;
double res2=0.0;
double res3=0.0;
double res4=0.0;
double res5=0.0;
double res6=0.0;
for (int j = 0; j < numAtoms - 1; j++) {
for (int k = j + 1; k < numAtoms; k++) {
if (i==0) {
p= 1;
}
else {
p = sin(R[i] * DM[j * numAtoms + k]) / (R[i] * DM[j * numAtoms + k]);
}
res1 += p;
res2 += Mass[j] * Mass[k] * p;
res3 += RelativeVdW[j] * RelativeVdW[k] * p;
res4 += RelativeElectroNeg[j] * RelativeElectroNeg[k] * p;
res5 += RelativePol[j] * RelativePol[k] * p;
res6 += IonPol[j] * IonPol[k] * p;
}
}
R1.push_back(round( 1000 * res1) / 1000);
R2.push_back(round( 1000 * res2) / 1000);
R3.push_back(round( 1000 * res3) / 1000);
R4.push_back(round( 1000 * res4) / 1000);
R5.push_back(round( 1000 * res5) / 1000);
R6.push_back(round( 1000 * res6) / 1000);
}
// remove the H and change number of Atoms only takes HeavyAtoms
// const ROMol *molnoH = MolOps::removeHs(mol, false, false); // return the copy of the molecule without Hs!
//int numAtomsnoH = molnoH->getNumAtoms();
//std::cout << "nA1:" << numAtoms << ",nA2;" << numAtomsnoH <<"\n";
// double *DMnoH = MolOps::get3DDistanceMat(*molnoH,confId);
std::vector<double> IState = prepareIState(mol,confId); // moldata3D.GetEState2(mol);
for (int i = 0; i < R.size(); i++) {
double res7 = 0.0;
for (int j = 0; j < numAtoms - 1; j++) {
for (int k = j + 1; k < numAtoms; k++) {
if (i==0) {
p= 1;
}
else {
p = sin(R[i] * DM[j * numAtoms + k]) / (R[i] * DM[j * numAtoms + k]);
}
res7 += IState[j] * IState[k] * p;
}
}
R7.push_back(round( 1000 * res7) / 1000);
}
R1.insert(R1.end(),R2.begin(), R2.end());
R1.insert(R1.end(),R3.begin(), R3.end());
R1.insert(R1.end(),R4.begin(), R4.end());
R1.insert(R1.end(),R5.begin(), R5.end());
R1.insert(R1.end(),R6.begin(), R6.end());
R1.insert(R1.end(),R7.begin(), R7.end());
return R1;
}