public class MemoryCoOccurrenceFrequencyMatrix extends BaseCoOccurrenceFrequencyMatrix
CoOccurrenceFrequencyMatrix
interface by using a large array
of values in memory.Modifier and Type | Field and 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 and 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 and 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)
java.lang.IllegalArgumentException
- if dimension is smaller than 1public void clear()
public int getDimension()
CoOccurrenceFrequencyMatrix
public double getValue(int i) throws java.lang.IllegalArgumentException
i
- index into the matrix, must be larger than or equal to 0 and smaller than CoOccurrenceFrequencyMatrix.getDimension()
java.lang.IllegalArgumentException
public double getValue(int i, int j) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public void setValue(int i, int j, double newValue) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException