aliases.hpp
Go to the documentation of this file.
/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
* Main author:
* Christian Schulte <schulte@gecode.org>
* Guido Tack <tack@gecode.org>
*
* Copyright:
* Christian Schulte, 2018
* Guido Tack, 2018
*
* This file is part of Gecode, the generic constraint
* development environment:
* http://www.gecode.org
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
namespace Gecode {
inline void
atmost(Home home, const IntVarArgs& x, int n, int m,
IntPropLevel ipl) {
count(home,x,n,IRT_LQ,m,ipl);
}
inline void
atmost(Home home, const IntVarArgs& x, IntVar y, int m,
IntPropLevel ipl) {
count(home,x,y,IRT_LQ,m,ipl);
}
inline void
atmost(Home home, const IntVarArgs& x, const IntArgs& y, int m,
IntPropLevel ipl) {
count(home,x,y,IRT_LQ,m,ipl);
}
inline void
atmost(Home home, const IntVarArgs& x, int n, IntVar z,
IntPropLevel ipl) {
count(home,x,n,IRT_LQ,z,ipl);
}
inline void
atmost(Home home, const IntVarArgs& x, IntVar y, IntVar z,
IntPropLevel ipl) {
count(home,x,y,IRT_LQ,z,ipl);
}
inline void
atmost(Home home, const IntVarArgs& x, const IntArgs& y, IntVar z,
IntPropLevel ipl) {
count(home,x,y,IRT_LQ,z,ipl);
}
inline void
atleast(Home home, const IntVarArgs& x, int n, int m,
IntPropLevel ipl) {
count(home,x,n,IRT_GQ,m,ipl);
}
inline void
atleast(Home home, const IntVarArgs& x, IntVar y, int m,
IntPropLevel ipl) {
count(home,x,y,IRT_GQ,m,ipl);
}
inline void
atleast(Home home, const IntVarArgs& x, const IntArgs& y, int m,
IntPropLevel ipl) {
count(home,x,y,IRT_GQ,m,ipl);
}
inline void
atleast(Home home, const IntVarArgs& x, int n, IntVar z,
IntPropLevel ipl) {
count(home,x,n,IRT_GQ,z,ipl);
}
inline void
atleast(Home home, const IntVarArgs& x, IntVar y, IntVar z,
IntPropLevel ipl) {
count(home,x,y,IRT_GQ,z,ipl);
}
inline void
atleast(Home home, const IntVarArgs& x, const IntArgs& y, IntVar z,
IntPropLevel ipl) {
count(home,x,y,IRT_GQ,z,ipl);
}
inline void
exactly(Home home, const IntVarArgs& x, int n, int m,
IntPropLevel ipl) {
count(home,x,n,IRT_EQ,m,ipl);
}
inline void
exactly(Home home, const IntVarArgs& x, IntVar y, int m,
IntPropLevel ipl) {
count(home,x,y,IRT_EQ,m,ipl);
}
inline void
exactly(Home home, const IntVarArgs& x, const IntArgs& y, int m,
IntPropLevel ipl) {
count(home,x,y,IRT_EQ,m,ipl);
}
inline void
exactly(Home home, const IntVarArgs& x, int n, IntVar z,
IntPropLevel ipl) {
count(home,x,n,IRT_EQ,z,ipl);
}
inline void
exactly(Home home, const IntVarArgs& x, IntVar y, IntVar z,
IntPropLevel ipl) {
count(home,x,y,IRT_EQ,z,ipl);
}
inline void
exactly(Home home, const IntVarArgs& x, const IntArgs& y, IntVar z,
IntPropLevel ipl) {
count(home,x,y,IRT_EQ,z,ipl);
}
inline void
lex(Home home, const IntVarArgs& x, IntRelType r, const IntVarArgs& y,
IntPropLevel ipl) {
rel(home,x,r,y,ipl);
}
inline void
lex(Home home, const BoolVarArgs& x, IntRelType r, const BoolVarArgs& y,
IntPropLevel ipl) {
rel(home,x,r,y,ipl);
}
inline void
values(Home home, const IntVarArgs& x, IntSet y,
IntPropLevel ipl) {
dom(home,x,y,ipl);
nvalues(home,x,IRT_EQ,static_cast<int>(y.size()),ipl);
}
#ifdef GECODE_HAS_SET_VARS
inline void
channel(Home home, const IntVarArgs& x, SetVar y) {
rel(home,SOT_UNION,x,y);
nvalues(home,x,IRT_EQ,expr(home,cardinality(y)));
}
inline void
range(Home home, const IntVarArgs& x, SetVar y, SetVar z) {
element(home,SOT_UNION,x,y,z);
}
inline void
roots(Home home, const IntVarArgs& x, SetVar y, SetVar z) {
SetVarArgs xiv(home,z.lubMax()+1,IntSet::empty,0,x.size()-1);
channel(home,x,xiv);
element(home,SOT_UNION,xiv,z,y);
}
#endif
}
// STATISTICS: minimodel-any
Gecode::ArgArrayBase::size
int size(void) const
Return size of array (number of elements).
Definition array.hpp:1607
Gecode::BoolVarArgs
Passing Boolean variables.
Definition int.hh:712
Gecode::Home
Home class for posting propagators
Definition core.hpp:856
Gecode::IntArgs
Passing integer arguments.
Definition int.hh:628
Gecode::IntSet
Integer sets.
Definition int.hh:174
Gecode::IntSet::size
unsigned int size(void) const
Return size (cardinality) of set.
Definition int-set-1.hpp:198
Gecode::IntSet::empty
static const IntSet empty
Empty set.
Definition int.hh:283
Gecode::IntVarArgs
Passing integer variables.
Definition int.hh:656
Gecode::IntVar
Integer variables.
Definition int.hh:371
Gecode::SetVarArgs
Passing set variables.
Definition set.hh:488
Gecode::SetVar
Set variables
Definition set.hh:127
Gecode::SetVar::lubMax
int lubMax(void) const
Return maximum element of least upper bound.
Definition set.hpp:87
Gecode::rel
void rel(Home home, FloatVar x0, FloatRelType frt, FloatVar x1)
Post propagator for .
Definition rel.cpp:68
Gecode::IntRelType
IntRelType
Relation types for integers.
Definition int.hh:925
Gecode::IntPropLevel
IntPropLevel
Propagation levels for integer propagators.
Definition int.hh:974
Gecode::IRT_EQ
@ IRT_EQ
Equality ( ).
Definition int.hh:926
Gecode::IRT_GQ
@ IRT_GQ
Greater or equal ( ).
Definition int.hh:930
Gecode::IRT_LQ
@ IRT_LQ
Less or equal ( ).
Definition int.hh:928
Gecode::SOT_UNION
@ SOT_UNION
Union.
Definition set.hh:661
Gecode
Gecode toplevel namespace
Gecode::lex
void lex(Home home, const IntVarArgs &x, IntRelType r, const IntVarArgs &y, IntPropLevel ipl=IPL_DEF)
Post lexical order between x and y.
Definition aliases.hpp:132
Gecode::count
void count(Home home, const IntVarArgs &x, int n, IntRelType irt, int m, IntPropLevel ipl=IPL_DEF)
Post propagator for .
Definition count.cpp:40
Gecode::channel
void channel(Home home, FloatVar x0, IntVar x1)
Post propagator for channeling a float and an integer variable .
Definition channel.cpp:41
Gecode::atmost
void atmost(Home home, const IntVarArgs &x, int n, int m, IntPropLevel ipl=IPL_DEF)
Post constraint .
Definition aliases.hpp:39
Gecode::expr
IntVar expr(Home home, const LinIntExpr &e, const IntPropLevels &ipls=IntPropLevels::def)
Post linear expression and return its value.
Definition int-expr.cpp:915
Gecode::atleast
void atleast(Home home, const IntVarArgs &x, int n, int m, IntPropLevel ipl=IPL_DEF)
Post constraint .
Definition aliases.hpp:70
Gecode::dom
void dom(Home home, FloatVar x, FloatVal n)
Propagates .
Definition dom.cpp:40
Gecode::element
void element(Home home, IntSharedArray n, IntVar x0, IntVar x1, IntPropLevel ipl=IPL_DEF)
Post domain consistent propagator for .
Definition element.cpp:39
Gecode::range
void range(Home home, const IntVarArgs &x, SetVar y, SetVar z)
Post constraint .
Definition aliases.hpp:158
Gecode::roots
void roots(Home home, const IntVarArgs &x, SetVar y, SetVar z)
Post constraint .
Definition aliases.hpp:163
Gecode::values
void values(Home home, const IntVarArgs &x, IntSet y, IntPropLevel ipl=IPL_DEF)
Post constraint .
Definition aliases.hpp:143
Gecode::exactly
void exactly(Home home, const IntVarArgs &x, int n, int m, IntPropLevel ipl=IPL_DEF)
Post constraint .
Definition aliases.hpp:101
Gecode::nvalues
void nvalues(Home home, const IntVarArgs &x, IntRelType irt, int y, IntPropLevel ipl=IPL_DEF)
Post propagator for .
Definition nvalues.cpp:40
Gecode::cardinality
LinIntExpr cardinality(const SetExpr &)
Cardinality of set expression.
Definition set-expr.cpp:817