Sorting/Longs/dot.h File Reference

Define interface for accessing API to generate sorting DOT graphs. Enable DOT graphs (http://www.graphviz.org) to be generatd from the invocation of specially crafted sort routines. This code is used to show the progress of MedianSort and QuickSort in the book. More...

Go to the source code of this file.

Classes

struct  df
 Core data structure to store all formatting information for the individual vertices for the graph being constructed. More...

Defines

#define GRAY   1
 Determines a vertex is to be colored gray.
#define BLACK   2
 Determines a vertex is to be colored black with white font.

Typedefs

typedef df DOT_FORMAT
 Core data structure to store all formatting information for the individual vertices for the graph being constructed.
typedef dfDOT_FORMAT_PTR
 Core data structure to store all formatting information for the individual vertices for the graph being constructed.

Functions

void dot_header (char *s)
 Output the header of the graph.
void dot_trailer ()
 Output the trailer of the graph.
void dot_release (DOT_FORMAT_PTR df)
 Free associated memory for the formatting information.
DOT_FORMAT_PTR dot_format_type (int id, int type)
 Construct a format node for the given vertex identifier and type information.
DOT_FORMAT_PTR dot_format_list ()
 Construct a raw format node.
int dot_format_td (int i, DOT_FORMAT_PTR fp)
 Process format node and output bgcolor information for

tag as appropriate.

int dot_format_font (int i, DOT_FORMAT_PTR fp)
 Process format node and output font color information for

tag as appropriate.

void dot_add_format (DOT_FORMAT_PTR fp, DOT_FORMAT_PTR n)
 Add the designated format information n to the end of the information pointed to by fp.
void dot_nodeid (int id)
 Output the node identified by unique identifier 'id'.
void dot_node (long *ar, int id, int left, int right, DOT_FORMAT_PTR fmt)
 Output a sub-array of ar[left,right] to appear as node 'id' using the designated format information.
void dot_add_edge (int id, int id2)
 Add to the graph a directed edge of the form id -> id2.
void dot_add_undir_edge (int id, int id2)
 Add to the graph an undirected edge of the form id -- id2.


Detailed Description

Define interface for accessing API to generate sorting DOT graphs. Enable DOT graphs (http://www.graphviz.org) to be generatd from the invocation of specially crafted sort routines. This code is used to show the progress of MedianSort and QuickSort in the book.

Author:
George Heineman
Date:
6/15/08

Define Documentation

#define BLACK   2

Determines a vertex is to be colored black with white font.

#define GRAY   1

Determines a vertex is to be colored gray.


Typedef Documentation

typedef struct df DOT_FORMAT

Core data structure to store all formatting information for the individual vertices for the graph being constructed.

typedef struct df * DOT_FORMAT_PTR

Core data structure to store all formatting information for the individual vertices for the graph being constructed.


Function Documentation

void dot_add_edge ( int  id,
int  id2 
)

Add to the graph a directed edge of the form id -> id2.

void dot_add_format ( DOT_FORMAT_PTR  fp,
DOT_FORMAT_PTR  n 
)

Add the designated format information n to the end of the information pointed to by fp.

void dot_add_undir_edge ( int  id,
int  id2 
)

Add to the graph an undirected edge of the form id -- id2.

int dot_format_font ( int  i,
DOT_FORMAT_PTR  fp 
)

Process format node and output font color information for

tag as appropriate.

DOT_FORMAT_PTR dot_format_list (  ) 

Construct a raw format node.

int dot_format_td ( int  i,
DOT_FORMAT_PTR  fp 
)

Process format node and output bgcolor information for

tag as appropriate.

DOT_FORMAT_PTR dot_format_type ( int  id,
int  type 
)

Construct a format node for the given vertex identifier and type information.

void dot_header ( char *  s  ) 

Output the header of the graph.

void dot_node ( long *  ar,
int  id,
int  left,
int  right,
DOT_FORMAT_PTR  fmt 
)

Output a sub-array of ar[left,right] to appear as node 'id' using the designated format information.

This is a powerful API function.

void dot_nodeid ( int  id  ) 

Output the node identified by unique identifier 'id'.

void dot_release ( DOT_FORMAT_PTR  df  ) 

Free associated memory for the formatting information.

void dot_trailer (  ) 

Output the trailer of the graph.

Algorithm Development Kit 1.0