Commit a06f343
committed
Simplify stride calculations in loglocator.
These are just algebraic manipulations:
In classic mode, we want the smallest stride so that
numdec/stride+1 <= numticks
i.e.
stride >= numdec/(numticks-1)
so stride is the ceil() of the RHS (and at least 1, to handle the case
vmin==vmax).
In nonclassic mode, we want the smallest stride so that
numdec//stride+1 <= numticks, i.e. numdec//stride < numticks
(everything is integer), i.e.
numdec < numticks*stride- 1
i.e.
stride > (numdec+1)/numticks
so stride is 1 + the floor() of the LHS.1 parent e0c9185 commit a06f343
1 file changed
+4
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2182 | 2182 | | |
2183 | 2183 | | |
2184 | 2184 | | |
2185 | | - | |
2186 | | - | |
2187 | | - | |
2188 | | - | |
2189 | | - | |
2190 | | - | |
2191 | | - | |
2192 | | - | |
2193 | | - | |
| 2185 | + | |
| 2186 | + | |
| 2187 | + | |
| 2188 | + | |
2194 | 2189 | | |
2195 | 2190 | | |
2196 | 2191 | | |
| |||
0 commit comments