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
int
sorted.hh
Go to the documentation of this file.
1
/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
2
/*
3
* Main authors:
4
* Patrick Pekczynski <pekczynski@ps.uni-sb.de>
5
*
6
* Copyright:
7
* Patrick Pekczynski, 2004
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
35
#ifndef __GECODE_INT_SORTED_HH__
36
#define __GECODE_INT_SORTED_HH__
37
38
#include <
gecode/int.hh
>
39
45
namespace
Gecode
{
namespace
Int {
namespace
Sorted {
46
58
template
<
class
View,
bool
Perm>
59
class
Sorted
:
public
Propagator
{
60
protected
:
62
ViewArray<View>
x
;
64
ViewArray<View>
y
;
66
ViewArray<View>
z
;
68
ViewArray<View>
w
;
70
int
reachable
;
72
Sorted
(
Home
home,
73
ViewArray<View>
&
x
,
ViewArray<View>
&
y
,
ViewArray<View>
&
z
);
75
Sorted
(
Space
& home,
Sorted<View,Perm>
&
p
);
76
public
:
78
virtual
size_t
dispose
(
Space
& home);
80
virtual
Actor
*
copy
(
Space
& home);
82
virtual
PropCost
cost
(
const
Space
& home,
const
ModEventDelta
&
med
)
const
;
84
virtual
void
reschedule
(
Space
& home);
86
virtual
ExecStatus
propagate
(
Space
& home,
const
ModEventDelta
&
med
);
88
static
ExecStatus
post
(
Home
home,
ViewArray<View>
&
x
,
ViewArray<View>
&
y
,
89
ViewArray<View>
&
z
);
90
};
91
92
93
}}}
94
95
#include <
gecode/int/sorted/sortsup.hpp
>
96
#include <
gecode/int/sorted/order.hpp
>
97
#include <
gecode/int/sorted/matching.hpp
>
98
#include <
gecode/int/sorted/narrowing.hpp
>
99
#include <
gecode/int/sorted/propagate.hpp
>
100
101
#endif
102
103
104
// STATISTICS: int-prop
105
Gecode::Int::Sorted::Sorted::reschedule
virtual void reschedule(Space &home)
Schedule function.
Definition:
propagate.hpp:382
Gecode::Int::Sorted::Sorted::w
ViewArray< View > w
Original y array.
Definition:
sorted.hh:68
int.hh
Gecode::Space
Computation spaces.
Definition:
core.hpp:1742
Gecode::Actor
Base-class for both propagators and branchers.
Definition:
core.hpp:628
narrowing.hpp
Gecode::Int::Sorted::Sorted::copy
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition:
propagate.hpp:371
Gecode
Gecode toplevel namespace
Gecode::Propagator
Base-class for propagators.
Definition:
core.hpp:1064
Gecode::Int::Sorted::Sorted::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition:
propagate.hpp:391
sortsup.hpp
Gecode::Int::Sorted::Sorted::x
ViewArray< View > x
Views to be sorted.
Definition:
sorted.hh:62
Gecode::Home
Home class for posting propagators
Definition:
core.hpp:856
Gecode::Int::Sorted::Sorted::z
ViewArray< View > z
Permutation variables (none, if Perm is false)
Definition:
sorted.hh:66
Gecode::Int::Sorted::Sorted::post
static ExecStatus post(Home home, ViewArray< View > &x, ViewArray< View > &y, ViewArray< View > &z)
Post propagator for views x, y, and z.
Definition:
propagate.hpp:629
Gecode::Propagator::med
ModEventDelta med
A set of modification events (used during propagation)
Definition:
core.hpp:1075
propagate.hpp
Gecode::Int::Sorted::Sorted::reachable
int reachable
connection to dropped view
Definition:
sorted.hh:70
Gecode::PropCost
Propagation cost.
Definition:
core.hpp:486
Gecode::Int::Sorted::Sorted::y
ViewArray< View > y
Views denoting the sorted version of x.
Definition:
sorted.hh:64
matching.hpp
Gecode::Int::Sorted::Sorted::Sorted
Sorted(Home home, ViewArray< View > &x, ViewArray< View > &y, ViewArray< View > &z)
Constructor for posting.
Definition:
propagate.hpp:350
Gecode::Int::Sorted::Sorted::dispose
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Definition:
propagate.hpp:361
Gecode::Int::Sorted::Sorted::cost
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function returning low linear.
Definition:
propagate.hpp:376
Gecode::ViewArray
View arrays.
Definition:
array.hpp:253
Gecode::ModEventDelta
int ModEventDelta
Modification event deltas.
Definition:
core.hpp:89
order.hpp
p
int p
Number of positive literals for node type.
Definition:
bool-expr.cpp:232
Gecode::Int::Sorted::Sorted
Bounds consistent sortedness propagator.
Definition:
sorted.hh:59
Gecode::ExecStatus
ExecStatus
Definition:
core.hpp:472