Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch 1 #115

Open
wants to merge 41 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
3992a0a
Create ibex_NodeType.cpp
domensta Feb 16, 2015
104e844
Create ibex_NodeType.h
domensta Feb 16, 2015
f276ae9
Create ibex_SetNode.cpp
domensta Feb 16, 2015
f26cec9
Create ibex_SetNode.h
domensta Feb 16, 2015
9f8352a
Create ibex_SetBisect.cpp
domensta Feb 16, 2015
96af337
Create ibex_SetBisect.h
domensta Feb 16, 2015
739b052
Create ibex_SetLeaf.cpp
domensta Feb 16, 2015
88322a2
Create ibex_SetLeaf.h
domensta Feb 16, 2015
3ca7dfe
Create ibex_SetInterval.cpp
domensta Feb 16, 2015
96dfb65
Create ibex_SetInterval.h
domensta Feb 16, 2015
3228fb6
Merge pull request #3 from domensta/patch-2
domensta Feb 23, 2015
4405523
Merge pull request #4 from domensta/patch-3
domensta Feb 23, 2015
8070684
Merge pull request #5 from domensta/patch-4
domensta Feb 23, 2015
29acddd
Merge pull request #6 from domensta/patch-5
domensta Feb 23, 2015
f29fc91
Merge pull request #7 from domensta/patch-6
domensta Feb 23, 2015
f8fd831
Merge pull request #8 from domensta/patch-7
domensta Feb 23, 2015
36b2dab
Merge pull request #9 from domensta/patch-8
domensta Feb 23, 2015
e33a398
Merge pull request #10 from domensta/patch-9
domensta Feb 23, 2015
71eeb37
Merge pull request #11 from domensta/patch-10
domensta Feb 23, 2015
e50d56a
Update ibex_NodeType.cpp
domensta Feb 26, 2015
fd74ea6
Update ibex_NodeType.h
domensta Feb 26, 2015
fea8543
Update ibex_SetBisect.cpp
domensta Feb 26, 2015
50a4181
Update ibex_SetBisect.h
domensta Feb 26, 2015
9ab9709
Update ibex_SetInterval.cpp
domensta Feb 26, 2015
f55cdce
Update ibex_SetInterval.h
domensta Feb 26, 2015
3af2afe
Update ibex_SetLeaf.cpp
domensta Feb 26, 2015
95d27f9
Update ibex_SetLeaf.h
domensta Feb 26, 2015
fc55e9f
Update ibex_SetNode.cpp
domensta Feb 26, 2015
6b1f809
Update ibex_SetNode.h
domensta Feb 26, 2015
2cadbda
Delete ibex_NodeType.cpp
domensta Feb 26, 2015
82d8a90
Delete ibex_NodeType.h
domensta Feb 26, 2015
264aed3
Delete ibex_SetBisect.cpp
domensta Feb 26, 2015
6e6e016
Delete ibex_SetBisect.h
domensta Feb 26, 2015
a9b8ef1
Delete ibex_SetInterval.cpp
domensta Feb 26, 2015
48d98c3
Delete ibex_SetInterval.h
domensta Feb 26, 2015
763cbbf
Delete ibex_SetLeaf.cpp
domensta Feb 26, 2015
c8744d5
Delete ibex_SetLeaf.h
domensta Feb 26, 2015
cbe6ae6
Delete ibex_SetNode.cpp
domensta Feb 26, 2015
fecf220
Delete ibex_SetNode.h
domensta Feb 26, 2015
f16b2f1
Update ibex_SetLeaf.cpp
domensta Mar 6, 2015
eecb923
Update ibex_SetBisect.cpp
domensta Mar 6, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
215 changes: 214 additions & 1 deletion src/set/ibex_NodeType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// ========================================

namespace ibex {

// relic from irregular set, need for SetBisect constructor
NodeType operator|(NodeType x, NodeType y) {
switch (x) {
case IN : {
Expand Down Expand Up @@ -78,6 +78,219 @@ NodeType operator|(NodeType x, NodeType y) {
}
}



// define operator or between two nodetype, assuming the two boxes associated are equal
NodeType uni(NodeType x,NodeType y) {
switch (x) {
case IN : {
return IN;

}
break;
case OUT : {
return y;
}
break;
case UNK : {
switch(y) {
case IN : return IN;
case UNK_IN: return UNK_IN;
case OUT : return UNK;
case UNK : return UNK;
case UNK_OUT: return UNK_OUT;
default: return UNK_IN_OUT;
}
}
break;
case UNK_IN : {
switch(y) {
case IN :
case UNK_IN:
case UNK : return UNK_IN;
default: return UNK_IN_OUT;
}
}
break;
case UNK_OUT : {
switch(y) {
case OUT :
case UNK_OUT:
case UNK : return UNK_OUT;
default: return UNK_IN_OUT;
}
}
break;
default :
//Warning: IN_TMP not considered here.
return UNK_IN_OUT;
}

}

// define operator or between two nodetype, assuming box of nodetype y is subset of box of nodetype x;
NodeType uni_in(NodeType x, NodeType y) {
switch (x) {
case IN : {
switch(y) {
case IN : return IN;
case OUT : return IN;
case UNK : return IN;
case UNK_OUT:
case UNK_IN_OUT: return UNK_IN_OUT;
default : return UNK_IN;
}
}
break;
case OUT : {
switch(y) {
case OUT : return OUT;
case IN : return UNK;
case UNK : return UNK;
case UNK_IN:
case UNK_IN_OUT: return UNK_IN_OUT;
default : return UNK_OUT;
}
}
break;
case UNK : {
switch(y) {
return UNK;
}
}
break;
/*case UNK_IN : {
switch(y) {
case IN :
case UNK_IN:
case UNK : return UNK_IN;
default: return UNK_IN_OUT;
}
}
break;
case UNK_OUT : {
switch(y) {
case OUT :
case UNK_OUT:
case UNK : return UNK_OUT;
default: return UNK_IN_OUT;
}
}
break;*/
default :
//Warning: IN_TMP not considered here.
return UNK_IN_OUT;

}
}

// define operator and between two nodetype, assuming the two boxes associated are equal
NodeType inte(NodeType x, NodeType y) {
switch (x) {
case IN : {
return y;
}
break;
case OUT : {
return OUT;
}
break;
case UNK : {
switch(y) {
case IN : return UNK;
case UNK_IN: return UNK_IN;
case OUT : return OUT;
case UNK : return UNK;
case UNK_OUT: return UNK_OUT;
default: return UNK_IN_OUT;
}
}
break;
case UNK_IN : {
switch(y) {
case IN :
case UNK_IN:
case UNK : return UNK_IN;
default: return UNK_IN_OUT;
}
}
break;
case UNK_OUT : {
switch(y) {
case OUT :
case UNK_OUT:
case UNK : return UNK_OUT;
default: return UNK_IN_OUT;
}
}
break;
default :
//Warning: IN_TMP not considered here.
return UNK_IN_OUT;
}
}


// define operator and between two nodetype, assuming box of nodetype y is subset of box of nodetype x;
NodeType inte_in(NodeType x, NodeType y) {
switch (x) {
case IN : {
switch(y) {
case IN : return IN;
case OUT : return UNK;
case UNK : return UNK;
case UNK_OUT:
case UNK_IN_OUT: return UNK_IN_OUT;
default : return UNK_IN;
}
}
break;
case OUT : {
switch(y) {
case OUT : return OUT;
case IN : return OUT;
case UNK : return OUT;
case UNK_IN:
case UNK_IN_OUT: return UNK_IN_OUT;
default : return UNK_OUT;
}
}
break;
case UNK : {
switch(y) {
case IN : return UNK;
case UNK_IN: return UNK_IN;
case OUT : return UNK;
case UNK_OUT: return UNK_OUT;
case UNK: return UNK;
default: return UNK_IN_OUT;
}
}
break;
case UNK_IN : {
switch(y) {
case IN :
case UNK_IN:
case UNK : return UNK_IN;
default: return UNK_IN_OUT;
}
}
break;
case UNK_OUT : {
switch(y) {
case OUT :
case UNK_OUT:
case UNK : return UNK_OUT;
default: return UNK_IN_OUT;
}
}
break;
default :
//Warning: IN_TMP not considered here.
return UNK_IN_OUT;
}
}

bool certainly_contains_in(NodeType x) {
return x==IN || x==UNK_IN || x==UNK_IN_OUT;
}
Expand Down
19 changes: 17 additions & 2 deletions src/set/ibex_NodeType.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,24 @@ typedef enum { __IBEX_IN__,
* \see SetBisect constructor.
*/
NodeType operator|(NodeType x, NodeType y);

/**
* \brief False only if the subtree contains no inner point
* \brief return value of union of two equal boxes
*/
NodeType uni(NodeType x,NodeType y);
/**
* \brief return value of union of two boxes, assuming the on associated to y is include in the one associated to x
*/
NodeType uni_in(NodeType x, NodeType y);
/**
* \brief return value of inter of two equal boxes
*/
NodeType inte(NodeType x, NodeType y);
/**
* \brief return value of inter of two boxes, assuming the on associated to y is include in the one associated to x
*/
NodeType inte_in(NodeType x, NodeType y);
/**
* \brief return value of inter of two boxes, assuming the on associated to y is include in the one associated to x
*/
bool possibly_contains_in(NodeType x);

Expand Down
Loading