Generated on Tue Apr 18 10:21:56 2017 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  *  Last modified:
00010  *     $Date: 2017-04-01 20:27:10 +0200 (Sat, 01 Apr 2017) $ by $Author: schulte $
00011  *     $Revision: 15623 $
00012  *
00013  *  This file is part of Gecode, the generic constraint
00014  *  development environment:
00015  *     http://www.gecode.org
00016  *
00017  *  Permission is hereby granted, free of charge, to any person obtaining
00018  *  a copy of this software and associated documentation files (the
00019  *  "Software"), to deal in the Software without restriction, including
00020  *  without limitation the rights to use, copy, modify, merge, publish,
00021  *  distribute, sublicense, and/or sell copies of the Software, and to
00022  *  permit persons to whom the Software is furnished to do so, subject to
00023  *  the following conditions:
00024  *
00025  *  The above copyright notice and this permission notice shall be
00026  *  included in all copies or substantial portions of the Software.
00027  *
00028  *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00029  *  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00030  *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
00031  *  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
00032  *  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
00033  *  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
00034  *  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
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 // STATISTICS: set-branch