39 template<
class TaskView,
bool inc>
43 bool operator ()(
const TaskView& t1,
const TaskView& t2)
const;
47 template<
class TaskView,
bool inc>
51 bool operator ()(
const TaskView& t1,
const TaskView& t2)
const;
55 template<
class TaskView,
bool inc>
59 bool operator ()(
const TaskView& t1,
const TaskView& t2)
const;
63 template<
class TaskView,
bool inc>
67 bool operator ()(
const TaskView& t1,
const TaskView& t2)
const;
71 template<
class TaskView,
template<
class,
bool>
class STO,
bool inc>
77 STO<TaskView,inc> sto;
85 template<
class TaskView,
bool inc>
88 (
const TaskView& t1,
const TaskView& t2)
const {
90 (t1.est() < t2.est() || (t1.est()==t2.est() && t1.lct() < t2.lct()))
91 : (t2.est() < t1.est() || (t2.est()==t1.est() && t2.lct() < t1.lct()));
94 template<
class TaskView,
bool inc>
97 (
const TaskView& t1,
const TaskView& t2)
const {
99 (t1.ect() < t2.ect() || (t1.ect()==t2.ect() && t1.lst() < t2.lst()))
100 : (t2.ect() < t1.ect() || (t2.ect()==t1.ect() && t2.lst() < t1.lst()));
103 template<
class TaskView,
bool inc>
106 (
const TaskView& t1,
const TaskView& t2)
const {
108 (t1.lst() < t2.lst() || (t1.lst()==t2.lst() && t1.ect() < t2.ect()))
109 : (t2.lst() < t1.lst() || (t2.lst()==t1.lst() && t2.ect() < t1.ect()));
112 template<
class TaskView,
bool inc>
115 (
const TaskView& t1,
const TaskView& t2)
const {
117 (t1.lct() < t2.lct() || (t1.lct()==t2.lct() && t1.est() < t2.est()))
118 : (t2.lct() < t1.lct() || (t2.lct()==t1.lct() && t2.est() < t1.est()));
121 template<
class TaskView,
template<
class,
bool>
class STO,
bool inc>
125 template<
class TaskView,
template<
class,
bool>
class STO,
bool inc>
128 return sto(tasks[i],tasks[j]);
131 template<
class TaskView, SortTaskOrder sto,
bool inc>
160 template<
class TaskView, SortTaskOrder sto,
bool inc>
163 for (
int i=0; i<t.
size(); i++)
195 template<
class TaskView, SortTaskOrder sto,
bool inc>
Sorting maps rather than tasks.
bool operator()(int &i, int &j) const
Sort order.
SortMap(const TaskViewArray< TaskView > &t)
Initialize.
Sort by earliest completion times.
bool operator()(const TaskView &t1, const TaskView &t2) const
Sort order.
Sort by earliest start times.
bool operator()(const TaskView &t1, const TaskView &t2) const
Sort order.
Sort by latest completion times.
bool operator()(const TaskView &t1, const TaskView &t2) const
Sort order.
Sort by latest start times.
bool operator()(const TaskView &t1, const TaskView &t2) const
Sort order.
int size(void) const
Return size of array (number of elements)
void sort(TaskViewArray< TaskView > &t)
Sort task view array t according to sto and inc (increasing or decreasing)
@ STO_ECT
Sort by earliest completion times.
@ STO_EST
Sort by earliest start times.
@ STO_LST
Sort by latest start times.
@ STO_LCT
Sort by latest completion times.
void quicksort(Type *l, Type *r, Less &less)
Standard quick sort.
Gecode toplevel namespace
#define GECODE_NEVER
Assert that this command is never executed.