annotate rDiff/src/locfit/Source/lfstruc.h @ 2:233c30f91d66

updated python based GFF parsing module which will handle GTF/GFF/GFF3 file types
author vipints <vipin@cbio.mskcc.org>
date Tue, 08 Oct 2013 07:15:44 -0400
parents 0f80a5141704
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
1 /*
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
2 * Structures, typedefs etc used in Locfit
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
3 */
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
4
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
5 typedef struct {
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
6 double *wk, *coef, *xbar, *f;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
7 jacobian xtwx;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
8 int lwk, haspc;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
9 } paramcomp;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
10 #define haspc(pc) ((pc)->haspc)
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
11
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
12 typedef struct {
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
13 double *x[MXDIM];
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
14 double *y;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
15 double *w;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
16 double *b;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
17 double *c;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
18 double sca[MXDIM];
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
19 double xl[2*MXDIM];
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
20 int n, d, ord;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
21 int sty[MXDIM];
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
22 varname yname, xname[MXDIM], wname, bname, cname;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
23 } lfdata;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
24 #define resp(lfd,i) (((lfd)->y==NULL) ? 0.0 : (lfd)->y[i])
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
25 #define base(lfd,i) (((lfd)->b==NULL) ? 0.0 : (lfd)->b[i])
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
26 #define prwt(lfd,i) (((lfd)->w==NULL) ? 1.0 : (lfd)->w[i])
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
27 #define cens(lfd,i) (((lfd)->c==NULL) ? 0 : (int)(lfd)->c[i])
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
28 #define datum(lfd,i,j) ((lfd)->x[i][j])
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
29 #define dvari(lfd,i) ((lfd)->x[i])
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
30
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
31 typedef struct {
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
32 int deflink, canlink, quasi, robust;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
33 int (*vallink)(), (*family)(), (*initial)(), (*like)(), (*pcheck)();
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
34 } family;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
35 #define isquasi(fam) ((fam)->quasi)
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
36 #define isrobust(fam) ((fam)->robust)
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
37 extern int inllmix; /* flag needed to ensure correct behavior in llmix. */
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
38
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
39 typedef struct {
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
40 double nn, fixh, adpen;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
41 int ker, kt;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
42 int deg, deg0, p;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
43 int acri;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
44 int fam, lin;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
45 family fami;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
46 int ubas;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
47 double (*vb)();
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
48 void (*vbasis)();
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
49 } smpar;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
50 #define nn(sp) ((sp)->nn)
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
51 #define fixh(sp) ((sp)->fixh)
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
52 #define pen(sp) ((sp)->adpen)
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
53 #define ker(sp) ((sp)->ker)
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
54 #define kt(sp) ((sp)->kt)
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
55 #define deg(sp) ((sp)->deg)
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
56 #define deg0(sp) ((sp)->deg0)
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
57 #define npar(sp) ((sp)->p)
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
58 #define acri(sp) ((sp)->acri)
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
59 #define ubas(sp) ((sp)->ubas)
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
60 #define fam(sp) ((sp)->fam)
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
61 #define fami(sp) (&(sp)->fami)
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
62 #define link(sp) ((sp)->lin)
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
63
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
64 typedef struct {
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
65 int deriv[MXDEG+2];
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
66 int nd;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
67 } deriv;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
68
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
69 typedef struct {
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
70 int ev;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
71 double *sv;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
72 double cut;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
73 double fl[2*MXDIM];
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
74 Sint *iwk, *ce, *s, *lo, *hi;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
75 int liw, nce, ncm, maxk;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
76 int mg[MXDIM];
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
77 void (*espec)();
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
78 } evstruc;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
79 #define ev(evs) ((evs)->ev)
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
80 #define cut(evs) ((evs)->cut)
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
81 #define mk(evs) ((evs)->maxk)
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
82 #define mg(evs) ((evs)->mg)
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
83
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
84 typedef struct {
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
85 double *xev, *coef, *nlx, *t0, *lik, *h, *deg, *kap;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
86 int lev, lwk;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
87 int d, dcor, geth, hasd;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
88 int nv, nvm;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
89 } fitpt;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
90 #define evp(fp) ((fp)->xev)
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
91 #define evpt(fp,i) (&(fp)->xev[(i)*(fp)->d])
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
92 #define evptx(fp,i,k) ((fp)->xev[(i)*(fp)->d+(k)])
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
93 #define llk(fp) ((fp)->kap[0])
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
94 #define df0(fp) ((fp)->kap[1])
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
95 #define df1(fp) ((fp)->kap[2])
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
96 #define rv(fp) ((fp)->kap[3])
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
97 #define rsc(fp) ((fp)->kap[5])
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
98 #define dc(fp) ((fp)->dcor)
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
99 #define geth(fp) ((fp)->geth)
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
100
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
101 typedef struct {
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
102 int (*procv)(), keepv, keepc, nopc, isset;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
103 void (*alloc)(), (*pp)();
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
104 } module;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
105
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
106 typedef struct {
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
107 int lf_init_id;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
108 lfdata lfd;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
109 smpar sp;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
110 evstruc evs;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
111 fitpt fp;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
112 deriv dv;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
113 paramcomp pc;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
114 module mdl;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
115 } lfit;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
116 #define LF_INIT_ID 34897239