Closed jonasvdd closed 9 months ago
Thank you for your very detailed bug report! I hadn't considered that anyone would use a non-floating-point data type for TData
, and I'm surprised that's the only issue you encountered.
Your proposed fix seems reasonable. If you want to make a pull request for authorship sake, please feel free. If not, let me know and I'll go ahead and implement it.
I made a PR @parkertomatoes! :)
Hi @parkertomatoes,
Thank you for sharing your well-written and high-quality open-source code! 👏🏼
I think that there is a (small) bug in your code; specifically this line: https://github.com/parkertomatoes/lttb-cpp/blob/000046203c2da52b47085893771ee94423b06381/include/lttb.hpp#L32
Further explanation Consider a scenario where you define your
data
template as int, for example:In this case, the variable
every
in the formula will be typecast toint
, leading to the generation of floored windows. This behavior will persist throughout the for-loop and consequently might result in the omission of a significant data window at the end of theTPoint
vector.To overcome this issue; only one step needs to be taken:
Cheers, Jonas Van Der Donckt