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;
186 static void*
operator new(size_t)
throw();
187 static void operator delete(
void*,size_t);
244 bool operator ()(
const X&,
const X&);
247 static void sort(View* x,
int n);
327 int size(
void)
const;
335 View& operator [](
int i);
338 const View& operator [](
int i)
const;
343 iterator begin(
void);
346 const_iterator begin(
void)
const;
350 const_iterator end(
void)
const;
352 reverse_iterator rbegin(
void);
354 const_reverse_iterator rbegin(
void)
const;
356 reverse_iterator rend(
void);
358 const_reverse_iterator rend(
void)
const;
397 void move_fst(
int i);
400 void move_lst(
int i);
429 void drop_fst(
int i);
432 void drop_lst(
int i);
476 bool same(
const Space& home,
const View& y)
const;
478 void unique(
const Space& home);
494 template<
class ViewY>
495 bool shared(
const Space& home,
const ViewY& y)
const;
501 template<
class ViewY>
506 static void*
operator new(size_t)
throw();
507 static void operator delete(
void*,size_t);
533 static const int onstack_size = 16;
535 T onstack[onstack_size];
545 A concat(
const T&
x)
const;
548 A& append(
const T&
x);
558 A
slice(
int start,
int inc=1,
int n=-1);
595 template<
class InputIterator>
601 int size(
void)
const;
607 T& operator [](
int i);
610 const T& operator [](
int i)
const;
615 iterator begin(
void);
618 const_iterator begin(
void)
const;
622 const_iterator end(
void)
const;
624 reverse_iterator rbegin(
void);
626 const_reverse_iterator rbegin(
void)
const;
628 reverse_iterator rend(
void);
630 const_reverse_iterator rend(
void)
const;
695 template<
class InputIterator>
706 slice(
int start,
int inc=1,
int n=-1);
715 operator <<(const PrimArgArray<T>&
x);
780 template<
class InputIterator>
781 ArgArray(InputIterator first, InputIterator last);
787 slice(
int start,
int inc=1,
int n=-1);
796 operator <<(const ArgArray<T>&
x);
850 bool operator ()(
const Var&,
const Var&);
867 template<
class InputIterator>
868 VarArgArray(InputIterator first, InputIterator last);
874 slice(
int start,
int inc=1,
int n=-1);
883 operator <<(const VarArgArray<Var>&
x);
924 template<
class Char,
class Traits,
class Var>
925 std::basic_ostream<Char,Traits>&
926 operator <<(std::basic_ostream<Char,Traits>& os,
933 template<
class Char,
class Traits,
class View>
934 std::basic_ostream<Char,Traits>&
941 template<
class Char,
class Traits,
class T>
942 std::basic_ostream<Char,Traits>&
992 assert((i >= 0) && (i <
size()));
999 assert((i >= 0) && (i <
size()));
1006 assert(
n==0 || start <
n);
1013 s = (
n-start)/inc + ((
n-start) % inc == 0 ? 0 : 1);
1015 s = (start+1)/-inc + ((start+1) % -inc == 0 ? 0 : 1);
1017 for (
int i=0;
i<r.size();
i++, start+=inc)
1076 for (
int i =
n;
i--;)
1077 x[
i].update(home, share, a.
x[
i]);
1086 for (
int i =
n;
i--;)
1107 for (
int i=x.
size();
i--;)
1109 for (
int i=y.
size();
i--;)
1118 for (
int i=x.
size();
i--;)
1120 for (
int i=y.
size();
i--;)
1129 for (
int i=x.
size();
i--;)
1131 for (
int i=y.
size();
i--;)
1140 for (
int i=x.
size();
i--;)
1151 for (
int i=y.
size();
i--;)
1161 template<
class View>
1165 template<
class View>
1169 x = (
n>0) ? home.
alloc<View>(
n) : NULL;
1171 template<
class View>
1175 x = (
n>0) ? r.
alloc<View>(
n) : NULL;
1178 template<
class View>
1183 for (
int i =
n;
i--; )
1189 template<
class View>
1194 for (
int i =
n;
i--; )
1201 template<
class View>
1206 template<
class View>
1213 template<
class View>
1219 template<
class View>
1225 template<
class View>
1228 assert((i >= 0) && (i <
size()));
1232 template<
class View>
1235 assert((i >= 0) && (i <
size()));
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>
1281 template<
class View>
1287 template<
class View>
1290 x[
i]=
x[0];
x++;
n--;
1293 template<
class View>
1299 template<
class View>
1306 template<
class View>
1313 template<
class View>
1317 x[
i].cancel(home,p,pc);
1318 x[
i]=
x[0];
x++;
n--;
1321 template<
class View>
1325 x[
i].cancel(home,p,pc);
1329 template<
class View>
1334 for (
int j=i; j--; )
1339 template<
class View>
1344 for (
int j=i+1; j<
n; j++)
1349 template<
class View>
1353 x[
i].cancel(home,a);
1354 x[
i]=
x[0];
x++;
n--;
1357 template<
class View>
1361 x[
i].cancel(home,a);
1365 template<
class View>
1370 for (
int j=i; j--; )
1375 template<
class View>
1380 for (
int j=i+1; j<
n; j++)
1385 template<
class View>
1391 for (
int i =
n;
i--; )
1392 x[
i].update(home, share, y.x[
i]);
1398 template<
class View>
1402 for (
int i =
n;
i--; )
1406 template<
class View>
1409 for (
int i =
n;
i--; )
1413 template<
class View>
1416 for (
int i =
n;
i--; )
1420 template<
class View>
1423 for (
int i =
n;
i--; )
1427 template<
class View>
1430 for (
int i =
n;
i--; )
1434 template<
class View>
1437 for (
int i =
n;
i--;)
1443 template<
class View>
1449 template<
class View>
template<
class X>
1455 template<
class View>
1459 Support::quicksort<View,ViewLess<View> >(y,m,
vl);
1462 template<
class X,
class Y>
1467 template<
class X,
class Y>
1473 template<
class View>
1479 View* y = r.
alloc<View>(
n);
1480 for (
int i =
n;
i--; )
1483 for (
int i =
n-1;
i--; )
1492 template<
class View>
1497 for (
int i =
n;
i--; )
1503 template<
class View>
1510 for (
int i = 1;
i<
n;
i++)
1516 template<
class View>
1522 View* y = r.
alloc<View>(
n);
1523 for (
int i =
n;
i--; )
1526 for (
int i =
n-1;
i--; )
1535 template<
class View>
template<
class ViewY>
1540 for (
int i =
n;
i--; )
1546 template<
class View>
template<
class ViewY>
1549 if ((
size() < 1) || (y.
size() < 1))
1553 for (
int i=
size();
i--; )
1556 Support::quicksort<View,ViewLess<View> >(xs,
size(),xvl);
1558 for (
int j=y.
size(); j--; )
1560 ViewLess<ViewY> yvl;
1561 Support::quicksort<ViewY,ViewLess<ViewY> >(ys,y.
size(),yvl);
1564 while ((i <
size()) && (j < y.
size()))
1569 }
else if (
before(
x[i],y[j])) {
1580 template<
class View>
1586 template<
class View>
1600 return (n > onstack_size) ?
1601 heap.
alloc<T>(
static_cast<unsigned int>(
n)) : &onstack[0];
1608 assert(
n+i >= onstack_size);
1610 if (newCapacity <=
n+i)
1612 T* newA = allocate(newCapacity);
1624 :
n(0),
capacity(onstack_size), a(allocate(0)) {}
1629 :
n(n0),
capacity(
n < onstack_size ? onstack_size :
n), a(allocate(
n)) {}
1634 :
n(aa.
n),
capacity(
n < onstack_size ? onstack_size :
n), a(allocate(
n)) {
1641 :
n(static_cast<int>(aa.
size())),
1642 capacity(
n < onstack_size ? onstack_size :
n), a(allocate(
n)) {
1660 capacity = (
n < onstack_size ? onstack_size :
n);
1676 assert((i>=0) && (i <
n));
1683 assert((i>=0) && (i <
n));
1735 template<
class T>
template<
class A>
1738 assert(
n==0 || start <
n);
1745 s = (
n-start)/inc + ((
n-start) % inc == 0 ? 0 : 1);
1747 s = (start+1)/-inc + ((start+1) % -inc == 0 ? 0 : 1);
1749 for (
int i=0;
i<r.
size();
i++, start+=inc)
1750 new (&r[
i]) T(a[start]);
1754 template<
class T>
template<
class A>
1759 return static_cast<A&
>(*this);
1763 template<
class InputIterator>
1766 :
n(0),
capacity(onstack_size), a(allocate(0)) {
1767 while (first != last) {
1774 template<
class T>
template<
class A>
1778 for (
int i=0;
i<x.
size();
i++)
1779 new (&a[
n++]) T(x[
i]);
1780 return static_cast<A&
>(*this);
1783 template<
class T>
template<
class A>
1788 new (&r[
i]) T(a[i]);
1789 for (
int i=x.
n; i--;)
1790 new (&r[
n+
i]) T(x.
a[i]);
1794 template<
class T>
template<
class A>
1799 new (&r[
i]) T(a[i]);
1823 for (
int i = 1;
i <
n;
i++)
1824 a[
i] = va_arg(args,T);
1831 for (
int i=n;
i--; )
1846 template<
class InputIterator>
1878 return x.template concat
1885 return x.template concat
1913 for (
int i=n;
i--; )
1928 template<
class InputIterator>
1960 return x.template concat
1967 return x.template concat
1976 return xa.template concat
2004 template<
class InputIterator>
2013 for (
int i=x.
size();
i--; )
2044 return x.template concat
2051 return x.template concat
2060 return xa.template concat
2067 return a.varimp() < b.varimp();
2073 for (
int i =
n;
i--;)
2086 for (
int i =
n;
i--; )
2089 Support::quicksort<Var,VarLess>(y,
n,
vl);
2090 for (
int i = n-1;
i--; )
2091 if (!y[
i].
assigned() && (y[
i+1].varimp() == y[
i].varimp())) {
2107 for (
int i =
n;
i--; )
2109 for (
int i = y.
n;
i--; )
2112 Support::quicksort<Var,VarLess>(z,m,
vl);
2113 for (
int i = m-1;
i--; )
2114 if (!z[
i].
assigned() && (z[
i+1].varimp() == z[
i].varimp())) {
2127 for (
int i =
n;
i--; )
2128 if (a[
i].varimp() == y.varimp())
2161 template<
class Char,
class Traits,
class Var>
2162 std::basic_ostream<Char,Traits>&
2163 operator <<(std::basic_ostream<Char,Traits>& os,
2165 std::basic_ostringstream<Char,Traits> s;
2166 s.copyfmt(os); s.width(0);
2170 for (
int i=1;
i<x.
size();
i++)
2174 return os << s.str();
2177 template<
class Char,
class Traits,
class View>
2178 std::basic_ostream<Char,Traits>&
2179 operator <<(std::basic_ostream<Char,Traits>& os,
2181 std::basic_ostringstream<Char,Traits> s;
2182 s.copyfmt(os); s.width(0);
2186 for (
int i=1;
i<x.
size();
i++)
2190 return os << s.str();
2193 template<
class Char,
class Traits,
class T>
2194 std::basic_ostream<Char,Traits>&
2195 operator <<(std::basic_ostream<Char,Traits>& os,
2197 std::basic_ostringstream<Char,Traits> s;
2198 s.copyfmt(os); s.width(0);
2202 for (
int i=1;
i<x.
size();
i++)
2206 return os << s.str();
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)
struct Gecode::@554::NNF::@60::@62 a
For atomic nodes.
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.
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.
bool before(const Item &i, const Item &j)
Test whether one item is before another.
T * pointer
Type of a pointer to the value type.
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.
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.
void free(T *b, long unsigned int n)
Delete n objects allocated from the region starting at b.
const Var * const_pointer
Type of a read-only pointer to the value type.
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.
struct Gecode::@554::NNF::@60::@61 b
For binary nodes (and, or, eqv)
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.
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.