Generated on Tue Feb 11 2025 17:33:26 for Gecode by doxygen 1.12.0
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
44namespace 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:
82 bool _stable;
83
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,
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
133namespace Gecode { namespace Int { namespace LDSB {
134
135 template <>
136 ArgArray<Literal>
137 VariableSequenceSymmetryImp<Set::SetView>
138 ::symmetric(Literal l, const ViewArray<Set::SetView>& x) const;
139
140}}}
141
143
144#endif
145
146// STATISTICS: set-branch
NNF * l
Left subtree.
struct Gecode::@603::NNF::@65::@66 b
For binary nodes (and, or, eqv)
int n
Number of negative literals for node type.
struct Gecode::@603::NNF::@65::@67 a
For atomic nodes.
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
int _nsyms
Number of symmetry implementations.
Definition ldsb.hh:338
SymmetryImp< View > ** _syms
Array of symmetry implementations.
Definition ldsb.hh:336
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
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
virtual Actor * copy(Space &home)
Perform cloning.
Definition brancher.hpp:249
virtual ExecStatus commit(Space &home, const Choice &c, unsigned int b)
Perform commit for choice c and alternative b.
Definition brancher.hpp:204
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.
LDSBSetBrancher(Space &home, LDSBSetBrancher &b)
Constructor for cloning b.
Definition brancher.hpp:70
void updatePart1(Space &home, int choicePos)
Part one of the update phase.
Definition brancher.hpp:134
int _nValueSymmetries
Number of value symmetries.
Definition ldsb.hh:66
static void post(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)
Brancher post function.
Definition brancher.hpp:258
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.
virtual const Choice * choice(Space &home)
Return choice.
Definition brancher.hpp:184
Computation spaces.
Definition core.hpp:1742
Base class for value selection and commit.
View arrays.
Definition array.hpp:253
ViewArray< View > x
Views to branch on.
Definition view.hpp:83
ViewSel< View > * vs[n]
View selection objects.
Definition view.hpp:87
Abstract class for view selection.
Definition view-sel.hpp:44
ValSelCommitBase< View, Val > * vsc
Value selection and commit object.
Definition view-val.hpp:99
Gecode toplevel namespace
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:40
ExecStatus
Definition core.hpp:472
Post propagator for SetVar x
Definition set.hh:767
std::function< bool(const Space &home, Var x, int i)> BranchFilter
Function type for branch filter functions.
Definition filter.hpp:40