Shallot icon indicating copy to clipboard operation
Shallot copied to clipboard

better int_pow algorithm, and why use int_pow in the first place?

Open ChrisCalderon opened this issue 10 years ago • 5 comments

I noticed that int_pow in the math.c file uses the O(n) obvious algorithm or computing pow instead of the method of repeated squaring, which is O(log(n)). Is there any reason for that? Also, I noticed that int_pow is only ever used with a base of two... so why use it when bit shifts will do?

ChrisCalderon avatar Nov 29 '13 06:11 ChrisCalderon

@ChrisCalderon I've fixed this also in my fork: https://github.com/preillyme/Shallot/commit/20d72dc541160f9b38d61c03552aa6a3c620d15d

yllierop avatar Jan 11 '15 18:01 yllierop

@preillyme I actually changed this on my local copy, but after testing it I didn't see a noticeable difference so I forgot about it lol. Is your fork in active development?

ChrisCalderon avatar Jan 11 '15 18:01 ChrisCalderon

@ChrisCalderon I'm trying to start working on this project. As it's interesting to me. I want to try adding GPU support.

yllierop avatar Jan 11 '15 18:01 yllierop

@preillyme There is actually already a project that does this with your GPU, it's called Scallion. I've never used it though. I'm interested to see what you do with your fork!

ChrisCalderon avatar Jan 11 '15 19:01 ChrisCalderon

Yeah @ChrisCalderon — I've looked at https://github.com/lachesis/scallion but I want to try it with this project instead of using MONO.

yllierop avatar Jan 11 '15 19:01 yllierop