main page
modules
namespaces
classes
files
Gecode home
Generated on Fri Jan 10 2020 11:38:25 for Gecode by
doxygen
1.8.16
gecode
set
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
:
60
using
typename
LDSBBrancher<View,n,Val,a,Filter,Print>::Var
;
62
int
_prevPos
;
64
int
_nNonValueSymmetries
;
66
int
_nValueSymmetries
;
69
ValueSymmetryImp<View>
**
_copiedSyms
;
71
int
_nCopiedSyms
;
73
IntSet
_leftBranchValues
;
82
bool
_stable
;
83
85
LDSBSetBrancher
(
Space
& home,
LDSBSetBrancher
&
b
);
87
LDSBSetBrancher
(
Home
home,
88
ViewArray<View>
&
x
,
89
ViewSel<View>
* vs[
n
],
90
ValSelCommitBase<View,Val>
* vsc,
91
SymmetryImp<View>
** syms,
int
nsyms,
92
BranchFilter<Var>
bf,
93
VarValPrint<Var,Val>
vvp);
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,
102
ViewArray<View>
&
x
,
103
ViewSel<View>
* vs[
n
],
104
ValSelCommitBase<View,Val>
* vsc,
105
SymmetryImp<View>
** _syms,
106
int
_nsyms,
107
BranchFilter<Var>
bf,
108
VarValPrint<Var,Val>
vvp);
109
111
template
<
class
View0,
int
n0,
class
Val0,
unsigned
int
a0>
112
void
postldsbsetbrancher
(
Home
home,
113
ViewArray<View0>
&
x
,
114
ViewSel<View0>
* vs[n0],
115
ValSelCommitBase<View0,Val0>
* vsc,
116
SymmetryImp<View0>
** syms,
int
nsyms,
117
BranchFilter<typename View0::VarType>
bf,
118
VarValPrint<typename View0::VarType,Val0>
vvp);
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>
137
VariableSequenceSymmetryImp<Set::SetView>
138
::symmetric
(Literal
l
,
const
ViewArray<Set::SetView>&
x
)
const
;
139
140
}}}
141
142
#include <
gecode/set/ldsb/brancher.hpp
>
143
144
#endif
145
146
// STATISTICS: set-branch
b
struct Gecode::@602::NNF::@65::@66 b
For binary nodes (and, or, eqv)
Gecode::BranchFilter
std::function< bool(const Space &home, Var x, int i)> BranchFilter
Function type for branch filter functions.
Definition:
filter.hpp:41
Gecode::x
Post propagator for SetVar x
Definition:
set.hh:767
Gecode::Int::LDSB::ValueSymmetryImp
Implementation of a value symmetry.
Definition:
ldsb.hh:203
Gecode::Set::LDSB::LDSBSetBrancher
Symmetry-breaking brancher with generic view and value selection.
Definition:
ldsb.hh:58
Gecode::Int::LDSB::VariableSequenceSymmetryImp::symmetric
virtual ArgArray< Literal > symmetric(Literal, const ViewArray< View > &) const
Compute symmetric literals.
Definition:
sym-imp.hpp:226
Gecode::Space
Computation spaces.
Definition:
core.hpp:1742
Gecode::Actor
Base-class for both propagators and branchers.
Definition:
core.hpp:628
ldsb.hh
Gecode::Set::LDSB::LDSBSetBrancher::_copiedSyms
ValueSymmetryImp< View > ** _copiedSyms
Copy of value symmetries from the first node where the current variable was branched on.
Definition:
ldsb.hh:69
Gecode
Gecode toplevel namespace
Gecode::IntSet
Integer sets.
Definition:
int.hh:174
a
struct Gecode::@602::NNF::@65::@67 a
For atomic nodes.
Gecode::Home
Home class for posting propagators
Definition:
core.hpp:856
brancher.hpp
Gecode::post
TFE post(PropagatorGroup g)
Only post functions (but not propagators) from g are considered.
Definition:
filter.cpp:138
Gecode::Set::LDSB::LDSBSetBrancher::_nValueSymmetries
int _nValueSymmetries
Number of value symmetries.
Definition:
ldsb.hh:66
Gecode::Set::LDSB::LDSBSetBrancher::_prevPos
int _prevPos
Position of previous variable that was branched on.
Definition:
ldsb.hh:62
Gecode::ValSelCommitBase< View, Val >
Gecode::Set::LDSB::postldsbsetbrancher
void postldsbsetbrancher(Home home, ViewArray< View > &x, ViewSel< View > *vs[n], ValSelCommitBase< View, Val > *vsc, SymmetryImp< View > **syms, int nsyms, BranchFilter< typename View::VarType > bf, VarValPrint< typename View::VarType, Val > vvp)
Definition:
brancher.hpp:269
Gecode::Set::LDSB::LDSBSetBrancher::_nNonValueSymmetries
int _nNonValueSymmetries
Number of non-value symmetries.
Definition:
ldsb.hh:64
l
NNF * l
Left subtree.
Definition:
bool-expr.cpp:240
Gecode::ViewSel< View >
set.hh
Gecode::Set::LDSB::LDSBSetBrancher::_stable
bool _stable
Is the state of the brancher "stable"?
Definition:
ldsb.hh:82
Gecode::Int::LDSB::LDSBBrancher
Symmetry-breaking brancher with generic view and value selection.
Definition:
ldsb.hh:332
Gecode::Set::LDSB::LDSBSetBrancher::_nCopiedSyms
int _nCopiedSyms
Number of copied symmetries.
Definition:
ldsb.hh:71
Test::Float::Arithmetic::c
Gecode::FloatVal c(-8, 8)
Gecode::ViewArray
View arrays.
Definition:
array.hpp:253
Gecode::Int::LDSB::SymmetryImp
Implementation of a single symmetry.
Definition:
ldsb.hh:162
n
int n
Number of negative literals for node type.
Definition:
bool-expr.cpp:234
Gecode::Choice
Choice for performing commit
Definition:
core.hpp:1412
Gecode::Set::LDSB::LDSBSetBrancher::_leftBranchValues
IntSet _leftBranchValues
Set of values used on left branches for the current variable.
Definition:
ldsb.hh:73
Gecode::VarValPrint
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::ExecStatus
ExecStatus
Definition:
core.hpp:472