Graphviz  2.31.20130525.0447
Data Structures | Defines | Typedefs | Functions
lib/neatogen/dijkstra.c File Reference
#include "bfs.h"
#include "dijkstra.h"
#include <limits.h>
#include <stdlib.h>
Include dependency graph for dijkstra.c:

Go to the source code of this file.

Data Structures

struct  heap

Defines

#define MAX_DIST   (double)INT_MAX
#define LOOP   while(TRUE)
#define left(i)   (2*(i))
#define right(i)   (2*(i)+1)
#define parent(i)   ((i)/2)
#define insideHeap(h, i)   ((i)<h->heapSize)
#define greaterPriority(h, i, j, dist)   (dist[h->data[i]]<dist[h->data[j]])
#define assign(h, i, j, index)   {h->data[i]=h->data[j]; index[h->data[i]]=i;}
#define exchange(h, i, j, index)

Typedefs

typedef DistType Word

Functions

void dijkstra (int vertex, vtx_data *graph, int n, DistType *dist)
int dijkstra_bounded (int vertex, vtx_data *graph, int n, DistType *dist, int bound, int *visited_nodes)
void dijkstra_f (int vertex, vtx_data *graph, int n, float *dist)

Define Documentation

#define assign (   h,
  i,
  j,
  index 
)    {h->data[i]=h->data[j]; index[h->data[i]]=i;}

Definition at line 45 of file dijkstra.c.

#define exchange (   h,
  i,
  j,
  index 
)
Value:
{int temp; \
                temp=h->data[i]; \
                h->data[i]=h->data[j]; \
                h->data[j]=temp; \
                index[h->data[i]]=i; \
                index[h->data[j]]=j; \
}

Definition at line 46 of file dijkstra.c.

#define greaterPriority (   h,
  i,
  j,
  dist 
)    (dist[h->data[i]]<dist[h->data[j]])

Definition at line 44 of file dijkstra.c.

#define insideHeap (   h,
 
)    ((i)<h->heapSize)

Definition at line 43 of file dijkstra.c.

#define left (   i)    (2*(i))

Definition at line 40 of file dijkstra.c.

#define LOOP   while(TRUE)

Definition at line 34 of file dijkstra.c.

#define MAX_DIST   (double)INT_MAX

Definition at line 30 of file dijkstra.c.

Referenced by dijkstra(), and dijkstra_bounded().

#define parent (   i)    ((i)/2)

Definition at line 42 of file dijkstra.c.

#define right (   i)    (2*(i)+1)

Definition at line 41 of file dijkstra.c.


Typedef Documentation

typedef DistType Word

Definition at line 32 of file dijkstra.c.


Function Documentation

void dijkstra ( int  vertex,
vtx_data graph,
int  n,
DistType dist 
)

Definition at line 155 of file dijkstra.c.

References INT_MAX, realloc(), MAX_DIST, vtx_data::nedges, vtx_data::ewgts, and vtx_data::edges.

Referenced by embed_graph().

int dijkstra_bounded ( int  vertex,
vtx_data graph,
int  n,
DistType dist,
int  bound,
int *  visited_nodes 
)
void dijkstra_f ( int  vertex,
vtx_data graph,
int  n,
float *  dist 
)

Definition at line 360 of file dijkstra.c.

References N_GNEW, MAXFLOAT, vtx_data::nedges, vtx_data::edges, and free().