JPRED-2 Add sources of all binaries (except alscript) to Git
[jpred.git] / sources / oc / oc.h
1 /* Include file of definitions for program oc (o.c). */
2
3 #define val_A_B(arr,n,i,j) arr[i][j-i-1]
4
5 /* structure to hold cluster details
6 Note:   Normally, parentA and parentB point to pre-existing
7         clusters stored above them in the array of clusters.
8         However, 
9         If the cluster is a single entity, then parentA and parentB
10         are set to NULL.
11         If one or more of the parents are single entites, then
12         the storage for the entites is malloc'd independently
13         of the master cluster array.
14 */
15
16 struct sc{
17         double score;   /* score for this cluster */
18         int n;          /* number of entitites in this cluster */
19         int *members;   /* entities - this is redundant but speeds code */
20         struct sc *parentA; /* one parent of this cluster */
21         struct sc *parentB; /* the other parent */
22         char lab;           /* lable set this to 1 normally.  0 if the cluster has been processed */
23 };
24
25 double **read_up_diag(FILE *infile, int n);
26 char   **read_idents(FILE *infile, int n);
27 void write_up_diag(FILE *infile, double **ret_val,int n);
28 void show_entity(struct sc *entity,FILE *out);
29 void show_inx_entity(struct sc *entity,int *inx,FILE *out);
30 struct sc *make_entity(int i,double base_val);
31 /* double val_A_B(double **arr,int n,int i,int j);*/
32 double val_Grp_B(
33         double **arr,   /* upper diagonal array */
34         int n,          /* side of array */
35         int *grpA,      /* array containing entities of group */
36         int ng,         /* number of members in grpA */
37         int j,          /* entity to compare to grpA */
38         int choice      /* see above */
39 );
40 double val_Grp_Grp(
41         double **arr,   /* upper diagonal array */
42         int n,          /* side of array */
43         int *grpA,      /* array containing entities of group */
44         int ngA,        /* number of members in grpA */
45         int *grpB,      /* array containing entities of group B*/
46         int ngB,        /* number of members in grpB */
47         int choice      /* see above */
48 );
49 void remove_unclust(int *unclust,int *nunclust,int val);
50 void iprintarr(int *arr,int n,FILE *out);
51 int no_share(
52             int *grpA,
53             int ngA,
54             int *grpB,
55             int ngb
56 );
57 void add_notparent(int *np,int *n,int A);
58 void remove_notparent(int *np,int *n,int A);
59 void sub_notparent(int *np,int *n,int A,int B);         
60 double **GJDudarr(int n);
61 void draw_dendrogram(FILE *fout,
62                      struct sc *clust,
63                      char **idents,
64                      int *inx,
65                      int n,
66                      int sim);
67
68 double get_mean(int *arr,int *inx,int n);
69 void draw_arch(FILE *fout,
70                float x1,
71                float x2,
72                float x3,
73                float y1,
74                float y2);
75
76 double trans_y(double X,
77                double Xmin,
78                double Xmax,
79                double Xrange,
80                float Twidth,
81                float Xoffset);
82
83 double trans_x(double x,
84                int sim,
85                double Xmin,
86                double Xmax,
87                double Xrange,
88                float Twidth,
89                float Xoffset);
90 void PSPutText(float x,float y,char *text,FILE *outf);
91 void show_id_entity(struct sc *entity,char **id,FILE *out);
92
93 void mark_parents(struct sc *entity);
94 void write_unclustered(struct sc *entity,char **idents,FILE *fout);
95 void up_diag_log(double **arr,int n);
96 void print_amps_cluster(struct sc *entity,int *inx,FILE *fp);
97
98
99
100
101
102
103
104