summaryrefslogtreecommitdiffstats
path: root/dis/Neighborhood/neighborhood.c
diff options
context:
space:
mode:
Diffstat (limited to 'dis/Neighborhood/neighborhood.c')
-rw-r--r--dis/Neighborhood/neighborhood.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/dis/Neighborhood/neighborhood.c b/dis/Neighborhood/neighborhood.c
index 1736d38..23f3a8e 100644
--- a/dis/Neighborhood/neighborhood.c
+++ b/dis/Neighborhood/neighborhood.c
@@ -11,6 +11,10 @@
11 * read the Benchmark Analysis and Specifications Document Version 1.0 11 * read the Benchmark Analysis and Specifications Document Version 1.0
12 * before going on since the detailed comments are given in this documents. 12 * before going on since the detailed comments are given in this documents.
13 * the comments are not repeated here. 13 * the comments are not repeated here.
14 *
15 * Change log:
16 * ------- ---------------- ---------------------------------------------------
17 * 06/2020 Joshua Bakita Include image creation time in timing
14 */ 18 */
15 19
16#include <stdio.h> 20#include <stdio.h>
@@ -58,12 +62,14 @@ int main(int argc, char** argv)
58 62
59 randInit(seed); 63 randInit(seed);
60 maxPixel = (1 << bitDepth) - 1; 64 maxPixel = (1 << bitDepth) - 1;
61 image = createImage(dimension, maxPixel, numberLines, 65 image = malloc(sizeof(Pixel) * dimension * dimension);
62 minThickness, maxThickness); 66 assert(image != NULL);
63 assert (image != NULL);
64 67
65 beginTime = time(NULL); 68 beginTime = time(NULL);
66 START_LOOP 69 START_LOOP
70 createImage(image, dimension, maxPixel, numberLines,
71 minThickness, maxThickness);
72
67 neighborhoodCalculation(image, dimension, 73 neighborhoodCalculation(image, dimension,
68 distanceShort, distanceLong, &values, maxPixel); 74 distanceShort, distanceLong, &values, maxPixel);
69 STOP_LOOP 75 STOP_LOOP
@@ -91,7 +97,7 @@ int main(int argc, char** argv)
91 values.distLong.deg135.entropy, 97 values.distLong.deg135.entropy,
92 values.distLong.deg135.energy); 98 values.distLong.deg135.energy);
93 99
94 fprintf(stderr, "time for neghborhood stressmark = %f\n", 100 fprintf(stderr, "time for neghborhood stressmark = %f seconds.\n",
95 difftime(endTime, beginTime)); 101 difftime(endTime, beginTime));
96 102
97 free((Pixel *)image); 103 free((Pixel *)image);