IntervalList.h

00001 #ifndef gridripper_amr1d_IntervalList_h
00002 #define gridripper_amr1d_IntervalList_h
00003 
00004 #include <string>
00005 
00006 namespace gridripper { namespace amr1d {
00007 
00008 using namespace std;
00009 
00016 class IntervalList
00017 {
00018 public:
00020     int left;
00021 
00023     int right;
00024 
00026     IntervalList* next;
00027 
00033     IntervalList(int l, int r) {
00034         left = l;
00035         right = r;
00036         next = NULL;
00037     }
00038 
00039     bool contains(int i) {
00040         return (left <= i && i <= right)
00041             || (right < left && (i <= right || left <= i));
00042     }
00043 
00044     string toString(bool recurse = false) const;
00045 };
00046 
00047 } } // namespace gridripper::amr1d
00048 
00049 #endif /* gridripper_amr1d_IntervalList_h */

Generated on Wed Jun 17 18:46:47 2009 for GridRipper by  doxygen 1.5.6