Graphviz 13.1.3~dev.20250829.0113
|
single-source distance filter More...
#include "config.h"
#include <stdbool.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <cgraph/cgraph.h>
#include <cgraph/ingraphs.h>
#include <getopt.h>
#include <util/alloc.h>
#include <util/exit.h>
#include <util/unreachable.h>
Go to the source code of this file.
Data Structures | |
struct | nodedata_t |
Macros | |
#define | getprev(n) (((nodedata_t*)((n)->base.data))->prev) |
#define | setprev(n, p) (((nodedata_t*)((n)->base.data))->prev = (p)) |
#define | isDone(n) (((nodedata_t*)((n)->base.data))->done) |
#define | setDone(n) (((nodedata_t*)((n)->base.data))->done = true) |
Functions | |
static double | getlength (Agedge_t *e) |
static double | getdist (Agnode_t *n) |
static void | setdist (Agnode_t *n, double dist) |
static int | cmpf (void *key1, void *key2) |
static Agnode_t * | extract_min (Dict_t *Q) |
static void | update (Dict_t *Q, Agnode_t *dest, Agnode_t *src, double len) |
static void | pre (Agraph_t *g) |
static void | post (Agraph_t *g) |
static void | dijkstra (Dict_t *Q, Agraph_t *G, Agnode_t *n) |
static void | usage (int v) |
static void | init (int argc, char *argv[]) |
int | main (int argc, char **argv) |
Variables | |
static char * | CmdName |
static char ** | Files |
static char ** | Nodes |
static bool | setall |
static bool | doPath |
static bool | doDirected |
static Agsym_t * | len_sym |
static Dtdisc_t | MyDisc |
static char * | useString |
#define getprev | ( | n | ) | (((nodedata_t*)((n)->base.data))->prev) |
Definition at line 77 of file dijkstra.c.
#define isDone | ( | n | ) | (((nodedata_t*)((n)->base.data))->done) |
Definition at line 79 of file dijkstra.c.
#define setDone | ( | n | ) | (((nodedata_t*)((n)->base.data))->done = true) |
Definition at line 80 of file dijkstra.c.
#define setprev | ( | n, | |
p | |||
) | (((nodedata_t*)((n)->base.data))->prev = (p)) |
Definition at line 78 of file dijkstra.c.
|
static |
Definition at line 82 of file dijkstra.c.
References dist2(), and getdist().
Referenced by dthash(), dttree(), and dtvsearch().
Definition at line 189 of file dijkstra.c.
References agfstedge(), agfstout(), agnxtedge(), agnxtout(), doDirected, dtinsert, extract_min(), G, getlength(), isDone, Agedge_s::node, post, pre, setdist(), setDone, and update().
Referenced by main().
Definition at line 105 of file dijkstra.c.
References dtdelete, and dtfirst.
Referenced by dijkstra().
|
static |
Definition at line 63 of file dijkstra.c.
References Agnode_s::base, and Agobj_s::data.
Referenced by cmpf(), post(), and update().
|
static |
Definition at line 47 of file dijkstra.c.
References agxget(), len(), and len_sym.
Referenced by dijkstra().
|
static |
Definition at line 229 of file dijkstra.c.
References CmdName, doDirected, doPath, Files, gv_calloc(), Nodes, NULL, setall, UNREACHABLE, and usage.
Referenced by main().
int main | ( | int | argc, |
char ** | argv | ||
) |
Definition at line 276 of file dijkstra.c.
References agclose(), agnameof(), agnode(), agwrite(), CmdName, dijkstra(), dtclear, dtopen(), Dtoset, fileName(), Files, free(), graphviz_exit(), init(), MyDisc, newIngraph(), nextGraph(), and Nodes.
|
static |
Definition at line 136 of file dijkstra.c.
References agattr_text(), agattrsym(), agclean(), AGEDGE, agfstnode(), agnameof(), AGNODE, agnxtnode(), AGRAPH, agxget(), agxset(), dist(), doPath, getdist(), getprev, NULL, prev, and setall.
|
static |
Definition at line 130 of file dijkstra.c.
References agattr_text(), AGEDGE, aginit(), AGNODE, len_sym, and NULL.
|
static |
Definition at line 70 of file dijkstra.c.
References Agnode_s::base, Agobj_s::data, and dist().
Referenced by dijkstra(), and update().
Definition at line 113 of file dijkstra.c.
References doPath, dtdelete, dtinsert, getdist(), len(), setdist(), and setprev.
Referenced by dijkstra().
|
static |
Definition at line 223 of file dijkstra.c.
References graphviz_exit(), and useString.
|
static |
Definition at line 30 of file dijkstra.c.
|
static |
Definition at line 37 of file dijkstra.c.
Referenced by dijkstra(), and init().
|
static |
Definition at line 36 of file dijkstra.c.
|
static |
Definition at line 31 of file dijkstra.c.
|
static |
Definition at line 38 of file dijkstra.c.
Referenced by getlength(), and pre().
|
static |
Definition at line 96 of file dijkstra.c.
Referenced by main().
|
static |
Definition at line 32 of file dijkstra.c.
|
static |
Definition at line 33 of file dijkstra.c.
|
static |
Definition at line 215 of file dijkstra.c.
Referenced by usage().