CoOccurrenceFrequencyMatrix
public class MemoryCoOccurrenceFrequencyMatrix extends BaseCoOccurrenceFrequencyMatrix
CoOccurrenceFrequencyMatrix
interface by using a large array
of values in memory.Modifier and Type | Field | Description |
---|---|---|
private double[] |
data |
co occurrence frequency values
|
private int |
dimension |
will be initialized in constructor and never changed
|
private int |
numValues |
total number of values, equals dimension * dimension and data.length
|
Constructor | Description |
---|---|
MemoryCoOccurrenceFrequencyMatrix(int dimension) |
Creates a co-occurrence frequency matrix of given dimension;
allocates dimension times dimension double values for
internal array;
does not call clear() to set everything to zero, must be
done by user (or automatically in init).
|
Modifier and Type | Method | Description |
---|---|---|
void |
clear() |
Sets all values of this matrix to zero.
|
int |
getDimension() |
Returns the dimension of this matrix.
|
double |
getValue(int i) |
Returns the value of this matrix at row i, column i.
|
double |
getValue(int i,
int j) |
Returns the value of this matrix at row j, column i.
|
void |
setValue(int i,
int j,
double newValue) |
Sets value at row j, column i to newValue.
|
computeStatistics, getMean, getScofMean, getScofStddev, getScofSum, getStddev
private final int dimension
private int numValues
private double[] data
public MemoryCoOccurrenceFrequencyMatrix(int dimension)
IllegalArgumentException
- if dimension is smaller than 1public void clear()
public int getDimension()
CoOccurrenceFrequencyMatrix
public double getValue(int i) throws IllegalArgumentException
i
- index into the matrix, must be larger than or equal to 0 and smaller than CoOccurrenceFrequencyMatrix.getDimension()
IllegalArgumentException
public double getValue(int i, int j) throws IllegalArgumentException
IllegalArgumentException
public void setValue(int i, int j, double newValue) throws IllegalArgumentException
IllegalArgumentException