private void CreateEdge(int idx, FhNode v1, FhNode v2, int diff)
 {
     if ((diff >= 0) && (diff < 256))
     {
         edges[idx].V1 = v1;
         edges[idx].V2 = v2;
         edges[idx].Next = edgePockets[diff];
         edgePockets[diff] = edges[idx];
     }
 }
 private void CreateArrays(int width, int height)
 {
     nodes = new FhNode[width, height];
     for (int j = 0; j < height; j++)
         for (int i = 0; i < width; i++)
             nodes[i,j] = new FhNode();
     components = new FhComponent[width * height];
     for (int i = 0; i < components.Length; i++)
         components[i] = new FhComponent();
     edges = new FhEdge[4 * width * height];
     for (int i = 0; i < edges.Length; i++)
         edges[i] = new FhEdge();
     edgePockets = new FhEdge[256];
 }