128 int size(
void)
const;
134 Var& operator [](
int i);
137 const Var& operator [](
int i)
const;
144 slice(
int start,
int inc=1,
int n=-1);
149 iterator begin(
void);
152 const_iterator begin(
void)
const;
156 const_iterator end(
void)
const;
158 reverse_iterator rbegin(
void);
160 const_reverse_iterator rbegin(
void)
const;
162 reverse_iterator rend(
void);
164 const_reverse_iterator rend(
void)
const;
176 static void*
operator new(size_t)
throw();
177 static void operator delete(
void*,size_t);
234 bool operator ()(
const X&,
const X&);
237 static void sort(View* x,
int n);
317 int size(
void)
const;
325 View& operator [](
int i);
328 const View& operator [](
int i)
const;
333 iterator begin(
void);
336 const_iterator begin(
void)
const;
340 const_iterator end(
void)
const;
342 reverse_iterator rbegin(
void);
344 const_reverse_iterator rbegin(
void)
const;
346 reverse_iterator rend(
void);
348 const_reverse_iterator rend(
void)
const;
381 void move_fst(
int i);
384 void move_lst(
int i);
413 void drop_fst(
int i);
416 void drop_lst(
int i);
454 bool same(
void)
const;
460 bool same(
const View&
y)
const;
478 template<
class ViewY>
479 bool shared(
const ViewY& y)
const;
485 template<
class ViewY>
490 static void*
operator new(size_t)
throw();
491 static void operator delete(
void*,size_t);
517 static const int onstack_size = 16;
519 T onstack[onstack_size];
529 A concat(
const T&
x)
const;
532 A& append(
const T&
x);
542 A
slice(
int start,
int inc=1,
int n=-1);
579 template<
class InputIterator>
585 int size(
void)
const;
591 T& operator [](
int i);
594 const T& operator [](
int i)
const;
599 iterator begin(
void);
602 const_iterator begin(
void)
const;
606 const_iterator end(
void)
const;
608 reverse_iterator rbegin(
void);
610 const_reverse_iterator rbegin(
void)
const;
612 reverse_iterator rend(
void);
614 const_reverse_iterator rend(
void)
const;
679 template<
class InputIterator>
690 slice(
int start,
int inc=1,
int n=-1);
699 operator <<(const PrimArgArray<T>&
x);
764 template<
class InputIterator>
765 ArgArray(InputIterator first, InputIterator last);
771 slice(
int start,
int inc=1,
int n=-1);
780 operator <<(const ArgArray<T>&
x);
834 bool operator ()(
const Var&,
const Var&);
851 template<
class InputIterator>
852 VarArgArray(InputIterator first, InputIterator last);
858 slice(
int start,
int inc=1,
int n=-1);
867 operator <<(const VarArgArray<Var>&
x);
888 bool same(
void)
const;
908 template<
class Char,
class Traits,
class Var>
909 std::basic_ostream<Char,Traits>&
910 operator <<(std::basic_ostream<Char,Traits>& os,
917 template<
class Char,
class Traits,
class View>
918 std::basic_ostream<Char,Traits>&
925 template<
class Char,
class Traits,
class T>
926 std::basic_ostream<Char,Traits>&
976 assert((i >= 0) && (i <
size()));
983 assert((i >= 0) && (i <
size()));
990 assert(
n==0 || start <
n);
997 s = (
n-start)/inc + ((
n-start) % inc == 0 ? 0 : 1);
999 s = (start+1)/-inc + ((start+1) % -inc == 0 ? 0 : 1);
1001 for (
int i=0;
i<r.size();
i++, start+=inc)
1060 for (
int i =
n;
i--;)
1070 for (
int i =
n;
i--;)
1091 for (
int i=x.
size();
i--;)
1093 for (
int i=y.
size();
i--;)
1102 for (
int i=x.
size();
i--;)
1104 for (
int i=y.
size();
i--;)
1113 for (
int i=x.
size();
i--;)
1115 for (
int i=y.
size();
i--;)
1124 for (
int i=x.
size();
i--;)
1135 for (
int i=y.
size();
i--;)
1145 template<
class View>
1149 template<
class View>
1153 x = (
n>0) ? home.
alloc<View>(
n) : NULL;
1155 template<
class View>
1159 x = (
n>0) ? r.
alloc<View>(
n) : NULL;
1162 template<
class View>
1167 for (
int i =
n;
i--; )
1173 template<
class View>
1178 for (
int i =
n;
i--; )
1185 template<
class View>
1190 template<
class View>
1197 template<
class View>
1203 template<
class View>
1209 template<
class View>
1212 assert((i >= 0) && (i <
size()));
1216 template<
class View>
1219 assert((i >= 0) && (i <
size()));
1223 template<
class View>
1229 template<
class View>
1235 template<
class View>
1241 template<
class View>
1247 template<
class View>
1253 template<
class View>
1259 template<
class View>
1265 template<
class View>
1271 template<
class View>
1274 x[
i]=
x[0];
x++;
n--;
1277 template<
class View>
1283 template<
class View>
1290 template<
class View>
1297 template<
class View>
1301 x[
i].cancel(home,p,pc);
1302 x[
i]=
x[0];
x++;
n--;
1305 template<
class View>
1309 x[
i].cancel(home,p,pc);
1313 template<
class View>
1318 for (
int j=i; j--; )
1323 template<
class View>
1328 for (
int j=i+1; j<
n; j++)
1333 template<
class View>
1337 x[
i].cancel(home,a);
1338 x[
i]=
x[0];
x++;
n--;
1341 template<
class View>
1345 x[
i].cancel(home,a);
1349 template<
class View>
1354 for (
int j=i; j--; )
1359 template<
class View>
1364 for (
int j=i+1; j<
n; j++)
1369 template<
class View>
1375 for (
int i =
n;
i--; )
1382 template<
class View>
1386 for (
int i =
n;
i--; )
1390 template<
class View>
1393 for (
int i =
n;
i--; )
1397 template<
class View>
1400 for (
int i =
n;
i--; )
1404 template<
class View>
1407 for (
int i =
n;
i--; )
1411 template<
class View>
1414 for (
int i =
n;
i--; )
1418 template<
class View>
1421 for (
int i =
n;
i--;)
1427 template<
class View>
1433 template<
class View>
template<
class X>
1439 template<
class View>
1443 Support::quicksort<View,ViewLess<View> >(
y,m,
vl);
1446 template<
class X,
class Y>
1451 template<
class X,
class Y>
1457 template<
class View>
1463 View* y = r.
alloc<View>(
n);
1464 for (
int i =
n;
i--; )
1467 for (
int i =
n-1;
i--; )
1476 template<
class View>
1481 for (
int i =
n;
i--; )
1487 template<
class View>
1494 for (
int i = 1;
i<
n;
i++)
1500 template<
class View>
1506 View* y = r.
alloc<View>(
n);
1507 for (
int i =
n;
i--; )
1510 for (
int i =
n-1;
i--; )
1519 template<
class View>
template<
class ViewY>
1524 for (
int i =
n;
i--; )
1530 template<
class View>
template<
class ViewY>
1533 if ((
size() < 1) || (y.
size() < 1))
1537 for (
int i=
size();
i--; )
1540 Support::quicksort<View,ViewLess<View> >(xs,
size(),xvl);
1542 for (
int j=y.
size(); j--; )
1544 ViewLess<ViewY> yvl;
1545 Support::quicksort<ViewY,ViewLess<ViewY> >(ys,y.
size(),yvl);
1548 while ((i <
size()) && (j < y.
size()))
1553 }
else if (
before(
x[i],y[j])) {
1564 template<
class View>
1570 template<
class View>
1584 return (n > onstack_size) ?
1585 heap.
alloc<T>(
static_cast<unsigned int>(
n)) : &onstack[0];
1592 assert(
n+i >= onstack_size);
1594 if (newCapacity <=
n+i)
1596 T* newA = allocate(newCapacity);
1608 :
n(0),
capacity(onstack_size), a(allocate(0)) {}
1613 :
n(n0),
capacity(
n < onstack_size ? onstack_size :
n), a(allocate(
n)) {}
1618 :
n(aa.
n),
capacity(
n < onstack_size ? onstack_size :
n), a(allocate(
n)) {
1625 :
n(static_cast<int>(aa.
size())),
1626 capacity(
n < onstack_size ? onstack_size :
n), a(allocate(
n)) {
1644 capacity = (
n < onstack_size ? onstack_size :
n);
1660 assert((i>=0) && (i <
n));
1667 assert((i>=0) && (i <
n));
1719 template<
class T>
template<
class A>
1722 assert(
n==0 || start <
n);
1729 s = (
n-start)/inc + ((
n-start) % inc == 0 ? 0 : 1);
1731 s = (start+1)/-inc + ((start+1) % -inc == 0 ? 0 : 1);
1733 for (
int i=0;
i<r.
size();
i++, start+=inc)
1734 new (&r[
i]) T(a[start]);
1738 template<
class T>
template<
class A>
1743 return static_cast<A&
>(*this);
1747 template<
class InputIterator>
1750 :
n(0),
capacity(onstack_size), a(allocate(0)) {
1751 while (first != last) {
1758 template<
class T>
template<
class A>
1762 for (
int i=0;
i<x.
size();
i++)
1763 new (&a[
n++]) T(x[
i]);
1764 return static_cast<A&
>(*this);
1767 template<
class T>
template<
class A>
1772 new (&r[
i]) T(a[i]);
1773 for (
int i=x.
n; i--;)
1774 new (&r[
n+
i]) T(x.
a[i]);
1778 template<
class T>
template<
class A>
1783 new (&r[
i]) T(a[i]);
1807 for (
int i = 1;
i <
n;
i++)
1808 a[
i] = va_arg(args,T);
1815 for (
int i=n;
i--; )
1830 template<
class InputIterator>
1862 return x.template concat
1869 return x.template concat
1897 for (
int i=n;
i--; )
1912 template<
class InputIterator>
1944 return x.template concat
1951 return x.template concat
1960 return xa.template concat
1988 template<
class InputIterator>
1997 for (
int i=x.
size();
i--; )
2028 return x.template concat
2035 return x.template concat
2044 return xa.template concat
2051 return a.varimp() < b.varimp();
2057 for (
int i =
n;
i--;)
2070 for (
int i =
n;
i--; )
2073 Support::quicksort<Var,VarLess>(
y,
n,
vl);
2074 for (
int i = n-1;
i--; )
2075 if (!y[
i].
assigned() && (y[
i+1].varimp() == y[
i].varimp())) {
2091 for (
int i =
n;
i--; )
2093 for (
int i = y.
n;
i--; )
2096 Support::quicksort<Var,VarLess>(
z,m,
vl);
2097 for (
int i = m-1;
i--; )
2098 if (!z[
i].
assigned() && (z[
i+1].varimp() == z[
i].varimp())) {
2111 for (
int i =
n;
i--; )
2112 if (a[
i].varimp() == y.varimp())
2145 template<
class Char,
class Traits,
class Var>
2146 std::basic_ostream<Char,Traits>&
2147 operator <<(std::basic_ostream<Char,Traits>& os,
2149 std::basic_ostringstream<Char,Traits> s;
2150 s.copyfmt(os); s.width(0);
2154 for (
int i=1;
i<x.
size();
i++)
2158 return os << s.str();
2161 template<
class Char,
class Traits,
class View>
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 T>
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();
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.