package edu.rice.hj.example.comp322.assignments.hw2; /** * This file is a skeleton for your GeneralizedReduce implementation. * You can assume that each client includes a call to perf.doWork(1) for each call to the * combine() method. This abstraction assumes that each call to * combine() takes 1 unit of time, and ignores the cost all other * computations. You should aim for maximum parallelism with respect * to this abstraction. All code should include basic documentation * for each method in this class. *

* TODO class to be implemented by you. * Though you will need to extend this file for your homework submission, * do not alter the declarations below in any way, other than filling * in the "..." code regions. * * @author Vivek Sarkar (vsarkar@rice.edu) */ public class GeneralizedReduce { private final GeneralizedReduceApp app; /** *

Constructor for GeneralizedReduce.

* * @param app a {@link edu.rice.hj.example.comp322.assignments.hw2.GeneralizedReduceApp} object. */ public GeneralizedReduce(final GeneralizedReduceApp app) { this.app = app; } /** *

run.

* * @param inArray an array of T objects. * @return a T object. */ public T run(final T[] inArray) { // Perform reduction on inArray using init() and combine() methods in app, // and return result // ... return null; } // ... // Insert other helper fields and methods here }