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
int
circuit.hh
Go to the documentation of this file.
1
/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
2
/*
3
* Main authors:
4
* Christian Schulte <schulte@gecode.org>
5
*
6
* Copyright:
7
* Christian Schulte, 2006
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_INT_CIRCUIT_HH__
35
#define __GECODE_INT_CIRCUIT_HH__
36
37
#include <
gecode/int.hh
>
38
#include <
gecode/int/distinct.hh
>
39
45
namespace
Gecode
{
namespace
Int {
namespace
Circuit {
46
54
template
<
class
View,
class
Offset>
55
class
Base
:
public
NaryPropagator
<View,Int::PC_INT_DOM> {
56
protected
:
57
using
NaryPropagator<View,Int::PC_INT_DOM>::x
;
59
int
start
;
61
ViewArray<View>
y
;
63
Offset
o
;
65
Base
(
Space
& home,
Base
&
p
);
67
Base
(
Home
home,
ViewArray<View>
&
x
,
Offset
&
o
);
69
ExecStatus
connected
(
Space
& home);
71
ExecStatus
path
(
Space
& home);
72
public
:
74
virtual
size_t
dispose
(
Space
& home);
75
};
76
87
template
<
class
View,
class
Offset>
88
class
Val
:
public
Base
<View,Offset> {
89
protected
:
90
using
Base<View,Offset>::x
;
91
using
Base<View,Offset>::y
;
92
using
Base<View,Offset>::connected
;
93
using
Base<View,Offset>::path
;
94
using
Base<View,Offset>::o
;
96
Val
(
Space
& home,
Val
&
p
);
98
Val
(
Home
home,
ViewArray<View>
&
x
,
Offset
&
o
);
99
public
:
101
virtual
Actor
*
copy
(
Space
& home);
103
virtual
PropCost
cost
(
const
Space
& home,
const
ModEventDelta
&
med
)
const
;
105
virtual
ExecStatus
propagate
(
Space
& home,
const
ModEventDelta
&
med
);
107
static
ExecStatus
post
(
Home
home,
ViewArray<View>
&
x
,
Offset
&
o
);
108
};
109
120
template
<
class
View,
class
Offset>
121
class
Dom
:
public
Base
<View,Offset> {
122
protected
:
123
using
Base<View,Offset>::x
;
124
using
Base<View,Offset>::y
;
125
using
Base<View,Offset>::connected
;
126
using
Base<View,Offset>::path
;
127
using
Base<View,Offset>::o
;
129
Int::Distinct::DomCtrl<View>
dc
;
131
Dom
(
Space
& home,
Dom
&
p
);
133
Dom
(
Home
home,
ViewArray<View>
&
x
,
Offset
&
o
);
134
public
:
136
virtual
Actor
*
copy
(
Space
& home);
143
virtual
PropCost
cost
(
const
Space
& home,
const
ModEventDelta
&
med
)
const
;
145
virtual
void
reschedule
(
Space
& home);
147
virtual
ExecStatus
propagate
(
Space
& home,
const
ModEventDelta
&
med
);
149
static
ExecStatus
post
(
Home
home,
ViewArray<View>
&
x
,
Offset
&
o
);
150
};
151
152
}}}
153
154
#include <
gecode/int/circuit/base.hpp
>
155
#include <
gecode/int/circuit/val.hpp
>
156
#include <
gecode/int/circuit/dom.hpp
>
157
158
#endif
159
160
// STATISTICS: int-prop
Gecode::Int::Circuit::Base::path
ExecStatus path(Space &home)
Ensure path property: prune edges that could give too small cycles.
Definition:
base.hpp:236
val.hpp
Gecode::Int::Circuit::Base::Base
Base(Space &home, Base &p)
Constructor for cloning p.
Gecode::Int::Offset
Converter with fixed offset.
Definition:
view.hpp:650
distinct.hh
int.hh
Gecode::Int::Circuit::Val::post
static ExecStatus post(Home home, ViewArray< View > &x, Offset &o)
Post propagator for circuit on x.
Definition:
val.hpp:80
Gecode::Int::Circuit::Dom::post
static ExecStatus post(Home home, ViewArray< View > &x, Offset &o)
Post propagator for circuit on x.
Definition:
dom.hpp:114
Gecode::Space
Computation spaces.
Definition:
core.hpp:1742
Gecode::Actor
Base-class for both propagators and branchers.
Definition:
core.hpp:628
Gecode::Int::Circuit::Val::Val
Val(Space &home, Val &p)
Constructor for cloning p.
Gecode::Int::Circuit::Base::dispose
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Definition:
base.hpp:290
Gecode::NaryPropagator< View, Int::PC_INT_DOM >::x
ViewArray< View > x
Array of views.
Definition:
pattern.hpp:145
Gecode::Int::Circuit::Base::o
Offset o
Offset transformation.
Definition:
circuit.hh:63
Gecode::Int::Circuit::Val::cost
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (returns high linear)
Definition:
val.hpp:58
Gecode::Int::Circuit::Dom::Dom
Dom(Space &home, Dom &p)
Constructor for cloning p.
Gecode
Gecode toplevel namespace
Gecode::Int::Circuit::Base
Base-class for circuit propagator.
Definition:
circuit.hh:55
base.hpp
Gecode::Int::Distinct::DomCtrl
Propagation controller for domain consistent distinct.
Definition:
distinct.hh:250
Gecode::Int::Circuit::Dom::dc
Int::Distinct::DomCtrl< View > dc
Propagation controller for propagating distinct.
Definition:
circuit.hh:129
Gecode::Home
Home class for posting propagators
Definition:
core.hpp:856
Gecode::Int::Circuit::Base::start
int start
Remember where to start the next time the propagator runs.
Definition:
circuit.hh:59
Gecode::NaryPropagator
n-ary propagator
Definition:
pattern.hpp:142
Gecode::Propagator::med
ModEventDelta med
A set of modification events (used during propagation)
Definition:
core.hpp:1075
Gecode::Int::Circuit::Dom::cost
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Definition:
dom.hpp:58
Gecode::Int::Circuit::Val::copy
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition:
val.hpp:52
Gecode::Int::Circuit::Dom
"Domain consistent" circuit propagator
Definition:
circuit.hh:121
dom.hpp
Gecode::PropCost
Propagation cost.
Definition:
core.hpp:486
Gecode::Int::Circuit::Dom::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition:
dom.hpp:78
Gecode::Int::Circuit::Dom::copy
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition:
dom.hpp:52
Gecode::Int::Circuit::Base::y
ViewArray< View > y
Array for performing value propagation for distinct.
Definition:
circuit.hh:61
Gecode::ViewArray
View arrays.
Definition:
array.hpp:253
Gecode::Int::Circuit::Val
"Value-consistent" circuit propagator
Definition:
circuit.hh:88
Gecode::ModEventDelta
int ModEventDelta
Modification event deltas.
Definition:
core.hpp:89
Gecode::Int::Circuit::Val::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition:
val.hpp:64
p
int p
Number of positive literals for node type.
Definition:
bool-expr.cpp:232
Gecode::Int::Circuit::Dom::reschedule
virtual void reschedule(Space &home)
Schedule function.
Definition:
dom.hpp:67
Gecode::Int::Circuit::Base::connected
ExecStatus connected(Space &home)
Check whether the view value graph is strongly connected.
Definition:
base.hpp:69
Gecode::ExecStatus
ExecStatus
Definition:
core.hpp:472