Sha256: 87061b9df72e105be5586cd81decd6fb6f3f177c145ba12cff4ef378cef4684b

Contents?: true

Size: 1.44 KB

Versions: 1

Compression:

Stored size: 1.44 KB

Contents

/*
 *  Main authors:
 *     Christian Schulte <schulte@gecode.org>
 *
 *  Copyright:
 *     Christian Schulte, 2006
 *
 *  Last modified:
 *     $Date: 2006-08-04 16:03:26 +0200 (Fri, 04 Aug 2006) $ by $Author: schulte $
 *     $Revision: 3512 $
 *
 *  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 Int { namespace Channel {

  template <class Info, PropCond pc>
  forceinline
  Base<Info,pc>::Base(Space* home, int n0, Info* xy0, bool fd)
    : Propagator(home,fd), n(n0), n_na(2*n), xy(xy0) {
    for (int i=2*n; i--; )
      xy[i].view.subscribe(home,this,pc);
  }

  template <class Info, PropCond pc>
  forceinline
  Base<Info,pc>::Base(Space* home, bool share, Base<Info,pc>& p)
    : Propagator(home,share,p), n(p.n), n_na(p.n_na),
      xy(Info::allocate(home,2*n)) {
    for (int i=2*n; i--; )
      xy[i].update(home,share,p.xy[i]);
  }

  template <class Info, PropCond pc>
  PropCost
  Base<Info,pc>::cost(void) const {
    return PC_QUADRATIC_LO;
  }

  template <class Info, PropCond pc>
  size_t
  Base<Info,pc>::dispose(Space* home) {
    if (!home->failed())
      for (int i=2*n; i--; )
	xy[i].view.cancel(home,this,pc);
    (void) Propagator::dispose(home);
    return sizeof(*this);
  }

}}}

// STATISTICS: int-prop

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gecoder-with-gecode-0.7.1 ext/gecode-1.3.1/gecode/int/channel/base.icc