00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
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
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