static initializers cause a problem for DFJ, easy enough to work around them
authorjjenista <jjenista>
Tue, 5 Apr 2011 23:02:07 +0000 (23:02 +0000)
committerjjenista <jjenista>
Tue, 5 Apr 2011 23:02:07 +0000 (23:02 +0000)
Robust/src/Benchmarks/oooJava/DelaunayRefinement/Element.java
Robust/src/Benchmarks/oooJava/DelaunayRefinement/Mesh.java
Robust/src/Benchmarks/oooJava/DelaunayRefinement/SerialDelaunayRefinement.java
Robust/src/Benchmarks/oooJava/DelaunayRefinement/Subgraph.java
Robust/src/Benchmarks/oooJava/DelaunayRefinement/Tuple.java
Robust/src/Benchmarks/oooJava/DelaunayRefinement/makefile

index 64993165ec614a0468d336e1e63a8a13ca404b3b..d449df16f09762d581e81d224208637da0f07a8d 100644 (file)
@@ -7,9 +7,10 @@ public class Element {
   private final int dim;
   private final Tuple center;
   private final double radius_squared;
-  private final double MINANGLE = 30D;
+  private final double MINANGLE;
   
   public Element(Tuple a, Tuple b, Tuple c) {
+    MINANGLE = 30D;
     dim = 3;
     coords = new Tuple[3];
     coords[0] = a;
index 27c603182eb8631829d61d7852200b5859330e45..e0b635f26b5cf8aeec3c20c52238ebab8b7dd3a2 100644 (file)
@@ -1,4 +1,5 @@
 public class Mesh {
+
   protected HashMap edge_map;
   protected Node    aNode;
 
index 7e93e01f1e56a0e9f7d9b43667564f495b6887f8..735a337e86ca6608359b80bb08dd6ec2162da948 100644 (file)
@@ -180,65 +180,26 @@ public class SerialDelaunayRefinement {
                    iterator.hasNext();) {
 
                 node = (Node) iterator.next();
-                //if( printChange ) {
-                //  System.out.println( "  "+mesh.getNodeData( node ) );
-                //}          
                 mesh.removeNode(node);
               }
  
               //add new data
-              //if( printChange ) {
-              //  System.out.println( "post nodes: " );
-              //}
               //Takes up 1.7% of runtime
               for (Iterator iterator1 = cavity.getPost().getNodes().iterator(); 
                    iterator1.hasNext();) {
 
                 node = (Node) iterator1.next();
-                //if( printChange ) {
-                //  System.out.println( "  "+mesh.getNodeData( node ) );
-                //}          
                 mesh.addNode(node);
               }
  
-              //if( printChange ) {
-              //  System.out.println( "post edges: " );
-              //}
               //Takes up 7.8% of runtime
               Edge_d edge;
               for (Iterator iterator2 = cavity.getPost().getEdges().iterator();
                    iterator2.hasNext();) {
               
                 edge = (Edge_d) iterator2.next();
-                //if( printChange ) {
-                //  System.out.println( "  "+mesh.getEdgeData( edge ) );
-                //}                        
                 mesh.addEdge(edge);
               }
-
-
-              /*
-              for (Iterator iterator1 = cavity.getPost().getNodes().iterator(); 
-                   iterator1.hasNext();) {
-                node = (Node) iterator1.next();
-
-                Element e = (Element)mesh.getNodeData( node );
-
-                int cntOutNeighbors = 0;
-                for (Iterator iterator = mesh.getOutNeighbors(node); iterator.hasNext();) {
-                  ++cntOutNeighbors;
-                  Node neighbor = (Node) iterator.next();
-                }
-
-                int dim = e.getDim();
-                int out = cntOutNeighbors;
-
-                if( dim == 3 && out < 3 ) {
-                  System.out.println( e+" has dim="+dim+" and num out-neighbors in graph="+out );
-                }
-              }
-              */
-
             }
           }
          
@@ -263,38 +224,9 @@ public class SerialDelaunayRefinement {
               worklist.push( nodeForBadTri );
             }
           
-            /*
-              if( appliedCavity != 1 ) {
-
-              // if we couldn't even apply this cavity, just
-              // throw it back on the worklist
-              if( nodeForBadTri != null && nodeForBadTri.inGraph ) {
-              worklist.push( nodeForBadTri );
-              } else {
-              System.out.println( "\n\n\nthis tri no longer a concern: "+
-              mesh.getNodeData( nodeForBadTri ) );
-              }
-
-              } else {
-              // otherwise we did apply the cavity,
-              // and we may have introduced new bad triangles
-              HashMapIterator it2 = cavity.getPost().newBad(mesh).iterator();
-              while (it2.hasNext()) {
-              worklist.push((Node)it2.next());
-              }
-              }
-            */
-
           } // end scheduleMoreBad
         } // end phase 3
 
-        //++zzz;
-        //Node aNode = (Node)lastAppliedCavity.getPost().getNodes().iterator().next();      
-        //mesh.discoverAllNodes( aNode );
-        //System.out.println( "\n\ntris="+mesh.getNumNodes()+
-        //                    " [wl="+worklist.size()+"]");
-        //if( zzz == 10 ) { System.exit( 0 ); }
-
       } // end while( !worklist.isEmpty() )
 
       System.out.println( "yuh?" );
@@ -326,7 +258,6 @@ public class SerialDelaunayRefinement {
     //Put in cuz of static issues.
     Mesh m = new Mesh();
     if (!m.verify(result)) {
-//      throw new IllegalStateException("refinement failed.");
       System.out.println("Refinement Failed.");
       System.exit(-1);
     }
index 375602c1088f44cd945e4935d2eebfe6b40d0e49..900691b6ad30eac3450aa4a8304081c7d09348be 100644 (file)
@@ -1,11 +1,14 @@
 public class Subgraph {
 
-  private final LinkedList nodes = new LinkedList();
-  private final LinkedList border = new LinkedList();
-  private final LinkedList edges = new LinkedList();
+  private final LinkedList nodes
+  private final LinkedList border;
+  private final LinkedList edges
 
 
   public Subgraph() {
+    nodes = new LinkedList();
+    border = new LinkedList();
+    edges = new LinkedList();
   }
 
   public boolean existsNode(Node n) {
index 0e4ab8d17c59f27df20fa4a86de346d981e3ec9c..5ab0723a09df1d61abb2f03732802de87591653e 100644 (file)
@@ -1,5 +1,9 @@
 public class Tuple {
 
+  private final double coords[];
+  private final int hashvalue;
+
+
   public Tuple(double a, double b, double c) {
     coords = new double[3];
     coords[0] = a;
@@ -147,7 +151,4 @@ public class Tuple {
   public double get(int i) {
     return coords[i];
   }
-
-  private final double coords[];
-  private final int hashvalue;
 }
index bfc6b8b2d1bd64caba5697ca460dd8881a4ca4ad..7c9f2e3a8f0e3a08b7edf32054b68d27f68e1aad 100644 (file)
@@ -3,6 +3,6 @@ PROGRAM=SerialDelaunayRefinement
 SOURCE_FILES=SerialDelaunayRefinement.java
 
 NUM_OOO_WORKERS=24
-NUM_RCR_WORKERS=23
+NUM_RCR_WORKERS=7
 
 include ../master-makefile