var-type.hpp
Go to the documentation of this file.
/*
* CAUTION:
* This file has been automatically generated. Do not edit,
* edit the following files instead:
* - ./gecode/int/var-imp/int.vis
* - ./gecode/int/var-imp/bool.vis
* - ./gecode/set/var-imp/set.vis
* - ./gecode/float/var-imp/float.vis
*
* This file contains generated code fragments which are
* copyrighted as follows:
*
* Main author:
* Christian Schulte <schulte@gecode.org>
*
* Copyright:
* Christian Schulte, 2007
*
* The generated code fragments are 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.
*
*/
#ifdef GECODE_HAS_INT_VARS
namespace Gecode { namespace Int {
const Gecode::ModEvent ME_INT_FAILED = Gecode::ME_GEN_FAILED;
const Gecode::ModEvent ME_INT_NONE = Gecode::ME_GEN_NONE;
const Gecode::ModEvent ME_INT_VAL = Gecode::ME_GEN_ASSIGNED;
const Gecode::ModEvent ME_INT_BND = Gecode::ME_GEN_ASSIGNED + 1;
const Gecode::ModEvent ME_INT_DOM = Gecode::ME_GEN_ASSIGNED + 2;
const Gecode::PropCond PC_INT_NONE = Gecode::PC_GEN_NONE;
const Gecode::PropCond PC_INT_VAL = Gecode::PC_GEN_ASSIGNED;
const Gecode::PropCond PC_INT_BND = Gecode::PC_GEN_ASSIGNED + 1;
const Gecode::PropCond PC_INT_DOM = Gecode::PC_GEN_ASSIGNED + 2;
}}
#endif
#ifdef GECODE_HAS_INT_VARS
namespace Gecode { namespace Int {
const Gecode::ModEvent ME_BOOL_FAILED = Gecode::ME_GEN_FAILED;
const Gecode::ModEvent ME_BOOL_NONE = Gecode::ME_GEN_NONE;
const Gecode::ModEvent ME_BOOL_VAL = Gecode::ME_GEN_ASSIGNED;
const Gecode::PropCond PC_BOOL_NONE = Gecode::PC_GEN_NONE;
const Gecode::PropCond PC_BOOL_VAL = Gecode::PC_GEN_ASSIGNED;
}}
#endif
#ifdef GECODE_HAS_SET_VARS
namespace Gecode { namespace Set {
const Gecode::ModEvent ME_SET_FAILED = Gecode::ME_GEN_FAILED;
const Gecode::ModEvent ME_SET_NONE = Gecode::ME_GEN_NONE;
const Gecode::ModEvent ME_SET_VAL = Gecode::ME_GEN_ASSIGNED;
const Gecode::ModEvent ME_SET_CARD = Gecode::ME_GEN_ASSIGNED + 1;
const Gecode::ModEvent ME_SET_LUB = Gecode::ME_GEN_ASSIGNED + 2;
const Gecode::ModEvent ME_SET_GLB = Gecode::ME_GEN_ASSIGNED + 3;
const Gecode::ModEvent ME_SET_BB = Gecode::ME_GEN_ASSIGNED + 4;
const Gecode::ModEvent ME_SET_CLUB = Gecode::ME_GEN_ASSIGNED + 5;
const Gecode::ModEvent ME_SET_CGLB = Gecode::ME_GEN_ASSIGNED + 6;
const Gecode::ModEvent ME_SET_CBB = Gecode::ME_GEN_ASSIGNED + 7;
const Gecode::PropCond PC_SET_NONE = Gecode::PC_GEN_NONE;
const Gecode::PropCond PC_SET_VAL = Gecode::PC_GEN_ASSIGNED;
const Gecode::PropCond PC_SET_CARD = Gecode::PC_GEN_ASSIGNED + 1;
const Gecode::PropCond PC_SET_CLUB = Gecode::PC_GEN_ASSIGNED + 2;
const Gecode::PropCond PC_SET_CGLB = Gecode::PC_GEN_ASSIGNED + 3;
const Gecode::PropCond PC_SET_ANY = Gecode::PC_GEN_ASSIGNED + 4;
}}
#endif
#ifdef GECODE_HAS_FLOAT_VARS
namespace Gecode { namespace Float {
const Gecode::ModEvent ME_FLOAT_FAILED = Gecode::ME_GEN_FAILED;
const Gecode::ModEvent ME_FLOAT_NONE = Gecode::ME_GEN_NONE;
const Gecode::ModEvent ME_FLOAT_VAL = Gecode::ME_GEN_ASSIGNED;
const Gecode::ModEvent ME_FLOAT_BND = Gecode::ME_GEN_ASSIGNED + 1;
const Gecode::PropCond PC_FLOAT_NONE = Gecode::PC_GEN_NONE;
const Gecode::PropCond PC_FLOAT_VAL = Gecode::PC_GEN_ASSIGNED;
const Gecode::PropCond PC_FLOAT_BND = Gecode::PC_GEN_ASSIGNED + 1;
}}
#endif
#ifdef GECODE_HAS_INT_VARS
namespace Gecode { namespace Int {
class IntVarImpConf {
public:
static const int idx_c = 0;
static const int idx_d = -1;
static const Gecode::PropCond pc_max = PC_INT_DOM;
static const int free_bits = 0;
static const int med_fst = 0;
static const int med_lst = med_fst + 2;
static const int med_mask = ((1 << 2) - 1) << med_fst;
static Gecode::ModEvent me_combine(Gecode::ModEvent me1, Gecode::ModEvent me2);
static bool med_update(Gecode::ModEventDelta& med, Gecode::ModEvent me);
};
}}
#else
namespace Gecode { namespace Int {
class IntVarImpConf {
public:
static const int idx_c = -1;
static const int idx_d = -1;
static const int med_lst = 0;
};
}}
#endif
#ifdef GECODE_HAS_INT_VARS
namespace Gecode { namespace Int {
class BoolVarImpConf {
public:
static const int idx_c = Gecode::Int::IntVarImpConf::idx_c+1;
static const int idx_d = Gecode::Int::IntVarImpConf::idx_d;
static const Gecode::PropCond pc_max = PC_BOOL_VAL;
static const int free_bits = 2;
static const int med_fst = Gecode::Int::IntVarImpConf::med_lst;
static const int med_lst = med_fst + 1;
static const int med_mask = ((1 << 1) - 1) << med_fst;
static Gecode::ModEvent me_combine(Gecode::ModEvent me1, Gecode::ModEvent me2);
static bool med_update(Gecode::ModEventDelta& med, Gecode::ModEvent me);
};
}}
#else
namespace Gecode { namespace Int {
class BoolVarImpConf {
public:
static const int idx_c = Gecode::Int::IntVarImpConf::idx_c;
static const int idx_d = Gecode::Int::IntVarImpConf::idx_d;
static const int med_lst = Gecode::Int::IntVarImpConf::med_lst;
};
}}
#endif
#ifdef GECODE_HAS_SET_VARS
namespace Gecode { namespace Set {
class SetVarImpConf {
public:
static const int idx_c = Gecode::Int::BoolVarImpConf::idx_c+1;
static const int idx_d = Gecode::Int::BoolVarImpConf::idx_d;
static const Gecode::PropCond pc_max = PC_SET_ANY;
static const int free_bits = 0;
static const int med_fst = Gecode::Int::BoolVarImpConf::med_lst;
static const int med_lst = med_fst + 4;
static const int med_mask = ((1 << 4) - 1) << med_fst;
static Gecode::ModEvent me_combine(Gecode::ModEvent me1, Gecode::ModEvent me2);
static bool med_update(Gecode::ModEventDelta& med, Gecode::ModEvent me);
};
}}
#else
namespace Gecode { namespace Set {
class SetVarImpConf {
public:
static const int idx_c = Gecode::Int::BoolVarImpConf::idx_c;
static const int idx_d = Gecode::Int::BoolVarImpConf::idx_d;
static const int med_lst = Gecode::Int::BoolVarImpConf::med_lst;
};
}}
#endif
#ifdef GECODE_HAS_FLOAT_VARS
namespace Gecode { namespace Float {
class FloatVarImpConf {
public:
static const int idx_c = Gecode::Set::SetVarImpConf::idx_c+1;
static const int idx_d = Gecode::Set::SetVarImpConf::idx_d;
static const Gecode::PropCond pc_max = PC_FLOAT_BND;
static const int free_bits = 0;
static const int med_fst = Gecode::Set::SetVarImpConf::med_lst;
static const int med_lst = med_fst + 2;
static const int med_mask = ((1 << 2) - 1) << med_fst;
static Gecode::ModEvent me_combine(Gecode::ModEvent me1, Gecode::ModEvent me2);
static bool med_update(Gecode::ModEventDelta& med, Gecode::ModEvent me);
};
}}
#else
namespace Gecode { namespace Float {
class FloatVarImpConf {
public:
static const int idx_c = Gecode::Set::SetVarImpConf::idx_c;
static const int idx_d = Gecode::Set::SetVarImpConf::idx_d;
static const int med_lst = Gecode::Set::SetVarImpConf::med_lst;
};
}}
#endif
namespace Gecode {
class AllVarConf {
public:
static const int idx_c = Gecode::Float::FloatVarImpConf::idx_c+1;
static const int idx_d = Gecode::Float::FloatVarImpConf::idx_d+1;
static ModEventDelta med_combine(ModEventDelta med1, ModEventDelta med2);
};
}
#ifdef GECODE_HAS_INT_VARS
namespace Gecode { namespace Int {
forceinline Gecode::ModEvent
IntVarImpConf::me_combine(Gecode::ModEvent me1, Gecode::ModEvent me2) {
static const Gecode::ModEvent me_c = (
(
(ME_INT_NONE << 0) | // [ME_INT_NONE][ME_INT_NONE]
(ME_INT_VAL << 2) | // [ME_INT_NONE][ME_INT_VAL ]
(ME_INT_BND << 4) | // [ME_INT_NONE][ME_INT_BND ]
(ME_INT_DOM << 6) // [ME_INT_NONE][ME_INT_DOM ]
) |
(
(ME_INT_VAL << 8) | // [ME_INT_VAL ][ME_INT_NONE]
(ME_INT_VAL << 10) | // [ME_INT_VAL ][ME_INT_VAL ]
(ME_INT_VAL << 12) | // [ME_INT_VAL ][ME_INT_BND ]
(ME_INT_VAL << 14) // [ME_INT_VAL ][ME_INT_DOM ]
) |
(
(ME_INT_BND << 16) | // [ME_INT_BND ][ME_INT_NONE]
(ME_INT_VAL << 18) | // [ME_INT_BND ][ME_INT_VAL ]
(ME_INT_BND << 20) | // [ME_INT_BND ][ME_INT_BND ]
(ME_INT_BND << 22) // [ME_INT_BND ][ME_INT_DOM ]
) |
(
(ME_INT_DOM << 24) | // [ME_INT_DOM ][ME_INT_NONE]
(ME_INT_VAL << 26) | // [ME_INT_DOM ][ME_INT_VAL ]
(ME_INT_BND << 28) | // [ME_INT_DOM ][ME_INT_BND ]
(ME_INT_DOM << 30) // [ME_INT_DOM ][ME_INT_DOM ]
)
);
return ((me_c >> (me2 << 3)) >> (me1 << 1)) & 3;
}
forceinline bool
IntVarImpConf::med_update(Gecode::ModEventDelta& med, Gecode::ModEvent me) {
switch (me) {
case ME_INT_NONE:
return false;
case ME_INT_VAL:
{
Gecode::ModEventDelta med_int = med & med_mask;
if (med_int == (ME_INT_VAL << med_fst))
return false;
med ^= med_int;
med ^= ME_INT_VAL << med_fst;
break;
}
case ME_INT_BND:
{
static const Gecode::ModEvent me_c = (
((ME_INT_NONE ^ ME_INT_BND ) << 0) |
((ME_INT_VAL ^ ME_INT_VAL ) << 4) |
((ME_INT_BND ^ ME_INT_BND ) << 8) |
((ME_INT_DOM ^ ME_INT_BND ) << 12)
);
Gecode::ModEvent me_o = (med & med_mask) >> med_fst;
Gecode::ModEvent me_n = (me_c >> (me_o << 2)) & (med_mask >> med_fst);
if (me_n == 0)
return false;
med ^= me_n << med_fst;
break;
}
case ME_INT_DOM:
{
Gecode::ModEventDelta med_int = med & med_mask;
if (med_int != 0)
return false;
med |= ME_INT_DOM << med_fst;
break;
}
default: GECODE_NEVER;
}
return true;
}
}}
#endif
#ifdef GECODE_HAS_INT_VARS
namespace Gecode { namespace Int {
forceinline Gecode::ModEvent
BoolVarImpConf::me_combine(Gecode::ModEvent me1, Gecode::ModEvent me2) {
return me1 | me2;
}
forceinline bool
BoolVarImpConf::med_update(Gecode::ModEventDelta& med, Gecode::ModEvent me) {
switch (me) {
case ME_BOOL_NONE:
return false;
case ME_BOOL_VAL:
if ((med & (ME_BOOL_VAL << med_fst)) != 0)
return false;
med |= ME_BOOL_VAL << med_fst;
break;
default: GECODE_NEVER;
}
return true;
}
}}
#endif
#ifdef GECODE_HAS_SET_VARS
namespace Gecode { namespace Set {
forceinline Gecode::ModEvent
SetVarImpConf::me_combine(Gecode::ModEvent me1, Gecode::ModEvent me2) {
static const Gecode::ModEvent me_c[ME_SET_CBB+1][ME_SET_CBB+1] = {
{
ME_SET_NONE, // [ME_SET_NONE][ME_SET_NONE]
ME_SET_VAL , // [ME_SET_NONE][ME_SET_VAL ]
ME_SET_CARD, // [ME_SET_NONE][ME_SET_CARD]
ME_SET_LUB , // [ME_SET_NONE][ME_SET_LUB ]
ME_SET_GLB , // [ME_SET_NONE][ME_SET_GLB ]
ME_SET_BB , // [ME_SET_NONE][ME_SET_BB ]
ME_SET_CLUB, // [ME_SET_NONE][ME_SET_CLUB]
ME_SET_CGLB, // [ME_SET_NONE][ME_SET_CGLB]
ME_SET_CBB // [ME_SET_NONE][ME_SET_CBB ]
},
{
ME_SET_VAL , // [ME_SET_VAL ][ME_SET_NONE]
ME_SET_VAL , // [ME_SET_VAL ][ME_SET_VAL ]
ME_SET_VAL , // [ME_SET_VAL ][ME_SET_CARD]
ME_SET_VAL , // [ME_SET_VAL ][ME_SET_LUB ]
ME_SET_VAL , // [ME_SET_VAL ][ME_SET_GLB ]
ME_SET_VAL , // [ME_SET_VAL ][ME_SET_BB ]
ME_SET_VAL , // [ME_SET_VAL ][ME_SET_CLUB]
ME_SET_VAL , // [ME_SET_VAL ][ME_SET_CGLB]
ME_SET_VAL // [ME_SET_VAL ][ME_SET_CBB ]
},
{
ME_SET_CARD, // [ME_SET_CARD][ME_SET_NONE]
ME_SET_VAL , // [ME_SET_CARD][ME_SET_VAL ]
ME_SET_CARD, // [ME_SET_CARD][ME_SET_CARD]
ME_SET_CLUB, // [ME_SET_CARD][ME_SET_LUB ]
ME_SET_CGLB, // [ME_SET_CARD][ME_SET_GLB ]
ME_SET_CBB , // [ME_SET_CARD][ME_SET_BB ]
ME_SET_CLUB, // [ME_SET_CARD][ME_SET_CLUB]
ME_SET_CGLB, // [ME_SET_CARD][ME_SET_CGLB]
ME_SET_CBB // [ME_SET_CARD][ME_SET_CBB ]
},
{
ME_SET_LUB , // [ME_SET_LUB ][ME_SET_NONE]
ME_SET_VAL , // [ME_SET_LUB ][ME_SET_VAL ]
ME_SET_CLUB, // [ME_SET_LUB ][ME_SET_CARD]
ME_SET_LUB , // [ME_SET_LUB ][ME_SET_LUB ]
ME_SET_BB , // [ME_SET_LUB ][ME_SET_GLB ]
ME_SET_BB , // [ME_SET_LUB ][ME_SET_BB ]
ME_SET_CLUB, // [ME_SET_LUB ][ME_SET_CLUB]
ME_SET_CBB , // [ME_SET_LUB ][ME_SET_CGLB]
ME_SET_CBB // [ME_SET_LUB ][ME_SET_CBB ]
},
{
ME_SET_GLB , // [ME_SET_GLB ][ME_SET_NONE]
ME_SET_VAL , // [ME_SET_GLB ][ME_SET_VAL ]
ME_SET_CGLB, // [ME_SET_GLB ][ME_SET_CARD]
ME_SET_BB , // [ME_SET_GLB ][ME_SET_LUB ]
ME_SET_GLB , // [ME_SET_GLB ][ME_SET_GLB ]
ME_SET_BB , // [ME_SET_GLB ][ME_SET_BB ]
ME_SET_CBB , // [ME_SET_GLB ][ME_SET_CLUB]
ME_SET_CGLB, // [ME_SET_GLB ][ME_SET_CGLB]
ME_SET_CBB // [ME_SET_GLB ][ME_SET_CBB ]
},
{
ME_SET_BB , // [ME_SET_BB ][ME_SET_NONE]
ME_SET_VAL , // [ME_SET_BB ][ME_SET_VAL ]
ME_SET_CBB , // [ME_SET_BB ][ME_SET_CARD]
ME_SET_BB , // [ME_SET_BB ][ME_SET_LUB ]
ME_SET_BB , // [ME_SET_BB ][ME_SET_GLB ]
ME_SET_BB , // [ME_SET_BB ][ME_SET_BB ]
ME_SET_CBB , // [ME_SET_BB ][ME_SET_CLUB]
ME_SET_CBB , // [ME_SET_BB ][ME_SET_CGLB]
ME_SET_CBB // [ME_SET_BB ][ME_SET_CBB ]
},
{
ME_SET_CLUB, // [ME_SET_CLUB][ME_SET_NONE]
ME_SET_VAL , // [ME_SET_CLUB][ME_SET_VAL ]
ME_SET_CLUB, // [ME_SET_CLUB][ME_SET_CARD]
ME_SET_CLUB, // [ME_SET_CLUB][ME_SET_LUB ]
ME_SET_CBB , // [ME_SET_CLUB][ME_SET_GLB ]
ME_SET_CBB , // [ME_SET_CLUB][ME_SET_BB ]
ME_SET_CLUB, // [ME_SET_CLUB][ME_SET_CLUB]
ME_SET_CBB , // [ME_SET_CLUB][ME_SET_CGLB]
ME_SET_CBB // [ME_SET_CLUB][ME_SET_CBB ]
},
{
ME_SET_CGLB, // [ME_SET_CGLB][ME_SET_NONE]
ME_SET_VAL , // [ME_SET_CGLB][ME_SET_VAL ]
ME_SET_CGLB, // [ME_SET_CGLB][ME_SET_CARD]
ME_SET_CBB , // [ME_SET_CGLB][ME_SET_LUB ]
ME_SET_CGLB, // [ME_SET_CGLB][ME_SET_GLB ]
ME_SET_CBB , // [ME_SET_CGLB][ME_SET_BB ]
ME_SET_CBB , // [ME_SET_CGLB][ME_SET_CLUB]
ME_SET_CGLB, // [ME_SET_CGLB][ME_SET_CGLB]
ME_SET_CBB // [ME_SET_CGLB][ME_SET_CBB ]
},
{
ME_SET_CBB , // [ME_SET_CBB ][ME_SET_NONE]
ME_SET_VAL , // [ME_SET_CBB ][ME_SET_VAL ]
ME_SET_CBB , // [ME_SET_CBB ][ME_SET_CARD]
ME_SET_CBB , // [ME_SET_CBB ][ME_SET_LUB ]
ME_SET_CBB , // [ME_SET_CBB ][ME_SET_GLB ]
ME_SET_CBB , // [ME_SET_CBB ][ME_SET_BB ]
ME_SET_CBB , // [ME_SET_CBB ][ME_SET_CLUB]
ME_SET_CBB , // [ME_SET_CBB ][ME_SET_CGLB]
ME_SET_CBB // [ME_SET_CBB ][ME_SET_CBB ]
}
};
return me_c[me1][me2];
}
forceinline bool
SetVarImpConf::med_update(Gecode::ModEventDelta& med, Gecode::ModEvent me) {
switch (me) {
case ME_SET_NONE:
return false;
case ME_SET_VAL:
{
Gecode::ModEventDelta med_set = med & med_mask;
if (med_set == (ME_SET_VAL << med_fst))
return false;
med ^= med_set;
med ^= ME_SET_VAL << med_fst;
break;
}
case ME_SET_CARD:
{
static const Gecode::ModEventDelta me_c[ME_SET_CBB+1] = {
(ME_SET_NONE ^ ME_SET_CARD) << med_fst,
(ME_SET_VAL ^ ME_SET_VAL ) << med_fst,
(ME_SET_CARD ^ ME_SET_CARD) << med_fst,
(ME_SET_LUB ^ ME_SET_CLUB) << med_fst,
(ME_SET_GLB ^ ME_SET_CGLB) << med_fst,
(ME_SET_BB ^ ME_SET_CBB ) << med_fst,
(ME_SET_CLUB ^ ME_SET_CLUB) << med_fst,
(ME_SET_CGLB ^ ME_SET_CGLB) << med_fst,
(ME_SET_CBB ^ ME_SET_CBB ) << med_fst
};
Gecode::ModEvent me_o = (med & med_mask) >> med_fst;
Gecode::ModEventDelta med_n = me_c[me_o];
if (med_n == 0)
return false;
med ^= med_n;
break;
}
case ME_SET_LUB:
{
static const Gecode::ModEventDelta me_c[ME_SET_CBB+1] = {
(ME_SET_NONE ^ ME_SET_LUB ) << med_fst,
(ME_SET_VAL ^ ME_SET_VAL ) << med_fst,
(ME_SET_CARD ^ ME_SET_CLUB) << med_fst,
(ME_SET_LUB ^ ME_SET_LUB ) << med_fst,
(ME_SET_GLB ^ ME_SET_BB ) << med_fst,
(ME_SET_BB ^ ME_SET_BB ) << med_fst,
(ME_SET_CLUB ^ ME_SET_CLUB) << med_fst,
(ME_SET_CGLB ^ ME_SET_CBB ) << med_fst,
(ME_SET_CBB ^ ME_SET_CBB ) << med_fst
};
Gecode::ModEvent me_o = (med & med_mask) >> med_fst;
Gecode::ModEventDelta med_n = me_c[me_o];
if (med_n == 0)
return false;
med ^= med_n;
break;
}
case ME_SET_GLB:
{
static const Gecode::ModEventDelta me_c[ME_SET_CBB+1] = {
(ME_SET_NONE ^ ME_SET_GLB ) << med_fst,
(ME_SET_VAL ^ ME_SET_VAL ) << med_fst,
(ME_SET_CARD ^ ME_SET_CGLB) << med_fst,
(ME_SET_LUB ^ ME_SET_BB ) << med_fst,
(ME_SET_GLB ^ ME_SET_GLB ) << med_fst,
(ME_SET_BB ^ ME_SET_BB ) << med_fst,
(ME_SET_CLUB ^ ME_SET_CBB ) << med_fst,
(ME_SET_CGLB ^ ME_SET_CGLB) << med_fst,
(ME_SET_CBB ^ ME_SET_CBB ) << med_fst
};
Gecode::ModEvent me_o = (med & med_mask) >> med_fst;
Gecode::ModEventDelta med_n = me_c[me_o];
if (med_n == 0)
return false;
med ^= med_n;
break;
}
case ME_SET_BB:
{
static const Gecode::ModEventDelta me_c[ME_SET_CBB+1] = {
(ME_SET_NONE ^ ME_SET_BB ) << med_fst,
(ME_SET_VAL ^ ME_SET_VAL ) << med_fst,
(ME_SET_CARD ^ ME_SET_CBB ) << med_fst,
(ME_SET_LUB ^ ME_SET_BB ) << med_fst,
(ME_SET_GLB ^ ME_SET_BB ) << med_fst,
(ME_SET_BB ^ ME_SET_BB ) << med_fst,
(ME_SET_CLUB ^ ME_SET_CBB ) << med_fst,
(ME_SET_CGLB ^ ME_SET_CBB ) << med_fst,
(ME_SET_CBB ^ ME_SET_CBB ) << med_fst
};
Gecode::ModEvent me_o = (med & med_mask) >> med_fst;
Gecode::ModEventDelta med_n = me_c[me_o];
if (med_n == 0)
return false;
med ^= med_n;
break;
}
case ME_SET_CLUB:
{
static const Gecode::ModEventDelta me_c[ME_SET_CBB+1] = {
(ME_SET_NONE ^ ME_SET_CLUB) << med_fst,
(ME_SET_VAL ^ ME_SET_VAL ) << med_fst,
(ME_SET_CARD ^ ME_SET_CLUB) << med_fst,
(ME_SET_LUB ^ ME_SET_CLUB) << med_fst,
(ME_SET_GLB ^ ME_SET_CBB ) << med_fst,
(ME_SET_BB ^ ME_SET_CBB ) << med_fst,
(ME_SET_CLUB ^ ME_SET_CLUB) << med_fst,
(ME_SET_CGLB ^ ME_SET_CBB ) << med_fst,
(ME_SET_CBB ^ ME_SET_CBB ) << med_fst
};
Gecode::ModEvent me_o = (med & med_mask) >> med_fst;
Gecode::ModEventDelta med_n = me_c[me_o];
if (med_n == 0)
return false;
med ^= med_n;
break;
}
case ME_SET_CGLB:
{
static const Gecode::ModEventDelta me_c[ME_SET_CBB+1] = {
(ME_SET_NONE ^ ME_SET_CGLB) << med_fst,
(ME_SET_VAL ^ ME_SET_VAL ) << med_fst,
(ME_SET_CARD ^ ME_SET_CGLB) << med_fst,
(ME_SET_LUB ^ ME_SET_CBB ) << med_fst,
(ME_SET_GLB ^ ME_SET_CGLB) << med_fst,
(ME_SET_BB ^ ME_SET_CBB ) << med_fst,
(ME_SET_CLUB ^ ME_SET_CBB ) << med_fst,
(ME_SET_CGLB ^ ME_SET_CGLB) << med_fst,
(ME_SET_CBB ^ ME_SET_CBB ) << med_fst
};
Gecode::ModEvent me_o = (med & med_mask) >> med_fst;
Gecode::ModEventDelta med_n = me_c[me_o];
if (med_n == 0)
return false;
med ^= med_n;
break;
}
case ME_SET_CBB:
{
static const Gecode::ModEventDelta me_c[ME_SET_CBB+1] = {
(ME_SET_NONE ^ ME_SET_CBB ) << med_fst,
(ME_SET_VAL ^ ME_SET_VAL ) << med_fst,
(ME_SET_CARD ^ ME_SET_CBB ) << med_fst,
(ME_SET_LUB ^ ME_SET_CBB ) << med_fst,
(ME_SET_GLB ^ ME_SET_CBB ) << med_fst,
(ME_SET_BB ^ ME_SET_CBB ) << med_fst,
(ME_SET_CLUB ^ ME_SET_CBB ) << med_fst,
(ME_SET_CGLB ^ ME_SET_CBB ) << med_fst,
(ME_SET_CBB ^ ME_SET_CBB ) << med_fst
};
Gecode::ModEvent me_o = (med & med_mask) >> med_fst;
Gecode::ModEventDelta med_n = me_c[me_o];
if (med_n == 0)
return false;
med ^= med_n;
break;
}
default: GECODE_NEVER;
}
return true;
}
}}
#endif
#ifdef GECODE_HAS_FLOAT_VARS
namespace Gecode { namespace Float {
forceinline Gecode::ModEvent
FloatVarImpConf::me_combine(Gecode::ModEvent me1, Gecode::ModEvent me2) {
static const Gecode::ModEvent me_c = (
(
(ME_FLOAT_NONE << 0) | // [ME_FLOAT_NONE][ME_FLOAT_NONE]
(ME_FLOAT_VAL << 2) | // [ME_FLOAT_NONE][ME_FLOAT_VAL ]
(ME_FLOAT_BND << 4) // [ME_FLOAT_NONE][ME_FLOAT_BND ]
) |
(
(ME_FLOAT_VAL << 8) | // [ME_FLOAT_VAL ][ME_FLOAT_NONE]
(ME_FLOAT_VAL << 10) | // [ME_FLOAT_VAL ][ME_FLOAT_VAL ]
(ME_FLOAT_VAL << 12) // [ME_FLOAT_VAL ][ME_FLOAT_BND ]
) |
(
(ME_FLOAT_BND << 16) | // [ME_FLOAT_BND ][ME_FLOAT_NONE]
(ME_FLOAT_VAL << 18) | // [ME_FLOAT_BND ][ME_FLOAT_VAL ]
(ME_FLOAT_BND << 20) // [ME_FLOAT_BND ][ME_FLOAT_BND ]
)
);
return ((me_c >> (me2 << 3)) >> (me1 << 1)) & 3;
}
forceinline bool
FloatVarImpConf::med_update(Gecode::ModEventDelta& med, Gecode::ModEvent me) {
switch (me) {
case ME_FLOAT_NONE:
return false;
case ME_FLOAT_VAL:
{
Gecode::ModEventDelta med_float = med & med_mask;
if (med_float == (ME_FLOAT_VAL << med_fst))
return false;
med ^= med_float;
med ^= ME_FLOAT_VAL << med_fst;
break;
}
case ME_FLOAT_BND:
{
Gecode::ModEventDelta med_float = med & med_mask;
if (med_float != 0)
return false;
med |= ME_FLOAT_BND << med_fst;
break;
}
default: GECODE_NEVER;
}
return true;
}
}}
#endif
namespace Gecode {
forceinline ModEventDelta
AllVarConf::med_combine(ModEventDelta med1, ModEventDelta med2) {
#ifdef GECODE_HAS_INT_VARS
(void) Gecode::Int::IntVarImpConf::med_update(med1,(med2 & Gecode::Int::IntVarImpConf::med_mask) >> Gecode::Int::IntVarImpConf::med_fst);
#endif
#ifdef GECODE_HAS_INT_VARS
(void) Gecode::Int::BoolVarImpConf::med_update(med1,(med2 & Gecode::Int::BoolVarImpConf::med_mask) >> Gecode::Int::BoolVarImpConf::med_fst);
#endif
#ifdef GECODE_HAS_SET_VARS
(void) Gecode::Set::SetVarImpConf::med_update(med1,(med2 & Gecode::Set::SetVarImpConf::med_mask) >> Gecode::Set::SetVarImpConf::med_fst);
#endif
#ifdef GECODE_HAS_FLOAT_VARS
(void) Gecode::Float::FloatVarImpConf::med_update(med1,(med2 & Gecode::Float::FloatVarImpConf::med_mask) >> Gecode::Float::FloatVarImpConf::med_fst);
#endif
return med1;
}
}
// STATISTICS: kernel-var
Gecode::AllVarConf
Configuration for all variable implementations.
Definition var-type.hpp:456
Gecode::AllVarConf::idx_d
static const int idx_d
Index for dispose.
Definition var-type.hpp:461
Gecode::AllVarConf::idx_c
static const int idx_c
Index for cloning.
Definition var-type.hpp:459
Gecode::AllVarConf::med_combine
static ModEventDelta med_combine(ModEventDelta med1, ModEventDelta med2)
Combine modification event delta med1 with med2.
Definition var-type.hpp:889
Gecode::Float::FloatVarImpConf
Configuration for Float-variable implementations.
Definition var-type.hpp:416
Gecode::Float::FloatVarImpConf::med_lst
static const int med_lst
End of bits for modification event delta.
Definition var-type.hpp:429
Gecode::Float::FloatVarImpConf::idx_d
static const int idx_d
Index for disposal.
Definition var-type.hpp:421
Gecode::Float::FloatVarImpConf::med_update
static bool med_update(Gecode::ModEventDelta &med, Gecode::ModEvent me)
Update modification even delta med by me, return true on change.
Definition var-type.hpp:859
Gecode::Float::FloatVarImpConf::med_mask
static const int med_mask
Bitmask for modification event delta.
Definition var-type.hpp:431
Gecode::Float::FloatVarImpConf::idx_c
static const int idx_c
Index for cloning.
Definition var-type.hpp:419
Gecode::Float::FloatVarImpConf::me_combine
static Gecode::ModEvent me_combine(Gecode::ModEvent me1, Gecode::ModEvent me2)
Combine modification events me1 and me2.
Definition var-type.hpp:838
Gecode::Float::FloatVarImpConf::med_fst
static const int med_fst
Start of bits for modification event delta.
Definition var-type.hpp:427
Gecode::Float::FloatVarImpConf::free_bits
static const int free_bits
Freely available bits.
Definition var-type.hpp:425
Gecode::Float::FloatVarImpConf::pc_max
static const Gecode::PropCond pc_max
Maximal propagation condition.
Definition var-type.hpp:423
Gecode::Int::BoolVarImpConf
Configuration for Bool-variable implementations.
Definition var-type.hpp:338
Gecode::Int::BoolVarImpConf::med_mask
static const int med_mask
Bitmask for modification event delta.
Definition var-type.hpp:353
Gecode::Int::BoolVarImpConf::me_combine
static Gecode::ModEvent me_combine(Gecode::ModEvent me1, Gecode::ModEvent me2)
Combine modification events me1 and me2.
Definition var-type.hpp:547
Gecode::Int::BoolVarImpConf::idx_d
static const int idx_d
Index for disposal.
Definition var-type.hpp:343
Gecode::Int::BoolVarImpConf::med_fst
static const int med_fst
Start of bits for modification event delta.
Definition var-type.hpp:349
Gecode::Int::BoolVarImpConf::idx_c
static const int idx_c
Index for cloning.
Definition var-type.hpp:341
Gecode::Int::BoolVarImpConf::med_update
static bool med_update(Gecode::ModEventDelta &med, Gecode::ModEvent me)
Update modification even delta med by me, return true on change.
Definition var-type.hpp:551
Gecode::Int::BoolVarImpConf::pc_max
static const Gecode::PropCond pc_max
Maximal propagation condition.
Definition var-type.hpp:345
Gecode::Int::BoolVarImpConf::free_bits
static const int free_bits
Freely available bits.
Definition var-type.hpp:347
Gecode::Int::BoolVarImpConf::med_lst
static const int med_lst
End of bits for modification event delta.
Definition var-type.hpp:351
Gecode::Int::IntVarImpConf
Configuration for Int-variable implementations.
Definition var-type.hpp:299
Gecode::Int::IntVarImpConf::free_bits
static const int free_bits
Freely available bits.
Definition var-type.hpp:308
Gecode::Int::IntVarImpConf::me_combine
static Gecode::ModEvent me_combine(Gecode::ModEvent me1, Gecode::ModEvent me2)
Combine modification events me1 and me2.
Definition var-type.hpp:471
Gecode::Int::IntVarImpConf::pc_max
static const Gecode::PropCond pc_max
Maximal propagation condition.
Definition var-type.hpp:306
Gecode::Int::IntVarImpConf::idx_c
static const int idx_c
Index for cloning.
Definition var-type.hpp:302
Gecode::Int::IntVarImpConf::med_fst
static const int med_fst
Start of bits for modification event delta.
Definition var-type.hpp:310
Gecode::Int::IntVarImpConf::med_update
static bool med_update(Gecode::ModEventDelta &med, Gecode::ModEvent me)
Update modification even delta med by me, return true on change.
Definition var-type.hpp:501
Gecode::Int::IntVarImpConf::idx_d
static const int idx_d
Index for disposal.
Definition var-type.hpp:304
Gecode::Int::IntVarImpConf::med_mask
static const int med_mask
Bitmask for modification event delta.
Definition var-type.hpp:314
Gecode::Int::IntVarImpConf::med_lst
static const int med_lst
End of bits for modification event delta.
Definition var-type.hpp:312
Gecode::Set::SetVarImpConf
Configuration for Set-variable implementations.
Definition var-type.hpp:377
Gecode::Set::SetVarImpConf::idx_c
static const int idx_c
Index for cloning.
Definition var-type.hpp:380
Gecode::Set::SetVarImpConf::pc_max
static const Gecode::PropCond pc_max
Maximal propagation condition.
Definition var-type.hpp:384
Gecode::Set::SetVarImpConf::med_lst
static const int med_lst
End of bits for modification event delta.
Definition var-type.hpp:390
Gecode::Set::SetVarImpConf::free_bits
static const int free_bits
Freely available bits.
Definition var-type.hpp:386
Gecode::Set::SetVarImpConf::med_update
static bool med_update(Gecode::ModEventDelta &med, Gecode::ModEvent me)
Update modification even delta med by me, return true on change.
Definition var-type.hpp:675
Gecode::Set::SetVarImpConf::med_mask
static const int med_mask
Bitmask for modification event delta.
Definition var-type.hpp:392
Gecode::Set::SetVarImpConf::med_fst
static const int med_fst
Start of bits for modification event delta.
Definition var-type.hpp:388
Gecode::Set::SetVarImpConf::idx_d
static const int idx_d
Index for disposal.
Definition var-type.hpp:382
Gecode::Set::SetVarImpConf::me_combine
static Gecode::ModEvent me_combine(Gecode::ModEvent me1, Gecode::ModEvent me2)
Combine modification events me1 and me2.
Definition var-type.hpp:570
Gecode::ModEventDelta
int ModEventDelta
Modification event deltas.
Definition core.hpp:89
Gecode::Float
Floating point numbers.
Gecode::Float::PC_FLOAT_NONE
const Gecode::PropCond PC_FLOAT_NONE
Propagation condition to be ignored (convenience).
Definition var-type.hpp:275
Gecode::Float::ME_FLOAT_VAL
const Gecode::ModEvent ME_FLOAT_VAL
Domain operation has resulted in a value (assigned variable).
Definition var-type.hpp:264
Gecode::Float::PC_FLOAT_VAL
const Gecode::PropCond PC_FLOAT_VAL
Propagate when a view becomes assigned (single value).
Definition var-type.hpp:283
Gecode::Float::ME_FLOAT_BND
const Gecode::ModEvent ME_FLOAT_BND
Domain operation has changed the minimum or maximum of the domain.
Definition var-type.hpp:273
Gecode::Float::ME_FLOAT_NONE
const Gecode::ModEvent ME_FLOAT_NONE
Domain operation has not changed domain.
Definition var-type.hpp:262
Gecode::Float::ME_FLOAT_FAILED
const Gecode::ModEvent ME_FLOAT_FAILED
Domain operation has resulted in failure.
Definition var-type.hpp:260
Gecode::Float::PC_FLOAT_BND
const Gecode::PropCond PC_FLOAT_BND
Propagate when minimum or maximum of a view changes.
Definition var-type.hpp:292
Gecode::Int
Finite domain integers.
Gecode::Int::ME_INT_BND
const Gecode::ModEvent ME_INT_BND
Domain operation has changed the minimum or maximum of the domain.
Definition var-type.hpp:65
Gecode::Int::ME_BOOL_NONE
const Gecode::ModEvent ME_BOOL_NONE
Domain operation has not changed domain.
Definition var-type.hpp:114
Gecode::Int::PC_INT_VAL
const Gecode::PropCond PC_INT_VAL
Propagate when a view becomes assigned (single value).
Definition var-type.hpp:82
Gecode::Int::PC_BOOL_NONE
const Gecode::PropCond PC_BOOL_NONE
Propagation condition to be ignored (convenience).
Definition var-type.hpp:118
Gecode::Int::PC_INT_BND
const Gecode::PropCond PC_INT_BND
Propagate when minimum or maximum of a view changes.
Definition var-type.hpp:91
Gecode::Int::ME_BOOL_FAILED
const Gecode::ModEvent ME_BOOL_FAILED
Domain operation has resulted in failure.
Definition var-type.hpp:112
Gecode::Int::ME_INT_FAILED
const Gecode::ModEvent ME_INT_FAILED
Domain operation has resulted in failure.
Definition var-type.hpp:52
Gecode::Int::ME_BOOL_VAL
const Gecode::ModEvent ME_BOOL_VAL
Domain operation has resulted in a value (assigned variable).
Definition var-type.hpp:116
Gecode::Int::PC_BOOL_VAL
const Gecode::PropCond PC_BOOL_VAL
Propagate when a view becomes assigned (single value).
Definition var-type.hpp:126
Gecode::Int::PC_INT_NONE
const Gecode::PropCond PC_INT_NONE
Propagation condition to be ignored (convenience).
Definition var-type.hpp:74
Gecode::Int::PC_INT_DOM
const Gecode::PropCond PC_INT_DOM
Propagate when domain changes.
Definition var-type.hpp:100
Gecode::Int::ME_INT_VAL
const Gecode::ModEvent ME_INT_VAL
Domain operation has resulted in a value (assigned variable).
Definition var-type.hpp:56
Gecode::Int::ME_INT_DOM
const Gecode::ModEvent ME_INT_DOM
Domain operation has changed the domain.
Definition var-type.hpp:72
Gecode::Int::ME_INT_NONE
const Gecode::ModEvent ME_INT_NONE
Domain operation has not changed domain.
Definition var-type.hpp:54
Gecode::Set
Finite integer sets.
Definition var-imp.hpp:137
Gecode::Set::ME_SET_CLUB
const Gecode::ModEvent ME_SET_CLUB
Domain operation has changed the least upper bound and the cardinality.
Definition var-type.hpp:179
Gecode::Set::ME_SET_NONE
const Gecode::ModEvent ME_SET_NONE
Domain operation has not changed domain.
Definition var-type.hpp:140
Gecode::Set::ME_SET_VAL
const Gecode::ModEvent ME_SET_VAL
Domain operation has resulted in a value (assigned variable).
Definition var-type.hpp:142
Gecode::Set::ME_SET_GLB
const Gecode::ModEvent ME_SET_GLB
Domain operation has changed the greatest lower bound.
Definition var-type.hpp:164
Gecode::Set::ME_SET_CGLB
const Gecode::ModEvent ME_SET_CGLB
Domain operation has changed the greatest lower bound and the cardinality.
Definition var-type.hpp:186
Gecode::Set::PC_SET_CARD
const Gecode::PropCond PC_SET_CARD
Propagate when the cardinality of a view changes.
Definition var-type.hpp:216
Gecode::Set::PC_SET_CLUB
const Gecode::PropCond PC_SET_CLUB
Propagate when the cardinality or the least upper bound of a view changes.
Definition var-type.hpp:227
Gecode::Set::ME_SET_CARD
const Gecode::ModEvent ME_SET_CARD
Domain operation has changed the variable cardinality.
Definition var-type.hpp:148
Gecode::Set::PC_SET_VAL
const Gecode::PropCond PC_SET_VAL
Propagate when a view becomes assigned (single value).
Definition var-type.hpp:207
Gecode::Set::PC_SET_ANY
const Gecode::PropCond PC_SET_ANY
Propagate when any bound or the cardinality of a view changes.
Definition var-type.hpp:248
Gecode::Set::ME_SET_LUB
const Gecode::ModEvent ME_SET_LUB
Domain operation has changed the least upper bound.
Definition var-type.hpp:156
Gecode::Set::ME_SET_BB
const Gecode::ModEvent ME_SET_BB
Domain operation has changed both greatest lower and least upper bound.
Definition var-type.hpp:172
Gecode::Set::ME_SET_FAILED
const Gecode::ModEvent ME_SET_FAILED
Domain operation has resulted in failure.
Definition var-type.hpp:138
Gecode::Set::ME_SET_CBB
const Gecode::ModEvent ME_SET_CBB
Domain operation has changed both the greatest lower bound and the least upper bound,...
Definition var-type.hpp:197
Gecode::Set::PC_SET_CGLB
const Gecode::PropCond PC_SET_CGLB
Propagate when the cardinality or the greatest lower bound of a view changes.
Definition var-type.hpp:238
Gecode::Set::PC_SET_NONE
const Gecode::PropCond PC_SET_NONE
Propagation condition to be ignored (convenience).
Definition var-type.hpp:199
Gecode
Gecode toplevel namespace
Gecode::PC_GEN_ASSIGNED
const PropCond PC_GEN_ASSIGNED
Propagation condition for an assigned variable.
Definition core.hpp:76
Gecode::ME_GEN_NONE
const ModEvent ME_GEN_NONE
Generic modification event: no modification.
Definition core.hpp:67
Gecode::ME_GEN_FAILED
const ModEvent ME_GEN_FAILED
Generic modification event: failed variable.
Definition core.hpp:65
Gecode::PropCond
int PropCond
Type for propagation conditions.
Definition core.hpp:72
Gecode::ME_GEN_ASSIGNED
const ModEvent ME_GEN_ASSIGNED
Generic modification event: variable is assigned a value.
Definition core.hpp:69
Gecode::PC_GEN_NONE
const PropCond PC_GEN_NONE
Propagation condition to be ignored (convenience).
Definition core.hpp:74
Gecode::ModEvent
int ModEvent
Type for modification events.
Definition core.hpp:62
forceinline
#define forceinline
Definition config.hpp:187
GECODE_NEVER
#define GECODE_NEVER
Assert that this command is never executed.
Definition macros.hpp:56