Graphviz 12.0.1~dev.20240716.0800
Loading...
Searching...
No Matches
sgraph.c File Reference
#include "config.h"
#include <cgraph/alloc.h>
#include <limits.h>
#include <ortho/sgraph.h>
#include <ortho/fPQ.h>
Include dependency graph for sgraph.c:

Go to the source code of this file.

Macros

#define UNSEEN   INT_MIN
 

Functions

void gsave (sgraph *G)
 
void reset (sgraph *G)
 
void initSEdges (sgraph *g, int maxdeg)
 
sgraphcreateSGraph (int nnodes)
 
snodecreateSNode (sgraph *g)
 
static void addEdgeToNode (snode *np, int idx)
 
sedgecreateSEdge (sgraph *g, snode *v1, snode *v2, double wt)
 
void freeSGraph (sgraph *g)
 
static snodeadjacentNode (sgraph *g, sedge *e, snode *n)
 
int shortPath (sgraph *g, snode *from, snode *to)
 

Macro Definition Documentation

◆ UNSEEN

#define UNSEEN   INT_MIN

Definition at line 131 of file sgraph.c.

Function Documentation

◆ addEdgeToNode()

static void addEdgeToNode ( snode np,
int  idx 
)
static

Definition at line 77 of file sgraph.c.

References snode::adj_edge_list, and snode::n_adj.

Referenced by createSEdge().

Here is the caller graph for this function:

◆ adjacentNode()

static snode * adjacentNode ( sgraph g,
sedge e,
snode n 
)
static

Definition at line 134 of file sgraph.c.

References snode::index, sgraph::nodes, sedge::v1, and sedge::v2.

Referenced by shortPath().

Here is the caller graph for this function:

◆ createSEdge()

sedge * createSEdge ( sgraph g,
snode v1,
snode v2,
double  wt 
)

Definition at line 84 of file sgraph.c.

References addEdgeToNode(), sedge::cnt, sgraph::edges, snode::index, sgraph::nedges, sedge::v1, sedge::v2, and sedge::weight.

Referenced by addLoop(), addNodeEdges(), and createSEdges().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ createSGraph()

sgraph * createSGraph ( int  nnodes)

Definition at line 57 of file sgraph.c.

References gv_alloc(), gv_calloc(), sgraph::nnodes, and sgraph::nodes.

Referenced by mkMazeGraph().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ createSNode()

snode * createSNode ( sgraph g)

Definition at line 68 of file sgraph.c.

References snode::index, sgraph::nnodes, and sgraph::nodes.

Referenced by findSVert().

Here is the caller graph for this function:

◆ freeSGraph()

void freeSGraph ( sgraph g)

Definition at line 102 of file sgraph.c.

References snode::adj_edge_list, sgraph::edges, free(), and sgraph::nodes.

Referenced by freeMaze().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gsave()

void gsave ( sgraph G)

Definition at line 19 of file sgraph.c.

References G.

Referenced by mkMazeGraph().

Here is the caller graph for this function:

◆ initSEdges()

void initSEdges ( sgraph g,
int  maxdeg 
)

Definition at line 41 of file sgraph.c.

References snode::adj_edge_list, sgraph::edges, gv_calloc(), sgraph::nnodes, and sgraph::nodes.

Referenced by mkMazeGraph().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reset()

void reset ( sgraph G)

Definition at line 29 of file sgraph.c.

References G.

Referenced by fdp_tLayout(), flat_edges(), and orthoEdges().

Here is the caller graph for this function:

◆ shortPath()

int shortPath ( sgraph g,
snode from,
snode to 
)

Definition at line 143 of file sgraph.c.

References snode::adj_edge_list, adjacentNode(), E_WT, sgraph::edges, snode::index, snode::n_adj, N_DAD, N_EDGE, N_VAL, sgraph::nnodes, sgraph::nodes, NULL, PQ_insert(), PQinit(), PQremove(), PQupdate(), and UNSEEN.

Referenced by orthoEdges().

Here is the call graph for this function:
Here is the caller graph for this function: