tree consTree( element e, tree leftTree, tree rightTree ) { tree root = EMPTYTREE; /* If there's no left and right three, make a new tree. */ if ( emptyTree( leftTree ) && emptyTree( rightTree ) ) { /* After this call a new graph will be initialized. */ root = newVertex( e, globalPointerToVertexHead, globalPointerToEdgeHead ); } else if ( emptyTree( rightTree ) ) { root = newVertex( e, globalPointerToVertexHead, globalPointerToEdgeHead ); connectVertex( globalPointerToEdgeHead, root, leftTree, 'l' ); } else if ( emptyTree( leftTree ) ) { root = newVertex( e, globalPointerToVertexHead, globalPointerToEdgeHead ); connectVertex( globalPointerToEdgeHead, root, rightTree, 'r' ); } /* otherwise make new vertex as root and two trees as son */ else { root = newVertex( e, globalPointerToVertexHead, globalPointerToEdgeHead ); connectVertex( globalPointerToEdgeHead, root, leftTree, 'l' ); connectVertex( globalPointerToEdgeHead, root, rightTree, 'r' ); } return root; }
void process(const SSSPEdge & edge) { connectVertex(edge); }
void process(const std::pair<CmiUInt8, BFSEdge > & edge) { connectVertex(edge); }
void process(const PageRankEdge & edge) { connectVertex(edge); }
void process(const BFSEdge & edge) { connectVertex(edge); }