本文整理汇总了Java中org.sat4j.specs.IVecInt.shrink方法的典型用法代码示例。如果您正苦于以下问题:Java IVecInt.shrink方法的具体用法?Java IVecInt.shrink怎么用?Java IVecInt.shrink使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.sat4j.specs.IVecInt
的用法示例。
在下文中一共展示了IVecInt.shrink方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: simpleSimplification
import org.sat4j.specs.IVecInt; //导入方法依赖的package包/类
private void simpleSimplification(IVecInt conflictToReduce) {
int i, j;
final boolean[] seen = mseen;
for (i = j = 1; i < conflictToReduce.size(); i++) {
IConstr r = voc.getReason(conflictToReduce.get(i));
if (r == null) {
conflictToReduce.moveTo(j++, i);
} else {
for (int k = 0; k < r.size(); k++)
if (voc.isFalsified(r.get(k)) && !seen[r.get(k) >> 1]
&& (voc.getLevel(r.get(k)) != 0)) {
conflictToReduce.moveTo(j++, i);
break;
}
}
}
conflictToReduce.shrink(i - j);
stats.reducedliterals += (i - j);
}
示例2: expensiveSimplification
import org.sat4j.specs.IVecInt; //导入方法依赖的package包/类
private void expensiveSimplification(IVecInt conflictToReduce) {
// Simplify conflict clause (a lot):
//
int i, j;
// (maintain an abstraction of levels involved in conflict)
analyzetoclear.clear();
conflictToReduce.copyTo(analyzetoclear);
for (i = 1, j = 1; i < conflictToReduce.size(); i++)
if (voc.getReason(conflictToReduce.get(i)) == null
|| !analyzeRemovable(conflictToReduce.get(i)))
conflictToReduce.moveTo(j++, i);
conflictToReduce.shrink(i - j);
stats.reducedliterals += (i - j);
}
示例3: expensiveSimplificationWLOnly
import org.sat4j.specs.IVecInt; //导入方法依赖的package包/类
private void expensiveSimplificationWLOnly(IVecInt conflictToReduce) {
// Simplify conflict clause (a lot):
//
int i, j;
// (maintain an abstraction of levels involved in conflict)
analyzetoclear.clear();
conflictToReduce.copyTo(analyzetoclear);
for (i = 1, j = 1; i < conflictToReduce.size(); i++)
if (voc.getReason(conflictToReduce.get(i)) == null
|| !analyzeRemovableWLOnly(conflictToReduce.get(i)))
conflictToReduce.moveTo(j++, i);
conflictToReduce.shrink(i - j);
stats.reducedliterals += (i - j);
}