an example showing empty reach state propagation that we considered for CC submission...
[IRC.git] / Robust / src / Tests / disjoint / cc-submission-example / test.java
1 public class Graph {
2   public Graph() {}
3   public Vertex vertex;
4 }
5
6 public class Vertex {
7   public Vertex() {}
8   public Vertex f;
9   public boolean marked;
10   public void updateVertex();
11 }
12
13
14 public class Test {
15
16   static public void main( String[] args ) {
17     Test.graphLoop( 2 );
18   }
19
20
21   static public void graphLoop( int nGraphs ) {
22
23     Graph[] a = new Graph[nGraphs];
24
25     for( int i = 0; i < nGraphs; i++ ) {
26
27       Graph g = disjoint graphs new Graph();
28       Vertex v1 = new Vertex();
29       g.vertex = v1;
30       Vertex v2 = new Vertex();
31       v2.f = v1; v1.f = v2 ;
32       a[i] = g;
33     }
34     /*
35     for( int i = 0; i < nGraphs; i++ ) {
36       
37       Graph  g = a[i];
38       Vertex v = g.vertex;
39
40       while( !v.marked ) {
41         v.marked = true;
42         v.updateVertex();
43         v=v.f;
44       } 
45     }
46     */
47   }
48 }