-
Notifications
You must be signed in to change notification settings - Fork 587
odin-soltion-2 #1022
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: drag-race
Are you sure you want to change the base?
odin-soltion-2 #1022
Conversation
@arenol Thank you for submitting this. I see you marked the solution as faithful. As per the contributing guidelines, some required characteristics of a faithful implementation are:
Your solution:
For these reasons, your solution cannot be marked as faithful. You can either address these points to make your submission a faithful solution, or mark your solution as unfaithful. Out of curiosity, what makes you're unsuccessful at getting the solution_1 multithreaded implementations to work? |
Thanks, for your response, Rutger. I'm not a professional programmer, and thought that this would be a nice excercise for me. Hence, I'm not 100% into what the all terminology exactly means, so excuse me for getting this wrong. I though that the declaration Furthermore, it took me quite some time to learn docker and figure out how to use it in this project. However, I have now corrected my solution, so it is in line with solution_1 and I get more or less the same result. I will upload new source code shortly. I guess part of the requirement is the calculation of q, which I now assume should be done within each iteration. Doing square roots is stupid if you can avoid it. It is better do "factor*factor <= size" than "factor <= sqrt(size)" Interestingly, I note that Ginger Bill and Kelimion's 1-bit solution is significantly slower than their byte solution. Using the core bit_array package (that must be quite new), I got a result that was almost as good as the byte solution. The reason why I could not compile solution_1, I assume, is that I have a newer version of the compiler that is not backward compatible. So I had to comment out those parts of their code to make it compile and run. For the same reason, I could not make my solution work from the primeimages/odin docker image, other docker iimages with odin comiler i could find. |
Changed code to comply with the requirements. Got the same result.
Thank you for following this up. I've gone over the code again, and it looks good to me now in terms of implementing the requirements for a faithful solution. With regards to using "factor < sqrt(limit)" vs. "factor * factor < limit" there is no rule or requirement, so you can pick whatever you think is best. It's also allowed to calculate either factor * factor or sqrt(limit) once per sieve run. I did see a few things in your Dockerfile that Hadolint will complain about. I will kick off CI after I post this comment, at which time Hadolint will run and add its comments to this PR's Files tab. You can also run Hadolint locally, the Hadolint section in the contributing guidelines explains how. Thank you, |
Description
Adding my own Odin implementation
Contributing requirements
drag-race
as the target branch.