]> granicus.if.org Git - graphviz/commitdiff
mm2gv makeDotGraph: replace 'MAX', 'MIN' with standard 'fmax', 'fmin'
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 28 Jan 2023 16:22:47 +0000 (08:22 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Mon, 30 Jan 2023 15:43:10 +0000 (07:43 -0800)
cmd/tools/mm2gv.c

index 3e97a3656564cb27f3548f6c4520ff6df0ccfb60..c452f8c2c8ba832928c4bfc547a99fb6f9e56a22 100644 (file)
@@ -149,10 +149,10 @@ static Agraph_t *makeDotGraph(SparseMatrix A, char *name, int dim,
                            mindist = color[j];
                            first = FALSE;
                        } else {
-                           mindist = MIN(mindist, color[j]);
+                           mindist = fmin(mindist, color[j]);
                        }
                    }
-                   maxdist = MAX(color[j], maxdist);
+                   maxdist = fmax(color[j], maxdist);
                }
            } else {
                for (j = ia[i]; j < ia[i + 1]; j++) {
@@ -163,17 +163,17 @@ static Agraph_t *makeDotGraph(SparseMatrix A, char *name, int dim,
                            mindist = color[j];
                            first = FALSE;
                        } else {
-                           mindist = MIN(mindist, color[j]);
+                           mindist = fmin(mindist, color[j]);
                        }
                    }
-                   maxdist = MAX(color[j], maxdist);
+                   maxdist = fmax(color[j], maxdist);
                }
            }
        }
        for (n = agfstnode(g); n; n = agnxtnode(g, n)) {
            i = ND_id(n);
            for (j = ia[i]; j < ia[i + 1]; j++) {
-               color[j] = (color[j] - mindist) / MAX(maxdist - mindist, 0.000001);
+               color[j] = (color[j] - mindist) / fmax(maxdist - mindist, 0.000001);
            }
        }
     }