re-nary.icc
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 namespace Gecode { namespace Set { namespace Projection {
00023
00024 forceinline
00025 ReNaryProjection::ReNaryProjection
00026 (Space* home, ViewArray<SetView>& x0, Gecode::Int::BoolView b0,
00027 ProjectorSet& ps0)
00028 : Propagator(home,true), x(x0), b(b0), ps(ps0) {
00029 x.subscribe(home, this, PC_SET_ANY);
00030 b.subscribe(home,this,Gecode::Int::PC_INT_VAL);
00031 }
00032
00033 forceinline
00034 ReNaryProjection::ReNaryProjection
00035 (Space* home, bool share, ReNaryProjection& p)
00036 : Propagator(home,share,p), ps(p.ps) {
00037 x.update(home,share,p.x);
00038 b.update(home,share,p.b);
00039 }
00040
00041 forceinline PropCost
00042 ReNaryProjection::cost(void) const {
00043 switch (x.size()) {
00044 case 1: return PC_UNARY_HI;
00045 case 2: return PC_BINARY_HI;
00046 case 3: return PC_TERNARY_HI;
00047 default: return PC_LINEAR_HI;
00048 }
00049 }
00050
00051 }}}
00052
00053