Generated on Wed Nov 1 15:04:29 2006 for Gecode by doxygen 1.4.5

base.icc

Go to the documentation of this file.
00001 /*
00002  *  Main authors:
00003  *     Christian Schulte <schulte@gecode.org>
00004  *
00005  *  Copyright:
00006  *     Christian Schulte, 2006
00007  *
00008  *  Last modified:
00009  *     $Date: 2006-08-04 16:03:26 +0200 (Fri, 04 Aug 2006) $ by $Author: schulte $
00010  *     $Revision: 3512 $
00011  *
00012  *  This file is part of Gecode, the generic constraint
00013  *  development environment:
00014  *     http://www.gecode.org
00015  *
00016  *  See the file "LICENSE" for information on usage and
00017  *  redistribution of this file, and for a
00018  *     DISCLAIMER OF ALL WARRANTIES.
00019  *
00020  */
00021 
00022 namespace Gecode { namespace Int { namespace Channel {
00023 
00024   template <class Info, PropCond pc>
00025   forceinline
00026   Base<Info,pc>::Base(Space* home, int n0, Info* xy0, bool fd)
00027     : Propagator(home,fd), n(n0), n_na(2*n), xy(xy0) {
00028     for (int i=2*n; i--; )
00029       xy[i].view.subscribe(home,this,pc);
00030   }
00031 
00032   template <class Info, PropCond pc>
00033   forceinline
00034   Base<Info,pc>::Base(Space* home, bool share, Base<Info,pc>& p)
00035     : Propagator(home,share,p), n(p.n), n_na(p.n_na),
00036       xy(Info::allocate(home,2*n)) {
00037     for (int i=2*n; i--; )
00038       xy[i].update(home,share,p.xy[i]);
00039   }
00040 
00041   template <class Info, PropCond pc>
00042   PropCost
00043   Base<Info,pc>::cost(void) const {
00044     return PC_QUADRATIC_LO;
00045   }
00046 
00047   template <class Info, PropCond pc>
00048   size_t
00049   Base<Info,pc>::dispose(Space* home) {
00050     if (!home->failed())
00051       for (int i=2*n; i--; )
00052         xy[i].view.cancel(home,this,pc);
00053     (void) Propagator::dispose(home);
00054     return sizeof(*this);
00055   }
00056 
00057 }}}
00058 
00059 // STATISTICS: int-prop
00060