Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Algorithms, Part II
- by Kevin Wayne, Robert Sedgewick
- Programming Assignment 2: Seam Carving | seamCarving.zip Help Submission
- Submission time Fri-14-Nov 15:42:52
- Raw Score 100.00 / 100.00
- Feedback See the Assessment Guide for information on how to read this report.
- Assessment Summary
- Compilation: PASSED
- Style: FAILED
- Findbugs: No potential bugs found.
- API: PASSED
- Correctness: 19/19 tests passed
- Memory: 7/7 tests passed
- Timing: 6/6 tests passed
- Aggregate score: 100.00% [Correctness: 65%, Memory: 10%, Timing: 25%, Style: 0%]
- Assessment Details
- The following files were submitted:
- ----------------------------------
- total 12K
- -rw-r--r-- 1 6.4K Nov 14 23:43 SeamCarver.java
- -rw-r--r-- 1 1.9K Nov 14 23:43 studentSubmission.zip
- ******************************************************************************
- * compiling
- ******************************************************************************
- % javac SeamCarver.java
- *-----------------------------------------------------------
- ================================================================
- % checkstyle *.java
- *-----------------------------------------------------------
- SeamCarver.java:20:1: File contains tab characters (this is the first instance).
- SeamCarver.java:78:78: '||' should be on a new line.
- SeamCarver.java:95:33: Name '_globalpred' must match pattern '^[a-z][a-zA-Z0-9]*$|^[A-Z][A-Z_0-9]*$'.
- SeamCarver.java:99:32: Name '_globalmin' must match pattern '^[a-z][a-zA-Z0-9]*$|^[A-Z][A-Z_0-9]*$'.
- SeamCarver.java:103:40: Name '_mincost' must match pattern '^[a-z][a-zA-Z0-9]*$|^[A-Z][A-Z_0-9]*$'.
- SeamCarver.java:104:49: Name '_cost' must match pattern '^[a-z][a-zA-Z0-9]*$|^[A-Z][A-Z_0-9]*$'.
- SeamCarver.java:105:37: Name '_pred' must match pattern '^[a-z][a-zA-Z0-9]*$|^[A-Z][A-Z_0-9]*$'.
- SeamCarver.java:148:33: Name '_globalpred' must match pattern '^[a-z][a-zA-Z0-9]*$|^[A-Z][A-Z_0-9]*$'.
- SeamCarver.java:152:32: Name '_globalmin' must match pattern '^[a-z][a-zA-Z0-9]*$|^[A-Z][A-Z_0-9]*$'.
- SeamCarver.java:156:40: Name '_mincost' must match pattern '^[a-z][a-zA-Z0-9]*$|^[A-Z][A-Z_0-9]*$'.
- SeamCarver.java:157:49: Name '_cost' must match pattern '^[a-z][a-zA-Z0-9]*$|^[A-Z][A-Z_0-9]*$'.
- SeamCarver.java:158:37: Name '_pred' must match pattern '^[a-z][a-zA-Z0-9]*$|^[A-Z][A-Z_0-9]*$'.
- SeamCarver.java:190:40: Array brackets at illegal position.
- SeamCarver.java:194:67: '?' is not preceded with whitespace.
- SeamCarver.java:194:67: Avoid inline conditionals.
- SeamCarver.java:197:71: '||' should be on a new line.
- SeamCarver.java:202:75: '?' is not preceded with whitespace.
- SeamCarver.java:202:75: Avoid inline conditionals.
- SeamCarver.java:203:75: '?' is not preceded with whitespace.
- SeamCarver.java:203:75: Avoid inline conditionals.
- SeamCarver.java:205:61: '||' should be on a new line.
- SeamCarver.java:209:67: '?' is not preceded with whitespace.
- SeamCarver.java:209:67: Avoid inline conditionals.
- ================================================================
- % findbugs *.class
- *-----------------------------------------------------------
- ================================================================
- Testing the APIs of your programs.
- *-----------------------------------------------------------
- SeamCarver:
- ================================================================
- ******************************************************************************
- * correctness
- ******************************************************************************
- Testing methods in SeamCarver
- *-----------------------------------------------------------
- Running 19 total tests.
- Test 1: Test energy() with file inputs
- * 6x5.png
- * 4x6.png
- ==> passed
- Test 2: Test energy() with random N-by-M pictures with 10 trials each
- * 4-by-4
- * 5-by-5
- * 6-by-6
- * 7-by-7
- ==> passed
- Test 3: Test width() with input file
- * 6x5.png
- * 4x6.png
- ==> passed
- Test 4: Test width() with random N-by-M picture
- * 4-by-6
- * 5-by-5
- * 6-by-4
- * 7-by-10
- ==> passed
- Test 5: Test height() with input file
- * 6x5.png
- * 4x6.png
- ==> passed
- Test 6: Test height() with random N-by-M picture
- * 4-by-6
- * 5-by-5
- * 6-by-4
- * 7-by-10
- ==> passed
- Test 7: Test findVerticalSeam() with random N-by-M pictures
- * 4-by-6
- * 5-by-5
- * 6-by-4
- * 7-by-10
- ==> passed
- Test 8: Test findVerticalSeam() with file
- * 6x5.png
- * 4x6.png
- * 10x12.png
- * 3x7.png
- * 5x6.png
- * 7x3.png
- * 12x10.png
- ==> passed
- Test 9: Test findHorizontalSeam() with random N-by-M pictures
- * 4-by-6
- * 5-by-5
- * 6-by-4
- * 7-by-10
- ==> passed
- Test 10: Test findHorizontalSeam() with file
- * 6x5.png
- * 4x6.png
- * 10x12.png
- * 3x7.png
- * 5x6.png
- * 7x3.png
- * 12x10.png
- ==> passed
- Test 11: Check whether exception is called if energy(i, j) are out of bounds
- * pic is 6-by-5, (i, j) = (-1, 4)
- * pic is 6-by-5, (i, j) = (6, 4)
- * pic is 6-by-5, (i, j) = (5, 5)
- * pic is 6-by-5, (i, j) = (4, -1)
- * pic is 6-by-5, (i, j) = (4, 5)
- ==> passed
- Test 12: Test if exception is thrown if removeVerticalSeam() or removeHoriziontalSeam() array parameter is the wrong length
- * pic is 6-by-5, horizontal seam to remove is of length = (1)
- * pic is 6-by-5, horizontal seam to remove is of length = (5)
- * pic is 6-by-5, vertical seam to remove is of length = (1)
- * pic is 6-by-5, vertical seam to remove is of length = (6)
- ==> passed
- Test 13: Check removeHorizontalSeam() and removeVerticalSeam() with null arguments
- * picture = 6x5.png
- * picture = 3x7.png
- ==> passed
- Test 14: Test removeHorizontalSeam() with file
- * 6x5.png
- * 10x12.png
- * 3x7.png
- * 5x6.png
- * 7x3.png
- * 12x10.png
- ==> passed
- Test 15: Test removeVerticalSeam() with random N-by-M pictures
- * 4-by-6
- * 5-by-5
- * 6-by-4
- * 7-by-10
- ==> passed
- Test 16: Test removeVerticalSeam() with file
- * 6x5.png
- * 10x12.png
- * 3x7.png
- * 5x6.png
- * 7x3.png
- * 12x10.png
- ==> passed
- Test 17: Test removeHorizontalSeam() with random N-by-M pictures
- * 4-by-4
- * 5-by-5
- * 6-by-6
- * 7-by-7
- ==> passed
- Test 18: Check intermixed calls to findHorizontalSeam(), findVerticalSeam(), removeHorizontalSeam(), removeVerticalSeam(). Probabilities of calling each are p1, p2, p3, and p4 respectively. All calls to removal methods are based on randomly generated seams.
- * 50 calls in 100-by-100 image with probabilties p1=0.0, p2=0.0, p3=0.0, p4=1.0
- * 50 calls in 100-by-90 image with probabilties p1=0.0, p2=0.0, p3=1.0, p4=0.0
- * 50 calls in 90-by-100 image with probabilties p1=0.25, p2=0.25, p3=0.25, p4=0.25
- * 5 calls in 7-by-9 image with probabilties p1=0.25, p2=0.25, p3=0.25, p4=0.25
- * 5 calls in 7-by-9 image with probabilties p1=0.25, p2=0.25, p3=0.25, p4=0.25
- * 5 calls in 7-by-9 image with probabilties p1=0.25, p2=0.25, p3=0.25, p4=0.25
- * 5 calls in 9-by-7 image with probabilties p1=0.25, p2=0.25, p3=0.25, p4=0.25
- * 5 calls in 9-by-7 image with probabilties p1=0.25, p2=0.25, p3=0.25, p4=0.25
- * 5 calls in 9-by-7 image with probabilties p1=0.25, p2=0.25, p3=0.25, p4=0.25
- ==> passed
- Test 19: Test findVerticalSeam() after call to removeVerticalSeam() with random images
- * 6x5.png
- * 10x12.png
- * 3x7.png
- * 5x6.png
- ==> passed
- Total: 19/19 tests passed!
- ================================================================
- ******************************************************************************
- * memory usage
- ******************************************************************************
- Computing memory of SeamCarver
- *-----------------------------------------------------------
- Running 7 total tests.
- Memory usage of a SeamCarver after removing 5 horizontal seams from a WxH image.
- Maximum allowed memory is 5x the reference.
- W, H student (bytes) reference (bytes)
- --------------------------------------------------------------
- => passed 10 1792 1792
- => passed 20 2792 2792
- => passed 25 3592 3592
- => passed 40 7192 7192
- => passed 80 25592 25592
- => passed 100 39600 39600
- => passed 200 157600 157600
- ==> 7/7 tests passed
- Total: 7/7 tests passed!
- Estimated student memory (bytes) = 4.00 N^2 + -19.93 N + 1590.41 (R^2 = 1.000)
- Estimated reference memory (bytes) = 4.00 N^2 + -19.93 N + 1590.41 (R^2 = 1.000)
- ================================================================
- ******************************************************************************
- * timing
- ******************************************************************************
- Timing SeamCarver
- *-----------------------------------------------------------
- Running 6 total tests.
- Finding 50 seams but not removing them for a 250-by-250 image
- width height h-seams v-seams find remove time
- ----------------------------------------------------------------
- 250 250 50 0 true false 2.04
- 250 250 0 50 true false 1.81
- 250 250 25 25 true false 1.74
- => PASSED
- Removing 50 randomly generated non-optimal seams for a 250-by-250 image
- width height h-seams v-seams find remove time
- ----------------------------------------------------------------
- 250 250 50 0 false true 0.31
- 250 250 0 50 false true 0.29
- 250 250 25 25 false true 0.25
- => PASSED
- Finding and removing 50 seams for a 250-by-250 image
- width height h-seams v-seams find remove time
- ----------------------------------------------------------------
- 250 250 50 0 true true 1.84
- 250 250 0 50 true true 1.90
- 250 250 25 25 true true 2.21
- => PASSED
- Finding 50 seams but not removing them for a 500-by-500 image
- width height h-seams v-seams find remove time
- ----------------------------------------------------------------
- 500 500 50 0 true false 7.94
- 500 500 0 50 true false 7.45
- 500 500 25 25 true false 7.71
- => PASSED
- Removing 50 randomly generated non-optimal seams for a 500-by-500 image
- width height h-seams v-seams find remove time
- ----------------------------------------------------------------
- 500 500 50 0 false true 1.21
- 500 500 0 50 false true 1.06
- 500 500 25 25 false true 1.18
- => PASSED
- Finding and removing 50 seams for a 500-by-500 image
- width height h-seams v-seams find remove time
- ----------------------------------------------------------------
- 500 500 50 0 true true 8.41
- 500 500 0 50 true true 8.02
- 500 500 25 25 true true 8.05
- => PASSED
- Total: 6/6 tests passed!
- ================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement