/* header file for sub.c */ #define DIGIT 10.0 #define MININT -999999 #define TRUE 1 #define FALSE 0 #define max(x,y) ((x) >= (y) ? (x) : (y)) char *AA, *BB; long (*w)[128]; /* w = W */ long g, h, m; /* g = G, h = H, m = g+h */ long opt; /* optimum score */ long cut; /* cutoff score */ int total_grid_pts; /* total grid points in all subproblems */ #define gap(k) ((k) <= 0 ? 0 : g+h*(k)) /* k-symbol indel cost */ int *sapp; /* Current script append ptr */ int last; /* Last script op appended */ /* Append "Delete k" op */ #define DEL(k) \ { if (last < 0) \ last = sapp[-1] -= (k); \ else \ last = *sapp++ = -(k); \ } /* Append "Insert k" op */ #define INS(k) \ { if (last > 0) \ last = sapp[-1] += (k); \ else \ last = *sapp++ = (k); \ } #define REP { last = *sapp++ = 0; } /* Append "Replace" op */ /* Define the structure for the DAG containing all suboptimal gridpoints. */ /* Here we store all suboptimal gridpoints in their corresponding column in increasing row order. A DAG is constructed based on F. */ typedef struct NODE { int i; /* position in column */ int j; /* position in row */ long c; /* Forward C value */ long d; /* Forward D value */ long e; /* Forward E value */ long r; /* Backward R value */ long s; /* Backward S value */ long t; /* Backward T value */ struct NODE *link; /* next suboptimal node in the same column I* */ struct NODE *blink; /* previous suboptimal node in the same column I* */ struct NODE *clink; /* pointer to next c node */ struct NODE *dlink; /* pointer to next d node */ struct NODE *elink; /* pointer to next e node */ int state; /* current state in pattern matching machine */ int cs; /* best backward pattern score at c node */ int ds; /* best backward pattern score at d node */ int es; /* best backward pattern score at e node */ struct NODE *cnext; /* pointer to next best c node */ struct NODE *dnext; /* pointer to next best d node */ struct NODE *enext; /* pointer to next best e node */ int cbs; /* backward score with best pattern score */ int dbs; /* backward score with best pattern score */ int ebs; /* backward score with best pattern score */ int pat_no; /* jump with a pattern */ } NODE; NODE **F; NODE **LastF; int ALL_SUB();