本文整理汇总了C++中ViewArray::same方法的典型用法代码示例。如果您正苦于以下问题:C++ ViewArray::same方法的具体用法?C++ ViewArray::same怎么用?C++ ViewArray::same使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ViewArray
的用法示例。
在下文中一共展示了ViewArray::same方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: vsr
inline ExecStatus
Prop<View>::post(Home home, ViewArray<View>& x, View y) {
if (x.size() == 0)
return ES_FAILED;
x.unique(home);
if (x.size() == 1)
return Rel::EqDom<View,View>::post(home,x[0],y);
if (x.same(home,y))
return ES_OK;
// Eliminate assigned views and store them into the value set
ValSet vs;
add(home, vs, x);
if (x.size() == 0) {
ValSet::Ranges vsr(vs);
GECODE_ME_CHECK(y.inter_r(home,vsr,false));
return ES_OK;
}
(void) new (home) Prop<View>(home, vs, x, y);
return ES_OK;
}
示例2: add
inline ExecStatus
ReProp<View,rm>::post(Home home, ViewArray<View>& x, View y, BoolView b) {
if (x.size() == 0) {
if (rm != RM_PMI)
GECODE_ME_CHECK(b.zero(home));
return ES_OK;
}
x.unique(home);
if (x.size() == 1)
return Rel::ReEqDom<View,BoolView,rm>::post(home,x[0],y,b);
if (x.same(home,y)) {
if (rm != RM_IMP)
GECODE_ME_CHECK(b.one(home));
return ES_OK;
}
// Eliminate assigned views and store them into the value set
ValSet vs;
add(home, vs, x);
switch (vs.compare(y)) {
case Iter::Ranges::CS_SUBSET:
if (rm != RM_IMP)
GECODE_ME_CHECK(b.one(home));
return ES_OK;
case Iter::Ranges::CS_DISJOINT:
if (x.size() == 0) {
if (rm != RM_PMI)
GECODE_ME_CHECK(b.zero(home));
return ES_OK;
}
break;
case Iter::Ranges::CS_NONE:
break;
default:
GECODE_NEVER;
}
(void) new (home) ReProp<View,rm>(home, vs, x, y, b);
return ES_OK;
}