52de99cab8e1064a58a4dddc51851670889ae1e9
[IRC.git] / Robust / src / Benchmarks / Scheduling / GC / NON_BAMBOO / voronoi / TestRunner.java
1 package voronoi;
2
3 /**
4  * 
5  * A Java implementation of the <tt>voronoi</tt> Olden benchmark. Voronoi
6  * generates a random set of points and computes a Voronoi diagram for
7  * the points.
8  * <p>
9  * <cite>
10  * L. Guibas and J. Stolfi.  "General Subdivisions and Voronoi Diagrams"
11  * ACM Trans. on Graphics 4(2):74-123, 1985.
12  * </cite>
13  * <p>
14  * The Java version of voronoi (slightly) differs from the C version
15  * in several ways.  The C version allocates an array of 4 edges and
16  * uses pointer addition to implement quick rotate operations.  The
17  * Java version does not use pointer addition to implement these
18  * operations.
19  **/
20 public class TestRunner extends Thread
21 {
22
23   /**
24    * The number of points in the diagram
25    **/
26   private int points;
27
28   public TestRunner(int npoints) {
29     this.points = npoints;
30   }
31
32   /**
33    * The main routine which creates the points and then performs
34    * the delaunay triagulation.
35    * @param args the command line parameters
36    **/
37   public void run()
38   {
39     Vertex v = new Vertex();
40     v.seed = 1023;
41     Vertex extra = v.createPoints(1, new MyDouble(1.0f), points);
42     Vertex point = v.createPoints(points-1, new MyDouble(extra.X()), points-1);
43     Edge edge = point.buildDelaunayTriangulation(extra);
44   }
45
46   public static void main(String[] args) {
47     int threadnum = 62;
48     int npoints = 32000;
49     for(int i = 0; i < threadnum; ++i) {
50       TestRunner tr = new TestRunner(npoints);
51       tr.start();
52     }
53   }
54 }