Go to the documentation of this file.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 MiniModel {
00039
00040 template<IntRelType irt>
00041 forceinline
00042 IntOptimizeSpace<irt>::IntOptimizeSpace(void) {}
00043
00044 template<IntRelType irt>
00045 forceinline
00046 IntOptimizeSpace<irt>::IntOptimizeSpace(bool share, IntOptimizeSpace& s)
00047 : Space(share,s) {}
00048
00049 template<IntRelType irt>
00050 void
00051 IntOptimizeSpace<irt>::constrain(const Space& _best) {
00052 const IntOptimizeSpace<irt>* best =
00053 dynamic_cast<const IntOptimizeSpace<irt>*>(&_best);
00054 if (best == NULL)
00055 throw DynamicCastFailed("IntOptimizeSpace::constrain");
00056 rel(*this, cost(), irt, best->cost().val());
00057 }
00058
00059 #ifdef GECODE_HAS_FLOAT_VARS
00060
00061 template<FloatRelType frt>
00062 forceinline
00063 FloatOptimizeSpace<frt>::FloatOptimizeSpace(void) {}
00064
00065 template<FloatRelType frt>
00066 forceinline
00067 FloatOptimizeSpace<frt>::FloatOptimizeSpace(bool share,
00068 FloatOptimizeSpace& s)
00069 : Space(share,s) {}
00070
00071 template<FloatRelType frt>
00072 void
00073 FloatOptimizeSpace<frt>::constrain(const Space& _best) {
00074 const FloatOptimizeSpace<frt>* best =
00075 dynamic_cast<const FloatOptimizeSpace<frt>*>(&_best);
00076 if (best == NULL)
00077 throw DynamicCastFailed("FloatOptimizeSpace::constrain");
00078 rel(*this, cost(), frt, best->cost().val());
00079 }
00080
00081 #endif
00082
00083 }}
00084
00085
00086