Matrix Market-DOT converter
More...
#include "config.h"
#include <util/alloc.h>
#include <cgraph/cgraph.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <assert.h>
#include "mmio.h"
#include <sparse/SparseMatrix.h>
#include <util/agxbuf.h>
#include <util/unreachable.h>
#include "matrix_market.h"
#include <getopt.h>
Go to the source code of this file.
|
static double | Hue2RGB (double v1, double v2, double H) |
|
static char * | hue2rgb (double hue, agxbuf *xb) |
|
static Agraph_t * | makeDotGraph (SparseMatrix A, char *name, int dim, double *x, int with_color, int with_label, int with_val) |
|
static void | usage (int eval) |
|
static FILE * | openF (char *fname, char *mode) |
|
static void | init (int argc, char **argv, parms_t *p) |
|
int | main (int argc, char *argv[]) |
|
◆ ND_id
◆ STANDALONE
◆ hue2rgb()
static char * hue2rgb |
( |
double |
hue, |
|
|
agxbuf * |
xb |
|
) |
| |
|
static |
◆ Hue2RGB()
static double Hue2RGB |
( |
double |
v1, |
|
|
double |
v2, |
|
|
double |
H |
|
) |
| |
|
static |
◆ init()
static void init |
( |
int |
argc, |
|
|
char ** |
argv, |
|
|
parms_t * |
p |
|
) |
| |
|
static |
Definition at line 235 of file mm2gv.c.
References parms_t::bipartite, BIPARTITE_ALWAYS, cmd, parms_t::inf, parms_t::infile, openF(), parms_t::outf, parms_t::undirected, UNREACHABLE, usage, parms_t::with_color, parms_t::with_label, and parms_t::with_val.
Referenced by main().
◆ main()
int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
Definition at line 293 of file mm2gv.c.
References A, agwrite(), B, parms_t::bipartite, BIPARTITE_PATTERN_UNSYM, dim, graphviz_exit(), parms_t::inf, parms_t::infile, init(), makeDotGraph(), NULL, parms_t::outf, SparseMatrix_delete(), SparseMatrix_import_matrix_market(), SparseMatrix_make_undirected(), SparseMatrix_to_square_matrix(), parms_t::undirected, usage, parms_t::with_color, parms_t::with_label, and parms_t::with_val.
◆ makeDotGraph()
static Agraph_t * makeDotGraph |
( |
SparseMatrix |
A, |
|
|
char * |
name, |
|
|
int |
dim, |
|
|
double * |
x, |
|
|
int |
with_color, |
|
|
int |
with_label, |
|
|
int |
with_val |
|
) |
| |
|
static |
Definition at line 73 of file mm2gv.c.
References A, agattr(), agbindrec(), Agdirected, AGEDGE, agedge(), agfstnode(), agnode(), agnxtnode(), agopen(), AGRAPH, Agundirected, agxbfree(), agxbprint(), agxbuse(), agxset(), color(), dim, distance(), free(), gv_calloc(), hue2rgb(), MATRIX_TYPE_REAL, ND_id, NULL, and strip_dir().
Referenced by main().
◆ openF()
static FILE * openF |
( |
char * |
fname, |
|
|
char * |
mode |
|
) |
| |
|
static |
◆ usage()
static void usage |
( |
int |
eval | ) |
|
|
static |
◆ cmd
◆ useString
Initial value:= "Usage: %s [-uvcl] [-o file] matrix_market_filename\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 <file> - output file \n"
Definition at line 195 of file mm2gv.c.
Referenced by usage().