cardinality.cc
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 #include "gecode/set.hh"
00029 #include "gecode/set/int.hh"
00030
00031 namespace Gecode {
00032
00033 void
00034 cardinality(Space* home, SetVar x, unsigned int i, unsigned int j) {
00035 if (home->failed()) return;
00036 Set::SetView _x(x);
00037 GECODE_ME_FAIL(home,_x.cardMin(home, i));
00038 GECODE_ME_FAIL(home,_x.cardMax(home, j));
00039 }
00040
00041 void
00042 cardinality(Space* home, SetVar s, IntVar x) {
00043 if (home->failed()) return;
00044 GECODE_ES_FAIL(home,Set::Int::Card::post(home,s, x));
00045 }
00046
00047 }
00048
00049