|
CSE Home | Other Quarters | ZPL | About Us | Search | Contact Info |
|
Assignment 3Due Nov. 18 before classSubmit solution by email to Adam prior to class on Nov. 18Rain Comes to SeattleThis is intended to suggest a "typical" scientific computation. We are less interested in the exact details of the model than in your solution using ZPL. So, if there are subtle things having to do with how the model works, tell us your assumptions and keep going. Let n be a configuration variable and E be an nXn elevation grid, an array of heights from a reference plane like sea level. Write a ZPL program to plot (print out as an array of 0's and 1's) the drainage map from the highest point to the lowest point in E. Conceptually, the drainage map is that portion of the elevation grid that a raindrop could visit starting from the highest point and descending to the lowest point. (Of course, the drainage map can be empty if it is not possible for a drop to get from the highest to lowest point.) As an example, consider the follwing 5x5 elevation map:
n m A11 A12 A13 ... A1m A22 A23 A33 ... . . . An1 An2 An3 ... AnmWhere n and m are the rows and columns, respectively and the data can be floats. (The assignment calls for square matrices, and we won't take points off if you only handle square matrices, but you should still read both dimensions from the input file. We'll be might run your program against both square and non-square matrices.) While there are a variety of solutions that have an iterative flavor, try to come up with one that uses the parallel features of ZPL. |
Department of Computer Science & Engineering University of Washington Box 352350 Seattle, WA 98195-2350 (206) 543-1695 voice, (206) 543-2969 FAX [comments to carlson] |