Note:

You are viewing a development version of the library. Goto the latest version.

let add_vertex t e =
  if Hashtbl.mem t.values e then
    Hashtbl.find t.values e
  else
    begin
      let v = Array.length t.vertexes in
      let nvertexes =
        Array.init
          (v + 1)
          (fun i ->
             if i = v then
               e, ref SetInt.empty
             else
               t.vertexes.(i))
      in
        t.vertexes <- nvertexes;
        Hashtbl.add t.values e v;
        v
    end