本文整理汇总了C++中AtomMask::MaskExpression方法的典型用法代码示例。如果您正苦于以下问题:C++ AtomMask::MaskExpression方法的具体用法?C++ AtomMask::MaskExpression怎么用?C++ AtomMask::MaskExpression使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AtomMask
的用法示例。
在下文中一共展示了AtomMask::MaskExpression方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetupBlock
//.........这里部分代码省略.........
else if (MH.varType_ == RESIDUES) {
int curRes = -1;
for (AtomMask::const_iterator at = currentMask.begin(); at != currentMask.end(); ++at) {
int res = (*currentTop)[*at].ResNum();
if (res != curRes) {
MH.Idxs_.push_back( res );
curRes = res;
}
}
} else if (MH.varType_ == MOLECULES ||
MH.varType_ == MOLFIRSTRES ||
MH.varType_ == MOLLASTRES)
{
int curMol = -1;
for (AtomMask::const_iterator at = currentMask.begin(); at != currentMask.end(); ++at) {
int mol = (*currentTop)[*at].MolNum();
if (mol != curMol) {
if (MH.varType_ == MOLECULES)
MH.Idxs_.push_back( mol );
else {
int res;
if (MH.varType_ == MOLFIRSTRES)
res = (*currentTop)[ currentTop->Mol( mol ).BeginAtom() ].ResNum();
else // MOLLASTRES
res = (*currentTop)[ currentTop->Mol( mol ).EndAtom()-1 ].ResNum();
MH.Idxs_.push_back( res );
}
curMol = mol;
}
}
}
Niterations = (int)MH.Idxs_.size();
description_.append(std::string(TypeStr[MH.varType_]) +
MH.varname_ + " inmask " + currentMask.MaskExpression());
// -------------------------------------------
} else if (ftype == INTEGER) {
// [<var>=<start>;[<var><OP><end>;]<var><OP>[<value>]]
MH.varType_ = ftype;
ArgList varArg( argIn[iarg], ";" );
if (varArg.Nargs() < 2 || varArg.Nargs() > 3) {
mprinterr("Error: Malformed 'for' loop variable.\n"
"Error: Expected '[<var>=<start>;[<var><OP><end>;]<var><OP>[<value>]]'\n"
"Error: Got '%s'\n", argIn[iarg].c_str());
return 1;
}
// First argument: <var>=<start>
ArgList startArg( varArg[0], "=" );
if (startArg.Nargs() != 2) {
mprinterr("Error: Malformed 'start' argument.\n"
"Error: Expected <var>=<start>, got '%s'\n", varArg[0].c_str());
return 1;
}
MH.varname_ = startArg[0];
if (!validInteger(startArg[1])) {
// TODO allow variables
mprinterr("Error: Start argument must be an integer.\n");
return 1;
} else
MH.start_ = convertToInteger(startArg[1]);
// Second argument: <var><OP><end>
size_t pos0 = MH.varname_.size();
size_t pos1 = pos0 + 1;
MH.endOp_ = NO_OP;
int iargIdx = 1;
if (varArg.Nargs() == 3) {
iargIdx = 2;