3
* Christian Schulte <schulte@gecode.org>
6
* Christian Schulte, 2002
9
* $Date: 2005-10-19 11:51:16 +0200 (Wed, 19 Oct 2005) $ by $Author: schulte $
12
* This file is part of Gecode, the generic constraint
13
* development environment:
14
* http://www.gecode.org
16
* See the file "LICENSE" for information on usage and
17
* redistribution of this file, and for a
18
* DISCLAIMER OF ALL WARRANTIES.
26
IntVarArray::IntVarArray(Space* home, int n, int min, int max)
27
: VarArray<IntVar>(home,n) {
28
if ((min < Limits::Int::int_min) || (max > Limits::Int::int_max))
29
throw Int::VariableOutOfRangeDomain("IntVarArray");
31
throw Int::VariableEmptyDomain("IntVarArray");
32
for (int i = size(); i--; )
33
x[i].init(home,min,max);
36
IntVarArray::IntVarArray(Space* home, int n, const IntSet& s)
37
: VarArray<IntVar>(home,n) {
38
if ((s.min() < Limits::Int::int_min) || (s.max() > Limits::Int::int_max))
39
throw Int::VariableOutOfRangeDomain("IntVarArray");
41
throw Int::VariableEmptyDomain("IntVarArray");
42
for (int i = size(); i--; )
46
BoolVarArray::BoolVarArray(Space* home, int n, int min, int max)
47
: IntVarArray(home, n) {
48
if ((min < 0) || (max > 1))
49
throw Int::VariableOutOfRangeDomain("BoolVarArray");
51
throw Int::VariableEmptyDomain("BoolVarArray");
52
for (int i = size(); i--; )
53
x[i].init(home,min,max);
60
// STATISTICS: int-post