/* * Main authors: * Guido Tack * Christian Schulte * * Copyright: * Guido Tack, 2004,2005 * Christian Schulte, 2004,2005 * * Last modified: * $Date: 2006-08-24 11:25:05 +0200 (Thu, 24 Aug 2006) $ by $Author: schulte $ * $Revision: 3559 $ * * This file is part of Gecode, the generic constraint * development environment: * http://www.gecode.org * * See the file "LICENSE" for information on usage and * redistribution of this file, and for a * DISCLAIMER OF ALL WARRANTIES. * */ namespace Gecode { namespace Set { namespace Select { /** * \brief Pairs of an index and a variable * */ template class IdxView { public: /// The index int idx; /// The variable View var; /// Allocate \a n elements static IdxView* allocate(Space* home,int n); }; /** * \brief An array of IndexView pairs * */ template class IdxViewArray { private: /// The actual array IdxView* xs; /// The size of the array int n; public: /// Default constructor IdxViewArray(void); /// Copy constructor IdxViewArray(const IdxViewArray&); /// Construct an IdxViewArray from \a x IdxViewArray(Space* home, const SetVarArgs& x); /// Return the current size int size(void) const; /// Set the size to \a n void size(int n); /// Access element \a n IdxView& operator[](int n); /// Access element \a n const IdxView& operator[](int) const; /** * Subscribe propagator \a p with propagation condition \a pc * to all elements of the array. */ void subscribe(Space* home,Propagator* p, PropCond pc, bool process=true); /** * Cancel subscription of propagator \a p with propagation condition \a pc * for all elements of the array. */ void cancel(Space* home, Propagator* p, PropCond pc); /// Cloning void update(Space* home, bool share, IdxViewArray& x); }; }}} #include "gecode/set/select/idxarray.icc" // STATISTICS: set-prop