public class OutMatrix implements Matrix
Implements an interface to the OUT matrix of a block. This class is used by the class CrochemoreLandauZivUkelson and subclasses to enconde the OUT matrix from the input border and DIST matrix of an class AlignmentBlock.
The OUT matrix defined as OUT[i,j] = I[i] + DIST[i,j] where I is the input border array and DIST is the DIST matrix.
The output border of a block is computed from the OUT matrix by taking the maximum value of each column. Note that this class does not compute the OUT matrix, it just stores the necessary information to retrieve a value at any position of the matrix.
It implements the Matrix interface so that the SMAWK algorithm can be used to compute its column maxima.
For more information on how this class is used, please refer to the specification of the CrochemoreLandauZivUkelson and its subclasses.
protected int max_length
The length of the longest sequence (number of characters) being aligned. It needs to be set only once per alignment.
protected int max_score
The maximum absolute score that the current scoring scheme can return. It needs to be set only once per alignment.
protected kotlin.Array[] dist
The DIST matrix of a block.
protected kotlin.Array[] input_border
The input border of a block.
protected int dim
The dimension of the OUT matrix.
protected int lc
The number of columns of the block.
public void init(int max_length,
int max_score)
Initialised this OUT matrix interface. This method needs to be executed only once per alignment.
max_length - the length of the longest sequence (number of characters) being alignedmax_score - the maximum absolute score that the current scoring scheme can returnpublic void setData(kotlin.Array[] dist,
kotlin.Array[] input_border,
int dim,
int lc)
Sets this interface's data to represent an OUT matrix for a block. This method is typically executed once for each block being aligned.
dist - the DIST matrixinput_border - the input borderdim - the dimension of the OUT matrixlc - the number of columns of the blockpublic int valueAt(int row,
int col)
Returns the value at a given position of the matrix. In general it returns the value of DIST[col][row] + input_border[row]. However, special cases occur for its upper right and lower left triangular parts.
row - row indexcol - column indexrow, column col of this OUT matrixpublic int numRows()
Returns the number of rows of this OUT matrix.
public int numColumns()
Returns the number of columns of this OUT matrix.