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

Function insertion

gecode/support/sort.hpp:96–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

94 /// Standard insertion sort
95 template<class Type, class Less>
96 forceinline void
97 insertion(Type* l, Type* r, Less &less) {
98 for (Type* i = r; i > l; i--)
99 exchange(*(i-1),*i,less);
100 for (Type* i = l+2; i <= r; i++) {
101 Type* j = i;
102 Type v = *i;
103 while (less(v,*(j-1))) {
104 *j = *(j-1); j--;
105 }
106 *j = v;
107 }
108 }
109
110 /// Standard partitioning
111 template<class Type, class Less>

Callers 2

propagateMethod · 0.85
quicksortFunction · 0.85

Calls 2

exchangeFunction · 0.85
lFunction · 0.85

Tested by

no test coverage detected