Sha256: 582ab583627be7834922accc80e87f16fde1cc3e505a31e1f3fa13ab55183d3c

Contents?: true

Size: 1.12 KB

Versions: 1

Compression:

Stored size: 1.12 KB

Contents

/*
 *  Main authors:
 *     Christian Schulte <schulte@gecode.org>
 *
 *  Copyright:
 *     Christian Schulte, 2002
 *
 *  Last modified:
 *     $Date: 2005-10-27 17:04:11 +0200 (Thu, 27 Oct 2005) $ by $Author: schulte $
 *     $Revision: 2418 $
 *
 *  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 {

  forceinline
  BoolVar::BoolVar(void) {}

  forceinline
  BoolVar::BoolVar(Space* home, int min, int max)
    : IntVar(home,min,max) {
    if ((min < 0) || (max > 1))
      throw Int::VariableOutOfRangeDomain("BoolVar");
  }

  forceinline
  BoolVar::BoolVar(const Int::BoolView& b)
    : IntVar(b) {}

  forceinline void
  BoolVar::update(Space* home, bool share, BoolVar& x) {
    var = x.var->copy(home,share);
  }

  forceinline
  BoolVar::BoolVar(const IntVar& x)
    : IntVar(x) {
    if ((x.min() < 0) || (x.max() > 1))
      throw Int::VariableOutOfRangeDomain("BoolVar");
  }

}

// STATISTICS: int-var

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/var/bool.icc