main page
modules
namespaces
classes
files
Gecode home
Generated on Sun Aug 9 2020 05:34:08 for Gecode by
doxygen
1.8.18
gecode
kernel
propagator
advisor.hpp
Go to the documentation of this file.
1
/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
2
/*
3
* Main authors:
4
* Mikael Lagerkvist <lagerkvist@gecode.org>
5
* Christian Schulte <schulte@gecode.org>
6
*
7
* Copyright:
8
* Mikael Lagerkvist, 2006
9
* Christian Schulte, 2007
10
*
11
* This file is part of Gecode, the generic constraint
12
* development environment:
13
* http://www.gecode.org
14
*
15
* Permission is hereby granted, free of charge, to any person obtaining
16
* a copy of this software and associated documentation files (the
17
* "Software"), to deal in the Software without restriction, including
18
* without limitation the rights to use, copy, modify, merge, publish,
19
* distribute, sublicense, and/or sell copies of the Software, and to
20
* permit persons to whom the Software is furnished to do so, subject to
21
* the following conditions:
22
*
23
* The above copyright notice and this permission notice shall be
24
* included in all copies or substantial portions of the Software.
25
*
26
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
27
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
28
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
29
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
30
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
31
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
32
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
33
*
34
*/
35
36
namespace
Gecode
{
37
42
template
<
class
View>
43
class
ViewAdvisor
:
public
Advisor
{
44
protected
:
46
View
x
;
47
public
:
49
template
<
class
A>
50
ViewAdvisor
(
Space
& home,
Propagator
&
p
,
Council<A>
&
c
, View x0);
52
ViewAdvisor
(
Space
& home,
ViewAdvisor<View>
&
a
);
54
View
view
(
void
)
const
;
56
void
view
(
Space
& home, View
y
);
58
template
<
class
A>
59
void
dispose
(
Space
& home,
Council<A>
&
c
);
60
};
61
62
63
template
<
class
View>
64
template
<
class
A>
65
forceinline
66
ViewAdvisor<View>::ViewAdvisor
(
Space
& home,
Propagator
&
p
,
67
Council<A>
&
c
, View x0)
68
:
Advisor
(home,
p
,
c
),
x
(x0) {
69
x
.subscribe(home,*
this
);
70
}
71
template
<
class
View>
72
forceinline
73
ViewAdvisor<View>::ViewAdvisor
(
Space
& home,
ViewAdvisor<View>
&
a
)
74
:
Advisor
(home,
a
) {
75
x
.update(home,
a
.x);
76
}
77
template
<
class
View>
78
forceinline
View
79
ViewAdvisor<View>::view
(
void
)
const
{
80
return
x
;
81
}
82
template
<
class
View>
83
forceinline
void
84
ViewAdvisor<View>::view
(
Space
& home, View
y
) {
85
x
.cancel(home,*
this
);
x
=
y
;
x
.subscribe(home,*
this
);
86
}
87
template
<
class
View>
88
template
<
class
A>
89
forceinline
void
90
ViewAdvisor<View>::dispose
(
Space
& home,
Council<A>
&
c
) {
91
x
.cancel(home,*
this
);
92
Advisor::dispose
(home,
c
);
93
}
94
95
}
96
97
// STATISTICS: kernel-other
Gecode::x
Post propagator for SetVar x
Definition:
set.hh:767
Gecode::y
Post propagator for SetVar SetOpType SetVar y
Definition:
set.hh:767
Gecode::ViewAdvisor::x
View x
The single view.
Definition:
advisor.hpp:46
Gecode::ViewAdvisor::dispose
void dispose(Space &home, Council< A > &c)
Delete advisor.
Definition:
advisor.hpp:90
Gecode::Space
Computation spaces.
Definition:
core.hpp:1742
Gecode::ViewAdvisor
Advisor storing a single view
Definition:
advisor.hpp:43
Gecode
Gecode toplevel namespace
Gecode::Propagator
Base-class for propagators.
Definition:
core.hpp:1064
Gecode::ViewAdvisor::view
View view(void) const
Access view.
Definition:
advisor.hpp:79
a
struct Gecode::@602::NNF::@65::@67 a
For atomic nodes.
Gecode::Council
Council of advisors
Definition:
core.hpp:155
Gecode::Advisor
Base-class for advisors.
Definition:
core.hpp:1292
Gecode::Advisor::dispose
void dispose(Space &home, Council< A > &c)
Dispose the advisor.
Definition:
core.hpp:3864
Gecode::ViewAdvisor::ViewAdvisor
ViewAdvisor(Space &home, Propagator &p, Council< A > &c, View x0)
Constructor for creation.
Definition:
advisor.hpp:66
forceinline
#define forceinline
Definition:
config.hpp:185
Test::Float::Arithmetic::c
Gecode::FloatVal c(-8, 8)
p
int p
Number of positive literals for node type.
Definition:
bool-expr.cpp:232