本文整理汇总了C++中vec::getDataEnd方法的典型用法代码示例。如果您正苦于以下问题:C++ vec::getDataEnd方法的具体用法?C++ vec::getDataEnd怎么用?C++ vec::getDataEnd使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vec
的用法示例。
在下文中一共展示了vec::getDataEnd方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updatePointers
void ClauseAllocator::updatePointers(vec<T*>& toUpdate, const map<Clause*, Clause*>& oldToNewPointer)
{
for (T **it = toUpdate.getData(), **end = toUpdate.getDataEnd(); it != end; it++) {
if (!(*it)->wasBin()) {
//assert(oldToNewPointer.find((TT*)*it) != oldToNewPointer.end());
map<Clause*, Clause*>::const_iterator it2 = oldToNewPointer.find((Clause*)*it);
*it = (T*)it2->second;
}
}
}
示例2: syncBinFromOthers
const bool DataSync::syncBinFromOthers(const Lit lit, const vector<Lit>& bins, uint32_t& finished, vec<Watched>& ws)
{
assert(solver.varReplacer->getReplaceTable()[lit.var()].var() == lit.var());
assert(solver.subsumer->getVarElimed()[lit.var()] == false);
assert(solver.xorSubsumer->getVarElimed()[lit.var()] == false);
vec<Lit> addedToSeen;
for (vec<Watched>::iterator it = ws.getData(), end = ws.getDataEnd(); it != end; it++) {
if (it->isBinary()) {
addedToSeen.push(it->getOtherLit());
seen[it->getOtherLit().toInt()] = true;
}
}
vec<Lit> lits(2);
for (uint32_t i = finished; i < bins.size(); i++) {
if (!seen[bins[i].toInt()]) {
Lit otherLit = bins[i];
otherLit = solver.varReplacer->getReplaceTable()[otherLit.var()] ^ otherLit.sign();
if (solver.subsumer->getVarElimed()[otherLit.var()]
|| solver.xorSubsumer->getVarElimed()[otherLit.var()]
|| solver.value(otherLit.var()) != l_Undef
) continue;
recvBinData++;
lits[0] = lit;
lits[1] = otherLit;
solver.addClauseInt(lits, 0, true, 2, 0, true);
lits.clear();
lits.growTo(2);
if (!solver.ok) goto end;
}
}
finished = bins.size();
end:
for (uint32_t i = 0; i < addedToSeen.size(); i++)
seen[addedToSeen[i].toInt()] = false;
return solver.ok;
}
示例3: assert
bool ClauseVivifier::vivifyClauses2(vec<Clause*>& clauses) {
assert(solver.ok);
vec<char> seen;
seen.growTo(solver.nVars()*2, 0);
vec<char> seen_subs;
seen_subs.growTo(solver.nVars()*2, 0);
uint32_t litsRem = 0;
uint32_t clShrinked = 0;
uint64_t countTime = 0;
uint64_t maxCountTime = 800 * 1000 * 1000;
maxCountTime *= 6;
if (solver.clauses_literals + solver.learnts_literals < 500000)
maxCountTime *= 2;
uint32_t clTried = 0;
vec<Lit> lits;
bool needToFinish = false;
double myTime = cpuTime();
uint32_t subsumed_tri_num = 0;
uint32_t subsumed_bin_num = 0;
Clause** i = clauses.getData();
Clause** j = i;
for (Clause** end = clauses.getDataEnd(); i != end; i++) {
if (needToFinish) {
*j++ = *i;
continue;
}
if (countTime > maxCountTime)
needToFinish = true;
Clause& cl = **i;
countTime += cl.size()*2;
clTried++;
bool subsumed = false;
const bool learnt = cl.learnt();
for (uint32_t i2 = 0; i2 < cl.size(); i2++) {
seen[cl[i2].toInt()] = 1; //for strengthening
seen_subs[cl[i2].toInt()] = 1; //for subsumption
}
for (const Lit *l = cl.getData(), *end = cl.getDataEnd(); l != end; l++) {
const Lit *l_other = l;
l_other++;
if (l_other != end)
__builtin_prefetch(solver.watches[(~*l_other).toInt()].getData());
const vec<Watched>& ws = solver.watches[(~*l).toInt()];
countTime += ws.size()*2;
for (vec<Watched>::const_iterator it = ws.getData(), end = ws.getDataEnd(); it != end; it++) {
//Handle tri clause
if (it->isTriClause() && cl.size() > 3) {
if (learnt //we cannot decide if TRI is learnt or not
&& seen_subs[it->getOtherLit().toInt()]
&& seen_subs[it->getOtherLit2().toInt()]
) {
subsumed_tri_num++;
subsumed = true;
}
if (seen[l->toInt()]) { //we may have removed it already
//one way
if (seen[(it->getOtherLit2()).toInt()])
seen[(~it->getOtherLit()).toInt()] = 0;
//other way
if (seen[(it->getOtherLit()).toInt()])
seen[(~it->getOtherLit2()).toInt()] = 0;
}
}
//Handle Binary clause
if (it->isBinary()) {
if (seen_subs[it->getOtherLit().toInt()]) {
if (!learnt && it->getLearnt())
makeNonLearntBin(*l, it->getOtherLit(), it->getLearnt());
subsumed_bin_num++;
subsumed = true;
}
if (seen[l->toInt()]) //we may have removed it already
seen[(~it->getOtherLit()).toInt()] = 0;
}
}
if (seen[l->toInt()] == 0)
continue;
countTime += solver.transOTFCache[l->toInt()].lits.size();
for (vector<Lit>::const_iterator it2 = solver.transOTFCache[l->toInt()].lits.begin()
, end2 = solver.transOTFCache[l->toInt()].lits.end(); it2 != end2; it2++) {
seen[(~(*it2)).toInt()] = 0;
}
}
lits.clear();
for (const Lit *it2 = cl.getData(), *end2 = cl.getDataEnd(); it2 != end2; it2++) {
//.........这里部分代码省略.........