//! ------------------------------------------------------- //! I need to hack this to make it possible for recomb vertices to send out 0 edges class EdgeIterator { private int v; private int iter[]; private int root[]; private int status[]; private int flip[]; private int edgesPerIteration; private int edgeVec[][]; private static final int TAIL = 0; private static final int HEAD = 1; public EdgeIterator( int numVer ) { //! The first vertex is a root, the second is a split, the last is a recomb v = numVer; iter = new int[v-1]; root = new int[v-1]; status = new int[v-1]; flip = new int[v-1]; edgesPerIteration = 1; //! The first arc is always for free AddIterator( 0, 1 ); AddIterator( 1, 2 ); //! No iterator for the last vertex because has no edges leaving it... } public void AddIterator( int vnum, int numArc ) { //! System.out.println("Adding iterator for "+vnum); iter[vnum] = numArc; edgesPerIteration += numArc; if( numArc == 1 ) { //! e.g. v=7, vnum=0, 6 arrows are possible numbered 0 to 5 //! but we allow an extra possibility: linking to yourself! i.e. no edge flip[vnum] = v - vnum; //! used to be -1 } else if( numArc == 2 ) { int temp = v - vnum - 1; root[vnum] = temp; flip[vnum] = temp*temp; } } public void armIterator() { edgeVec = new int[edgesPerIteration][2]; } public boolean isFinished() { //! It's finished if all counters are maxed out for( int x=0; x