blob: cd8084c2c25f649eb9daa488d4b21228e69713aa (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
|
/* $Id: defs.h,v 1.5 2005/10/18 18:42:59 ellson Exp $ $Revision: 1.5 $ */
/* vim:set shiftwidth=4 ts=8: */
/**********************************************************
* This software is part of the graphviz package *
* http://www.graphviz.org/ *
* *
* Copyright (c) 1994-2004 AT&T Corp. *
* and is licensed under the *
* Common Public License, Version 1.0 *
* by AT&T Corp. *
* *
* Information and Software Systems Research *
* AT&T Research, Florham Park NJ *
**********************************************************/
#ifdef __cplusplus
extern "C" {
#endif
#ifndef _DEFS_H_
#define _DEFS_H_
#include "neato.h"
#ifdef __cplusplus
enum Style { regular, invisible };
struct vtx_data {
int nedges;
int *edges;
float *ewgts;
Style *styles;
float *edists; /* directed dist reflecting the direction of the edge */
};
struct cluster_data {
int nvars; /* total count of vars in clusters */
int nclusters; /* number of clusters */
int *clustersizes; /* number of vars in each cluster */
int **clusters; /* list of var indices for constituents of each c */
int ntoplevel; /* number of nodes not in any cluster */
int *toplevel; /* array of nodes not in any cluster */
boxf *bb; /* bounding box of each cluster */
};
typedef int DistType; /* must be signed!! */
inline double max(double x, double y) {
if (x >= y)
return x;
else
return y;
} inline double min(double x, double y) {
if (x <= y)
return x;
else
return y;
}
inline int max(int x, int y) {
if (x >= y)
return x;
else
return y;
}
inline int min(int x, int y) {
if (x <= y)
return x;
else
return y;
}
struct Point {
double x;
double y;
int operator==(Point other) {
return x == other.x && y == other.y;
}};
#else
#undef inline
#define inline
#define NOTUSED(var) (void) var
#include <macros.h>
extern void *gmalloc(size_t);
#define DIGCOLA 1
#ifdef USE_STYLES
typedef enum { regular, invisible } Style;
#endif
typedef struct {
int nedges; /* no. of neighbors, including self */
int *edges; /* edges[0..(nedges-1)] are neighbors; edges[0] is self */
float *ewgts; /* preferred edge lengths */
float *eweights; /* edge weights */
node_t *np; /* original node */
#ifdef USE_STYLES
Style *styles;
#endif
#ifdef DIGCOLA
float *edists; /* directed dist reflecting the direction of the edge */
#endif
} vtx_data;
typedef struct cluster_data {
int nvars; /* total count of vars in clusters */
int nclusters; /* number of clusters */
int *clustersizes; /* number of vars in each cluster */
int **clusters; /* list of var indices for constituents of each c */
int ntoplevel; /* number of nodes not in any cluster */
int *toplevel; /* array of nodes not in any cluster */
boxf *bb; /* bounding box of each cluster */
} cluster_data;
typedef int DistType; /* must be signed!! */
#ifdef UNUSED
typedef struct {
double x;
double y;
} Point;
#endif
#endif
#endif
#ifdef __cplusplus
}
#endif
|