本文整理汇总了C++中IntervalVector::intersects方法的典型用法代码示例。如果您正苦于以下问题:C++ IntervalVector::intersects方法的具体用法?C++ IntervalVector::intersects怎么用?C++ IntervalVector::intersects使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IntervalVector
的用法示例。
在下文中一共展示了IntervalVector::intersects方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: compare
void SetNodeReg::compare(const IntervalVector& root, const IntervalVector& box,const int& type, bool * flag,unsigned int op) {
if(is_leaf()) {
//cout<<"leaf box: "<<root<<"of status: "<<status<<" box: "<<box<<endl;
switch(op){
case 0:
if(status != type){*flag = false;}
break;
case 1:
if(status == type){*flag = true;}
break;
case 2:
if(status == type){*flag = false;}
break;
}
}
else if(((op==0||op==2)&& (*flag)) || (op ==1 && !(*flag))) {
if(root.intersects(right_box(box)))
{right->compare(right_box(root),box,type,flag,op);}
if(root.intersects(left_box(box)))
{left->compare(left_box(root),box,type,flag,op);}
}
return;
}
示例2: findNeighbor
void SetNodeReg::findNeighbor(const IntervalVector& box,const IntervalVector& nbox,vector<SetNodeReg*> * neigh) {
if(is_leaf()){
if(box.intersects(nbox) && box!=nbox )
neigh->push_back(this);
}
else if(box.intersects(nbox)) {
right->findNeighbor(right_box(box),nbox,neigh);
left->findNeighbor(left_box(box),nbox,neigh);
}
}
示例3: Interset
int Interset(IntervalVector x, IntervalVector y) {
assert(x.size() == y.size());
int res = 2;
int i;
for(i = 0;i<x.size();i++) {
if (!x[i].is_subset(y[i])) {
res = 1;
break;}
}
while(i<x.size()) {
if(!x.intersects(y)) {
res = 0;
return res;
}
i++;}
return res;}