本文整理汇总了C++中TableIterator::isAtEnd方法的典型用法代码示例。如果您正苦于以下问题:C++ TableIterator::isAtEnd方法的具体用法?C++ TableIterator::isAtEnd怎么用?C++ TableIterator::isAtEnd使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TableIterator
的用法示例。
在下文中一共展示了TableIterator::isAtEnd方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: visit
void visit(const PredTable* table) {
Assert(isTheoryOpen());
if (not table->finite()) {
std::clog << "Requested to print infinite table, did not do this.\n";
}
TableIterator kt = table->begin();
if (table->arity() > 0) {
output() << "{ ";
if (not kt.isAtEnd()) {
bool beginlist = true;
for (; not kt.isAtEnd(); ++kt) {
CHECKTERMINATION;
if (not beginlist) {
output() << "; ";
}
beginlist = false;
ElementTuple tuple = *kt;
bool begintuple = true;
for (auto lt = tuple.cbegin(); lt != tuple.cend(); ++lt) {
if (not begintuple) {
output() << ',';
}
begintuple = false;
output() << print(*lt);
}
}
}
output() << " }";
} else if (not kt.isAtEnd()) {
output() << "{()}";
} else {
output() << "{}";
}
}
示例2: exists
FOPropTableDomain* FOPropTableDomainFactory::exists(FOPropTableDomain* domain, const varset& sv) const {
vector<bool> keepcol;
vector<Variable*> newvars;
vector<SortTable*> newunivcols;
for (unsigned int n = 0; n < domain->vars().size(); ++n) {
Variable* v = domain->vars()[n];
if (sv.find(v) == sv.cend()) {
keepcol.push_back(true);
newvars.push_back(v);
newunivcols.push_back(domain->table()->universe().tables()[n]);
} else {
keepcol.push_back(false);
}
}
if (not domain->table()->approxFinite()) {
clog << "Probably entering an infinite loop when trying to project a possibly infinite table...\n";
}
PredTable* npt = new PredTable(new EnumeratedInternalPredTable(), Universe(newunivcols));
for (TableIterator it = domain->table()->begin(); not it.isAtEnd(); ++it) {
const ElementTuple& tuple = *it;
ElementTuple newtuple;
for (size_t n = 0; n < tuple.size(); ++n) {
if (keepcol[n]) {
newtuple.push_back(tuple[n]);
}
}
npt->add(newtuple);
}
return new FOPropTableDomain(npt, newvars);
}