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<Var>& 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<Var>& 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<Var>& 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<Var>& 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<Var>& 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&, FloatView x, int) {
00104 return x.afc() / static_cast<double>(x.size());
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 MeritActionSize::MeritActionSize(Space& home,
00118 const VarBranch<Var>& vb)
00119 : MeritBase<FloatView,double>(home,vb), action(vb.action()) {}
00120 forceinline
00121 MeritActionSize::MeritActionSize(Space& home, bool shared,
00122 MeritActionSize& m)
00123 : MeritBase<FloatView,double>(home,shared,m) {
00124 action.update(home, shared, m.action);
00125 }
00126 forceinline double
00127 MeritActionSize::operator ()(const Space&, FloatView x, int i) {
00128 return action[i] / static_cast<double>(x.size());
00129 }
00130 forceinline bool
00131 MeritActionSize::notice(void) const {
00132 return true;
00133 }
00134 forceinline void
00135 MeritActionSize::dispose(Space&) {
00136 action.~Action();
00137 }
00138
00139
00140
00141 forceinline
00142 MeritCHBSize::MeritCHBSize(Space& home,
00143 const VarBranch<Var>& vb)
00144 : MeritBase<FloatView,double>(home,vb), chb(vb.chb()) {}
00145 forceinline
00146 MeritCHBSize::MeritCHBSize(Space& home, bool shared,
00147 MeritCHBSize& m)
00148 : MeritBase<FloatView,double>(home,shared,m) {
00149 chb.update(home, shared, m.chb);
00150 }
00151 forceinline double
00152 MeritCHBSize::operator ()(const Space&, FloatView x, int i) {
00153 return chb[i] / static_cast<double>(x.size());
00154 }
00155 forceinline bool
00156 MeritCHBSize::notice(void) const {
00157 return true;
00158 }
00159 forceinline void
00160 MeritCHBSize::dispose(Space&) {
00161 chb.~CHB();
00162 }
00163
00164 }}}
00165
00166