00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 namespace Gecode { namespace Float { namespace Branch {
00043
00044
00045 forceinline
00046 MeritMin::MeritMin(Space& home, const VarBranch& vb)
00047 : MeritBase<FloatView,double>(home,vb) {}
00048 forceinline
00049 MeritMin::MeritMin(Space& home, bool shared, MeritMin& m)
00050 : MeritBase<FloatView,double>(home,shared,m) {}
00051 forceinline double
00052 MeritMin::operator ()(const Space&, FloatView x, int) {
00053 return x.min();
00054 }
00055
00056
00057 forceinline
00058 MeritMax::MeritMax(Space& home, const VarBranch& vb)
00059 : MeritBase<FloatView,double>(home,vb) {}
00060 forceinline
00061 MeritMax::MeritMax(Space& home, bool shared, MeritMax& m)
00062 : MeritBase<FloatView,double>(home,shared,m) {}
00063 forceinline double
00064 MeritMax::operator ()(const Space&, FloatView x, int) {
00065 return x.max();
00066 }
00067
00068
00069 forceinline
00070 MeritSize::MeritSize(Space& home, const VarBranch& vb)
00071 : MeritBase<FloatView,double>(home,vb) {}
00072 forceinline
00073 MeritSize::MeritSize(Space& home, bool shared, MeritSize& m)
00074 : MeritBase<FloatView,double>(home,shared,m) {}
00075 forceinline double
00076 MeritSize::operator ()(const Space&, FloatView x, int) {
00077 return x.size();
00078 }
00079
00080
00081 forceinline
00082 MeritDegreeSize::MeritDegreeSize(Space& home, const VarBranch& vb)
00083 : MeritBase<FloatView,double>(home,vb) {}
00084 forceinline
00085 MeritDegreeSize::MeritDegreeSize(Space& home, bool shared,
00086 MeritDegreeSize& m)
00087 : MeritBase<FloatView,double>(home,shared,m) {}
00088 forceinline double
00089 MeritDegreeSize::operator ()(const Space&, FloatView x, int) {
00090 return x.size() / static_cast<double>(x.degree());
00091 }
00092
00093
00094 forceinline
00095 MeritAFCSize::MeritAFCSize(Space& home, const VarBranch& vb)
00096 : MeritBase<FloatView,double>(home,vb), afc(vb.afc()) {}
00097 forceinline
00098 MeritAFCSize::MeritAFCSize(Space& home, bool shared, MeritAFCSize& m)
00099 : MeritBase<FloatView,double>(home,shared,m) {
00100 afc.update(home,shared,m.afc);
00101 }
00102 forceinline double
00103 MeritAFCSize::operator ()(const Space& home, FloatView x, int) {
00104 return x.size() / x.afc(home);
00105 }
00106 forceinline bool
00107 MeritAFCSize::notice(void) const {
00108 return true;
00109 }
00110 forceinline void
00111 MeritAFCSize::dispose(Space&) {
00112 afc.~AFC();
00113 }
00114
00115
00116 forceinline
00117 MeritActivitySize::MeritActivitySize(Space& home,
00118 const VarBranch& vb)
00119 : MeritBase<FloatView,double>(home,vb), activity(vb.activity()) {}
00120 forceinline
00121 MeritActivitySize::MeritActivitySize(Space& home, bool shared,
00122 MeritActivitySize& m)
00123 : MeritBase<FloatView,double>(home,shared,m) {
00124 activity.update(home, shared, m.activity);
00125 }
00126 forceinline double
00127 MeritActivitySize::operator ()(const Space&, FloatView x, int i) {
00128 return activity[i] / static_cast<double>(x.size());
00129 }
00130 forceinline bool
00131 MeritActivitySize::notice(void) const {
00132 return true;
00133 }
00134 forceinline void
00135 MeritActivitySize::dispose(Space&) {
00136 activity.~Activity();
00137 }
00138
00139 }}}
00140
00141