3 ms·
What is "wheel" in this context? The main one I can think of in programming is Python packages. I even considered you were talking about literal wheels! But it
by quietbritishjim 6y ago
What is "wheel" in this context? The main one I can think of in programming is Python packages. I even considered you were talking about literal wheels! But it sounds like you're talking about some sort of data structure, like a ring buffer?
- bjoli 6y agoI call it a wheel because I was first exposed to them in wheel factorisation: https://en.m.wikipedia.org/wiki/Wheel_factorization https://en.m.wikipedia.org/wiki/Wheel_factorization
- quietbritishjim 6y ago> I call it a wheel Call what a wheel? What is the "it" here? It doesn't seem to be a standard term but since you went to the trouble of posting a comment surely you were hoping it would be understood. Are you talking about modulo arithmetic? Or hierarchical timing wheels (the top hit for "wheel data structure")?
- bjoli 6y agoAny kind of circular data that repeats itself. In the case of wheel factorisation, it is a wheel "rolling" over the number line. Any data structure will do. Either a circular one or one with O(1) access time. It is the concept used in the article with a vector mask repeating every 15 elements. It is a technique. I have just always used a circular list for it :)
- bjoli 6y agoAnd the Link I posted explains it just fine. Anyway, I actually wrote some code to generate wheels not too long ago: https://git.sr.ht/~bjoli/wheel-utils https://git.sr.ht/~bjoli/wheel-utils
- quietbritishjim 6y agoOK, thanks. I think your concept of a wheel could be summarised as "use of a ring buffer for modulo arithmetic". (Of course, like you said, a "ring buffer" doesn't have to be a linked list with start and end links connected - an array that you just index carefully works too.)