42 namespace Gecode {
namespace Int {
namespace Cumulative {
45 template<
class TaskView,
bool inc>
49 bool operator ()(
const TaskView& t1,
const TaskView& t2)
const {
50 return inc ? (t1.c() < t2.c()) : (t2.c() < t1.c());
62 return prec[
i] > prec[j];
66 template<
class TaskView>
69 sort<TaskView,STO_LCT,false>(
t);
76 int* prec = r.alloc<
int>(t.
size());
77 for (
int i=t.
size();
i--; )
82 for (
int j=0; j<t.
size(); j++) {
84 (ol.
lenv() >
static_cast<long long int>(
c)*t[j].lct())) {
99 int* cap = r.alloc<
int>(t.
size());
100 for (
int i=t.
size();
i--;)
105 int* capacities = r.alloc<
int>(t.
size());
106 int* capInv = r.alloc<
int>(t.
size());
107 for (
int i=t.
size();
i--;) {
108 capacities[cap[
i]] = t[
i].c();
113 for (
int i=0, cur_c=INT_MIN;
i<t.
size();
i++) {
114 if (capacities[
i] != cur_c)
115 capacities[n_c++] = cur_c = capacities[
i];
116 cap[capInv[
i]] = n_c-1;
118 r.free<
int>(capInv, t.
size());
123 for (
int i=t.
size()*n_c;
i--;)
127 for (
int i=0;
i<n_c;
i++) {
128 eo.
init(capacities[
i]);
130 for (
int j=t.
size(); j--;) {
132 static_cast<long long int>(c-capacities[
i])*t[j].lct();
133 long long int eml =
plus(eo.
env(j), -lctj);
134 long long int diff_l;
139 static_cast<long long int>(capacities[i]));
143 update[i*t.
size()+j] =
u;
150 int* precMap = r.alloc<
int>(t.
size());
151 for (
int i=t.
size();
i--;)
157 for (
int i=0;
i<t.
size();
i++) {
159 while (curJ < t.
size() && t[curJ].lct() > prec[precMap[
i]])
161 if (curJ >= t.
size())
166 if (t[locJ].lct() != t[precMap[
i]].lct()) {
170 }
while (t[locJ].lct() == prec[precMap[
i]] && locJ++ < t.
size() - 1);
long long int env(int i)
Compute update for task with index i.
Omega-lambda trees for computing ect of task sets.
const FloatNum max
Largest allowed float value.
bool lempty(void) const
Whether has responsible task.
void shift(int i)
Shift task with index i from omega to lambda.
PrecOrder(int *prec0)
Constructor.
int size(void) const
Return size of array (number of elements)
Omega trees for computing ect of task sets.
#define GECODE_ES_CHECK(es)
Check whether execution status es is failed or subsumed, and forward failure or subsumption.
Gecode::FloatVal c(-8, 8)
Gecode::IntArgs i(4, 1, 2, 3, 4)
void quicksort(Type *l, Type *r, Less &less)
Standard quick sort.
Sorting maps rather than tasks.
int plus(int x, int y)
Safe addition in case x is -IntLimits::infinity.
void init(int ci)
Initialize tasks for current capacity ci.
IntType ceil_div_xx(IntType x, IntType y)
Compute .
union Gecode::@585::NNF::@62 u
Union depending on nodetype t.
#define GECODE_ME_CHECK(me)
Check whether modification event me is failed, and forward failure.
Post propagator for SetVar SetOpType SetVar SetRelType r
int responsible(void) const
Return responsible task.
struct Gecode::@585::NNF::@62::@63 b
For binary nodes (and, or, eqv)
Post propagator for f(x \diamond_{\mathit{op}} y) \sim_r z \f$ void rel(Home home
const int infinity
Infinity for integers.
long long int lenv(void) const
Return energy envelope of all tasks excluding lambda tasks.
bool operator()(const TaskView &t1, const TaskView &t2) const
Sort order.
Gecode toplevel namespace
const long long int llinfinity
Infinity for long long integers.
void update(IntSet &y, Space &home, IntSet &py)
ExecStatus edgefinding(Space &home, int c, TaskViewArray< TaskView > &t)
void lremove(int i)
Remove task with index i from lambda.