RPDindexOptimized provides an algorithmically optimized Python implementation of the six RPD indices while preserving the intended mathematical semantics of the original RPDindex reference software. The implementation retains linear-time complexity for the local indices and reduces the computational complexity of the global indices from (O(n^2)) to (O(n \log n)). This improvement is achieved through coordinate compression and Fenwick trees, which efficiently maintain cumulative counts and sums without explicitly enumerating all pairwise comparisons. The software also provides a dedicated progressive_indices() function for computing complete RPD trajectories over successive prefixes of a sequence, avoiding repeated full recomputation where incremental updates are possible. Numerical compatibility with the historical implementation is assessed through deterministic regression tests covering increasing, decreasing, constant, tied, negative, fractional, and pseudorandom numerical sequences, with floating-point differences evaluated using explicit numerical tolerances. The repository includes the optimized implementation, an archival reference implementation for regression testing, validation scripts, reproducible benchmarks, and technical documentation. RPDindexOptimized is intended as a computational optimization of the original RPD methodology rather than a redefinition of the indices.
RPDindexOptimized: optimized Python implementation of the RPD indices
marco righi
2026
Abstract
RPDindexOptimized provides an algorithmically optimized Python implementation of the six RPD indices while preserving the intended mathematical semantics of the original RPDindex reference software. The implementation retains linear-time complexity for the local indices and reduces the computational complexity of the global indices from (O(n^2)) to (O(n \log n)). This improvement is achieved through coordinate compression and Fenwick trees, which efficiently maintain cumulative counts and sums without explicitly enumerating all pairwise comparisons. The software also provides a dedicated progressive_indices() function for computing complete RPD trajectories over successive prefixes of a sequence, avoiding repeated full recomputation where incremental updates are possible. Numerical compatibility with the historical implementation is assessed through deterministic regression tests covering increasing, decreasing, constant, tied, negative, fractional, and pseudorandom numerical sequences, with floating-point differences evaluated using explicit numerical tolerances. The repository includes the optimized implementation, an archival reference implementation for regression testing, validation scripts, reproducible benchmarks, and technical documentation. RPDindexOptimized is intended as a computational optimization of the original RPD methodology rather than a redefinition of the indices.I documenti in IRIS sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.


