/misc/src/release/graphviz-2.18-1/src/graphviz-2.18/lib/neatogen/kkutils.h

Go to the documentation of this file.
00001 /* $Id: kkutils.h,v 1.2 2005/07/13 20:29:40 erg Exp $ $Revision: 1.2 $ */
00002 /* vim:set shiftwidth=4 ts=8: */
00003 
00004 /**********************************************************
00005 *      This software is part of the graphviz package      *
00006 *                http://www.graphviz.org/                 *
00007 *                                                         *
00008 *            Copyright (c) 1994-2004 AT&T Corp.           *
00009 *                and is licensed under the                *
00010 *            Common Public License, Version 1.0           *
00011 *                      by AT&T Corp.                      *
00012 *                                                         *
00013 *        Information and Software Systems Research        *
00014 *              AT&T Research, Florham Park NJ             *
00015 **********************************************************/
00016 
00017 #ifdef __cplusplus
00018 extern "C" {
00019 #endif
00020 
00021 
00022 
00023 #ifndef KKUTILS_H_
00024 #define KKUTILS_H_
00025 
00026 #include "defs.h"
00027 
00028 #ifdef __cplusplus
00029 
00030     inline double distance_kD(double **coords, int dim, int i, int j) {
00031         /* compute a k-D Euclidean distance between 'coords[*][i]' and 'coords[*][j]' */
00032         double sum = 0;
00033         for (int k = 0; k < dim; k++) {
00034             sum +=
00035                 (coords[k][i] - coords[k][j]) * (coords[k][i] -
00036                                                  coords[k][j]);
00037         } return sqrt(sum);
00038     }
00039     void compute_apsp(vtx_data * graph, int n, DistType ** (&Dij));
00040     void compute_apsp_artifical_weights(vtx_data * graph, int n,
00041                                         DistType ** (&Dij));
00042 
00043     void quicksort_place(double *place, int *ordering, int first, int last);
00044     void free_graph(vtx_data * (&graph));
00045 #else
00046     extern void fill_neighbors_vec_unweighted(vtx_data *, int vtx,
00047                                               int *vtx_vec);
00048     extern int common_neighbors(vtx_data *, int v, int u, int *);
00049     extern void empty_neighbors_vec(vtx_data * graph, int vtx,
00050                                     int *vtx_vec);
00051     extern DistType **compute_apsp(vtx_data *, int);
00052     extern DistType **compute_apsp_artifical_weights(vtx_data *, int);
00053     extern double distance_kD(double **, int, int, int);
00054     extern void quicksort_place(double *, int *, int, int);
00055     extern void quicksort_placef(float *, int *, int, int);
00056     extern void compute_new_weights(vtx_data * graph, int n);
00057     extern void restore_old_weights(vtx_data * graph, int n,
00058                                     float *old_weights);
00059 #endif
00060 
00061 #endif
00062 
00063 #ifdef __cplusplus
00064 }
00065 #endif

Generated on Mon Mar 31 19:03:27 2008 for Graphviz by  doxygen 1.5.1