User Tools

Site Tools


haas:spring2024:comporg:projects:pnc2

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
haas:spring2024:comporg:projects:pnc2 [2024/04/11 09:49] – created - external edit 127.0.0.1haas:spring2024:comporg:projects:pnc2 [2024/04/18 10:46] (current) – [PNC2] wedge
Line 20: Line 20:
  
 ====PNC2==== ====PNC2====
 +{{:haas:spring2024:comporg:projects:pnc2runtime.png|}}
 +
 +Your next program, and first sieve, will be the Sieve of Eratosthenes. Perhaps among the best and likely longest-known sieves, its origins date from antiquity.
 +
 +This sieve, instead of calculating to determine the eligibility of a prime, works in a manner of marking off patterns of values that cannot be prime (so, it is composite-focused in approach vs. prime-focused).
 +
 +In order for it to work, we must store all the values we're processing so we can obtain what is left when done– what remains are the prime values.
 +
 +Some refined considerations:
 +
 +  * include memory management related to the sieve in your timing
 +  * for better visibility of performance, take measurements out to FOUR (4) decimal places (instead of the previous 3 we did for pnc0/pnc1)
 +  * for graphing purposes, you may want to exclude the brute results, so your graphs do not suffer from needless compression (you want to see how soe performs against the better brute variants; at this point we already know it'll blow baseline brute out of the water)
 +  * if the line graph is too noisy (too many things, not enough clear labels), consider doing a bar graph instead.
 +  * you can, optionally, choose to bypass running brute once it surpasses a certain threshold; in my example, I set a threshold of 4 seconds, which is why you do not see results provided for 8192, as it'll have exceeded the limit during the 4096 run.
 +
 +Here is the wikipedia page: 
 +  * https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes
 +
 +Here is an animated image of this sieve in action (from wikipedia):
 +{{:haas:spring2024:comporg:projects:sieve_of_eratosthenes_animation.gif|}}
  
 =====EDIT===== =====EDIT=====
Line 73: Line 94:
 *:pnc2:graph produced from timing data produced [26/26] *:pnc2:graph produced from timing data produced [26/26]
 *:pnc2:graph posted to discord and documentation page [26/26] *:pnc2:graph posted to discord and documentation page [26/26]
-*:pnc2:timing data is taken out to decimal places [26/26]+*:pnc2:timing data is taken out to decimal places [26/26]
 </code> </code>
  
haas/spring2024/comporg/projects/pnc2.1712843397.txt.gz · Last modified: 2024/04/11 09:49 by 127.0.0.1