Generated on Thu Apr 11 13:59:10 2019 for Gecode by doxygen 1.6.3

ldsb.hh

Go to the documentation of this file.
00001 /* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
00002 /*
00003  *  Main authors:
00004  *     Christopher Mears <chris.mears@monash.edu>
00005  *
00006  *  Copyright:
00007  *     Christopher Mears, 2012
00008  *
00009  *  This file is part of Gecode, the generic constraint
00010  *  development environment:
00011  *     http://www.gecode.org
00012  *
00013  *  Permission is hereby granted, free of charge, to any person obtaining
00014  *  a copy of this software and associated documentation files (the
00015  *  "Software"), to deal in the Software without restriction, including
00016  *  without limitation the rights to use, copy, modify, merge, publish,
00017  *  distribute, sublicense, and/or sell copies of the Software, and to
00018  *  permit persons to whom the Software is furnished to do so, subject to
00019  *  the following conditions:
00020  *
00021  *  The above copyright notice and this permission notice shall be
00022  *  included in all copies or substantial portions of the Software.
00023  *
00024  *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00025  *  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00026  *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
00027  *  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
00028  *  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
00029  *  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
00030  *  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
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 // STATISTICS: set-branch