Generated on Sun Feb 17 15:24:07 2019 for Gecode by doxygen 1.6.3

var.hpp

Go to the documentation of this file.
00001 /* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
00002 /*
00003  *  Main authors:
00004  *     Christian Schulte <schulte@gecode.org>
00005  *
00006  *  Copyright:
00007  *     Christian Schulte, 2012
00008  *
00009  *  This file is part of Gecode, the generic constraint
00010  *  development environment:
00011  *     http://www.gecode.org
00012  *
00013  *  Permission is hereby granted, free of charge, to any person obtaining
00014  *  a copy of this software and associated documentation files (the
00015  *  "Software"), to deal in the Software without restriction, including
00016  *  without limitation the rights to use, copy, modify, merge, publish,
00017  *  distribute, sublicense, and/or sell copies of the Software, and to
00018  *  permit persons to whom the Software is furnished to do so, subject to
00019  *  the following conditions:
00020  *
00021  *  The above copyright notice and this permission notice shall be
00022  *  included in all copies or substantial portions of the Software.
00023  *
00024  *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00025  *  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00026  *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
00027  *  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
00028  *  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
00029  *  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
00030  *  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00031  *
00032  */
00033 
00034 namespace Gecode {
00035 
00036   forceinline
00037   FloatVarBranch::FloatVarBranch(void)
00038     : s(SEL_NONE) {}
00039 
00040   forceinline
00041   FloatVarBranch::FloatVarBranch(Select s0, BranchTbl t)
00042     : VarBranch<FloatVar>(t), s(s0) {}
00043 
00044   forceinline
00045   FloatVarBranch::FloatVarBranch(Rnd r)
00046     : VarBranch<FloatVar>(r), s(SEL_RND) {}
00047 
00048   forceinline
00049   FloatVarBranch::FloatVarBranch(Select s0, double d, BranchTbl t)
00050     : VarBranch<FloatVar>(d,t), s(s0) {}
00051 
00052   forceinline
00053   FloatVarBranch::FloatVarBranch(Select s0, FloatAFC a, BranchTbl t)
00054     : VarBranch<FloatVar>(a,t), s(s0) {}
00055 
00056   forceinline
00057   FloatVarBranch::FloatVarBranch(Select s0, FloatAction a, BranchTbl t)
00058     : VarBranch<FloatVar>(a,t), s(s0) {}
00059 
00060   forceinline
00061   FloatVarBranch::FloatVarBranch(Select s0, FloatCHB c, BranchTbl t)
00062     : VarBranch<FloatVar>(c,t), s(s0) {}
00063 
00064   forceinline
00065   FloatVarBranch::FloatVarBranch(Select s0, FloatBranchMerit mf, BranchTbl t)
00066     : VarBranch<FloatVar>(mf,t), s(s0) {}
00067 
00068   forceinline FloatVarBranch::Select
00069   FloatVarBranch::select(void) const {
00070     return s;
00071   }
00072 
00073   forceinline void
00074   FloatVarBranch::expand(Home home, const FloatVarArgs& x) {
00075     switch (select()) {
00076     case SEL_AFC_MIN: case SEL_AFC_MAX:
00077     case SEL_AFC_SIZE_MIN: case SEL_AFC_SIZE_MAX:
00078       if (!_afc)
00079         _afc = FloatAFC(home,x,decay());
00080       break;
00081     case SEL_ACTION_MIN: case SEL_ACTION_MAX:
00082     case SEL_ACTION_SIZE_MIN: case SEL_ACTION_SIZE_MAX:
00083       if (!_act)
00084         _act = FloatAction(home,x,decay());
00085       break;
00086     case SEL_CHB_MIN: case SEL_CHB_MAX:
00087     case SEL_CHB_SIZE_MIN: case SEL_CHB_SIZE_MAX:
00088       if (!_chb)
00089         _chb = FloatCHB(home,x);
00090       break;
00091     default: ;
00092     }
00093   }
00094 
00095 
00096   inline FloatVarBranch
00097   FLOAT_VAR_NONE(void) {
00098     return FloatVarBranch(FloatVarBranch::SEL_NONE,nullptr);
00099   }
00100 
00101   inline FloatVarBranch
00102   FLOAT_VAR_MERIT_MIN(FloatBranchMerit bm, BranchTbl tbl) {
00103     return FloatVarBranch(FloatVarBranch::SEL_MERIT_MIN,bm,tbl);
00104   }
00105 
00106   inline FloatVarBranch
00107   FLOAT_VAR_MERIT_MAX(FloatBranchMerit bm, BranchTbl tbl) {
00108     return FloatVarBranch(FloatVarBranch::SEL_MERIT_MAX,bm,tbl);
00109   }
00110 
00111   inline FloatVarBranch
00112   FLOAT_VAR_RND(Rnd r) {
00113     return FloatVarBranch(r);
00114   }
00115 
00116   inline FloatVarBranch
00117   FLOAT_VAR_DEGREE_MIN(BranchTbl tbl) {
00118     return FloatVarBranch(FloatVarBranch::SEL_DEGREE_MIN,tbl);
00119   }
00120 
00121   inline FloatVarBranch
00122   FLOAT_VAR_DEGREE_MAX(BranchTbl tbl) {
00123     return FloatVarBranch(FloatVarBranch::SEL_DEGREE_MAX,tbl);
00124   }
00125 
00126   inline FloatVarBranch
00127   FLOAT_VAR_AFC_MIN(double d, BranchTbl tbl) {
00128     return FloatVarBranch(FloatVarBranch::SEL_AFC_MIN,d,tbl);
00129   }
00130 
00131   inline FloatVarBranch
00132   FLOAT_VAR_AFC_MIN(FloatAFC a, BranchTbl tbl) {
00133     return FloatVarBranch(FloatVarBranch::SEL_AFC_MIN,a,tbl);
00134   }
00135 
00136   inline FloatVarBranch
00137   FLOAT_VAR_AFC_MAX(double d, BranchTbl tbl) {
00138     return FloatVarBranch(FloatVarBranch::SEL_AFC_MAX,d,tbl);
00139   }
00140 
00141   inline FloatVarBranch
00142   FLOAT_VAR_AFC_MAX(FloatAFC a, BranchTbl tbl) {
00143     return FloatVarBranch(FloatVarBranch::SEL_AFC_MAX,a,tbl);
00144   }
00145 
00146   inline FloatVarBranch
00147   FLOAT_VAR_ACTION_MIN(double d, BranchTbl tbl) {
00148     return FloatVarBranch(FloatVarBranch::SEL_ACTION_MIN,d,tbl);
00149   }
00150 
00151   inline FloatVarBranch
00152   FLOAT_VAR_ACTION_MIN(FloatAction a, BranchTbl tbl) {
00153     return FloatVarBranch(FloatVarBranch::SEL_ACTION_MIN,a,tbl);
00154   }
00155 
00156   inline FloatVarBranch
00157   FLOAT_VAR_ACTION_MAX(double d, BranchTbl tbl) {
00158     return FloatVarBranch(FloatVarBranch::SEL_ACTION_MAX,d,tbl);
00159   }
00160 
00161   inline FloatVarBranch
00162   FLOAT_VAR_ACTION_MAX(FloatAction a, BranchTbl tbl) {
00163     return FloatVarBranch(FloatVarBranch::SEL_ACTION_MAX,a,tbl);
00164   }
00165 
00166   inline FloatVarBranch
00167   FLOAT_VAR_CHB_MIN(BranchTbl tbl) {
00168     return FloatVarBranch(FloatVarBranch::SEL_CHB_MIN,tbl);
00169   }
00170 
00171   inline FloatVarBranch
00172   FLOAT_VAR_CHB_MIN(FloatCHB c, BranchTbl tbl) {
00173     return FloatVarBranch(FloatVarBranch::SEL_CHB_MIN,c,tbl);
00174   }
00175 
00176   inline FloatVarBranch
00177   FLOAT_VAR_CHB_MAX(BranchTbl tbl) {
00178     return FloatVarBranch(FloatVarBranch::SEL_CHB_MAX,tbl);
00179   }
00180 
00181   inline FloatVarBranch
00182   FLOAT_VAR_CHB_MAX(FloatCHB c, BranchTbl tbl) {
00183     return FloatVarBranch(FloatVarBranch::SEL_CHB_MAX,c,tbl);
00184   }
00185 
00186   inline FloatVarBranch
00187   FLOAT_VAR_MIN_MIN(BranchTbl tbl) {
00188     return FloatVarBranch(FloatVarBranch::SEL_MIN_MIN,tbl);
00189   }
00190 
00191   inline FloatVarBranch
00192   FLOAT_VAR_MIN_MAX(BranchTbl tbl) {
00193     return FloatVarBranch(FloatVarBranch::SEL_MIN_MAX,tbl);
00194   }
00195 
00196   inline FloatVarBranch
00197   FLOAT_VAR_MAX_MIN(BranchTbl tbl) {
00198     return FloatVarBranch(FloatVarBranch::SEL_MAX_MIN,tbl);
00199   }
00200 
00201   inline FloatVarBranch
00202   FLOAT_VAR_MAX_MAX(BranchTbl tbl) {
00203     return FloatVarBranch(FloatVarBranch::SEL_MAX_MAX,tbl);
00204   }
00205 
00206   inline FloatVarBranch
00207   FLOAT_VAR_SIZE_MIN(BranchTbl tbl) {
00208     return FloatVarBranch(FloatVarBranch::SEL_SIZE_MIN,tbl);
00209   }
00210 
00211   inline FloatVarBranch
00212   FLOAT_VAR_SIZE_MAX(BranchTbl tbl) {
00213     return FloatVarBranch(FloatVarBranch::SEL_SIZE_MAX,tbl);
00214   }
00215 
00216   inline FloatVarBranch
00217   FLOAT_VAR_DEGREE_SIZE_MIN(BranchTbl tbl) {
00218     return FloatVarBranch(FloatVarBranch::SEL_DEGREE_SIZE_MIN,tbl);
00219   }
00220 
00221   inline FloatVarBranch
00222   FLOAT_VAR_DEGREE_SIZE_MAX(BranchTbl tbl) {
00223     return FloatVarBranch(FloatVarBranch::SEL_DEGREE_SIZE_MAX,tbl);
00224   }
00225 
00226   inline FloatVarBranch
00227   FLOAT_VAR_AFC_SIZE_MIN(double d, BranchTbl tbl) {
00228     return FloatVarBranch(FloatVarBranch::SEL_AFC_SIZE_MIN,d,tbl);
00229   }
00230 
00231   inline FloatVarBranch
00232   FLOAT_VAR_AFC_SIZE_MIN(FloatAFC a, BranchTbl tbl) {
00233     return FloatVarBranch(FloatVarBranch::SEL_AFC_SIZE_MIN,a,tbl);
00234   }
00235 
00236   inline FloatVarBranch
00237   FLOAT_VAR_AFC_SIZE_MAX(double d, BranchTbl tbl) {
00238     return FloatVarBranch(FloatVarBranch::SEL_AFC_SIZE_MAX,d,tbl);
00239   }
00240 
00241   inline FloatVarBranch
00242   FLOAT_VAR_AFC_SIZE_MAX(FloatAFC a, BranchTbl tbl) {
00243     return FloatVarBranch(FloatVarBranch::SEL_AFC_SIZE_MAX,a,tbl);
00244   }
00245 
00246   inline FloatVarBranch
00247   FLOAT_VAR_ACTION_SIZE_MIN(double d, BranchTbl tbl) {
00248     return FloatVarBranch(FloatVarBranch::SEL_ACTION_SIZE_MIN,d,tbl);
00249   }
00250 
00251   inline FloatVarBranch
00252   FLOAT_VAR_ACTION_SIZE_MIN(FloatAction a, BranchTbl tbl) {
00253     return FloatVarBranch(FloatVarBranch::SEL_ACTION_SIZE_MIN,a,tbl);
00254   }
00255 
00256   inline FloatVarBranch
00257   FLOAT_VAR_ACTION_SIZE_MAX(double d, BranchTbl tbl) {
00258     return FloatVarBranch(FloatVarBranch::SEL_ACTION_SIZE_MAX,d,tbl);
00259   }
00260 
00261   inline FloatVarBranch
00262   FLOAT_VAR_ACTION_SIZE_MAX(FloatAction a, BranchTbl tbl) {
00263     return FloatVarBranch(FloatVarBranch::SEL_ACTION_SIZE_MAX,a,tbl);
00264   }
00265 
00266   inline FloatVarBranch
00267   FLOAT_VAR_CHB_SIZE_MIN(BranchTbl tbl) {
00268     return FloatVarBranch(FloatVarBranch::SEL_CHB_SIZE_MIN,tbl);
00269   }
00270 
00271   inline FloatVarBranch
00272   FLOAT_VAR_CHB_SIZE_MIN(FloatCHB c, BranchTbl tbl) {
00273     return FloatVarBranch(FloatVarBranch::SEL_CHB_SIZE_MIN,c,tbl);
00274   }
00275 
00276   inline FloatVarBranch
00277   FLOAT_VAR_CHB_SIZE_MAX(BranchTbl tbl) {
00278     return FloatVarBranch(FloatVarBranch::SEL_CHB_SIZE_MAX,tbl);
00279   }
00280 
00281   inline FloatVarBranch
00282   FLOAT_VAR_CHB_SIZE_MAX(FloatCHB c, BranchTbl tbl) {
00283     return FloatVarBranch(FloatVarBranch::SEL_CHB_SIZE_MAX,c,tbl);
00284   }
00285 
00286 }
00287 
00288 // STATISTICS: float-branch