Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
Exercise 1 ---------- *** Source files: The files are available at http://www.daimi.au.dk/~ups/PE/exercise1 power.c: The generic power function in C. Takes no arguments. imageprocessor.c: Main program part for image filtering for ppm images. Needs '-lppm' when compiling. Takes #iterations, infile, outfile, and either 'round5' or an integer as command-line arguments. convolutionfilter.c: Generic convolution filter with two kinds of sample masks for blurring. *** What to do: (1) Implement program generators for the power function, parameterized with the operator and the exponent, in M4, in C using printf, and using C++ templates. If you did not follow Olivier's PE course this previous quarter, do it using quasiquotation as well. Compare the efficiency of the resulting programs to the generic program (for an appropriate number of iterations). For "extra credit" do the russian peasant version as well. (2) Implement a program generator for the convolution filter, using the technique of your choice from the previous assignment (note: printf is easiest, C++ templates is hardest). Depending on the specific mask, various amounts of optimization are possible for the generated code (for those having followed Olivier's course: do not necessarily feel constrained by what a PE would be able to do). Compare the efficiency of the resulting program to the original program.