Generated on Fri Mar 20 15:56:11 2015 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: 2013-05-08 13:30:48 +0200 (Wed, 08 May 2013) $ by $Author: schulte $
00011  *     $Revision: 13622 $
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 LDSBSetBrancher : public LDSBBrancher<View,n,Val,a> {
00062   public:
00064     typedef void (*VarValPrint)(const Space& home, const BrancherHandle& bh,
00065                                 unsigned int b,
00066                                 typename View::VarType x, int i,
00067                                 const Val& m,
00068                                 std::ostream& o);
00070     int _prevPos;
00072     int _nNonValueSymmetries;
00074     int _nValueSymmetries;
00077     ValueSymmetryImp<View>** _copiedSyms;
00079     int _nCopiedSyms;
00081     IntSet _leftBranchValues;
00090     bool _stable;
00091     
00093     LDSBSetBrancher(Space& home, bool share, LDSBSetBrancher& b);
00095     LDSBSetBrancher(Home home, 
00096                     ViewArray<View>& x,
00097                     ViewSel<View>* vs[n], 
00098                     ValSelCommitBase<View,Val>* vsc,
00099                     SymmetryImp<View>** syms, int nsyms,
00100                     SetBranchFilter bf,
00101                     VarValPrint vvp);
00103     virtual const Choice* choice(Space& home);
00105     virtual ExecStatus commit(Space& home, const Choice& c, unsigned int b);
00107     virtual Actor* copy(Space& home, bool share);
00109     static BrancherHandle post(Home home, 
00110                                ViewArray<View>& x,
00111                                ViewSel<View>* vs[n],
00112                                ValSelCommitBase<View,Val>* vsc,
00113                                SymmetryImp<View>** _syms,
00114                                int _nsyms,
00115                                SetBranchFilter bf,
00116                                VarValPrint vvp);
00117 
00126     void updatePart1(Space& home, int choicePos);
00127   };
00128 
00129 }}}
00130 
00131 namespace Gecode { namespace Int { namespace LDSB {
00132   template <>
00133   ArgArray<Literal>
00134   VariableSequenceSymmetryImp<Set::SetView>
00135   ::symmetric(Literal l, const ViewArray<Set::SetView>& x) const;
00136 }}}
00137 
00138 #include <gecode/set/ldsb/brancher.hpp>
00139 
00140 #endif
00141 
00142 // STATISTICS: set-branch