|
JIU 0.14.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.jiu.color.data.MemoryCoOccurrenceMatrix
public class MemoryCoOccurrenceMatrix
This class stores a co-occurrence matrix, a two-dimensional array of int counters. The dimension is given to the constructor which allocates a corresponding array.
Constructor Summary | |
---|---|
MemoryCoOccurrenceMatrix(int dimension)
Creates a new matrix that stores dimension times dimension int values in memory. |
Method Summary | |
---|---|
void |
clear()
Sets all counters to zero. |
int |
getDimension()
Returns the dimension of this matrix. |
int |
getValue(int i,
int j)
Returns the matrix value at a given position. |
void |
incValue(int i,
int j)
Increases the counter for pair (i, j) by one. |
void |
setValue(int i,
int j,
int newValue)
Sets the counter for pair (i, j) to a new value. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MemoryCoOccurrenceMatrix(int dimension)
dimension
- the matrix' dimension, which is both the number of rows and columnsMethod Detail |
---|
public void clear()
CoOccurrenceMatrix
clear
in interface CoOccurrenceMatrix
public int getDimension()
CoOccurrenceMatrix
getDimension
in interface CoOccurrenceMatrix
public int getValue(int i, int j)
CoOccurrenceMatrix
getValue
in interface CoOccurrenceMatrix
i
- column index, from 0 to CoOccurrenceMatrix.getDimension()
- 1j
- row index, from 0 to CoOccurrenceMatrix.getDimension()
- 1public void incValue(int i, int j) throws IllegalArgumentException
CoOccurrenceMatrix
setValue(i, j, getValue(i, j) + 1);
.
incValue
in interface CoOccurrenceMatrix
i
- column index, from 0 to CoOccurrenceMatrix.getDimension()
- 1j
- row index, from 0 to CoOccurrenceMatrix.getDimension()
- 1
IllegalArgumentException
- for invalid index pairs (i, j)public void setValue(int i, int j, int newValue)
CoOccurrenceMatrix
setValue
in interface CoOccurrenceMatrix
i
- column index, from 0 to CoOccurrenceMatrix.getDimension()
- 1j
- row index, from 0 to CoOccurrenceMatrix.getDimension()
- 1
|
JIU 0.14.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |