Sha256: d03555dab593bb15a0fde29d95372cd401b9cb7363231844c4610da019f8321a

Contents?: true

Size: 1.39 KB

Versions: 1

Compression:

Stored size: 1.39 KB

Contents

/*
 *  Main authors:
 *     Guido Tack <tack@gecode.org>
 *     Christian Schulte <schulte@gecode.org>
 *
 *  Copyright:
 *     Guido Tack, 2004
 *     Christian Schulte, 2004
 *
 *  Last modified:
 *     $Date: 2005-11-24 18:03:01 +0100 (Thu, 24 Nov 2005) $ by $Author: tack $
 *     $Revision: 2639 $
 *
 *  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 {

  forceinline
  SelectDisjoint::SelectDisjoint(Space* home,
				 IdxViewArray<SetView>& iv0,
				 SetView y1)
    : Propagator(home), iv(iv0), x1(y1) {

    x1.subscribe(home,this, PC_SET_ANY);
    iv.subscribe(home,this, PC_SET_ANY);
  }

  forceinline
  SelectDisjoint::SelectDisjoint(Space* home, bool share, SelectDisjoint& p)
    : Propagator(home,share,p) {
    x1.update(home,share,p.x1);
    iv.update(home,share,p.iv);
  }

  forceinline ExecStatus
  SelectDisjoint::post(Space* home, IdxViewArray<SetView>& xs,
                       SetView x1) {
    int n = xs.size();

    // s2 \subseteq {0,...,n-1}
    Iter::Ranges::Singleton s(0, n-1);
    GECODE_ME_CHECK(x1.intersectI(home,s));
    (void) new (home)
      SelectDisjoint(home,xs,x1);
    return ES_OK;
  }


}}}

// STATISTICS: set-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/set/select/disjoint.icc