Class MemoryCoOccurrenceFrequencyMatrix

    • Field Detail

      • dimension

        private final int dimension
        will be initialized in constructor and never changed
      • numValues

        private int numValues
        total number of values, equals dimension * dimension and data.length
      • data

        private double[] data
        co occurrence frequency values
    • Constructor Detail

      • MemoryCoOccurrenceFrequencyMatrix

        public 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). Dimension should be number of colors in palette.
        Throws:
        IllegalArgumentException - if dimension is smaller than 1
    • Method Detail

      • clear

        public void clear()
        Sets all values of this matrix to zero.
      • getDimension

        public int getDimension()
        Description copied from interface: CoOccurrenceFrequencyMatrix
        Returns the dimension of this matrix.
      • getValue

        public double getValue​(int i,
                               int j)
                        throws IllegalArgumentException
        Returns the value of this matrix at row j, column i. Both arguments are zero-based, so make sure that 0 <= i, j < getDimension(). Other values will raise an IllegalArgumentException.
        Throws:
        IllegalArgumentException
      • setValue

        public void setValue​(int i,
                             int j,
                             double newValue)
                      throws IllegalArgumentException
        Sets value at row j, column i to newValue. Both arguments are zero-based, so make sure that 0 <= i, j < getDimension(). Other values will raise an IllegalArgumentException.
        Throws:
        IllegalArgumentException