Home > matgraph > @graph > hasxy.m

hasxy

PURPOSE ^

hasxy(g) --- determine if an embedding has been created for g

SYNOPSIS ^

function yn = hasxy(g)

DESCRIPTION ^

 hasxy(g) --- determine if an embedding has been created for g

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function yn = hasxy(g)
0002 % hasxy(g) --- determine if an embedding has been created for g
0003 
0004 global GRAPH_MAGIC;
0005 
0006 n = nv(g);
0007 
0008 if isfield(GRAPH_MAGIC.graphs{g.idx},'xy')
0009     % the field exsts. now is is the right size?
0010     [nr,nc] = size(GRAPH_MAGIC.graphs{g.idx}.xy);
0011     if (nr == n) & (nc == 2)
0012         yn = 1;
0013         return
0014     else
0015         yn = 0;
0016         GRAPH_MAGIC.graphs{g.idx} = ...
0017             rmfield(GRAPH_MAGIC.graphs{g.idx},'xy');
0018         return
0019     end
0020 end
0021 yn = 0;

Generated on Thu 13-Mar-2008 14:23:52 by m2html © 2003