set_matrix(g,A) --- set g to be the graph specificed in the matrix A.
SYNOPSIS
function set_matrix(g,A)
DESCRIPTION
set_matrix(g,A) --- set g to be the graph specificed in the matrix A.
The matrix is scanned by check_matrix to be sure it is a valid adjacency
matrix. If it is not, an error is triggered and the graph is left
unchanged.
CROSS-REFERENCE INFORMATION
This function calls:
fast_set_matrix fast_set_matrix(g,A) --- overwrite the adjacency matrix of g with A
This function is called by:
bucky bucky(g) --- overwrite g with the Buckyball graph (and give a nice
match_join match_join(g,h1,h2) --- overwrite g with a graph formed from disjoint
0001 function set_matrix(g,A)
0002 % set_matrix(g,A) --- set g to be the graph specificed in the matrix A.
0003 % The matrix is scanned by check_matrix to be sure it is a valid adjacency
0004 % matrix. If it is not, an error is triggered and the graph is left
0005 % unchanged.
0006
0007 if (~check_matrix(A))
0008 error('Input matrix is not a valid adjacency matrix')
0009 end
0010
0011 fast_set_matrix(g,logical(A));
0012