Graphviz 13.0.0~dev.20241220.2304
|
#include "config.h"
#include <cgraph/list.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
#include <graph_generator.h>
#include <util/alloc.h>
#include <util/exit.h>
Go to the source code of this file.
Data Structures | |
struct | vtx_data |
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) |
static void | constructSierpinski (unsigned v1, unsigned v2, unsigned v3, unsigned depth, vtx_data *graph) |
void | makeSierpinski (unsigned depth, edgefn ef) |
static void | constructTetrix (unsigned v1, unsigned v2, unsigned v3, unsigned v4, unsigned depth, vtx_data *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 void | push (int_stack_t *sp, unsigned j, unsigned d) |
static pair | pop (int_stack_t *sp) |
static unsigned * | genCnt (unsigned NN) |
static double | drand (void) |
static void | genTree (unsigned NN, unsigned *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 137 of file graph_generator.c.
|
static |
Definition at line 498 of file graph_generator.c.
References tree_t::p, tree_t::root, and tree_t::top.
Referenced by genTree().
|
static |
Definition at line 203 of file graph_generator.c.
References constructSierpinski(), graph(), and nedges.
Referenced by constructSierpinski(), and makeSierpinski().
|
static |
Definition at line 263 of file graph_generator.c.
References constructTetrix(), graph(), and nedges.
Referenced by constructTetrix(), and makeTetrix().
|
static |
Definition at line 559 of file graph_generator.c.
Referenced by genTree(), make_map_from_rectangle_groups(), make_map_internal(), node_distinct_coloring_internal2(), power_method(), prolongate(), SparseStressMajorizationSmoother_new(), spring_electrical_embedding(), spring_electrical_embedding_fast(), spring_electrical_embedding_slow(), spring_electrical_spring_embedding(), stress_model(), and StressMajorizationSmoother_smooth().
|
static |
Definition at line 463 of file graph_generator.c.
References free(), and tree_t::p.
Referenced by freeTreeGen().
void freeTreeGen | ( | treegen_t * | tg | ) |
Definition at line 654 of file graph_generator.c.
References free(), freeTree(), treegen_s::sp, treegen_s::T, and treegen_s::tp.
Referenced by main().
|
static |
Definition at line 537 of file graph_generator.c.
References D, gv_calloc(), I, and T.
Referenced by makeTreeGen().
|
static |
void makeBall | ( | unsigned | w, |
unsigned | h, | ||
edgefn | ef | ||
) |
Definition at line 370 of file graph_generator.c.
References makeCylinder().
Referenced by main().
void makeBinaryTree | ( | unsigned | depth, |
edgefn | ef | ||
) |
Definition at line 189 of file graph_generator.c.
Referenced by main(), and makeRandom().
void makeCircle | ( | unsigned | n, |
edgefn | ef | ||
) |
Definition at line 44 of file graph_generator.c.
References makePath().
Referenced by main().
void makeComplete | ( | unsigned | n, |
edgefn | ef | ||
) |
Definition at line 32 of file graph_generator.c.
Referenced by main(), and makeWheel().
void makeCompleteB | ( | unsigned | dim1, |
unsigned | dim2, | ||
edgefn | ef | ||
) |
Definition at line 81 of file graph_generator.c.
Referenced by main().
void makeCylinder | ( | unsigned | dim1, |
unsigned | dim2, | ||
edgefn | ef | ||
) |
Definition at line 121 of file graph_generator.c.
Referenced by main(), and makeBall().
void makeHypercube | ( | unsigned | dim, |
edgefn | ef | ||
) |
Definition at line 335 of file graph_generator.c.
Referenced by main().
void makeMobius | ( | unsigned | w, |
unsigned | h, | ||
edgefn | ef | ||
) |
Definition at line 415 of file graph_generator.c.
References makePath().
Referenced by main().
void makePath | ( | unsigned | n, |
edgefn | ef | ||
) |
Definition at line 23 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 385 of file graph_generator.c.
References makeBinaryTree(), makePath(), and type.
Referenced by main().
Definition at line 645 of file graph_generator.c.
References genTree(), 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 234 of file graph_generator.c.
References constructSierpinski(), free(), graph(), and gv_calloc().
Referenced by main().
void makeSquareGrid | ( | unsigned | dim1, |
unsigned | dim2, | ||
int | connect_corners, | ||
int | partial, | ||
edgefn | ef | ||
) |
Definition at line 139 of file graph_generator.c.
References OUTE.
Referenced by main().
void makeStar | ( | unsigned | n, |
edgefn | ef | ||
) |
Definition at line 56 of file graph_generator.c.
References makePath().
Referenced by main(), and makeWheel().
void makeTetrix | ( | unsigned | depth, |
edgefn | ef | ||
) |
Definition at line 306 of file graph_generator.c.
References constructTetrix(), free(), graph(), and gv_calloc().
Referenced by main().
void makeTorus | ( | unsigned | dim1, |
unsigned | dim2, | ||
edgefn | ef | ||
) |
Definition at line 89 of file graph_generator.c.
Referenced by main().
void makeTree | ( | unsigned | depth, |
unsigned | nary, | ||
edgefn | ef | ||
) |
Definition at line 178 of file graph_generator.c.
Referenced by main().
treegen_t * makeTreeGen | ( | unsigned | N | ) |
Definition at line 633 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 347 of file graph_generator.c.
Referenced by main().
void makeTwistedTorus | ( | unsigned | dim1, |
unsigned | dim2, | ||
unsigned | t1, | ||
unsigned | t2, | ||
edgefn | ef | ||
) |
Definition at line 106 of file graph_generator.c.
Referenced by main().
void makeWheel | ( | unsigned | n, |
edgefn | ef | ||
) |
Definition at line 67 of file graph_generator.c.
References makeComplete(), and makeStar().
Referenced by main().
|
static |
Definition at line 454 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 526 of file graph_generator.c.
|
static |
Definition at line 480 of file graph_generator.c.
References tree_t::p, and tree_t::root.
Referenced by treeDup(), and treePop().
|
static |
Definition at line 521 of file graph_generator.c.
Referenced by genTree().
|
static |
Definition at line 470 of file graph_generator.c.
References tree_t::root, and tree_t::top.
Referenced by makeRandomTree().
|
static |
Definition at line 505 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 493 of file graph_generator.c.
References prevRoot(), and tree_t::root.
Referenced by genTree().
|
static |
Definition at line 476 of file graph_generator.c.
References tree_t::root.
Referenced by treeDup().
|
static |
Definition at line 484 of file graph_generator.c.
References tree_t::root, and tree_t::top.
Referenced by treeDup().
|
static |
Definition at line 488 of file graph_generator.c.
References tree_t::top.
Referenced by genTree().
Definition at line 620 of file graph_generator.c.
References tree_t::p, and tree_t::top.
Referenced by makeRandomTree().