main page
modules
namespaces
classes
files
Gecode home
Generated on Wed Jan 1 2020 10:37:59 for Gecode by
doxygen
1.8.16
gecode
int
array.hpp
Go to the documentation of this file.
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
34
namespace
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
Gecode::x
Post propagator for SetVar x
Definition:
set.hh:767
Gecode::IntArgs::create
static IntArgs create(int n, int start, int inc=1)
Allocate array with n elements such that for all .
Definition:
array.hpp:76
Gecode::IntVarArgs
Passing integer variables.
Definition:
int.hh:656
Gecode::Iter::Ranges::size
unsigned int size(I &i)
Size of all ranges of range iterator i.
Definition:
ranges-operations.hpp:74
Gecode::ArgArrayBase< int >::n
int n
Number of elements.
Definition:
array.hpp:540
Gecode::Space
Computation spaces.
Definition:
core.hpp:1742
Gecode::IntVarArray
Integer variable array.
Definition:
int.hh:763
Gecode::BoolVarArgs::BoolVarArgs
BoolVarArgs(void)
Allocate empty array.
Definition:
array.hpp:114
Gecode::IntVarArgs::IntVarArgs
IntVarArgs(void)
Allocate empty array.
Definition:
array.hpp:85
Gecode::VarArray< IntVar >
Gecode::IntArgs::IntArgs
IntArgs(void)
Allocate empty array.
Definition:
array.hpp:42
Gecode
Gecode toplevel namespace
Gecode::BoolVarArray
Boolean variable array.
Definition:
int.hh:808
a
struct Gecode::@602::NNF::@65::@67 a
For atomic nodes.
Gecode::ArgArray
Argument array for non-primitive types.
Definition:
array.hpp:656
Gecode::BoolVarArgs
Passing Boolean variables.
Definition:
int.hh:712
Gecode::r
Post propagator for SetVar SetOpType SetVar SetRelType r
Definition:
set.hh:767
Gecode::BoolVar
Boolean integer variables.
Definition:
int.hh:512
Gecode::BoolVarArray::BoolVarArray
BoolVarArray(void)
Default constructor (array of size 0)
Definition:
array.hpp:159
Gecode::IntVar
Integer variables.
Definition:
int.hh:371
Gecode::ArgArrayBase< int >::a
int * a
Element array.
Definition:
array.hpp:544
forceinline
#define forceinline
Definition:
config.hpp:185
Gecode::IntVarArray::IntVarArray
IntVarArray(void)
Default constructor (array of size 0)
Definition:
array.hpp:143
Gecode::SharedArray< int >
n
int n
Number of negative literals for node type.
Definition:
bool-expr.cpp:234
Gecode::VarArgArray
Argument array for variables.
Definition:
array.hpp:79
Gecode::IntArgs
Passing integer arguments.
Definition:
int.hh:628
Test::Int::Basic::i
Gecode::IntArgs i({1, 2, 3, 4})