/***************************************************************************** * score.h *****************************************************************************/ /***************************************************************************** * PAYOFF *****************************************************************************/ typedef struct { int match; int mismatch; int open; int extend; } Payoff; typedef Payoff Align__NW__Payoff; extern Payoff *payoff_new (int match, int mismatch, int open, int extend); extern void payoff_DESTROY(Payoff *pPayoff); /***************************************************************************** * CELL *****************************************************************************/ typedef struct Cell { int row; int col; int score; struct Cell *prev; } Cell; typedef Cell Align__NW__Cell; extern int cell_row (Cell *pCell); extern int cell_col (Cell *pCell); extern int cell_score(Cell *pCell); extern Cell *cell_prev (Cell *pCell); /***************************************************************************** * MATRIX *****************************************************************************/ typedef struct { Payoff payoff; char *pszA; char *pszB; int nRows; int nCols; Cell **ppCell; } Matrix; typedef Matrix Align__NW__Matrix; extern Matrix *matrix_new (char *pszA, char *pszB, Payoff *pPayoff); extern void matrix_DESTROY(Matrix *pMatrix); extern void matrix_score (Matrix *pMatrix); extern void matrix_dump (Matrix *pMatrix); extern Cell *matrix_cell (Matrix *pMatrix, int nRow, int nCol);