Sorting/Longs/dot.c File Reference

Implementation of interface to DOT for sorting 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...

#include <malloc.h>
#include <stdio.h>
#include "dot.h"

Functions

DOT_FORMAT_PTR dot_format_list ()
 Construct a raw format node.
DOT_FORMAT_PTR dot_format_type (int id, int i)
 Construct a format node for the given vertex identifier and type information.
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_release (DOT_FORMAT_PTR dp)
 Free associated memory for the formatting information.
void dot_header (char *s)
 Output the header of the graph.
int dot_format_font (int i, DOT_FORMAT_PTR fp)
 Process format node and output font color information for

tag as appropriate.

int dot_format_td (int i, DOT_FORMAT_PTR fp)
 Process format node and output bgcolor information for

tag as appropriate.

void dot_trailer ()
 Output the trailer of the graph.
void dot_nodeid (int id)
 Output the node identified by unique identifier 'id'.
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.
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.


Detailed Description

Implementation of interface to DOT for sorting 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

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  i 
)

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  dp  ) 

Free associated memory for the formatting information.

void dot_trailer (  ) 

Output the trailer of the graph.

Algorithm Development Kit 1.0