Generated on Thu Jan 16 2025 00:00:00 for Gecode by doxygen 1.14.0
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
44
45namespace Gecode { namespace Int { namespace Sorted {
46
57
58 template<class View, bool Perm>
59 class Sorted : public Propagator {
60 protected:
72 Sorted(Home home,
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);
90 };
91
92
93}}}
94
100
101#endif
102
103
104// STATISTICS: int-prop
105
Home class for posting propagators
Definition core.hpp:856
Bounds consistent sortedness propagator.
Definition sorted.hh:59
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
ViewArray< View > w
Original y array.
Definition sorted.hh:68
int reachable
connection to dropped view
Definition sorted.hh:70
virtual void reschedule(Space &home)
Schedule function.
static ExecStatus post(Home home, ViewArray< View > &x, ViewArray< View > &y, ViewArray< View > &z)
Post propagator for views x, y, and z.
ViewArray< View > x
Views to be sorted.
Definition sorted.hh:62
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function returning low linear.
ViewArray< View > y
Views denoting the sorted version of x.
Definition sorted.hh:64
virtual size_t dispose(Space &home)
Delete propagator and return its size.
ViewArray< View > z
Permutation variables (none, if Perm is false)
Definition sorted.hh:66
Sorted(Home home, ViewArray< View > &x, ViewArray< View > &y, ViewArray< View > &z)
Constructor for posting.
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Propagation cost.
Definition core.hpp:486
friend class Space
Definition core.hpp:1068
ModEventDelta med
A set of modification events (used during propagation)
Definition core.hpp:1077
Propagator(Home home)
Constructor for posting.
Definition core.hpp:3505
View arrays.
Definition array.hpp:253
int ModEventDelta
Modification event deltas.
Definition core.hpp:89
Finite domain integers.
Gecode toplevel namespace
ExecStatus
Definition core.hpp:472