~ubuntu-branches/ubuntu/natty/gecode/natty

« back to all changes in this revision

Viewing changes to int/var/bool.icc

  • Committer: Bazaar Package Importer
  • Author(s): Kari Pahula
  • Date: 2005-12-24 07:51:25 UTC
  • Revision ID: james.westby@ubuntu.com-20051224075125-klkiqofvbfvusfvt
Tags: upstream-1.0.0.dfsg.1
ImportĀ upstreamĀ versionĀ 1.0.0.dfsg.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *  Main authors:
 
3
 *     Christian Schulte <schulte@gecode.org>
 
4
 *
 
5
 *  Copyright:
 
6
 *     Christian Schulte, 2002
 
7
 *
 
8
 *  Last modified:
 
9
 *     $Date: 2005-10-27 17:04:11 +0200 (Thu, 27 Oct 2005) $ by $Author: schulte $
 
10
 *     $Revision: 2418 $
 
11
 *
 
12
 *  This file is part of Gecode, the generic constraint
 
13
 *  development environment:
 
14
 *     http://www.gecode.org
 
15
 *
 
16
 *  See the file "LICENSE" for information on usage and
 
17
 *  redistribution of this file, and for a
 
18
 *     DISCLAIMER OF ALL WARRANTIES.
 
19
 *
 
20
 */
 
21
 
 
22
namespace Gecode {
 
23
 
 
24
  forceinline
 
25
  BoolVar::BoolVar(void) {}
 
26
 
 
27
  forceinline
 
28
  BoolVar::BoolVar(Space* home, int min, int max)
 
29
    : IntVar(home,min,max) {
 
30
    if ((min < 0) || (max > 1))
 
31
      throw Int::VariableOutOfRangeDomain("BoolVar");
 
32
  }
 
33
 
 
34
  forceinline
 
35
  BoolVar::BoolVar(const Int::BoolView& b)
 
36
    : IntVar(b) {}
 
37
 
 
38
  forceinline void
 
39
  BoolVar::update(Space* home, bool share, BoolVar& x) {
 
40
    var = x.var->copy(home,share);
 
41
  }
 
42
 
 
43
  forceinline
 
44
  BoolVar::BoolVar(const IntVar& x)
 
45
    : IntVar(x) {
 
46
    if ((x.min() < 0) || (x.max() > 1))
 
47
      throw Int::VariableOutOfRangeDomain("BoolVar");
 
48
  }
 
49
 
 
50
}
 
51
 
 
52
// STATISTICS: int-var