From 0491d30ac801a0b46443b1b91a9be91261662595 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffan=20S=C3=B8lvsten?= <201505832@post.au.dk> Date: Fri, 5 Apr 2024 09:20:37 +0200 Subject: [PATCH] Add number of repeated transpositions to statistics --- src/adiar/internal/algorithms/quantify.h | 1 + src/adiar/statistics.cpp | 10 +++++++++- src/adiar/statistics.h | 5 +++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/adiar/internal/algorithms/quantify.h b/src/adiar/internal/algorithms/quantify.h index cca740620..e9847438e 100644 --- a/src/adiar/internal/algorithms/quantify.h +++ b/src/adiar/internal/algorithms/quantify.h @@ -1435,6 +1435,7 @@ namespace adiar::internal #ifdef ADIAR_STATS stats_quantify.partial_sweeps += 1u; + stats_quantify.partial_repetitions += 1u; #endif transposed = __quantify(ep, transposed, partial_impl); diff --git a/src/adiar/statistics.cpp b/src/adiar/statistics.cpp index cd59c56a2..e122b621b 100644 --- a/src/adiar/statistics.cpp +++ b/src/adiar/statistics.cpp @@ -527,7 +527,15 @@ namespace adiar indent_level++; - o << indent << label << "termination" << internal::stats_quantify.partial_termination << endl; + o << indent << label << "repeated transpositions" + << internal::stats_quantify.partial_repetitions << " = " + << internal::percent_frac(internal::stats_quantify.partial_repetitions, + internal::stats_quantify.partial_sweeps) + << percent << endl; + o << indent << label << "termination" << internal::stats_quantify.partial_termination << " = " + << internal::percent_frac(internal::stats_quantify.partial_termination, + internal::stats_quantify.partial_sweeps) + << percent << endl; indent_level--; } diff --git a/src/adiar/statistics.h b/src/adiar/statistics.h index 5e3922545..57ed414b0 100644 --- a/src/adiar/statistics.h +++ b/src/adiar/statistics.h @@ -421,6 +421,11 @@ namespace adiar ////////////////////////////////////////////////////////////////////////////////////////////// uintwide partial_termination = 0; + ////////////////////////////////////////////////////////////////////////////////////////////// + /// \brief Number of *partial* multi-variable sweeps that are repeated partial transposition. + ////////////////////////////////////////////////////////////////////////////////////////////// + uintwide partial_repetitions = 0; + ////////////////////////////////////////////////////////////////////////////////////////////// /// \brief Number of *nested* multi-variable sweeps. //////////////////////////////////////////////////////////////////////////////////////////////