this repo has no description
1/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
2/*
3 * Main authors:
4 * Christian Schulte <schulte@gecode.org>
5 *
6 * Copyright:
7 * Christian Schulte, 2005
8 *
9 * This file is part of Gecode, the generic constraint
10 * development environment:
11 * http://www.gecode.org
12 *
13 * Permission is hereby granted, free of charge, to any person obtaining
14 * a copy of this software and associated documentation files (the
15 * "Software"), to deal in the Software without restriction, including
16 * without limitation the rights to use, copy, modify, merge, publish,
17 * distribute, sublicense, and/or sell copies of the Software, and to
18 * permit persons to whom the Software is furnished to do so, subject to
19 * the following conditions:
20 *
21 * The above copyright notice and this permission notice shall be
22 * included in all copies or substantial portions of the Software.
23 *
24 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
28 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
29 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
30 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31 *
32 */
33
34namespace Gecode {
35
36 /*
37 * Implementation
38 *
39 */
40
41 forceinline
42 IntArgs::IntArgs(void) : ArgArray<int>(0) {}
43
44 forceinline
45 IntArgs::IntArgs(int n) : ArgArray<int>(n) {}
46
47 forceinline
48 IntArgs::IntArgs(const SharedArray<int>& x)
49 : ArgArray<int>(x.size()) {
50 for (int i=0; i<x.size(); i++)
51 a[i] = x[i];
52 }
53
54 forceinline
55 IntArgs::IntArgs(const std::vector<int>& x)
56 : ArgArray<int>(x) {}
57
58 forceinline
59 IntArgs::IntArgs(std::initializer_list<int> x)
60 : ArgArray<int>(x) {}
61
62 template<class InputIterator>
63 forceinline
64 IntArgs::IntArgs(InputIterator first, InputIterator last)
65 : ArgArray<int>(first,last) {}
66
67 forceinline
68 IntArgs::IntArgs(int n, const int* e)
69 : ArgArray<int>(n, e) {}
70
71 forceinline
72 IntArgs::IntArgs(const ArgArray<int>& a)
73 : ArgArray<int>(a) {}
74
75 forceinline IntArgs
76 IntArgs::create(int n, int start, int inc) {
77 IntArgs r(n);
78 for (int i=0; i<n; i++, start+=inc)
79 r[i] = start;
80 return r;
81 }
82
83
84 forceinline
85 IntVarArgs::IntVarArgs(void) {}
86
87 forceinline
88 IntVarArgs::IntVarArgs(int n)
89 : VarArgArray<IntVar>(n) {}
90
91 forceinline
92 IntVarArgs::IntVarArgs(const IntVarArgs& a)
93 : VarArgArray<IntVar>(a) {}
94
95 forceinline
96 IntVarArgs::IntVarArgs(const VarArray<IntVar>& a)
97 : VarArgArray<IntVar>(a) {}
98
99 forceinline
100 IntVarArgs::IntVarArgs(const std::vector<IntVar>& a)
101 : VarArgArray<IntVar>(a) {}
102
103 forceinline
104 IntVarArgs::IntVarArgs(std::initializer_list<IntVar> a)
105 : VarArgArray<IntVar>(a) {}
106
107 template<class InputIterator>
108 forceinline
109 IntVarArgs::IntVarArgs(InputIterator first, InputIterator last)
110 : VarArgArray<IntVar>(first,last) {}
111
112
113 forceinline
114 BoolVarArgs::BoolVarArgs(void) {}
115
116 forceinline
117 BoolVarArgs::BoolVarArgs(int n)
118 : VarArgArray<BoolVar>(n) {}
119
120 forceinline
121 BoolVarArgs::BoolVarArgs(const BoolVarArgs& a)
122 : VarArgArray<BoolVar>(a) {}
123
124 forceinline
125 BoolVarArgs::BoolVarArgs(const VarArray<BoolVar>& a)
126 : VarArgArray<BoolVar>(a) {}
127
128 forceinline
129 BoolVarArgs::BoolVarArgs(const std::vector<BoolVar>& a)
130 : VarArgArray<BoolVar>(a) {}
131
132 forceinline
133 BoolVarArgs::BoolVarArgs(std::initializer_list<BoolVar> a)
134 : VarArgArray<BoolVar>(a) {}
135
136 template<class InputIterator>
137 forceinline
138 BoolVarArgs::BoolVarArgs(InputIterator first, InputIterator last)
139 : VarArgArray<BoolVar>(first,last) {}
140
141
142 forceinline
143 IntVarArray::IntVarArray(void) {}
144
145 forceinline
146 IntVarArray::IntVarArray(Space& home, int n)
147 : VarArray<IntVar>(home,n) {}
148
149 forceinline
150 IntVarArray::IntVarArray(const IntVarArray& a)
151 : VarArray<IntVar>(a) {}
152
153 forceinline
154 IntVarArray::IntVarArray(Space& home, const IntVarArgs& a)
155 : VarArray<IntVar>(home,a) {}
156
157
158 forceinline
159 BoolVarArray::BoolVarArray(void) {}
160
161 forceinline
162 BoolVarArray::BoolVarArray(Space& home, int n)
163 : VarArray<BoolVar>(home,n) {}
164
165 forceinline
166 BoolVarArray::BoolVarArray(const BoolVarArray& a)
167 : VarArray<BoolVar>(a) {}
168
169 forceinline
170 BoolVarArray::BoolVarArray(Space& home, const BoolVarArgs& a)
171 : VarArray<BoolVar>(home,a) {}
172
173}
174
175// STATISTICS: int-other