本文整理汇总了Java中kodkod.util.ints.SparseSequence.isEmpty方法的典型用法代码示例。如果您正苦于以下问题:Java SparseSequence.isEmpty方法的具体用法?Java SparseSequence.isEmpty怎么用?Java SparseSequence.isEmpty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kodkod.util.ints.SparseSequence
的用法示例。
在下文中一共展示了SparseSequence.isEmpty方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: and
import kodkod.util.ints.SparseSequence; //导入方法依赖的package包/类
/**
* Returns a new matrix such that an entry in the returned matrix represents
* a conjunction of the corresponding entries in this and other matrix. The
* effect of this method is the same as calling
* this.compose(ExprOperator.Binary.AND, other).
*
* @return { m: BooleanMatrix | m.dimensions = this.dimensions && m.factory
* = this.factory && all i: [0..m.dimensions.capacity) |
* m.elements[i] = this.elements[i] AND other.elements[i] }
* @throws NullPointerException other = null
* @throws IllegalArgumentException
* !other.dimensions.equals(this.dimensions) || this.factory !=
* other.factory
*/
public final BooleanMatrix and(BooleanMatrix other) {
checkFactory(this.factory, other.factory);
checkDimensions(this.dims, other.dims);
final BooleanMatrix ret = new BooleanMatrix(dims, factory, cells, other.cells);
ret.mergeDefConds(this, other);
final SparseSequence<BooleanValue> s1 = other.cells;
if (cells.isEmpty() || s1.isEmpty())
return ret;
for (IndexedEntry<BooleanValue> e0 : cells) {
BooleanValue v1 = s1.get(e0.index());
if (v1 != null)
ret.fastSet(e0.index(), factory.and(e0.value(), v1));
}
return ret;
}
示例2: and
import kodkod.util.ints.SparseSequence; //导入方法依赖的package包/类
/**
* Returns a new matrix such that an entry in the returned matrix represents a
* conjunction of the corresponding entries in this and other matrix. The effect
* of this method is the same as calling this.compose(ExprOperator.Binary.AND, other).
*
* @return { m: BooleanMatrix | m.dimensions = this.dimensions && m.factory = this.factory &&
* all i: [0..m.dimensions.capacity) |
* m.elements[i] = this.elements[i] AND other.elements[i] }
* @throws NullPointerException other = null
* @throws IllegalArgumentException !other.dimensions.equals(this.dimensions) || this.factory != other.factory
*/
public final BooleanMatrix and(BooleanMatrix other) {
checkFactory(this.factory, other.factory);
checkDimensions(this.dims, other.dims);
final BooleanMatrix ret = new BooleanMatrix(dims, factory, cells, other.cells);
final SparseSequence<BooleanValue> s1 = other.cells;
if (cells.isEmpty() || s1.isEmpty()) return ret;
for(IndexedEntry<BooleanValue> e0 : cells) {
BooleanValue v1 = s1.get(e0.index());
if (v1!=null)
ret.fastSet(e0.index(), factory.and(e0.value(), v1));
}
return ret;
}