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 namespace Gecode { namespace Float { namespace Branch {
00039
00040
00041 forceinline
00042 MeritMin::MeritMin(Space& home, const VarBranch<Var>& vb)
00043 : MeritBase<FloatView,double>(home,vb) {}
00044 forceinline
00045 MeritMin::MeritMin(Space& home, MeritMin& m)
00046 : MeritBase<FloatView,double>(home,m) {}
00047 forceinline double
00048 MeritMin::operator ()(const Space&, FloatView x, int) {
00049 return x.min();
00050 }
00051
00052
00053 forceinline
00054 MeritMax::MeritMax(Space& home, const VarBranch<Var>& vb)
00055 : MeritBase<FloatView,double>(home,vb) {}
00056 forceinline
00057 MeritMax::MeritMax(Space& home, MeritMax& m)
00058 : MeritBase<FloatView,double>(home,m) {}
00059 forceinline double
00060 MeritMax::operator ()(const Space&, FloatView x, int) {
00061 return x.max();
00062 }
00063
00064
00065 forceinline
00066 MeritSize::MeritSize(Space& home, const VarBranch<Var>& vb)
00067 : MeritBase<FloatView,double>(home,vb) {}
00068 forceinline
00069 MeritSize::MeritSize(Space& home, MeritSize& m)
00070 : MeritBase<FloatView,double>(home,m) {}
00071 forceinline double
00072 MeritSize::operator ()(const Space&, FloatView x, int) {
00073 return x.size();
00074 }
00075
00076
00077 forceinline
00078 MeritDegreeSize::MeritDegreeSize(Space& home, const VarBranch<Var>& vb)
00079 : MeritBase<FloatView,double>(home,vb) {}
00080 forceinline
00081 MeritDegreeSize::MeritDegreeSize(Space& home,
00082 MeritDegreeSize& m)
00083 : MeritBase<FloatView,double>(home,m) {}
00084 forceinline double
00085 MeritDegreeSize::operator ()(const Space&, FloatView x, int) {
00086 return x.size() / static_cast<double>(x.degree());
00087 }
00088
00089
00090 forceinline
00091 MeritAFCSize::MeritAFCSize(Space& home, const VarBranch<Var>& vb)
00092 : MeritBase<FloatView,double>(home,vb), afc(vb.afc()) {}
00093 forceinline
00094 MeritAFCSize::MeritAFCSize(Space& home, MeritAFCSize& m)
00095 : MeritBase<FloatView,double>(home,m), afc(m.afc) {}
00096 forceinline double
00097 MeritAFCSize::operator ()(const Space&, FloatView x, int) {
00098 return x.afc() / static_cast<double>(x.size());
00099 }
00100 forceinline bool
00101 MeritAFCSize::notice(void) const {
00102 return false;
00103 }
00104 forceinline void
00105 MeritAFCSize::dispose(Space&) {
00106
00107 afc.~AFC();
00108 }
00109
00110
00111 forceinline
00112 MeritActionSize::MeritActionSize(Space& home,
00113 const VarBranch<Var>& vb)
00114 : MeritBase<FloatView,double>(home,vb), action(vb.action()) {}
00115 forceinline
00116 MeritActionSize::MeritActionSize(Space& home,
00117 MeritActionSize& m)
00118 : MeritBase<FloatView,double>(home,m), action(m.action) {}
00119 forceinline double
00120 MeritActionSize::operator ()(const Space&, FloatView x, int i) {
00121 return action[i] / static_cast<double>(x.size());
00122 }
00123 forceinline bool
00124 MeritActionSize::notice(void) const {
00125 return true;
00126 }
00127 forceinline void
00128 MeritActionSize::dispose(Space&) {
00129 action.~Action();
00130 }
00131
00132
00133
00134 forceinline
00135 MeritCHBSize::MeritCHBSize(Space& home,
00136 const VarBranch<Var>& vb)
00137 : MeritBase<FloatView,double>(home,vb), chb(vb.chb()) {}
00138 forceinline
00139 MeritCHBSize::MeritCHBSize(Space& home,
00140 MeritCHBSize& m)
00141 : MeritBase<FloatView,double>(home,m), chb(m.chb) {}
00142 forceinline double
00143 MeritCHBSize::operator ()(const Space&, FloatView x, int i) {
00144 return chb[i] / static_cast<double>(x.size());
00145 }
00146 forceinline bool
00147 MeritCHBSize::notice(void) const {
00148 return true;
00149 }
00150 forceinline void
00151 MeritCHBSize::dispose(Space&) {
00152 chb.~CHB();
00153 }
00154
00155 }}}
00156
00157