sorted.hh
Go to the documentation of this file.
/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
* Main authors:
* Patrick Pekczynski <pekczynski@ps.uni-sb.de>
*
* Copyright:
* Patrick Pekczynski, 2004
*
* This file is part of Gecode, the generic constraint
* development environment:
* http://www.gecode.org
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*
*/
#ifndef __GECODE_INT_SORTED_HH__
#define __GECODE_INT_SORTED_HH__
#include <gecode/int.hh>
namespace Gecode { namespace Int { namespace Sorted {
template<class View, bool Perm>
class Sorted : public Propagator {
protected:
ViewArray<View> x;
ViewArray<View> y;
ViewArray<View> z;
ViewArray<View> w;
int reachable;
Sorted(Home home,
ViewArray<View>& x, ViewArray<View>& y, ViewArray<View>& z);
Sorted(Space& home, Sorted<View,Perm>& p);
public:
virtual size_t dispose(Space& home);
virtual Actor* copy(Space& home);
virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
virtual void reschedule(Space& home);
virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
static ExecStatus post(Home home, ViewArray<View>& x, ViewArray<View>& y,
ViewArray<View>& z);
};
}}}
#include <gecode/int/sorted/sortsup.hpp>
#include <gecode/int/sorted/order.hpp>
#include <gecode/int/sorted/matching.hpp>
#include <gecode/int/sorted/narrowing.hpp>
#include <gecode/int/sorted/propagate.hpp>
#endif
// STATISTICS: int-prop
Gecode::ActorLink::Actor
friend class Actor
Definition core.hpp:590
Gecode::Home
Home class for posting propagators
Definition core.hpp:856
Gecode::Int::Sorted::Sorted
Bounds consistent sortedness propagator.
Definition sorted.hh:59
Gecode::Int::Sorted::Sorted::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition propagate.hpp:391
Gecode::Int::Sorted::Sorted::w
ViewArray< View > w
Original y array.
Definition sorted.hh:68
Gecode::Int::Sorted::Sorted::reachable
int reachable
connection to dropped view
Definition sorted.hh:70
Gecode::Int::Sorted::Sorted::reschedule
virtual void reschedule(Space &home)
Schedule function.
Definition propagate.hpp:382
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::Int::Sorted::Sorted::x
ViewArray< View > x
Views to be sorted.
Definition sorted.hh:62
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::Int::Sorted::Sorted::y
ViewArray< View > y
Views denoting the sorted version of x.
Definition sorted.hh:64
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::z
ViewArray< View > z
Permutation variables (none, if Perm is false).
Definition sorted.hh:66
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::copy
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition propagate.hpp:371
Gecode::PropCost
Propagation cost.
Definition core.hpp:486
Gecode::Propagator::Space
friend class Space
Definition core.hpp:1066
Gecode::Propagator::med
ModEventDelta med
A set of modification events (used during propagation).
Definition core.hpp:1075
Gecode::Propagator::Propagator
Propagator(Home home)
Constructor for posting.
Definition core.hpp:3498
Gecode::ViewArray
View arrays.
Definition array.hpp:253
int.hh
Gecode::ModEventDelta
int ModEventDelta
Modification event deltas.
Definition core.hpp:89
matching.hpp
Gecode::Int
Finite domain integers.
Gecode
Gecode toplevel namespace
Gecode::ExecStatus
ExecStatus
Definition core.hpp:472
narrowing.hpp
order.hpp
propagate.hpp
sortsup.hpp