Generated on Thu Apr 11 13:59:17 2019 for Gecode by doxygen 1.6.3

aliases.hpp

Go to the documentation of this file.
00001 /* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
00002 /*
00003  *  Main author:
00004  *     Christian Schulte <schulte@gecode.org>
00005  *     Guido Tack <tack@gecode.org>
00006  *
00007  *  Copyright:
00008  *     Christian Schulte, 2018
00009  *     Guido Tack, 2018
00010  *
00011  *  This file is part of Gecode, the generic constraint
00012  *  development environment:
00013  *     http://www.gecode.org
00014  *
00015  *  Permission is hereby granted, free of charge, to any person obtaining
00016  *  a copy of this software and associated documentation files (the
00017  *  "Software"), to deal in the Software without restriction, including
00018  *  without limitation the rights to use, copy, modify, merge, publish,
00019  *  distribute, sublicense, and/or sell copies of the Software, and to
00020  *  permit persons to whom the Software is furnished to do so, subject to
00021  *  the following conditions:
00022  *
00023  *  The above copyright notice and this permission notice shall be
00024  *  included in all copies or substantial portions of the Software.
00025  *
00026  *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00027  *  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00028  *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
00029  *  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
00030  *  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
00031  *  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
00032  *  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00033  *
00034  */
00035 
00036 namespace Gecode {
00037 
00038   inline void
00039   atmost(Home home, const IntVarArgs& x, int n, int m,
00040          IntPropLevel ipl) {
00041     count(home,x,n,IRT_LQ,m,ipl);
00042   }
00043   inline void
00044   atmost(Home home, const IntVarArgs& x, IntVar y, int m,
00045          IntPropLevel ipl) {
00046     count(home,x,y,IRT_LQ,m,ipl);
00047   }
00048   inline void
00049   atmost(Home home, const IntVarArgs& x, const IntArgs& y, int m,
00050          IntPropLevel ipl) {
00051     count(home,x,y,IRT_LQ,m,ipl);
00052   }
00053   inline void
00054   atmost(Home home, const IntVarArgs& x, int n, IntVar z,
00055          IntPropLevel ipl) {
00056     count(home,x,n,IRT_LQ,z,ipl);
00057   }
00058   inline void
00059   atmost(Home home, const IntVarArgs& x, IntVar y, IntVar z,
00060          IntPropLevel ipl) {
00061     count(home,x,y,IRT_LQ,z,ipl);
00062   }
00063   inline void
00064   atmost(Home home, const IntVarArgs& x, const IntArgs& y, IntVar z,
00065          IntPropLevel ipl) {
00066     count(home,x,y,IRT_LQ,z,ipl);
00067   }
00068 
00069   inline void
00070   atleast(Home home, const IntVarArgs& x, int n, int m,
00071           IntPropLevel ipl) {
00072     count(home,x,n,IRT_GQ,m,ipl);
00073   }
00074   inline void
00075   atleast(Home home, const IntVarArgs& x, IntVar y, int m,
00076           IntPropLevel ipl) {
00077     count(home,x,y,IRT_GQ,m,ipl);
00078   }
00079   inline void
00080   atleast(Home home, const IntVarArgs& x, const IntArgs& y, int m,
00081           IntPropLevel ipl) {
00082     count(home,x,y,IRT_GQ,m,ipl);
00083   }
00084   inline void
00085   atleast(Home home, const IntVarArgs& x, int n, IntVar z,
00086           IntPropLevel ipl) {
00087     count(home,x,n,IRT_GQ,z,ipl);
00088   }
00089   inline void
00090   atleast(Home home, const IntVarArgs& x, IntVar y, IntVar z,
00091           IntPropLevel ipl) {
00092     count(home,x,y,IRT_GQ,z,ipl);
00093   }
00094   inline void
00095   atleast(Home home, const IntVarArgs& x, const IntArgs& y, IntVar z,
00096           IntPropLevel ipl) {
00097     count(home,x,y,IRT_GQ,z,ipl);
00098   }
00099 
00100   inline void
00101   exactly(Home home, const IntVarArgs& x, int n, int m,
00102           IntPropLevel ipl) {
00103     count(home,x,n,IRT_EQ,m,ipl);
00104   }
00105   inline void
00106   exactly(Home home, const IntVarArgs& x, IntVar y, int m,
00107           IntPropLevel ipl) {
00108     count(home,x,y,IRT_EQ,m,ipl);
00109   }
00110   inline void
00111   exactly(Home home, const IntVarArgs& x, const IntArgs& y, int m,
00112           IntPropLevel ipl) {
00113     count(home,x,y,IRT_EQ,m,ipl);
00114   }
00115   inline void
00116   exactly(Home home, const IntVarArgs& x, int n, IntVar z,
00117           IntPropLevel ipl) {
00118     count(home,x,n,IRT_EQ,z,ipl);
00119   }
00120   inline void
00121   exactly(Home home, const IntVarArgs& x, IntVar y, IntVar z,
00122           IntPropLevel ipl) {
00123     count(home,x,y,IRT_EQ,z,ipl);
00124   }
00125   inline void
00126   exactly(Home home, const IntVarArgs& x, const IntArgs& y, IntVar z,
00127           IntPropLevel ipl) {
00128     count(home,x,y,IRT_EQ,z,ipl);
00129   }
00130 
00131   inline void
00132   lex(Home home, const IntVarArgs& x, IntRelType r, const IntVarArgs& y,
00133       IntPropLevel ipl) {
00134     rel(home,x,r,y,ipl);
00135   }
00136   inline void
00137   lex(Home home, const BoolVarArgs& x, IntRelType r, const BoolVarArgs& y,
00138       IntPropLevel ipl) {
00139     rel(home,x,r,y,ipl);
00140   }
00141 
00142   inline void
00143   values(Home home, const IntVarArgs& x, IntSet y,
00144          IntPropLevel ipl) {
00145     dom(home,x,y,ipl);
00146     nvalues(home,x,IRT_EQ,static_cast<int>(y.size()),ipl);
00147   }
00148 
00149 #ifdef GECODE_HAS_SET_VARS
00150 
00151   inline void
00152   channel(Home home, const IntVarArgs& x, SetVar y) {
00153     rel(home,SOT_UNION,x,y);
00154     nvalues(home,x,IRT_EQ,expr(home,cardinality(y)));
00155   }
00156 
00157   inline void
00158   range(Home home, const IntVarArgs& x, SetVar y, SetVar z) {
00159     element(home,SOT_UNION,x,y,z);
00160   }
00161 
00162   inline void
00163   roots(Home home, const IntVarArgs& x, SetVar y, SetVar z) {
00164     SetVarArgs xiv(home,z.lubMax()+1,IntSet::empty,0,x.size()-1);
00165     channel(home,x,xiv);
00166     element(home,SOT_UNION,xiv,z,y);
00167   }
00168 
00169 #endif
00170 
00171 }
00172 
00173 // STATISTICS: minimodel-any
00174