MCPcopy Create free account
hub / github.com/audeering/opensmile / MyQuickSortDescending

Function MyQuickSortDescending

src/newmat/sort.cpp:96–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

94}
95
96static void MyQuickSortDescending(Real* first, Real* last, int depth)
97{
98 REPORT
99 for (;;)
100 {
101 const int length = last - first + 1;
102 if (length < DoSimpleSort) { REPORT return; }
103 if (depth++ > MaxDepth)
104 Throw(ConvergenceException("QuickSortDescending fails: "));
105 Real* centre = first + length/2;
106 const Real test = SortThreeDescending(first, centre, last);
107 Real* f = first; Real* l = last;
108 for (;;)
109 {
110 while (*(++f) > test) {}
111 while (*(--l) < test) {}
112 if (l <= f) break;
113 const Real temp = *f; *f = *l; *l = temp;
114 }
115 if (f > centre)
116 { REPORT MyQuickSortDescending(l+1, last, depth); last = f-1; }
117 else { REPORT MyQuickSortDescending(first, f-1, depth); first = l+1; }
118 }
119}
120
121void SortAscending(GeneralMatrix& GM)
122{

Callers 1

SortDescendingFunction · 0.85

Calls 3

SortThreeDescendingFunction · 0.85
ThrowFunction · 0.70

Tested by

no test coverage detected