2 * Copyright 1997, Regents of the University of Minnesota
6 * This file takes a graph and a fill-reducing ordering and computes
12 * $Id: cmpfillin.c 9982 2011-05-25 17:18:00Z karypis $
20 /*************************************************************************
22 **************************************************************************/
23 int main(int argc
, char *argv
[])
32 printf("Usage: %s <GraphFile> <PermFile\n", argv
[0]);
36 params
.filename
= gk_strdup(argv
[1]);
37 graph
= ReadGraph(¶ms
);
38 if (graph
->nvtxs
<= 0) {
39 printf("Empty graph. Nothing to do.\n");
42 if (graph
->ncon
!= 1) {
43 printf("Ordering can only be applied to graphs with one constraint.\n");
48 /* Read the external iperm vector */
49 perm
= imalloc(graph
->nvtxs
, "main: perm");
50 iperm
= imalloc(graph
->nvtxs
, "main: iperm");
51 ReadPOVector(graph
, argv
[2], iperm
);
53 for (i
=0; i
<graph
->nvtxs
; i
++)
56 printf("**********************************************************************\n");
57 printf("%s", METISTITLE
);
58 printf("Graph Information ---------------------------------------------------\n");
59 printf(" Name: %s, #Vertices: %"PRIDX
", #Edges: %"PRIDX
"\n\n", argv
[1],
60 graph
->nvtxs
, graph
->nedges
/2);
61 printf("Fillin... -----------------------------------------------------------\n");
63 ComputeFillIn(graph
, perm
, iperm
, &maxlnz
, &opc
);
65 printf(" Nonzeros: %6.3le \tOperation Count: %6.3le\n", (double)maxlnz
, (double)opc
);
68 printf("**********************************************************************\n");