45 plus(
long long int x,
long long int y) {
50 template<
class TaskView,
class Node>
53 return tasks.size()-1;
55 template<
class TaskView,
class Node>
58 return 2*
tasks.size() - 1;
61 template<
class TaskView,
class Node>
66 template<
class TaskView,
class Node>
71 template<
class TaskView,
class Node>
76 template<
class TaskView,
class Node>
83 template<
class TaskView,
class Node>
88 template<
class TaskView,
class Node>
95 template<
class TaskView,
class Node>
101 template<
class TaskView,
class Node>
107 template<
class TaskView,
class Node>
113 template<
class TaskView,
class Node>
120 template<
class TaskView,
class Node>
127 template<
class TaskView,
class Node>
139 template<
class TaskView,
class Node>
147 int* map =
r.alloc<
int>(
tasks.size());
150 for (
int i=0; i<
tasks.size(); i++)
152 r.free<
int>(map,
tasks.size());
155 while (fst <
tasks.size())
159 for (
int i=0; i<
tasks.size(); i++)
166 template<
class TaskView,
class Node>
template<
class Node2>
173 for (
int i=0; i<
tasks.size(); i++)
int n_nodes(void) const
Return number of nodes for balanced binary tree.
const TaskViewArray< TaskView > & tasks
The tasks from which the tree is computed.
static int n_right(int i)
Return index of right child of node i.
int n_inner(void) const
Return number of inner nodes.
static bool right(int i)
Test whether node i is a right child.
static int n_left(int i)
Return index of left child of node i.
static bool left(int i)
Test whether node i is a left child.
void init(void)
Initialize tree after leaves have been initialized.
bool n_leaf(int i) const
Whether node i is leaf.
const Node & root(void) const
Return root node.
static int n_parent(int i)
Return index of parent of node i.
int * _leaf
Map task number to leaf node number in right order.
Node & leaf(int i)
Return leaf for task i.
void update(void)
Update all inner nodes of tree after leaves have been initialized.
static bool n_root(int i)
Whether node i is index of root.
void update(const NoOffset &)
Integer-precision integer scale view.
const int infinity
Infinity for integers.
const long long int llinfinity
Infinity for long long integers.
void sort(TaskViewArray< TaskView > &t)
Sort task view array t according to sto and inc (increasing or decreasing)
int plus(int x, int y)
Safe addition in case x is -Int::Limits::infinity.
Gecode toplevel namespace
Post propagator for SetVar SetOpType SetVar SetRelType r
Post propagator for SetVar SetOpType SetVar y
Post propagator for SetVar x