/[paths]/src/graph.h
ViewVC logotype

Contents of /src/graph.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6 - (show annotations)
Tue Jul 24 21:47:59 2012 UTC (7 years, 2 months ago) by ben
File MIME type: text/plain
File size: 707 byte(s)
make simple graph test compilable

1 #ifndef GRAPH_H
2 #define GRAPH_H
3 struct event {
4 int pitch;
5 int duration;
6 int attack;
7 int decay;
8 int sustain;
9 int release;
10 int instrument;
11 int modulation;
12 int detune;
13 int velocity;
14 int volume;
15 };
16
17 struct node;
18
19 struct edge {
20 struct node *to;
21 int distance;
22 };
23
24 struct node {
25 struct event event;
26 int wheight;
27 struct edge *neighbours;
28 int count;
29 };
30
31 struct graph {
32 struct node* nodes;
33 int count;
34 };
35
36 void node_destroy(struct node* n);
37
38 void node_radomize(struct node* n);
39
40 void edge_randomize(struct edge* e);
41
42 int node_link(struct node* a, struct node* b, int d);
43
44 int node_unlink(struct node* a, struct node* b);
45
46 struct graph* graph_new(int n);
47
48 int graph_randomize(struct graph*);
49
50 #endif

  ViewVC Help
Powered by ViewVC 1.1.26