00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00027 #ifndef _BOUND_DELTA_H_
00028 #define _BOUND_DELTA_H_
00029
00030 #include <api_delta.h>
00031
00032 class bound_undelta : public undelta_base
00033 {
00034 public:
00035 std::vector<unsigned int> indices;
00036
00037 std::vector<interval> old_f_bounds;
00038
00039
00040 double old_gain, old_log_vol;
00041 public:
00042 bound_undelta(const std::vector<unsigned int>& __i,
00043 const std::vector<interval>& __b,
00044 double _og, double _olv) : undelta_base(), indices(__i),
00045 old_f_bounds(__b), old_gain(_og),
00046 old_log_vol(_olv) {}
00047
00048 bound_undelta(const std::vector<unsigned int>& __i, double _og,
00049 double _olv) : undelta_base(), indices(__i),
00050 old_f_bounds(), old_gain(_og),
00051 old_log_vol(_olv) {}
00052
00053 bound_undelta(const bound_undelta& __d) : undelta_base(__d),
00054 indices(__d.indices),
00055 old_f_bounds(__d.old_f_bounds),
00056 old_gain(__d.old_gain),
00057 old_log_vol(__d.old_log_vol)
00058 {
00059 #if DEBUG_DELTA
00060 std::cerr << "Called bound_undelta copy constructor" << std::endl;
00061 #endif
00062 }
00063
00064 bound_undelta* new_copy() const { return new bound_undelta(*this); }
00065 void destroy_copy(bound_undelta* __d) { delete __d; }
00066
00067 bool unapply(work_node& _x) const;
00068
00069 friend class bound_delta;
00070 };
00071
00072 class bound_delta : public delta_base
00073 {
00074 public:
00075 std::vector<unsigned int> indices;
00076
00077 std::vector<interval> new_f_bounds;
00078 public:
00079 bound_delta(const std::vector<unsigned int>& __i,
00080 const std::vector<interval>& __b)
00081 : delta_base("change bounds"), indices(__i),
00082 new_f_bounds(__b) {}
00083
00084 bound_delta(unsigned int __i, interval __b)
00085 : delta_base("change bounds"), indices(1,__i),
00086 new_f_bounds(1,__b) {}
00087
00088 bound_delta(const bound_delta& __d) : delta_base(__d), indices(__d.indices),
00089 new_f_bounds(__d.new_f_bounds)
00090 {
00091 #if DEBUG_DELTA
00092 std::cerr << "Called bound_delta copy constructor" << std::endl;
00093 #endif
00094 }
00095
00096 bound_delta* new_copy() const { return new bound_delta(*this); }
00097 void destroy_copy(bound_delta* __d) { delete __d; }
00098
00099 bool apply(work_node& _x, undelta_base*& _u) const;
00100 };
00101
00102 #endif