Generated on Fri Oct 19 11:24:54 2018 for Gecode by doxygen 1.6.3

val.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   IntValBranch::IntValBranch(Select s0)
00038     : s(s0) {}
00039 
00040   forceinline
00041   IntValBranch::IntValBranch(Rnd r)
00042     : ValBranch<IntVar>(r), s(SEL_RND) {}
00043 
00044   forceinline
00045   IntValBranch::IntValBranch(IntBranchVal v, IntBranchCommit c)
00046     : ValBranch<IntVar>(v,c), s(SEL_VAL_COMMIT) {}
00047 
00048   forceinline IntValBranch::Select
00049   IntValBranch::select(void) const {
00050     return s;
00051   }
00052 
00053 
00054   inline IntValBranch
00055   INT_VAL_MIN(void) {
00056     return IntValBranch(IntValBranch::SEL_MIN);
00057   }
00058 
00059   inline IntValBranch
00060   INT_VAL_MED(void) {
00061     return IntValBranch(IntValBranch::SEL_MED);
00062   }
00063 
00064   inline IntValBranch
00065   INT_VAL_MAX(void) {
00066     return IntValBranch(IntValBranch::SEL_MAX);
00067   }
00068 
00069   inline IntValBranch
00070   INT_VAL_RND(Rnd r) {
00071     return IntValBranch(r);
00072   }
00073 
00074   inline IntValBranch
00075   INT_VAL_SPLIT_MIN(void) {
00076     return IntValBranch(IntValBranch::SEL_SPLIT_MIN);
00077   }
00078 
00079   inline IntValBranch
00080   INT_VAL_SPLIT_MAX(void) {
00081     return IntValBranch(IntValBranch::SEL_SPLIT_MAX);
00082   }
00083 
00084   inline IntValBranch
00085   INT_VAL_RANGE_MIN(void) {
00086     return IntValBranch(IntValBranch::SEL_RANGE_MIN);
00087   }
00088 
00089   inline IntValBranch
00090   INT_VAL_RANGE_MAX(void) {
00091     return IntValBranch(IntValBranch::SEL_RANGE_MAX);
00092   }
00093 
00094   inline IntValBranch
00095   INT_VAL(IntBranchVal v, IntBranchCommit c) {
00096     return IntValBranch(v,c);
00097   }
00098 
00099   inline IntValBranch
00100   INT_VALUES_MIN(void) {
00101     return IntValBranch(IntValBranch::SEL_VALUES_MIN);
00102   }
00103 
00104   inline IntValBranch
00105   INT_VALUES_MAX(void) {
00106     return IntValBranch(IntValBranch::SEL_VALUES_MAX);
00107   }
00108 
00109 
00110 
00111   forceinline
00112   BoolValBranch::BoolValBranch(Select s0)
00113     : s(s0) {}
00114 
00115   forceinline
00116   BoolValBranch::BoolValBranch(Rnd r)
00117     : ValBranch<BoolVar>(r), s(SEL_RND) {}
00118 
00119   forceinline
00120   BoolValBranch::BoolValBranch(BoolBranchVal v, BoolBranchCommit c)
00121     : ValBranch<BoolVar>(v,c), s(SEL_VAL_COMMIT) {}
00122 
00123   forceinline BoolValBranch::Select
00124   BoolValBranch::select(void) const {
00125     return s;
00126   }
00127 
00128 
00129   inline BoolValBranch
00130   BOOL_VAL_MIN(void) {
00131     return BoolValBranch(BoolValBranch::SEL_MIN);
00132   }
00133 
00134   inline BoolValBranch
00135   BOOL_VAL_MAX(void) {
00136     return BoolValBranch(BoolValBranch::SEL_MAX);
00137   }
00138 
00139   inline BoolValBranch
00140   BOOL_VAL_RND(Rnd r) {
00141     return BoolValBranch(r);
00142   }
00143 
00144   inline BoolValBranch
00145   BOOL_VAL(BoolBranchVal v, BoolBranchCommit c) {
00146     return BoolValBranch(v,c);
00147   }
00148 
00149 }
00150 
00151 // STATISTICS: int-branch