User Tools

Site Tools


haas:fall2017:discrete:projects:pnc0

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
haas:fall2017:discrete:projects:pnc0 [2017/08/30 17:34] – [Full Verification Compliance] wedgehaas:fall2017:discrete:projects:pnc0 [2017/10/15 21:11] (current) – [Programs] wedge
Line 3: Line 3:
 <WRAP><fs 150%>CSCS2330 Discrete Structures</fs></WRAP> <WRAP><fs 150%>CSCS2330 Discrete Structures</fs></WRAP>
 </WRAP> </WRAP>
- 
-~~TOC~~ 
  
 ======Project: ALGORITHMS - PRIME NUMBER CALCULATION (pnc0)====== ======Project: ALGORITHMS - PRIME NUMBER CALCULATION (pnc0)======
Line 230: Line 228:
 It is your task to write the following prime number variants: It is your task to write the following prime number variants:
  
-  **primereg.c**: our baseline (does JUST the process, no optimizations) +  **primereg.c**: our baseline (does JUST the process, no optimizations) 
-  **primeregb.c**: tests specifically the break optimization +  **primeregb.c**: tests specifically the break optimization 
-  **primeregm.c**: tests specifically the map traversal +  **primeregm.c**: tests specifically the map traversal 
-  **primerego.c**: tests specifically the odd traversal +  **primerego.c**: tests specifically the odd traversal 
-  **primeregs.c**: tests specifically the square root trick (using sqrt()) +  **primeregs.c**: tests specifically the square root trick (using sqrt()) 
-  **primerega.c**: tests specifically the square root trick by approximating square root +  **primerega.c**: tests specifically the square root trick by approximating square root 
-  **primeregbm.c**: tests the break and map optimizations (together) +  **primeregbm.c**: tests the break and map optimizations (together) 
-  **primeregbo.c**: tests the break and odd optimizations (together) +  **primeregbo.c**: tests the break and odd optimizations (together) 
-  **primeregbs.c**: tests the break and sqrt() optimizations (together) +  **primeregbs.c**: tests the break and sqrt() optimizations (together) 
-  **primeregba.c**: tests the break and approximated square root optimizations (together)+  **primeregba.c**: tests the break and approximated square root optimizations (together)
  
 ====Program Specifications==== ====Program Specifications====
Line 359: Line 357:
 Just another "nice thing" we deserve. Just another "nice thing" we deserve.
 =====Command-Line Arguments===== =====Command-Line Arguments=====
-To automate our comparisons, we will be making use of command-line arguments in our programs. As we have yet to really get into arrays, I will provide you some code that you can use that will allow you to utilize them for the purposes of this project.+To automate our comparisons, we will be making use of command-line arguments in our programs.
  
 ====header files==== ====header files====
Line 377: Line 375:
 int main(int argc, char **argv) int main(int argc, char **argv)
 </code> </code>
 +
 +There are two very important variables involved here (the types are actually what are important, the names given to the variables are actually quite, variable; you may see other references refer to them as things like "ac" and "av"):
 +
 +  * int argc: the count (an integer) of tokens given on the command line (program name + arguments)
 +  * <nowiki>char **argv</nowiki>: an array of strings (technically an array of an array of char) that contains "strings" of the various tokens provided on the command-line.
  
 The arguments are accessible via the argv array, in the order they were specified: The arguments are accessible via the argv array, in the order they were specified:
Line 385: Line 388:
   * argv[3]: conditionally optional; represents lower bound   * argv[3]: conditionally optional; represents lower bound
   * argv[4]: conditionally optional; represents upper bound   * argv[4]: conditionally optional; represents upper bound
 +
 +Additionally, let's not forget the **argc** variable, an integer, which contains a count of arguments (argc == argument count). If we provided argv[0] through argv[4], argc would contain a 5.
 +
 +===example===
 +For example, if we were to execute the **primereg** program:
 +
 +<cli>
 +lab46:~/src/discrete/pnc0$ ./primereg 128 1 2 2048
 +</cli>
 +
 +We'd have:
 +
 +  * <nowiki>argv[0]</nowiki>: "./primereg" 
 +  * <nowiki>argv[1]</nowiki>: "128" (note, NOT the scalar integer 128, but a string) 
 +  * <nowiki>argv[2]</nowiki>: "1"
 +  * <nowiki>argv[3]</nowiki>: "2" 
 +  * <nowiki>argv[4]</nowiki>: "2048" 
 +
 +and let's not forget:
 +
 +  * argc: 5   (there are 5 things, argv indexes 0, 1, 2, 3, and 4)
 +
 +With the conditionally optional arguments as part of the program spec, for a valid execution of the program, argc could be a value anywhere from 3 to 5.
  
 ====Simple argument checks==== ====Simple argument checks====
Line 797: Line 823:
  
 ====Evaluation Criteria==== ====Evaluation Criteria====
-What I will be looking for:+Grand total points:
  
 <code> <code>
 390:pnc0:final tally of results (390/390) 390:pnc0:final tally of results (390/390)
-*:pnc0:primereg.c performs proper argument checking [2/2] 
-*:pnc0:primereg.c performs proper bounds checking [2/2] 
-*:pnc0:primereg.c compiles cleanly, no compiler messages [2/2] 
-*:pnc0:primereg.c implements only specified algorithm [6/6] 
-*:pnc0:primereg.c consistent indentation throughout code [2/2] 
-*:pnc0:primereg.c relevant comments throughout code [2/2] 
-*:pnc0:primereg.c code conforms to project specifications [3/3] 
-*:pnc0:primereg.c program output conforms to specifications [3/3] 
-*:pnc0:primereg.c make checkqty runtimes within reason [2/2] 
-*:pnc0:primereg.c make checkrange runtimes within reason [2/2] 
-*:pnc0:primereg.c make verifyall tests succeed [13/13] 
-*:pnc0:primerega.c performs proper argument checking [2/2] 
-*:pnc0:primerega.c performs proper bounds checking [2/2] 
-*:pnc0:primerega.c compiles cleanly, no compiler messages [2/2] 
-*:pnc0:primerega.c implements only specified algorithm [6/6] 
-*:pnc0:primerega.c consistent indentation throughout code [2/2] 
-*:pnc0:primerega.c relevant comments throughout code [2/2] 
-*:pnc0:primerega.c code conforms to project specifications [3/3] 
-*:pnc0:primerega.c program output conforms to specifications [3/3] 
-*:pnc0:primerega.c make checkqty runtimes within reason [2/2] 
-*:pnc0:primerega.c make checkrange runtimes within reason [2/2] 
-*:pnc0:primerega.c make verifyall tests succeed [13/13] 
-*:pnc0:primeregb.c performs proper argument checking [2/2] 
-*:pnc0:primeregb.c performs proper bounds checking [2/2] 
-*:pnc0:primeregb.c compiles cleanly, no compiler messages [2/2] 
-*:pnc0:primeregb.c implements only specified algorithm [6/6] 
-*:pnc0:primeregb.c consistent indentation throughout code [2/2] 
-*:pnc0:primeregb.c relevant comments throughout code [2/2] 
-*:pnc0:primeregb.c code conforms to project specifications [3/3] 
-*:pnc0:primeregb.c program output conforms to specifications [3/3] 
-*:pnc0:primeregb.c make checkqty runtimes within reason [2/2] 
-*:pnc0:primeregb.c make checkrange runtimes within reason [2/2] 
-*:pnc0:primeregb.c make verifyall tests succeed [13/13] 
-*:pnc0:primeregba.c performs proper argument checking [2/2] 
-*:pnc0:primeregba.c performs proper bounds checking [2/2] 
-*:pnc0:primeregba.c compiles cleanly, no compiler messages [2/2] 
-*:pnc0:primeregba.c implements only specified algorithm [6/6] 
-*:pnc0:primeregba.c consistent indentation throughout code [2/2] 
-*:pnc0:primeregba.c relevant comments throughout code [2/2] 
-*:pnc0:primeregba.c code conforms to project specifications [3/3] 
-*:pnc0:primeregba.c program output conforms to specifications [3/3] 
-*:pnc0:primeregba.c make checkqty runtimes within reason [2/2] 
-*:pnc0:primeregba.c make checkrange runtimes within reason [2/2] 
-*:pnc0:primeregba.c make verifyall tests succeed [13/13] 
-*:pnc0:primeregbm.c performs proper argument checking [2/2] 
-*:pnc0:primeregbm.c performs proper bounds checking [2/2] 
-*:pnc0:primeregbm.c compiles cleanly, no compiler messages [2/2] 
-*:pnc0:primeregbm.c implements only specified algorithm [6/6] 
-*:pnc0:primeregbm.c consistent indentation throughout code [2/2] 
-*:pnc0:primeregbm.c relevant comments throughout code [2/2] 
-*:pnc0:primeregbm.c code conforms to project specifications [3/3] 
-*:pnc0:primeregbm.c program output conforms to specifications [3/3] 
-*:pnc0:primeregbm.c make checkqty runtimes within reason [2/2] 
-*:pnc0:primeregbm.c make checkrange runtimes within reason [2/2] 
-*:pnc0:primeregbm.c make verifyall tests succeed [13/13] 
-*:pnc0:primeregbo.c performs proper argument checking [2/2] 
-*:pnc0:primeregbo.c performs proper bounds checking [2/2] 
-*:pnc0:primeregbo.c compiles cleanly, no compiler messages [2/2] 
-*:pnc0:primeregbo.c implements only specified algorithm [6/6] 
-*:pnc0:primeregbo.c consistent indentation throughout code [2/2] 
-*:pnc0:primeregbo.c relevant comments throughout code [2/2] 
-*:pnc0:primeregbo.c code conforms to project specifications [3/3] 
-*:pnc0:primeregbo.c program output conforms to specifications [3/3] 
-*:pnc0:primeregbo.c make checkqty runtimes within reason [2/2] 
-*:pnc0:primeregbo.c make checkrange runtimes within reason [2/2] 
-*:pnc0:primeregbo.c make verifyall tests succeed [13/13] 
-*:pnc0:primeregbs.c performs proper argument checking [2/2] 
-*:pnc0:primeregbs.c performs proper bounds checking [2/2] 
-*:pnc0:primeregbs.c compiles cleanly, no compiler messages [2/2] 
-*:pnc0:primeregbs.c implements only specified algorithm [6/6] 
-*:pnc0:primeregbs.c consistent indentation throughout code [2/2] 
-*:pnc0:primeregbs.c relevant comments throughout code [2/2] 
-*:pnc0:primeregbs.c code conforms to project specifications [3/3] 
-*:pnc0:primeregbs.c program output conforms to specifications [3/3] 
-*:pnc0:primeregbs.c make checkqty runtimes within reason [2/2] 
-*:pnc0:primeregbs.c make checkrange runtimes within reason [2/2] 
-*:pnc0:primeregbs.c make verifyall tests succeed [13/13] 
-*:pnc0:primeregm.c performs proper argument checking [2/2] 
-*:pnc0:primeregm.c performs proper bounds checking [2/2] 
-*:pnc0:primeregm.c compiles cleanly, no compiler messages [2/2] 
-*:pnc0:primeregm.c implements only specified algorithm [6/6] 
-*:pnc0:primeregm.c consistent indentation throughout code [2/2] 
-*:pnc0:primeregm.c relevant comments throughout code [2/2] 
-*:pnc0:primeregm.c code conforms to project specifications [3/3] 
-*:pnc0:primeregm.c program output conforms to specifications [3/3] 
-*:pnc0:primeregm.c make checkqty runtimes within reason [2/2] 
-*:pnc0:primeregm.c make checkrange runtimes within reason [2/2] 
-*:pnc0:primeregm.c make verifyall tests succeed [13/13] 
-*:pnc0:primerego.c performs proper argument checking [2/2] 
-*:pnc0:primerego.c performs proper bounds checking [2/2] 
-*:pnc0:primerego.c compiles cleanly, no compiler messages [2/2] 
-*:pnc0:primerego.c implements only specified algorithm [6/6] 
-*:pnc0:primerego.c consistent indentation throughout code [2/2] 
-*:pnc0:primerego.c relevant comments throughout code [2/2] 
-*:pnc0:primerego.c code conforms to project specifications [3/3] 
-*:pnc0:primerego.c program output conforms to specifications [3/3] 
-*:pnc0:primerego.c make checkqty runtimes within reason [2/2] 
-*:pnc0:primerego.c make checkrange runtimes within reason [2/2] 
-*:pnc0:primerego.c make verifyall tests succeed [13/13] 
-*:pnc0:primeregs.c performs proper argument checking [2/2] 
-*:pnc0:primeregs.c performs proper bounds checking [2/2] 
-*:pnc0:primeregs.c compiles cleanly, no compiler messages [2/2] 
-*:pnc0:primeregs.c implements only specified algorithm [6/6] 
-*:pnc0:primeregs.c consistent indentation throughout code [2/2] 
-*:pnc0:primeregs.c relevant comments throughout code [2/2] 
-*:pnc0:primeregs.c code conforms to project specifications [3/3] 
-*:pnc0:primeregs.c program output conforms to specifications [3/3] 
-*:pnc0:primeregs.c make checkqty runtimes within reason [2/2] 
-*:pnc0:primeregs.c make checkrange runtimes within reason [2/2] 
-*:pnc0:primeregs.c make verifyall tests succeed [13/13] 
 </code> </code>
 +
 +What I will be looking for (for each file):
 +
 +<code>
 +*:pnc0:primeALGO.c compiles cleanly, no compiler messages [3/3]
 +*:pnc0:primeALGO.c implements only specified algorithm [6/6]
 +*:pnc0:primeALGO.c consistent indentation throughout code [3/3]
 +*:pnc0:primeALGO.c relevant comments throughout code [3/3]
 +*:pnc0:primeALGO.c code conforms to project specifications [3/3]
 +*:pnc0:primeALGO.c runtime output conforms to specifications [4/4]
 +*:pnc0:primeALGO.c make checkqty test times within reason [2/2]
 +*:pnc0:primeALGO.c make checkrange test times within reason [2/2]
 +*:pnc0:primeALGO.c make verifyall tests succeed [13/13]
 +</code>
 +
 +As the optimizations improve upon others, some evaluations will be based upon differences between a baseline (in some cases, primereg) and the optimization.
haas/fall2017/discrete/projects/pnc0.1504114470.txt.gz · Last modified: 2017/08/30 17:34 by wedge