36 namespace Gecode {
namespace Int {
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=t.
size();
i--; )
195 template<
class TaskView, SortTaskOrder sto,
bool inc>
Sort by earliest completion times.
bool operator()(const TaskView &t1, const TaskView &t2) const
Sort order.
int size(void) const
Return size of array (number of elements)
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.
Sorting maps rather than tasks.
Sort by latest completion times.
Sort by latest start times.
Sort by latest completion times.
Sort by earliest completion times.
Sort by earliest start times.
Gecode toplevel namespace
Sort by latest start times.
#define GECODE_NEVER
Assert that this command is never executed.
bool operator()(int &i, int &j) const
Sort order.