本文整理汇总了C++中forcefields::ForceField::dimension方法的典型用法代码示例。如果您正苦于以下问题:C++ ForceField::dimension方法的具体用法?C++ ForceField::dimension怎么用?C++ ForceField::dimension使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类forcefields::ForceField
的用法示例。
在下文中一共展示了ForceField::dimension方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ForceField
ForceFields::ForceField *constructForceField(
const BoundsMatrix &mmat, RDGeom::PointPtrVect &positions,
const VECT_CHIRALSET &csets, double weightChiral, double weightFourthDim,
std::map<std::pair<int, int>, double> *extraWeights, double basinSizeTol) {
unsigned int N = mmat.numRows();
CHECK_INVARIANT(N == positions.size(), "");
ForceFields::ForceField *field =
new ForceFields::ForceField(positions[0]->dimension());
for (unsigned int i = 0; i < N; i++) {
field->positions().push_back(positions[i]);
}
for (unsigned int i = 1; i < N; i++) {
for (unsigned int j = 0; j < i; j++) {
double w = 1.0;
double l = mmat.getLowerBound(i, j);
double u = mmat.getUpperBound(i, j);
bool includeIt = false;
if (extraWeights) {
std::map<std::pair<int, int>, double>::const_iterator mapIt;
mapIt = extraWeights->find(std::make_pair(i, j));
if (mapIt != extraWeights->end()) {
w = mapIt->second;
includeIt = true;
}
}
if (u - l <= basinSizeTol) {
includeIt = true;
}
if (includeIt) {
DistViolationContrib *contrib =
new DistViolationContrib(field, i, j, u, l, w);
field->contribs().push_back(ForceFields::ContribPtr(contrib));
}
}
}
// now add chiral constraints
if (weightChiral > 1.e-8) {
for (VECT_CHIRALSET::const_iterator csi = csets.begin(); csi != csets.end();
csi++) {
ChiralViolationContrib *contrib =
new ChiralViolationContrib(field, csi->get(), weightChiral);
field->contribs().push_back(ForceFields::ContribPtr(contrib));
}
}
// finally the contribution from the fourth dimension if we need to
if ((field->dimension() == 4) && (weightFourthDim > 1.e-8)) {
for (unsigned int i = 1; i < N; i++) {
FourthDimContrib *contrib =
new FourthDimContrib(field, i, weightFourthDim);
field->contribs().push_back(ForceFields::ContribPtr(contrib));
}
}
return field;
} // constructForceField