bool check_negligible_line(int id, int num_list, struct DotList *dots) { int i = 0; while( i < num_list ) { if( i == id ) i++; else { if(proper_subset(dots[id].x, dots[i].x) && proper_subset(dots[id].y, dots[i].x) ) { return true; } else if(proper_subset(dots[id].x, dots[i].y) && proper_subset(dots[id].y, dots[i].y) ) { return true; } i++; } } return false; }
template<class T, class Policies1, class Policies2> inline bool operator>(const interval<T, Policies1>& x, const interval<T, Policies2>& y) { return proper_subset(y, x); }
int is_left_to_right_again(int id, int num_list, struct DotList *dots) { int i = 0; bool is_conv = false; bool is_overlap_x = false; bool is_overlap_y = false; bool is_subset_x = false; bool is_subset_y = false; while( (i < num_list) && (is_conv == false) ) { if( (i == id) || (dots[i].sign == 2) ) i++; else { if((proper_overlap(dots[id].x, dots[i].x) && (!subset(dots[id].x, dots[i].x))) || (proper_overlap(dots[id].x, dots[i].y) && (!subset(dots[id].x, dots[i].y)))) { if(is_overlap_x == false) is_overlap_x = true; if(is_subset_y || is_overlap_y) { is_conv = true; } } if(proper_subset(dots[id].x, dots[i].x) || proper_subset(dots[id].x, dots[i].y)) { if(is_subset_x == false) is_subset_x = true; if(is_overlap_y == true) { is_conv = true; } } if((proper_overlap(dots[id].y, dots[i].x) && (!subset(dots[id].y, dots[i].x))) || (proper_overlap(dots[id].y, dots[i].y) && (!subset(dots[id].y, dots[i].y)))) { if(is_overlap_y == false) is_overlap_y = true; if(is_subset_x || is_overlap_x) { is_conv = true; } } if(proper_subset(dots[id].y, dots[i].x) || proper_subset(dots[id].y, dots[i].y)) { if(is_subset_y == false) is_subset_y = true; if(is_overlap_x == true) { is_conv = true; } } i++; } } i = 0; while( i < num_list ) { if( i == id ) i++; else { if(equal(dots[id].y, dots[i].x) || equal(dots[id].y, dots[i].y)) { if(is_conv == true) return(CON_X_TO_Y); else return(DUP_X_TO_Y); } else if(equal(dots[id].x, dots[i].x) || equal(dots[id].x, dots[i].y) ) { if(is_conv == true) return(CON_Y_TO_X); else return(DUP_Y_TO_X); } i++; } } i = 0; while( i < num_list ) { if( i == id ) i++; else { if(subset(dots[id].x, dots[i].x) || subset(dots[id].x, dots[i].y) ) { if(is_conv == true) return(CON_X_TO_Y); else return(DUP_X_TO_Y); } else if(subset(dots[id].y, dots[i].x) || subset(dots[id].y, dots[i].y)) { if(is_conv == true) return(CON_X_TO_Y); else return(DUP_Y_TO_X); } i++; } } if(is_conv == true) return(CON_X_TO_Y); else return(DUP_X_TO_Y); }