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
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 #ifndef __GECODE_SET_LDSB_HH__
00039 #define __GECODE_SET_LDSB_HH__
00040
00041 #include <gecode/set.hh>
00042 #include <gecode/int/ldsb.hh>
00043
00048 namespace Gecode { namespace Set { namespace LDSB {
00049
00050 using namespace Int::LDSB;
00051
00060 template<class View, int n, class Val, unsigned int a,
00061 class Filter, class Print>
00062 class LDSBSetBrancher : public LDSBBrancher<View,n,Val,a,Filter,Print> {
00063 public:
00064 using typename LDSBBrancher<View,n,Val,a,Filter,Print>::Var;
00066 int _prevPos;
00068 int _nNonValueSymmetries;
00070 int _nValueSymmetries;
00073 ValueSymmetryImp<View>** _copiedSyms;
00075 int _nCopiedSyms;
00077 IntSet _leftBranchValues;
00086 bool _stable;
00087
00089 LDSBSetBrancher(Space& home, bool share, LDSBSetBrancher& b);
00091 LDSBSetBrancher(Home home,
00092 ViewArray<View>& x,
00093 ViewSel<View>* vs[n],
00094 ValSelCommitBase<View,Val>* vsc,
00095 SymmetryImp<View>** syms, int nsyms,
00096 BranchFilter<Var> bf,
00097 VarValPrint<Var,Val> vvp);
00099 virtual const Choice* choice(Space& home);
00101 virtual ExecStatus commit(Space& home, const Choice& c, unsigned int b);
00103 virtual Actor* copy(Space& home, bool share);
00105 static void post(Home home,
00106 ViewArray<View>& x,
00107 ViewSel<View>* vs[n],
00108 ValSelCommitBase<View,Val>* vsc,
00109 SymmetryImp<View>** _syms,
00110 int _nsyms,
00111 BranchFilter<Var> bf,
00112 VarValPrint<Var,Val> vvp);
00113
00115 template<class View0, int n0, class Val0, unsigned int a0>
00116 void postldsbsetbrancher(Home home,
00117 ViewArray<View0>& x,
00118 ViewSel<View0>* vs[n0],
00119 ValSelCommitBase<View0,Val0>* vsc,
00120 SymmetryImp<View0>** syms, int nsyms,
00121 BranchFilter<typename View0::VarType> bf,
00122 VarValPrint<typename View0::VarType,Val0> vvp);
00123
00132 void updatePart1(Space& home, int choicePos);
00133 };
00134
00135 }}}
00136
00137 namespace Gecode { namespace Int { namespace LDSB {
00138
00139 template <>
00140 ArgArray<Literal>
00141 VariableSequenceSymmetryImp<Set::SetView>
00142 ::symmetric(Literal l, const ViewArray<Set::SetView>& x) const;
00143
00144 }}}
00145
00146 #include <gecode/set/ldsb/brancher.hpp>
00147
00148 #endif
00149
00150