MCPcopy Create free account
hub / github.com/Gecode/gecode / sort

Method sort

test/test.cpp:77–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75 };
76
77 void
78 Base::sort() {
79 Base** b = Gecode::heap.alloc<Base*>(_n_tests);
80 unsigned int i=0;
81 for (Base* t = _tests; t != nullptr; t = t->next())
82 b[i++] = t;
83 SortByName sbn;
84 Gecode::Support::quicksort(b, _n_tests,sbn);
85 i=0;
86 _tests = nullptr;
87 for ( ; i < _n_tests; i++) {
88 b[i]->next(_tests); _tests = b[i];
89 }
90 Gecode::heap.free(b,_n_tests);
91 }
92
93 Base::~Base() = default;
94

Callers

nothing calls this directly

Calls 3

quicksortFunction · 0.85
nextMethod · 0.45
freeMethod · 0.45

Tested by

no test coverage detected