Code covered by the BSD License  

Highlights from
Matgraph

from Matgraph by Ed Scheinerman
Toolbox for working with simple, undirected graphs

Description of set_matrix
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:
  • 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
  • thresh thresh(g,x) -- create a threshold graph

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

Contact us at files@mathworks.com