Generated on Tue Jan 19 2021 06:15:49 for Gecode by doxygen 1.8.13
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:
70  int reachable;
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);
89  ViewArray<View>& z);
90  };
91 
92 
93 }}}
94 
100 
101 #endif
102 
103 
104 // STATISTICS: int-prop
105 
ViewArray< View > w
Original y array.
Definition: sorted.hh:68
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Definition: propagate.hpp:361
Bounds consistent sortedness propagator.
Definition: sorted.hh:59
Sorted(Home home, ViewArray< View > &x, ViewArray< View > &y, ViewArray< View > &z)
Constructor for posting.
Definition: propagate.hpp:350
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition: propagate.hpp:371
Base-class for propagators.
Definition: core.hpp:1023
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function returning low linear.
Definition: propagate.hpp:376
Computation spaces.
Definition: core.hpp:1701
int reachable
connection to dropped view
Definition: sorted.hh:70
Base-class for both propagators and branchers.
Definition: core.hpp:627
int p
Number of positive literals for node type.
Definition: bool-expr.cpp:232
ModEventDelta med
A set of modification events (used during propagation)
Definition: core.hpp:1034
View arrays.
Definition: array.hpp:235
ViewArray< View > z
Permutation variables (none, if Perm is false)
Definition: sorted.hh:66
ViewArray< View > y
Views denoting the sorted version of x.
Definition: sorted.hh:64
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
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: propagate.hpp:391
Propagation cost.
Definition: core.hpp:485
ExecStatus
Definition: core.hpp:471
ViewArray< View > x
Views to be sorted.
Definition: sorted.hh:62
Gecode toplevel namespace
int ModEventDelta
Modification event deltas.
Definition: core.hpp:89
Home class for posting propagators
Definition: core.hpp:853
virtual void reschedule(Space &home)
Schedule function.
Definition: propagate.hpp:382