Generated on Sat Apr 10 2021 00:00:00 for Gecode by doxygen 1.9.1
ldsb.hh
Go to the documentation of this file.
1 /* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
2 /*
3  * Main authors:
4  * Christopher Mears <chris.mears@monash.edu>
5  *
6  * Copyright:
7  * Christopher Mears, 2012
8  *
9  * This file is part of Gecode, the generic constraint
10  * development environment:
11  * http://www.gecode.org
12  *
13  * Permission is hereby granted, free of charge, to any person obtaining
14  * a copy of this software and associated documentation files (the
15  * "Software"), to deal in the Software without restriction, including
16  * without limitation the rights to use, copy, modify, merge, publish,
17  * distribute, sublicense, and/or sell copies of the Software, and to
18  * permit persons to whom the Software is furnished to do so, subject to
19  * the following conditions:
20  *
21  * The above copyright notice and this permission notice shall be
22  * included in all copies or substantial portions of the Software.
23  *
24  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
28  * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
29  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
30  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31  *
32  */
33 
34 #ifndef __GECODE_SET_LDSB_HH__
35 #define __GECODE_SET_LDSB_HH__
36 
37 #include <gecode/set.hh>
38 #include <gecode/int/ldsb.hh>
39 
44 namespace Gecode { namespace Set { namespace LDSB {
45 
46  using namespace Int::LDSB;
47 
56  template<class View, int n, class Val, unsigned int a,
57  class Filter, class Print>
58  class LDSBSetBrancher : public LDSBBrancher<View,n,Val,a,Filter,Print> {
59  public:
62  int _prevPos;
82  bool _stable;
83 
89  ViewSel<View>* vs[n],
91  SymmetryImp<View>** syms, int nsyms,
95  virtual const Choice* choice(Space& home);
97  virtual ExecStatus commit(Space& home, const Choice& c, unsigned int b);
99  virtual Actor* copy(Space& home);
101  static void post(Home home,
103  ViewSel<View>* vs[n],
105  SymmetryImp<View>** _syms,
106  int _nsyms,
109 
111  template<class View0, int n0, class Val0, unsigned int a0>
114  ViewSel<View0>* vs[n0],
116  SymmetryImp<View0>** syms, int nsyms,
119 
128  void updatePart1(Space& home, int choicePos);
129  };
130 
131 }}}
132 
133 namespace Gecode { namespace Int { namespace LDSB {
134 
135  template <>
136  ArgArray<Literal>
139 
140 }}}
141 
143 
144 #endif
145 
146 // STATISTICS: set-branch
struct Gecode::@602::NNF::@65::@66 b
For binary nodes (and, or, eqv)
NNF * l
Left subtree.
Definition: bool-expr.cpp:240
int n
Number of negative literals for node type.
Definition: bool-expr.cpp:234
Node * x
Pointer to corresponding Boolean expression node.
Definition: bool-expr.cpp:249
struct Gecode::@602::NNF::@65::@67 a
For atomic nodes.
std::function< bool(const Space &home, Var x, int i)> BranchFilter
Function type for branch filter functions.
Definition: filter.hpp:41
Base-class for both propagators and branchers.
Definition: core.hpp:628
Choice for performing commit
Definition: core.hpp:1412
Home class for posting propagators
Definition: core.hpp:856
Integer sets.
Definition: int.hh:174
Symmetry-breaking brancher with generic view and value selection.
Definition: ldsb.hh:332
A Literal is a pair of variable index and value.
Definition: ldsb.hh:46
Implementation of a single symmetry.
Definition: ldsb.hh:162
Implementation of a value symmetry.
Definition: ldsb.hh:204
virtual ArgArray< Literal > symmetric(Literal, const ViewArray< View > &) const
Compute symmetric literals.
Definition: sym-imp.hpp:226
Symmetry-breaking brancher with generic view and value selection.
Definition: ldsb.hh:58
bool _stable
Is the state of the brancher "stable"?
Definition: ldsb.hh:82
int _nCopiedSyms
Number of copied symmetries.
Definition: ldsb.hh:71
int _prevPos
Position of previous variable that was branched on.
Definition: ldsb.hh:62
ValueSymmetryImp< View > ** _copiedSyms
Copy of value symmetries from the first node where the current variable was branched on.
Definition: ldsb.hh:69
IntSet _leftBranchValues
Set of values used on left branches for the current variable.
Definition: ldsb.hh:73
int _nNonValueSymmetries
Number of non-value symmetries.
Definition: ldsb.hh:64
void postldsbsetbrancher(Home home, ViewArray< View0 > &x, ViewSel< View0 > *vs[n0], ValSelCommitBase< View0, Val0 > *vsc, SymmetryImp< View0 > **syms, int nsyms, BranchFilter< typename View0::VarType > bf, VarValPrint< typename View0::VarType, Val0 > vvp)
Post LDSB brancher.
int _nValueSymmetries
Number of value symmetries.
Definition: ldsb.hh:66
LDSBSetBrancher(Home home, ViewArray< View > &x, ViewSel< View > *vs[n], ValSelCommitBase< View, Val > *vsc, SymmetryImp< View > **syms, int nsyms, BranchFilter< Var > bf, VarValPrint< Var, Val > vvp)
Constructor for creation.
Computation spaces.
Definition: core.hpp:1742
View arrays.
Definition: array.hpp:253
ExecStatus
Definition: core.hpp:472
void post(Home home, Term *t, int n, FloatRelType frt, FloatVal c)
Post propagator for linear constraint over floats.
Definition: post.cpp:238
std::function< void(const Space &home, const Brancher &b, unsigned int a, Var x, int i, const Val &m, std::ostream &o)> VarValPrint
Function type for printing variable and value selection.
Definition: print.hpp:43
Gecode::FloatVal c(-8, 8)