copy(g,h) --- overwrite g with a copy of h
This is different from writing g = h which makes g another view of the
same graph h (so changes to h affect g). Rather, copy(g,h) makes g an
identical, but independent copy of h.
Note that g = graph(h) has a similar effect, but grabs a new slot in
GRAPH_MAGIC. The syntax copy(g,h) is preferred when g is already a handle
to a graph object.
CROSS-REFERENCE INFORMATION
This function calls:
This function is called by:
bridges bridges(g,algo) --- find all cut edges in g
prufer prufer --- convert a tree to/from its Prufer code
random_regular random_regular(g,n,k) --- create a random regular graph
union union(g,h1,h2) --- set g equal to the union of h1 and h2.
SOURCE CODE
0001 function copy(g,h)
0002 % copy(g,h) --- overwrite g with a copy of h
0003 %
0004 % This is different from writing g = h which makes g another view of the
0005 % same graph h (so changes to h affect g). Rather, copy(g,h) makes g an
0006 % identical, but independent copy of h.
0007 %
0008 % Note that g = graph(h) has a similar effect, but grabs a new slot in
0009 % GRAPH_MAGIC. The syntax copy(g,h) is preferred when g is already a handle
0010 % to a graph object.
0011
0012 global GRAPH_MAGIC
0013
0014 GRAPH_MAGIC.graphs{g.idx} = GRAPH_MAGIC.graphs{h.idx};
0015
0016