An integer vector containing exactly 0,1,...,n-1 in any order.
The validity of the input is not checked by this function.
Value
The refined Hoeffding statistic of perm.
The normalization is such that -1/180 <= R <= 1/90.
The return value -1.0 indicates an error.
Details
Given (X1,Y1),...,(Xn,Yn), the refined Hoeffding statistic Rn only depends
on the permutation P that satisfies rank Yi = P[rank Xi].
This function computes Rn given P in O(n log n) time.