public class HMatrix extends Object
Constructor and Description |
---|
HMatrix(int distance,
int maxLength)
Allocates memory and initializes matrix (constructor).
|
Modifier and Type | Method and Description |
---|---|
int |
get(int i,
int j)
Provide an item of hMatrix indexed by indices.
|
void |
set(int i,
int j,
int val)
Set an item in hMatrix.
|
public HMatrix(int distance, int maxLength)
distance
- (int) max edit distance allowed for
candidates;maxLength
- (int) max length of words.public int get(int i, int j)
i
- - (int) row number;j
- - (int) column number.+---------------------+ 0 |#####################| j=i-e-1 1 | | j=i-e : : e+1 | | j=i-1 +---------------------+ e+2 | | j=i +---------------------+ e+3 | | j=i+1 : : 2e+2| | j=i+e 2e+3|#####################| j=i+e+1 +---------------------+
public void set(int i, int j, int val)
i
- - (int) row number;j
- - (int) column number;val
- - (int) value to put there.Copyright © 2015. All rights reserved.