You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/Measures-of-disorder.md
+36-3Lines changed: 36 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -83,9 +83,9 @@ The graph below shows the partial ordering of several measures of disorder:
83
83
-*m₀* is a measure of presortedness that always returns 0.
84
84
-*m₀₁* is a measure of presortedness that returns 0 when $X$ is sorted and 1 otherwise.
85
85
86
-

86
+

87
87
88
-
This graph is a modified version of the one in *A framework for adaptive sorting*. The relations of *Mono* are empirically derived [original research][original-research] and incomplete (unknown relations with *Osc* and *Loc*).
88
+
This graph is a modified version of the one found in *A framework for adaptive sorting*. The relations of *Mono*and *Amp* with other measures of disorder are empirically derived [original research][original-research] and known to be incomplete (unknown relations with *Osc* and *Loc*).
89
89
90
90
The measures of disorder in bold in the graph are available in **cpp-sort**, the others are not.
91
91
@@ -133,7 +133,40 @@ It takes an integer `n` and returns the maximum value that the measure of disord
133
133
134
134
## Available measures of disorder
135
135
136
-
Measures of disorder are pretty formalized, so the names of the functions in the library are short and generally correspond to the ones used in the literature.
136
+
Measures of disorder are pretty formalized, so the names of the functions in the library are short and generally correspond to the ones used in the literature, with a few exceptions. A justification is given whenever a name does not exactly match the ones from the literature, or when the definition differs.
137
+
138
+
### *Amp*
139
+
140
+
```cpp
141
+
#include <cpp-sort/probes/amp.h>
142
+
```
143
+
144
+
Let's consider the following functions to compare two elements elements of a sequence:
Where $N_{\mathit{eq}}(X)$ is the number of pairs of neighbors that compare equivalent in $X$, and $\mathit{PTP}(X)$ is the number of unique values in the prefix sum of the sequence obtained by applying $comp$ to every pair of adjacent elements in $X$.
160
+
161
+

0 commit comments