| 1 | #ifndef SPINEHDR_T | 
| 2 | #define SPINEHDR_T | 
| 3 |  | 
| 4 | /* | 
| 5 | #include <stdlib.h> | 
| 6 | #include <math.h> | 
| 7 | #include <subset.h> | 
| 8 | #include <assert.h> | 
| 9 | */ | 
| 10 | #include <spine.h> | 
| 11 |  | 
| 12 | #define N_NEW(n,t)       (t*)mcalloc((n),sizeof(t)) | 
| 13 | #define NEW(t)       (t*)mcalloc((1),sizeof(t)) | 
| 14 |  | 
| 15 | extern void *mcalloc(size_t nmemb, size_t size); | 
| 16 |  | 
| 17 | #define NOTUSED(var)     (void) var | 
| 18 |  | 
| 19 | typedef struct { | 
| 20 | 	Agrec_t h; | 
| 21 | 	int id; | 
| 22 | 	int deg; | 
| 23 | 	int UF_size; | 
| 24 | 	Agnode_t *UF_parent; | 
| 25 | } nodeinfo_t; | 
| 26 |  | 
| 27 | typedef struct { | 
| 28 | 	Agrec_t h; | 
| 29 | 	float weight; | 
| 30 | 	int id; | 
| 31 | } edgeinfo_t; | 
| 32 |  | 
| 33 | #define ED_wt(e) (((edgeinfo_t*)AGDATA(e))->weight) | 
| 34 | #define ED_id(e) (((edgeinfo_t*)AGDATA(e))->id) | 
| 35 | #define ND_id(n) (((nodeinfo_t*)AGDATA(n))->id) | 
| 36 | #define ND_deg(n) (((nodeinfo_t*)AGDATA(n))->deg) | 
| 37 | #define ND_UF_parent(n) (((nodeinfo_t*)AGDATA(n))->UF_parent) | 
| 38 | #define ND_UF_size(n) (((nodeinfo_t*)AGDATA(n))->UF_size) | 
| 39 |  | 
| 40 | #endif | 
| 41 |  |