Declarations of functions associated with group_R.
Version of Saturday 14 September 2024.
/* R1 */ int qty_deranged (permzbi const & a); /* R1 */ int qty_deranged (permzbi const & a, permzbi const & b); /* R1 */ bool all_deranged (permzbi const & a); /* R1 */ bool all_deranged (permzbi const & a, permzbi const & b); /* R1 */ int conjunctions (std::initializer_listilp); /* R1 */ bool are_disjoint (std::initializer_list ilp);
Although the two-parameter version of qty_deranged could have been made a member function, the asymmetric syntax of calling it would have seemed awkward, so it is a non-member. Then to be consistent, qty_deranged with only one parameter needed also to be a non-member function. The same comments of course apply to all_deranged.
/* R2 */ double correlation (permzbi const & a, permzbi const & b); /* R2 */ double angle (permzbi const & a, permzbi const & b);
correlation gives the Pearson correlation coefficient. Note that Spearman's rank correlation coefficient would have the same value, because a permutation of consecutive integers is self-ranking.
Function angle gives the angle in radians between the two permutations, interpreting them as vectors.