|
Graphviz 14.0.5~dev.20251117.1017
|
#include "config.h"#include <assert.h>#include <inttypes.h>#include <limits.h>#include <stdbool.h>#include <stdio.h>#include <stdint.h>#include <stdlib.h>#include <math.h>#include <graph_generator.h>#include <util/alloc.h>#include <util/exit.h>#include <util/list.h>#include <util/random.h>#include <util/overflow.h>Go to the source code of this file.
Data Structures | |
| struct | pair |
| struct | tree_t |
| struct | treegen_s |
Macros | |
| #define | OUTE(h) if (tl < (hd=(h))) ef( tl, hd) |
Functions | |
| void | makePath (unsigned n, edgefn ef) |
| void | makeComplete (unsigned n, edgefn ef) |
| void | makeCircle (unsigned n, edgefn ef) |
| void | makeStar (unsigned n, edgefn ef) |
| void | makeWheel (unsigned n, edgefn ef) |
| void | makeCompleteB (unsigned dim1, unsigned dim2, edgefn ef) |
| void | makeTorus (unsigned dim1, unsigned dim2, edgefn ef) |
| void | makeTwistedTorus (unsigned dim1, unsigned dim2, unsigned t1, unsigned t2, edgefn ef) |
| void | makeCylinder (unsigned dim1, unsigned dim2, edgefn ef) |
| void | makeSquareGrid (unsigned dim1, unsigned dim2, int connect_corners, int partial, edgefn ef) |
| void | makeTree (unsigned depth, unsigned nary, edgefn ef) |
| void | makeBinaryTree (unsigned depth, edgefn ef) |
| typedef | LIST (unsigned) |
vtx_data destructor | |
| typedef | LIST (vtx_data) |
| static void | constructSierpinski (unsigned v1, unsigned v2, unsigned v3, unsigned depth, vtx_datas_t *graph) |
| void | makeSierpinski (unsigned depth, edgefn ef) |
| static void | constructTetrix (unsigned v1, unsigned v2, unsigned v3, unsigned v4, unsigned depth, vtx_datas_t *graph) |
| void | makeTetrix (unsigned depth, edgefn ef) |
| void | makeHypercube (unsigned dim, edgefn ef) |
| void | makeTriMesh (unsigned sz, edgefn ef) |
| void | makeBall (unsigned w, unsigned h, edgefn ef) |
| void | makeRandom (unsigned h, unsigned w, edgefn ef) |
| void | makeMobius (unsigned w, unsigned h, edgefn ef) |
| static tree_t * | mkTree (unsigned sz) |
| static void | freeTree (tree_t *tp) |
| static void | resetTree (tree_t *tp) |
| static unsigned | treeRoot (tree_t *tp) |
| static unsigned | prevRoot (tree_t *tp) |
| static unsigned | treeSize (tree_t *tp) |
| static unsigned | treeTop (tree_t *tp) |
| static void | treePop (tree_t *tp) |
| static void | addTree (tree_t *tp, unsigned sz) |
| static void | treeDup (tree_t *tp, unsigned J) |
| static pair | pop (int_stack_t *sp) |
| static uint64_t | umul (uint64_t a, uint64_t b) |
| multiply two 64-bit unsigned integers, exiting on overflow | |
| static uint64_t | uadd (uint64_t a, uint64_t b) |
| add two 64-bit unsigned integers, exiting on overflow | |
| static uint64_t * | genCnt (unsigned NN) |
| static void | genTree (unsigned NN, uint64_t *T, int_stack_t *stack, tree_t *TREE) |
| static void | writeTree (tree_t *tp, edgefn ef) |
| treegen_t * | makeTreeGen (unsigned N) |
| void | makeRandomTree (treegen_t *tg, edgefn ef) |
| void | freeTreeGen (treegen_t *tg) |
| #define OUTE | ( | h | ) | if (tl < (hd=(h))) ef( tl, hd) |
Definition at line 141 of file graph_generator.c.
|
static |
Definition at line 483 of file graph_generator.c.
References tree_t::p, tree_t::root, and tree_t::top.
Referenced by genTree().
|
static |
Definition at line 224 of file graph_generator.c.
References constructSierpinski(), and graph().
Referenced by constructSierpinski(), and makeSierpinski().
|
static |
Definition at line 267 of file graph_generator.c.
References constructTetrix(), and graph().
Referenced by constructTetrix(), and makeTetrix().
|
static |
Definition at line 448 of file graph_generator.c.
References free(), and tree_t::p.
Referenced by freeTreeGen().
| void freeTreeGen | ( | treegen_t * | tg | ) |
Definition at line 648 of file graph_generator.c.
References free(), freeTree(), LIST_FREE, treegen_s::sp, treegen_s::T, and treegen_s::tp.
Referenced by main().
|
static |
Definition at line 542 of file graph_generator.c.
References D, gv_calloc(), I, T, uadd(), and umul().
Referenced by makeTreeGen().
|
static |
| typedef LIST | ( | unsigned | ) |
Definition at line 203 of file graph_generator.c.
References LIST_FREE.
| typedef LIST | ( | vtx_data | ) |
Definition at line 210 of file graph_generator.c.
References graph(), LIST_APPEND, LIST_AT, LIST_SIZE, and NULL.
| void makeBall | ( | unsigned | w, |
| unsigned | h, | ||
| edgefn | ef | ||
| ) |
Definition at line 356 of file graph_generator.c.
References makeCylinder().
Referenced by main().
| void makeBinaryTree | ( | unsigned | depth, |
| edgefn | ef | ||
| ) |
Definition at line 193 of file graph_generator.c.
Referenced by main(), and makeRandom().
| void makeCircle | ( | unsigned | n, |
| edgefn | ef | ||
| ) |
Definition at line 48 of file graph_generator.c.
References makePath().
Referenced by main().
| void makeComplete | ( | unsigned | n, |
| edgefn | ef | ||
| ) |
Definition at line 36 of file graph_generator.c.
Referenced by main(), and makeWheel().
| void makeCompleteB | ( | unsigned | dim1, |
| unsigned | dim2, | ||
| edgefn | ef | ||
| ) |
Definition at line 85 of file graph_generator.c.
Referenced by main().
| void makeCylinder | ( | unsigned | dim1, |
| unsigned | dim2, | ||
| edgefn | ef | ||
| ) |
Definition at line 125 of file graph_generator.c.
Referenced by main(), and makeBall().
| void makeHypercube | ( | unsigned | dim, |
| edgefn | ef | ||
| ) |
Definition at line 320 of file graph_generator.c.
Referenced by main().
| void makeMobius | ( | unsigned | w, |
| unsigned | h, | ||
| edgefn | ef | ||
| ) |
Definition at line 400 of file graph_generator.c.
References makePath().
Referenced by main().
| void makePath | ( | unsigned | n, |
| edgefn | ef | ||
| ) |
Definition at line 27 of file graph_generator.c.
Referenced by main(), makeCircle(), makeMobius(), makeRandom(), makeStar(), and Pobspath().
| void makeRandom | ( | unsigned | h, |
| unsigned | w, | ||
| edgefn | ef | ||
| ) |
Definition at line 371 of file graph_generator.c.
References makeBinaryTree(), makePath(), and type.
Referenced by main().
Definition at line 639 of file graph_generator.c.
References genTree(), LIST_CLEAR, treegen_s::N, resetTree(), treegen_s::sp, treegen_s::T, treegen_s::tp, and writeTree().
Referenced by main().
| void makeSierpinski | ( | unsigned | depth, |
| edgefn | ef | ||
| ) |
Definition at line 249 of file graph_generator.c.
References constructSierpinski(), graph(), LIST_AT, LIST_FREE, LIST_GET, and LIST_SIZE.
Referenced by main().
| void makeSquareGrid | ( | unsigned | dim1, |
| unsigned | dim2, | ||
| int | connect_corners, | ||
| int | partial, | ||
| edgefn | ef | ||
| ) |
Definition at line 143 of file graph_generator.c.
References OUTE.
Referenced by main().
| void makeStar | ( | unsigned | n, |
| edgefn | ef | ||
| ) |
Definition at line 60 of file graph_generator.c.
References makePath().
Referenced by main(), and makeWheel().
| void makeTetrix | ( | unsigned | depth, |
| edgefn | ef | ||
| ) |
Definition at line 302 of file graph_generator.c.
References constructTetrix(), graph(), LIST_AT, LIST_FREE, LIST_GET, and LIST_SIZE.
Referenced by main().
| void makeTorus | ( | unsigned | dim1, |
| unsigned | dim2, | ||
| edgefn | ef | ||
| ) |
Definition at line 93 of file graph_generator.c.
Referenced by main().
| void makeTree | ( | unsigned | depth, |
| unsigned | nary, | ||
| edgefn | ef | ||
| ) |
Definition at line 182 of file graph_generator.c.
Referenced by main().
| treegen_t * makeTreeGen | ( | unsigned | N | ) |
Definition at line 628 of file graph_generator.c.
References genCnt(), gv_alloc(), mkTree(), N, treegen_s::N, treegen_s::sp, treegen_s::T, and treegen_s::tp.
Referenced by main().
| void makeTriMesh | ( | unsigned | sz, |
| edgefn | ef | ||
| ) |
Definition at line 333 of file graph_generator.c.
Referenced by main().
| void makeTwistedTorus | ( | unsigned | dim1, |
| unsigned | dim2, | ||
| unsigned | t1, | ||
| unsigned | t2, | ||
| edgefn | ef | ||
| ) |
Definition at line 110 of file graph_generator.c.
Referenced by main().
| void makeWheel | ( | unsigned | n, |
| edgefn | ef | ||
| ) |
Definition at line 71 of file graph_generator.c.
References makeComplete(), and makeStar().
Referenced by main().
|
static |
Definition at line 439 of file graph_generator.c.
References gv_alloc(), gv_calloc(), tree_t::p, tree_t::root, and tree_t::top.
Referenced by makeTreeGen().
|
static |
Definition at line 511 of file graph_generator.c.
References LIST_POP_BACK.
|
static |
Definition at line 465 of file graph_generator.c.
References tree_t::p, and tree_t::root.
Referenced by treeDup(), and treePop().
|
static |
Definition at line 455 of file graph_generator.c.
References tree_t::root, and tree_t::top.
Referenced by makeRandomTree().
|
static |
Definition at line 490 of file graph_generator.c.
References L, M, tree_t::p, prevRoot(), tree_t::top, treeRoot(), and treeSize().
Referenced by genTree().
|
static |
Definition at line 478 of file graph_generator.c.
References prevRoot(), and tree_t::root.
Referenced by genTree().
|
static |
Definition at line 461 of file graph_generator.c.
References tree_t::root.
Referenced by treeDup().
|
static |
Definition at line 469 of file graph_generator.c.
References tree_t::root, and tree_t::top.
Referenced by treeDup().
|
static |
Definition at line 473 of file graph_generator.c.
References tree_t::top.
Referenced by genTree().
|
static |
Definition at line 533 of file graph_generator.c.
References graphviz_exit(), and u64add_overflow().
Referenced by genCnt().
|
static |
Definition at line 523 of file graph_generator.c.
References graphviz_exit(), and u64mul_overflow().
Referenced by genCnt(), and genTree().
Definition at line 615 of file graph_generator.c.
References tree_t::p, and tree_t::top.
Referenced by makeRandomTree().