00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef BOUNDS_CHECK_H_
00019 #define BOUNDS_CHECK_H_
00020
00021 #include <string>
00022
00023 class IntervalBoundsCheckImpl;
00024 class Sym;
00025
00026 class BoundsCheck {
00027 public :
00028 virtual ~BoundsCheck() {};
00029 virtual bool in_bounds(const Sym&) const = 0;
00030 virtual std::string get_bounds(const Sym&) const = 0;
00031 };
00032
00033
00034 class IntervalBoundsCheck : public BoundsCheck {
00035
00036 IntervalBoundsCheckImpl* pimpl;
00037
00038 public:
00039
00040 IntervalBoundsCheck(const std::vector<double>& minima, const std::vector<double>& maxima);
00041 ~IntervalBoundsCheck();
00042 IntervalBoundsCheck(const IntervalBoundsCheck&);
00043 IntervalBoundsCheck& operator=(const IntervalBoundsCheck&);
00044
00045 bool in_bounds(const Sym&) const;
00046 std::string get_bounds(const Sym&) const;
00047
00048 std::pair<double, double> calc_bounds(const Sym&) const;
00049 };
00050
00051 class NoBoundsCheck : public BoundsCheck {
00052 bool in_bounds(const Sym&) const { return false; }
00053 std::string get_bounds(const Sym&) const { return ""; }
00054 };
00055
00056 #endif
00057
00058