本文整理汇总了Java中jpaul.DataStructs.UnionFind.find方法的典型用法代码示例。如果您正苦于以下问题:Java UnionFind.find方法的具体用法?Java UnionFind.find怎么用?Java UnionFind.find使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jpaul.DataStructs.UnionFind
的用法示例。
在下文中一共展示了UnionFind.find方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: rewrite
import jpaul.DataStructs.UnionFind; //导入方法依赖的package包/类
public Constraint<V,Info> rewrite(UnionFind<V> uf) {
V vs2 = uf.find(vs);
V vd2 = uf.find(vd);
// remove superfluous constraints
if(vs2.equals(vd2)) return null;
// nothing changed, so why generate a new constraint ?
if(vs.equals(vs2) && vd.equals(vd2)) return this;
return new LtConstraint<V,Info>(vs2, vd2);
}
示例2: rewrite
import jpaul.DataStructs.UnionFind; //导入方法依赖的package包/类
/** We implemented {@link #rewrite}, {@link #equals}, and {@link
#hashCode}, such that constraints that are identical after
variable unification are not duplicated needlessly. */
public Constraint<SVar<T>,Set<T>> rewrite(UnionFind<SVar<T>> uf) {
SVar<T> vIn1_p = uf.find(vIn1);
SVar<T> vIn2_p = uf.find(vIn2);
SVar<T> vDest_p = uf.find(vDest);
return new IntersectConstraint<T>(vIn1_p, vIn2_p, vDest_p);
}
示例3: rewrite
import jpaul.DataStructs.UnionFind; //导入方法依赖的package包/类
/** We implemented {@link #rewrite}, {@link #equals}, and {@link
#hashCode}, such that constraints that are identical after
variable unification are not duplicated needlessly. */
public Constraint<SVar<T>,Set<T>> rewrite(UnionFind<SVar<T>> uf) {
SVar<T> vIn1_p = uf.find(vIn1);
SVar<T> vIn2_p = uf.find(vIn2);
SVar<T> vDest_p = uf.find(vDest);
return new IntersectConstraint(vIn1_p, vIn2_p, vDest_p);
}
示例4: rewrite
import jpaul.DataStructs.UnionFind; //导入方法依赖的package包/类
public Constraint<V,Info> rewrite(UnionFind<V> uf) {
V vd2 = uf.find(vd);
// nothing changed, so why generate a new constraint ?
if(vd.equals(vd2)) return this;
return new CtConstraint<V,Info>(ct, vd2);
}
示例5: rewrite
import jpaul.DataStructs.UnionFind; //导入方法依赖的package包/类
/** We implemented {@link #rewrite}, {@link #equals}, and {@link
#hashCode}, such that constraints that are identical after
variable unification are not duplicated needlessly. */
public Constraint<SVar<T>,Set<T>> rewrite(UnionFind<SVar<T>> uf) {
SVar<T> vIn_p = uf.find(vIn);
SVar<T> vDest_p = uf.find(vDest);
return new CtDiffConstraint<T>(vIn_p, ctSet, vDest_p);
}