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 #ifndef __GECODE_SET_LDSB_HH__
00035 #define __GECODE_SET_LDSB_HH__
00036
00037 #include <gecode/set.hh>
00038 #include <gecode/int/ldsb.hh>
00039
00044 namespace Gecode { namespace Set { namespace LDSB {
00045
00046 using namespace Int::LDSB;
00047
00056 template<class View, int n, class Val, unsigned int a,
00057 class Filter, class Print>
00058 class LDSBSetBrancher : public LDSBBrancher<View,n,Val,a,Filter,Print> {
00059 public:
00060 using typename LDSBBrancher<View,n,Val,a,Filter,Print>::Var;
00062 int _prevPos;
00064 int _nNonValueSymmetries;
00066 int _nValueSymmetries;
00069 ValueSymmetryImp<View>** _copiedSyms;
00071 int _nCopiedSyms;
00073 IntSet _leftBranchValues;
00082 bool _stable;
00083
00085 LDSBSetBrancher(Space& home, LDSBSetBrancher& b);
00087 LDSBSetBrancher(Home home,
00088 ViewArray<View>& x,
00089 ViewSel<View>* vs[n],
00090 ValSelCommitBase<View,Val>* vsc,
00091 SymmetryImp<View>** syms, int nsyms,
00092 BranchFilter<Var> bf,
00093 VarValPrint<Var,Val> vvp);
00095 virtual const Choice* choice(Space& home);
00097 virtual ExecStatus commit(Space& home, const Choice& c, unsigned int b);
00099 virtual Actor* copy(Space& home);
00101 static void post(Home home,
00102 ViewArray<View>& x,
00103 ViewSel<View>* vs[n],
00104 ValSelCommitBase<View,Val>* vsc,
00105 SymmetryImp<View>** _syms,
00106 int _nsyms,
00107 BranchFilter<Var> bf,
00108 VarValPrint<Var,Val> vvp);
00109
00111 template<class View0, int n0, class Val0, unsigned int a0>
00112 void postldsbsetbrancher(Home home,
00113 ViewArray<View0>& x,
00114 ViewSel<View0>* vs[n0],
00115 ValSelCommitBase<View0,Val0>* vsc,
00116 SymmetryImp<View0>** syms, int nsyms,
00117 BranchFilter<typename View0::VarType> bf,
00118 VarValPrint<typename View0::VarType,Val0> vvp);
00119
00128 void updatePart1(Space& home, int choicePos);
00129 };
00130
00131 }}}
00132
00133 namespace Gecode { namespace Int { namespace LDSB {
00134
00135 template <>
00136 ArgArray<Literal>
00137 VariableSequenceSymmetryImp<Set::SetView>
00138 ::symmetric(Literal l, const ViewArray<Set::SetView>& x) const;
00139
00140 }}}
00141
00142 #include <gecode/set/ldsb/brancher.hpp>
00143
00144 #endif
00145
00146