java bounds_Java Bounds.intBounds方法代码示例

import kodkod.instance.Bounds; //导入方法依赖的package包/类

/**

* Returns an exact interpreter for the given bounds and options. If

* {@code incremental} is true, then the resulting interpreter

* can be {@linkplain #extend(Set, Map, Map) extended} with new bindings.

* Otherwise, the interpreter will throw an exception if extension is

* attempted.

*

* @return some l: LeafInterpreter | l.universe = bounds.universe &&

* l.relations = bounds.relations() && l.ints = bounds.ints() &&

* l.lbounds = bounds.lowerBound && l.ubounds = bounds.upperBound &&

* l.ibounds = bounds.intBound && l.factory =

* BooleanFactory.factory(sum(r: l.relations |

* #(l.ubounds[r]-l.lbounds[r]))-1, options) && l.vars[relations] =

* l.factory & BooleanVariable

*/

static final LeafInterpreter exact(Bounds bounds, Options options, boolean incremental) {

final Map vars = new LinkedHashMap();

final Map lowers = incremental ? new LinkedHashMap(bounds.lowerBounds())

: bounds.lowerBounds();

final Map uppers = incremental ? new LinkedHashMap(bounds.upperBounds())

: bounds.upperBounds();

final int numVars = allocateVars(1, vars, bounds.relations(), lowers, uppers);

return new LeafInterpreter(bounds.universe(), lowers, uppers, bounds.intBounds(),

BooleanFactory.factory(numVars, options), vars);

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值