#include <iostream.h>#include "BufferBase.h"#include "MRAclevel.h"#include "MRAcrange.h"Include dependency graph for MRAcrange.cpp:

Go to the source code of this file.
Functions | |
| bool | connected (MRAcrange lhs, MRAcrange rhs) |
| bool | contains (MRAcrange lhs, MRAcrange rhs) |
| MRAcrange | Difference (MRAcrange lhs, MRAcrange rhs) |
| bool | disjoint (MRAcrange lhs, MRAcrange rhs) |
| bool | equal (MRAcrange lhs, MRAcrange rhs) |
| bool | interior (MRAcrange lhs, MRAcrange rhs) |
| MRAcrange | Intersection (MRAcrange lhs, MRAcrange rhs) |
| MRAcrange | Union (MRAcrange lhs, MRAcrange rhs) |
|
||||||||||||
|
Definition at line 51 of file MRAcrange.cpp.
00052 {
00053 if ( !lhs.good() || !rhs.good() || !lhs || !rhs ) return false;
00054 if ( lhs.is_empty() || rhs.is_empty() ) return false;
00055 if ( lhs <= rhs || lhs >= rhs ) return true;
00056 if ( int(lhs.cmin) <= int(rhs.cmin) && int(lhs.cmax) >= int(rhs.cmin) - 1 )
00057 return true;
00058 if ( int(lhs.cmax) >= int(rhs.cmax) && int(lhs.cmin) <= int(rhs.cmax) + 1 )
00059 return true;
00060 return false;
00061 }
|
|
||||||||||||
|
Definition at line 29 of file MRAcrange.cpp.
|
|
||||||||||||
|
Definition at line 115 of file MRAcrange.cpp.
00116 {
00117 MRAcrange crange;
00118 if ( !lhs.good() || !rhs.good() || !lhs || !rhs ) {
00119 crange.clrstate(MRAcrange::goodbit);
00120 crange.setstate(MRAcrange::failbit);
00121 } else if ( lhs.is_empty() ) {
00122 crange = lhs;
00123 } else if ( rhs.is_empty() ) {
00124 crange = rhs;
00125 } else if ( disjoint( lhs, rhs ) ) {
00126 crange = lhs;
00127 } else if ( lhs == rhs ) {
00128 crange.set_empty();
00129 } else if ( lhs < rhs ) {
00130 crange.set_empty();
00131 } else if ( interior( lhs, rhs) ) {
00132 crange.clrstate(MRAcrange::goodbit);
00133 crange.setstate(MRAcrange::failbit);
00134 crange.setstate(MRAcrange::fragbit);
00135 } else {
00136 if ( interior( rhs, lhs ) ) {
00137 crange = lhs;
00138 crange.clrstate(MRAcrange::goodbit);
00139 crange.setstate(MRAcrange::failbit);
00140 crange.setstate(MRAcrange::fragbit);
00141 } else {
00142 crange = lhs;
00143 if ( int(rhs.cmin) > int(lhs.cmin) ) crange.cmax = rhs.cmin - 1;
00144 if ( int(rhs.cmax) < int(lhs.cmax) ) crange.cmin = rhs.cmax + 1;
00145 }
00146 }
00147 return crange;
00148 }
|
|
||||||||||||
|
Definition at line 39 of file MRAcrange.cpp.
00040 {
00041 if ( !lhs.good() || !rhs.good() || !lhs || !rhs ) return false;
00042 if ( lhs.is_empty() || rhs.is_empty() ) return false;
00043 if ( lhs <= rhs || lhs >= rhs ) return false;
00044 if ( int(lhs.cmin) < int(rhs.cmin) && int(lhs.cmax) < int(rhs.cmin) )
00045 return true;
00046 if ( int(lhs.cmin) > int(rhs.cmax) && int(lhs.cmax) > int(rhs.cmax) )
00047 return true;
00048 return false;
00049 }
|
|
||||||||||||
|
Definition at line 21 of file MRAcrange.cpp.
|
|
||||||||||||
|
Definition at line 63 of file MRAcrange.cpp.
00064 {
00065 if ( !lhs.good() || !rhs.good() || !lhs || !rhs ) return false;
00066 if ( lhs.is_empty() || rhs.is_empty() ) return false;
00067 if ( lhs >= rhs || disjoint( lhs, rhs ) ) return false;
00068 if ( int(lhs.cmin) <= int(rhs.cmin) || int(lhs.cmax) >= int(rhs.cmax) )
00069 return false;
00070 return true;
00071 }
|
|
||||||||||||
|
Definition at line 95 of file MRAcrange.cpp.
00096 {
00097 MRAcrange crange;
00098 if ( !lhs.good() || !rhs.good() || !lhs || !rhs ) {
00099 crange.clrstate(MRAcrange::goodbit);
00100 crange.setstate(MRAcrange::failbit);
00101 } else if ( lhs.is_empty() ) {
00102 crange = lhs;
00103 } else if ( rhs.is_empty() ) {
00104 crange = rhs;
00105 } else if ( disjoint( lhs, rhs ) ) {
00106 crange.set_empty();
00107 } else {
00108 crange = lhs;
00109 if ( int(rhs.cmin) > int(crange.cmin) ) crange.cmin = rhs.cmin;
00110 if ( int(rhs.cmax) < int(crange.cmax) ) crange.cmax = rhs.cmax;
00111 }
00112 return crange;
00113 }
|
|
||||||||||||
|
Definition at line 73 of file MRAcrange.cpp.
00074 {
00075 MRAcrange crange;
00076 if ( !lhs.good() || !rhs.good() || !lhs || !rhs ) {
00077 crange.clrstate(MRAcrange::goodbit);
00078 crange.setstate(MRAcrange::failbit);
00079 } else if ( rhs.is_empty() ) {
00080 crange = lhs;
00081 } else if ( lhs.is_empty() ) {
00082 crange = rhs;
00083 } else if ( !connected( lhs, rhs ) ) {
00084 crange.clrstate(MRAcrange::goodbit);
00085 crange.setstate(MRAcrange::failbit);
00086 crange.setstate(MRAcrange::fragbit);
00087 } else {
00088 crange = lhs;
00089 if ( int(rhs.cmin) < int(crange.cmin) ) crange.cmin = rhs.cmin;
00090 if ( int(rhs.cmax) > int(crange.cmin) ) crange.cmax = rhs.cmax;
00091 }
00092 return crange;
00093 }
|
1.3.6