From: Emden R. Gansner Date: Wed, 19 Jun 2013 16:26:45 +0000 (-0400) Subject: Make the usage string a bit clearer on the -U flag; X-Git-Tag: LAST_LIBGRAPH~32^2~183 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4fef86064fd0f2270cfed2b065ef52681213f41b;p=graphviz Make the usage string a bit clearer on the -U flag; add -U flag to the man page. --- diff --git a/cmd/tools/Makefile.am b/cmd/tools/Makefile.am index e4363c2c1..60ddf4f35 100644 --- a/cmd/tools/Makefile.am +++ b/cmd/tools/Makefile.am @@ -157,7 +157,7 @@ mm2gv_LDADD = \ $(top_builddir)/lib/cgraph/libcgraph.la @MATH_LIBS@ mm2gv.1.pdf: mm2gv.1 - - @GROFF@ -Tps -man mm2gv.1 | @PS2PDF@ - - >mm2gv.1.pdf + - @TBL@ mm2gv.1 | @GROFF@ -Tps -man | @PS2PDF@ - - >mm2gv.1.pdf gv2gml_SOURCES = gv2gml.c diff --git a/cmd/tools/mm2gv.1 b/cmd/tools/mm2gv.1 index d43fd7927..4fea0ab06 100644 --- a/cmd/tools/mm2gv.1 +++ b/cmd/tools/mm2gv.1 @@ -7,6 +7,9 @@ mm2gv \- Matrix Market-DOT converters .B \-cluv? ] [ +.BI -U i +] +[ .BI -o outfile ] [ @@ -16,6 +19,21 @@ mm2gv \- Matrix Market-DOT converters .SH DESCRIPTION .B mm2gv converts a sparse matrix of the Matrix Market format to a graph in the GV (formerly DOT) format. +If the matrix \fIM\fP is not square, the graph is considered bipartite and the matrix is viewed +as a bipartite graph adjacency matrix, with the rows and columns of the matrix specifying the +two sets of vertices. Equivalently, the matrix is converted into a symmetric square matrix +.TS +c c. +0 \fIM\fP +\fIM\fP^T 0 +.TE +a block matrix with square blocks of 0's in the upper left and lower right, the upper right +block being \fIM\fP and the lower left block being the transpose of \fIM\fP. +This matrix is then viewed as the adjacency matrix of the graph. +.P +For a square matrix, \fBmm2gv\fP uses it directly as an adjacency matrix if its pattern of non-zero +entries is symmetric; otherwise, it will treat it as a bipartite graph as with the case of non-square +matrices. This behavior can be modified by the \fB-U\fP flag. .SH OPTIONS The following options are supported: .TP @@ -36,6 +54,15 @@ If specified, the graph is assumed to be undirected. By default, the graph gener This flag causes \fBmm2gv\fP to store the matrix values as the \fI"len"\fP attribute of the corresponding edge. .TP +.BI \-U "bflag" +Specifies how square matrices are handled. If \fIbflag\fP is 0, a square matrix will always be treated +as an adjacency matrix. +If \fIbflag\fP is 1 (the default), a square matrix with a symmetric pattern +of non-zero entries will be used as an adjacency matrix; otherwise, it will be used a bipartite graph. +If \fIbflag\fP is 2, a symmetric matrix +will be used as an adjacency matrix; otherwise, it will be used a bipartite graph. +If \fIbflag\fP is 3, any input matrix will be treated like a bipartite graph. +.TP .BI \-o "outfile" Prints output to the file \fIoutfile\fP. If not given, \fBmm2gv\fP uses stdout. diff --git a/cmd/tools/mm2gv.c b/cmd/tools/mm2gv.c index 31c7766e8..a7e4e0c3b 100644 --- a/cmd/tools/mm2gv.c +++ b/cmd/tools/mm2gv.c @@ -368,11 +368,15 @@ static Agraph_t *makeDotGraph(SparseMatrix A, char *name, int dim, } static char* useString = "Usage: %s [-uvcl] [-o file] matrix_market_filename\n\ - -u - make graph undirected\n\ - -U i whether to treat unsymmetric square matrix as a bipartite graph. 0 (never), 1 (default, pattern unsymmetric as bipartite), 2 (unsymmetric matrix always as bipartite. 3: always treat square matrix as bipartite.\n\ - -v - assign len to edges\n\ - -c - assign color and wt to edges\n\ - -l - add label\n\ + -u - make graph undirected\n\ + -U i - treat non-square matrix as a bipartite graph\n\ + i = 0 never\n\ + i = 1 if pattern unsymmetric (default)\n\ + i = 2 if matrix unsymmetric\n\ + i = 3 always\n\ + -v - assign len to edges\n\ + -c - assign color and wt to edges\n\ + -l - add label\n\ -o - output file \n"; static void usage(int eval)