132 int size(
void)
const;
138 Var& operator [](
int i);
141 const Var& operator [](
int i)
const;
148 slice(
int start,
int inc=1,
int n=-1);
153 iterator begin(
void);
156 const_iterator begin(
void)
const;
160 const_iterator end(
void)
const;
162 reverse_iterator rbegin(
void);
164 const_reverse_iterator rbegin(
void)
const;
166 reverse_iterator rend(
void);
168 const_reverse_iterator rend(
void)
const;
180 static void*
operator new(size_t)
throw();
181 static void operator delete(
void*,size_t);
238 bool operator ()(
const X&,
const X&);
241 static void sort(View* x,
int n);
321 int size(
void)
const;
329 View& operator [](
int i);
332 const View& operator [](
int i)
const;
337 iterator begin(
void);
340 const_iterator begin(
void)
const;
344 const_iterator end(
void)
const;
346 reverse_iterator rbegin(
void);
348 const_reverse_iterator rbegin(
void)
const;
350 reverse_iterator rend(
void);
352 const_reverse_iterator rend(
void)
const;
385 void move_fst(
int i);
388 void move_lst(
int i);
417 void drop_fst(
int i);
420 void drop_lst(
int i);
458 bool same(
void)
const;
464 bool same(
const View&
y)
const;
482 template<
class ViewY>
483 bool shared(
const ViewY& y)
const;
489 template<
class ViewY>
494 static void*
operator new(size_t)
throw();
495 static void operator delete(
void*,size_t);
521 static const int onstack_size = 16;
523 T onstack[onstack_size];
533 A concat(
const T&
x)
const;
536 A& append(
const T&
x);
546 A
slice(
int start,
int inc=1,
int n=-1);
583 template<
class InputIterator>
589 int size(
void)
const;
595 T& operator [](
int i);
598 const T& operator [](
int i)
const;
603 iterator begin(
void);
606 const_iterator begin(
void)
const;
610 const_iterator end(
void)
const;
612 reverse_iterator rbegin(
void);
614 const_reverse_iterator rbegin(
void)
const;
616 reverse_iterator rend(
void);
618 const_reverse_iterator rend(
void)
const;
683 template<
class InputIterator>
694 slice(
int start,
int inc=1,
int n=-1);
703 operator <<(const PrimArgArray<T>&
x);
768 template<
class InputIterator>
769 ArgArray(InputIterator first, InputIterator last);
775 slice(
int start,
int inc=1,
int n=-1);
784 operator <<(const ArgArray<T>&
x);
838 bool operator ()(
const Var&,
const Var&);
855 template<
class InputIterator>
856 VarArgArray(InputIterator first, InputIterator last);
862 slice(
int start,
int inc=1,
int n=-1);
871 operator <<(const VarArgArray<Var>&
x);
892 bool same(
void)
const;
912 template<
class Char,
class Traits,
class Var>
913 std::basic_ostream<Char,Traits>&
914 operator <<(std::basic_ostream<Char,Traits>& os,
921 template<
class Char,
class Traits,
class View>
922 std::basic_ostream<Char,Traits>&
929 template<
class Char,
class Traits,
class T>
930 std::basic_ostream<Char,Traits>&
980 assert((i >= 0) && (i <
size()));
987 assert((i >= 0) && (i <
size()));
994 assert(
n==0 || start <
n);
1001 s = (
n-start)/inc + ((
n-start) % inc == 0 ? 0 : 1);
1003 s = (start+1)/-inc + ((start+1) % -inc == 0 ? 0 : 1);
1005 for (
int i=0;
i<r.size();
i++, start+=inc)
1064 for (
int i =
n;
i--;)
1074 for (
int i =
n;
i--;)
1095 for (
int i=x.
size();
i--;)
1097 for (
int i=y.
size();
i--;)
1106 for (
int i=x.
size();
i--;)
1108 for (
int i=y.
size();
i--;)
1117 for (
int i=x.
size();
i--;)
1119 for (
int i=y.
size();
i--;)
1128 for (
int i=x.
size();
i--;)
1139 for (
int i=y.
size();
i--;)
1149 template<
class View>
1153 template<
class View>
1157 x = (
n>0) ? home.
alloc<View>(
n) : NULL;
1159 template<
class View>
1163 x = (
n>0) ? r.
alloc<View>(
n) : NULL;
1166 template<
class View>
1171 for (
int i =
n;
i--; )
1177 template<
class View>
1182 for (
int i =
n;
i--; )
1189 template<
class View>
1194 template<
class View>
1201 template<
class View>
1207 template<
class View>
1213 template<
class View>
1216 assert((i >= 0) && (i <
size()));
1220 template<
class View>
1223 assert((i >= 0) && (i <
size()));
1227 template<
class View>
1233 template<
class View>
1239 template<
class View>
1245 template<
class View>
1251 template<
class View>
1257 template<
class View>
1263 template<
class View>
1269 template<
class View>
1275 template<
class View>
1278 x[
i]=
x[0];
x++;
n--;
1281 template<
class View>
1287 template<
class View>
1294 template<
class View>
1301 template<
class View>
1305 x[
i].cancel(home,p,pc);
1306 x[
i]=
x[0];
x++;
n--;
1309 template<
class View>
1313 x[
i].cancel(home,p,pc);
1317 template<
class View>
1322 for (
int j=i; j--; )
1327 template<
class View>
1332 for (
int j=i+1; j<
n; j++)
1337 template<
class View>
1341 x[
i].cancel(home,a);
1342 x[
i]=
x[0];
x++;
n--;
1345 template<
class View>
1349 x[
i].cancel(home,a);
1353 template<
class View>
1358 for (
int j=i; j--; )
1363 template<
class View>
1368 for (
int j=i+1; j<
n; j++)
1373 template<
class View>
1379 for (
int i =
n;
i--; )
1386 template<
class View>
1390 for (
int i =
n;
i--; )
1394 template<
class View>
1397 for (
int i =
n;
i--; )
1401 template<
class View>
1404 for (
int i =
n;
i--; )
1408 template<
class View>
1411 for (
int i =
n;
i--; )
1415 template<
class View>
1418 for (
int i =
n;
i--; )
1422 template<
class View>
1425 for (
int i =
n;
i--;)
1431 template<
class View>
1437 template<
class View>
template<
class X>
1443 template<
class View>
1447 Support::quicksort<View,ViewLess<View> >(
y,m,
vl);
1450 template<
class X,
class Y>
1455 template<
class X,
class Y>
1461 template<
class View>
1467 View* y = r.
alloc<View>(
n);
1468 for (
int i =
n;
i--; )
1471 for (
int i =
n-1;
i--; )
1480 template<
class View>
1485 for (
int i =
n;
i--; )
1491 template<
class View>
1498 for (
int i = 1;
i<
n;
i++)
1504 template<
class View>
1510 View* y = r.
alloc<View>(
n);
1511 for (
int i =
n;
i--; )
1514 for (
int i =
n-1;
i--; )
1523 template<
class View>
template<
class ViewY>
1528 for (
int i =
n;
i--; )
1534 template<
class View>
template<
class ViewY>
1537 if ((
size() < 1) || (y.
size() < 1))
1541 for (
int i=
size();
i--; )
1544 Support::quicksort<View,ViewLess<View> >(xs,
size(),xvl);
1546 for (
int j=y.
size(); j--; )
1548 ViewLess<ViewY> yvl;
1549 Support::quicksort<ViewY,ViewLess<ViewY> >(ys,y.
size(),yvl);
1552 while ((i <
size()) && (j < y.
size()))
1557 }
else if (
before(
x[i],y[j])) {
1568 template<
class View>
1574 template<
class View>
1588 return (n > onstack_size) ?
1589 heap.
alloc<T>(
static_cast<unsigned int>(
n)) : &onstack[0];
1596 assert(
n+i >= onstack_size);
1598 if (newCapacity <=
n+i)
1600 T* newA = allocate(newCapacity);
1612 :
n(0),
capacity(onstack_size), a(allocate(0)) {}
1617 :
n(n0),
capacity(
n < onstack_size ? onstack_size :
n), a(allocate(
n)) {}
1622 :
n(aa.
n),
capacity(
n < onstack_size ? onstack_size :
n), a(allocate(
n)) {
1629 :
n(static_cast<int>(aa.
size())),
1630 capacity(
n < onstack_size ? onstack_size :
n), a(allocate(
n)) {
1648 capacity = (
n < onstack_size ? onstack_size :
n);
1664 assert((i>=0) && (i <
n));
1671 assert((i>=0) && (i <
n));
1723 template<
class T>
template<
class A>
1726 assert(
n==0 || start <
n);
1733 s = (
n-start)/inc + ((
n-start) % inc == 0 ? 0 : 1);
1735 s = (start+1)/-inc + ((start+1) % -inc == 0 ? 0 : 1);
1737 for (
int i=0;
i<r.
size();
i++, start+=inc)
1738 new (&r[
i]) T(a[start]);
1742 template<
class T>
template<
class A>
1747 return static_cast<A&
>(*this);
1751 template<
class InputIterator>
1754 :
n(0),
capacity(onstack_size), a(allocate(0)) {
1755 while (first != last) {
1762 template<
class T>
template<
class A>
1766 for (
int i=0;
i<x.
size();
i++)
1767 new (&a[
n++]) T(x[
i]);
1768 return static_cast<A&
>(*this);
1771 template<
class T>
template<
class A>
1776 new (&r[
i]) T(a[i]);
1777 for (
int i=x.
n; i--;)
1778 new (&r[
n+
i]) T(x.
a[i]);
1782 template<
class T>
template<
class A>
1787 new (&r[
i]) T(a[i]);
1811 for (
int i = 1;
i <
n;
i++)
1812 a[
i] = va_arg(args,T);
1819 for (
int i=n;
i--; )
1834 template<
class InputIterator>
1866 return x.template concat
1873 return x.template concat
1901 for (
int i=n;
i--; )
1916 template<
class InputIterator>
1948 return x.template concat
1955 return x.template concat
1964 return xa.template concat
1992 template<
class InputIterator>
2001 for (
int i=x.
size();
i--; )
2032 return x.template concat
2039 return x.template concat
2048 return xa.template concat
2055 return a.varimp() < b.varimp();
2061 for (
int i =
n;
i--;)
2074 for (
int i =
n;
i--; )
2077 Support::quicksort<Var,VarLess>(
y,
n,
vl);
2078 for (
int i = n-1;
i--; )
2079 if (!y[
i].
assigned() && (y[
i+1].varimp() == y[
i].varimp())) {
2095 for (
int i =
n;
i--; )
2097 for (
int i = y.
n;
i--; )
2100 Support::quicksort<Var,VarLess>(
z,m,
vl);
2101 for (
int i = m-1;
i--; )
2102 if (!z[
i].
assigned() && (z[
i+1].varimp() == z[
i].varimp())) {
2115 for (
int i =
n;
i--; )
2116 if (a[
i].varimp() == y.varimp())
2149 template<
class Char,
class Traits,
class Var>
2150 std::basic_ostream<Char,Traits>&
2151 operator <<(std::basic_ostream<Char,Traits>& os,
2153 std::basic_ostringstream<Char,Traits> s;
2154 s.copyfmt(os); s.width(0);
2158 for (
int i=1;
i<x.
size();
i++)
2162 return os << s.str();
2165 template<
class Char,
class Traits,
class View>
2166 std::basic_ostream<Char,Traits>&
2167 operator <<(std::basic_ostream<Char,Traits>& os,
2169 std::basic_ostringstream<Char,Traits> s;
2170 s.copyfmt(os); s.width(0);
2174 for (
int i=1;
i<x.
size();
i++)
2178 return os << s.str();
2181 template<
class Char,
class Traits,
class T>
2182 std::basic_ostream<Char,Traits>&
2183 operator <<(std::basic_ostream<Char,Traits>& os,
2185 std::basic_ostringstream<Char,Traits> s;
2186 s.copyfmt(os); s.width(0);
2190 for (
int i=1;
i<x.
size();
i++)
2194 return os << s.str();
void free(void)
Free allocate memory.
int capacity
Allocated size of the array.
static T * copy(T *d, const T *s, long unsigned int n)
Copy n objects starting at s to d.
const T * const_iterator
Type of the iterator used to iterate read-only through this array's elements.
int size(void) const
Return size of array (number of elements)
int size(void) const
Return size of array (number of elements)
Argument array for primtive types.
bool __shared(const X &x, const Y &y)
void cancel(Space &home, Propagator &p, IntSet &y)
T * alloc(long unsigned int n)
Allocate block of n objects of type T from region.
Var * iterator
Type of the iterator used to iterate through this array's elements.
std::reverse_iterator< const T * > const_reverse_iterator
Type of the iterator used to iterate backwards and read-only through this array's elements...
Var & reference
Type of a reference to the value type.
Base-class for propagators.
Var * pointer
Type of a pointer to the value type.
std::basic_ostream< Char, Traits > & operator<<(std::basic_ostream< Char, Traits > &os, const ArgArrayBase< T > &x)
T * iterator
Type of the iterator used to iterate through this array's elements.
const View & const_reference
Type of a constant reference to the value type.
View * iterator
Type of the iterator used to iterate through this array's elements.
bool shared(const IntSet &, VX)
T * alloc(long unsigned int n)
Allocate block of n objects of type T from space heap.
View * pointer
Type of a pointer to the value type.
const Var & const_reference
Type of a constant reference to the value type.
void sort(TaskViewArray< TaskView > &t)
Sort task view array t according to sto and inc (increasing or decreasing)
bool same(const ConstView< ViewA > &, const ConstView< ViewB > &)
Test whether two views are the same.
int p
Number of positive literals for node type.
std::reverse_iterator< const Var * > const_reverse_iterator
Type of the iterator used to iterate backwards and read-only through this array's elements...
T * alloc(long unsigned int n)
Allocate block of n objects of type T from heap.
const FloatNum min
Smallest allowed float value.
Gecode::IntArgs i(4, 1, 2, 3, 4)
int n
Number of negative literals for node type.
Argument array for non-primitive types.
Var * x
Array of variables.
const View * const_pointer
Type of a read-only pointer to the value type.
FloatVal operator+(const FloatVal &x)
int PropCond
Type for propagation conditions.
void subscribe(Space &home, Propagator &p, IntSet &y)
ArrayTraits< VarArgArray< Var > >::ArgsType operator+(const Var &x, const VarArgArray< Var > &y)
unsigned int size(I &i)
Size of all ranges of range iterator i.
ViewArray(Region &r, const VarArgArray< Var > &a)
Initialize from variable argument array a (copy elements)
VarArray(void)
Default constructor (array of size 0)
T & reference
Type of a reference to the value type.
Post propagator for SetVar SetOpType SetVar SetRelType SetVar z
bool __before(const View &x, const View &y)
int n
Number of variables (size)
bool __same(const X &x, const Y &y)
Boolean integer variables.
Post propagator for SetVar SetOpType SetVar SetRelType r
bool before(const Item &i, const Item &j)
Test whether one item is before another.
struct Gecode::@585::NNF::@62::@63 b
For binary nodes (and, or, eqv)
T * pointer
Type of a pointer to the value type.
Post propagator for SetVar SetOpType SetVar y
View & reference
Type of a reference to the value type.
Base class for variables.
void free(T *b, long unsigned int n)
Delete n objects starting at b.
Node * x
Pointer to corresponding Boolean expression node.
struct Gecode::@585::NNF::@62::@64 a
For atomic nodes.
Base-class for argument arrays.
Heap heap
The single global heap.
bool assigned(View x, int v)
Whether x is assigned to value v.
bool same(const Item &i, const Item &j)
Whether two items are the same.
const Var * const_pointer
Type of a read-only pointer to the value type.
Post propagator for SetVar x
Archive & operator<<(Archive &e, FloatNumBranch nl)
bool shared(const ConstView< ViewA > &, const ConstView< ViewB > &)
Test whether views share same variable.
Sort order for variables.
Traits of arrays in Gecode.
const T & const_reference
Type of a constant reference to the value type.
Gecode toplevel namespace
Argument array for variables.
const int capacity[n_warehouses]
Capacity of a single warehouse.
std::reverse_iterator< const View * > const_reverse_iterator
Type of the iterator used to iterate backwards and read-only through this array's elements...
ViewArray(Space &home, const VarArgArray< Var > &a)
Initialize from variable argument array a (copy elements)
std::reverse_iterator< T * > reverse_iterator
Type of the iterator used to iterate backwards through this array's elements.
void reschedule(Space &home, Propagator &p, IntSet &y)
const Var * const_iterator
Type of the iterator used to iterate read-only through this array's elements.
View value_type
Type of the view stored in this array.
int size(void) const
Return size of array (number of elements)
const View * const_iterator
Type of the iterator used to iterate read-only through this array's elements.
std::reverse_iterator< View * > reverse_iterator
Type of the iterator used to iterate backwards through this array's elements.
const T * const_pointer
Type of a read-only pointer to the value type.
void update(IntSet &y, Space &home, IntSet &py)
const unsigned int slice
Size of a slice in a portfolio and scale factor for restarts(in number of failures) ...
std::reverse_iterator< Var * > reverse_iterator
Type of the iterator used to iterate backwards through this array's elements.