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

Function SortThreeDescending

src/newmat/sort.cpp:57–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55}
56
57static Real SortThreeDescending(Real* a, Real* b, Real* c)
58{
59 // sort *a, *b, *c; return *b; optimise for already sorted
60 if (*a >= *b)
61 {
62 if (*b >= *c) { REPORT return *b; }
63 else if (*a >= *c) { REPORT Real x = *c; *c = *b; *b = x; return x; }
64 else { REPORT Real x = *a; *a = *c; *c = *b; *b = x; return x; }
65 }
66 else if (*c >= *b) { REPORT Real x = *c; *c = *a; *a = x; return *b; }
67 else if (*a >= *c) { REPORT Real x = *a; *a = *b; *b = x; return x; }
68 else { REPORT Real x = *c; *c = *a; *a = *b; *b = x; return x; }
69}
70
71static void InsertionSortDescending(Real* first, const int length,
72 int guard)

Callers 2

MyQuickSortDescendingFunction · 0.85
MyQuickSortAscendingFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected