slice.h
Go to the documentation of this file.00001
00015 #ifndef DLR_NUMERIC_SLICE_H
00016 #define DLR_NUMERIC_SLICE_H
00017
00018 namespace dlr {
00019
00020 namespace numeric {
00021
00027 class Slice {
00028 public:
00034 Slice() : start_(0), stop_(0), stride_(1) {}
00035
00044 Slice(int start, int stop) : start_(start), stop_(stop), stride_(1) {}
00045
00055 Slice(int start, int stop, int stride)
00056 : start_(start), stop_(stop), stride_(stride) {}
00057
00063 inline int start() const {return start_;}
00064
00071 inline int stop() const {return stop_;}
00072
00079 inline int stride() const {return stride_;}
00080
00081 private:
00082 int start_;
00083 int stop_;
00084 int stride_;
00085 };
00086
00087 }
00088
00089 }
00090
00091
00092
00093
00094 namespace dlr {
00095
00096 using numeric::Slice;
00097
00098 }
00099
00100 #endif // #ifdef DLR_NUMERIC_SLICE_H
00101