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 #ifndef _DEFS_H_
00022 #define _DEFS_H_
00023
00024 #include "neato.h"
00025
00026 #ifdef __cplusplus
00027 enum Style { regular, invisible };
00028 struct vtx_data {
00029 int nedges;
00030 int *edges;
00031 float *ewgts;
00032 Style *styles;
00033 float *edists;
00034 };
00035
00036 typedef int DistType;
00037
00038 inline double max(double x, double y) {
00039 if (x >= y)
00040 return x;
00041 else
00042 return y;
00043 } inline double min(double x, double y) {
00044 if (x <= y)
00045 return x;
00046 else
00047 return y;
00048 }
00049
00050 inline int max(int x, int y) {
00051 if (x >= y)
00052 return x;
00053 else
00054 return y;
00055 }
00056
00057 inline int min(int x, int y) {
00058 if (x <= y)
00059 return x;
00060 else
00061 return y;
00062 }
00063
00064 struct Point {
00065 double x;
00066 double y;
00067 int operator==(Point other) {
00068 return x == other.x && y == other.y;
00069 }};
00070 #else
00071 #undef inline
00072 #define inline
00073 #define NOTUSED(var) (void) var
00074
00075 #include <macros.h>
00076
00077 #ifdef USE_STYLES
00078 typedef enum { regular, invisible } Style;
00079 #endif
00080 typedef struct {
00081 int nedges;
00082 int *edges;
00083 float *ewgts;
00084 float *eweights;
00085 node_t *np;
00086 #ifdef USE_STYLES
00087 Style *styles;
00088 #endif
00089 #ifdef DIGCOLA
00090 float *edists;
00091 #endif
00092 } vtx_data;
00093
00094 #ifdef DIGCOLA
00095 #ifdef IPSEPCOLA
00096 typedef struct cluster_data {
00097 int nvars;
00098 int nclusters;
00099 int *clustersizes;
00100 int **clusters;
00101 int ntoplevel;
00102 int *toplevel;
00103 boxf *bb;
00104 } cluster_data;
00105 #endif
00106 #endif
00107
00108 typedef int DistType;
00109
00110 #ifdef UNUSED
00111 typedef struct {
00112 double x;
00113 double y;
00114 } Point;
00115 #endif
00116
00117 #endif
00118
00119 #endif
00120
00121 #ifdef __cplusplus
00122 }
00123 #endif