main page
modules
namespaces
classes
files
Gecode home
Generated on Wed Jan 1 2020 10:37:59 for Gecode by
doxygen
1.8.16
gecode
search
nogoods.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, 2013
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_SEARCH_NOGOODS_HH__
35
#define __GECODE_SEARCH_NOGOODS_HH__
36
37
#include <
gecode/search.hh
>
38
39
namespace
Gecode
{
namespace
Search {
40
42
class
GECODE_VTABLE_EXPORT
NoNGL
:
public
NGL
{
43
public
:
45
NoNGL
(
void
);
47
NoNGL
(
Space
& home);
49
NoNGL
(
Space
& home,
NoNGL
& ngl);
51
virtual
void
subscribe
(
Space
& home,
Propagator
&
p
);
53
virtual
void
reschedule
(
Space
& home,
Propagator
&
p
);
55
virtual
void
cancel
(
Space
& home,
Propagator
&
p
);
57
virtual
NGL::Status
status(
const
Space
& home)
const
;
59
virtual
ExecStatus
prune
(
Space
& home);
61
virtual
NGL
* copy(
Space
& home);
62
};
63
65
class
GECODE_SEARCH_EXPORT
NoGoodsProp
:
public
Propagator
{
66
protected
:
68
NGL
*
root
;
70
unsigned
int
n
;
72
NoGoodsProp
(
Space
& home,
NGL
* root);
74
NoGoodsProp
(
Space
& home,
NoGoodsProp
&
p
);
75
public
:
77
virtual
Actor
* copy(
Space
& home);
79
virtual
PropCost
cost(
const
Space
& home,
const
ModEventDelta
& med)
const
;
81
virtual
void
reschedule
(
Space
& home);
83
virtual
ExecStatus
propagate(
Space
& home,
const
ModEventDelta
& med);
85
template
<
class
Path>
86
static
ExecStatus
post
(
Space
& home,
const
Path&
p
);
88
virtual
size_t
dispose(
Space
& home);
89
};
90
91
}}
92
93
#include <
gecode/search/nogoods.hpp
>
94
95
#endif
96
97
// STATISTICS: search-other
Gecode::Search::NoGoodsProp
No-good propagator.
Definition:
nogoods.hh:65
GECODE_VTABLE_EXPORT
#define GECODE_VTABLE_EXPORT
Definition:
support.hh:72
GECODE_SEARCH_EXPORT
#define GECODE_SEARCH_EXPORT
Definition:
search.hh:67
Gecode::Search::NoNGL
Class for a sentinel no-good literal.
Definition:
nogoods.hh:42
search.hh
Gecode::Space
Computation spaces.
Definition:
core.hpp:1742
Gecode::Actor
Base-class for both propagators and branchers.
Definition:
core.hpp:628
nogoods.hpp
Gecode
Gecode toplevel namespace
Gecode::Propagator
Base-class for propagators.
Definition:
core.hpp:1064
Gecode::Int::Count::reschedule
void reschedule(Space &home, Propagator &p, IntSet &y)
Definition:
rel.hpp:92
Gecode::post
TFE post(PropagatorGroup g)
Only post functions (but not propagators) from g are considered.
Definition:
filter.cpp:138
Gecode::Int::Count::prune
ExecStatus prune(Space &home, ViewArray< VX > &x, ConstIntView)
Definition:
rel.hpp:264
Gecode::Search::NoGoodsProp::root
NGL * root
Root of no-good literal tree.
Definition:
nogoods.hh:68
Gecode::PropCost
Propagation cost.
Definition:
core.hpp:486
Gecode::Int::Count::cancel
void cancel(Space &home, Propagator &p, IntSet &y)
Definition:
rel.hpp:81
Gecode::NGL
No-good literal recorded during search.
Definition:
core.hpp:1340
Gecode::Int::Count::subscribe
void subscribe(Space &home, Propagator &p, IntSet &y)
Definition:
rel.hpp:71
Gecode::NGL::Status
Status
The status of a no-good literal.
Definition:
core.hpp:1346
Gecode::ModEventDelta
int ModEventDelta
Modification event deltas.
Definition:
core.hpp:89
p
int p
Number of positive literals for node type.
Definition:
bool-expr.cpp:232
Gecode::Search::NoGoodsProp::n
unsigned int n
Number of no-good literals with subscriptions.
Definition:
nogoods.hh:70
Gecode::ExecStatus
ExecStatus
Definition:
core.hpp:472