Home > matgraph > @graph > set_matrix.m

set_matrix

PURPOSE ^

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: This function is called by:

SOURCE CODE ^

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

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