40 namespace Gecode {
namespace Int {
43 template<
class TaskView,
bool inc>
47 bool operator ()(
const TaskView& t1,
const TaskView& t2)
const;
51 template<
class TaskView,
bool inc>
55 bool operator ()(
const TaskView& t1,
const TaskView& t2)
const;
59 template<
class TaskView,
bool inc>
63 bool operator ()(
const TaskView& t1,
const TaskView& t2)
const;
67 template<
class TaskView,
bool inc>
71 bool operator ()(
const TaskView& t1,
const TaskView& t2)
const;
75 template<
class TaskView,
template<
class,
bool>
class STO,
bool inc>
81 STO<TaskView,inc> sto;
89 template<
class TaskView,
bool inc>
92 (
const TaskView& t1,
const TaskView& t2)
const {
94 (t1.est() < t2.est() || (t1.est()==t2.est() && t1.lct() < t2.lct()))
95 : (t2.est() < t1.est() || (t2.est()==t1.est() && t2.lct() < t1.lct()));
98 template<
class TaskView,
bool inc>
101 (
const TaskView& t1,
const TaskView& t2)
const {
103 (t1.ect() < t2.ect() || (t1.ect()==t2.ect() && t1.lst() < t2.lst()))
104 : (t2.ect() < t1.ect() || (t2.ect()==t1.ect() && t2.lst() < t1.lst()));
107 template<
class TaskView,
bool inc>
110 (
const TaskView& t1,
const TaskView& t2)
const {
112 (t1.lst() < t2.lst() || (t1.lst()==t2.lst() && t1.ect() < t2.ect()))
113 : (t2.lst() < t1.lst() || (t2.lst()==t1.lst() && t2.ect() < t1.ect()));
116 template<
class TaskView,
bool inc>
119 (
const TaskView& t1,
const TaskView& t2)
const {
121 (t1.lct() < t2.lct() || (t1.lct()==t2.lct() && t1.est() < t2.est()))
122 : (t2.lct() < t1.lct() || (t2.lct()==t1.lct() && t2.est() < t1.est()));
125 template<
class TaskView,
template<
class,
bool>
class STO,
bool inc>
129 template<
class TaskView,
template<
class,
bool>
class STO,
bool inc>
132 return sto(tasks[
i],tasks[j]);
135 template<
class TaskView, SortTaskOrder sto,
bool inc>
164 template<
class TaskView, SortTaskOrder sto,
bool inc>
167 for (
int i=
t.size();
i--; )
199 template<
class TaskView, SortTaskOrder sto,
bool inc>
Sort by earliest completion times.
bool operator()(const TaskView &t1, const TaskView &t2) const
Sort order.
SortMap(const TaskViewArray< TaskView > &t)
Initialize.
Sort by earliest start times.
void sort(TaskViewArray< TaskView > &t)
Sort task view array t according to sto and inc (increasing or decreasing)
Gecode::IntArgs i(4, 1, 2, 3, 4)
void quicksort(Type *l, Type *r, Less &less)
Standard quick sort.
int n
Number of negative literals for node type.
bool operator()(const TaskView &t1, const TaskView &t2) const
Sort order.
Sorting maps rather than tasks.
Sort by latest completion times.
Sort by latest start times.
Sort by latest completion times.
bool operator()(const TaskView &t1, const TaskView &t2) const
Sort order.
Sort by earliest completion times.
Sort by earliest start times.
Gecode toplevel namespace
bool operator()(const TaskView &t1, const TaskView &t2) const
Sort order.
Sort by latest start times.
#define GECODE_NEVER
Assert that this command is never executed.
bool operator()(int &i, int &j) const
Sort order.