LogarithmicCap verbosity option dev

Sun, 19 Jan 2025 16:49:09 +0100

author
Tuomo Valkonen <tuomov@iki.fi>
date
Sun, 19 Jan 2025 16:49:09 +0100
branch
dev
changeset 87
72968cf30033
parent 76
99ad55974e62
child 88
086a59b3a2b4

LogarithmicCap verbosity option

Cargo.toml file | annotate | diff | comparison | revisions
src/iterate.rs file | annotate | diff | comparison | revisions
--- a/Cargo.toml	Mon Dec 30 15:46:28 2024 -0500
+++ b/Cargo.toml	Sun Jan 19 16:49:09 2025 +0100
@@ -21,7 +21,7 @@
 itertools = "~0.13.0"
 numeric_literals = "~0.2.0"
 cpu-time = "~1.0.0"
-serde_json = "~1.0.85"
+serde_json = { version = "~1.0.85", features = ["std"] }
 rayon = "1.5.3"
 simba = "0.9.0"
 anyhow = "1.0.95"
--- a/src/iterate.rs	Mon Dec 30 15:46:28 2024 -0500
+++ b/src/iterate.rs	Sun Jan 19 16:49:09 2025 +0100
@@ -451,6 +451,11 @@
     /// * every 10 iterations from there on until 100 iterations,
     /// * every 100 iteartinos frmo there on until 1000 iterations, etc.
     Logarithmic(usize),
+    /// Same as `Logarithmic`, but $\log_b(n)$ is replaced by $min\{c, \log_b(n)\}$ where $c$
+    /// is the given `cap`. For example, with `base=10` and `cap=2`, the first ten iterations
+    /// will be output, then every tenth iteration, and after 100 iterations, every 100th iteration,
+    /// without further logarithmic progression.
+    LogarithmicCap{ base : usize, cap : u32 },
 }
 
 impl Verbose {
@@ -467,6 +472,10 @@
                 let every = base.pow((iter as float).log(base as float).floor() as u32);
                 iter % every == 0
             }
+            &Verbose::LogarithmicCap{base, cap} => {
+                let every = base.pow(((iter as float).log(base as float).floor() as u32).min(cap));
+                iter % every == 0
+            }
         }
     }
 }

mercurial