001    /*
002     * CoOccurrenceFrequencyMatrix
003     * 
004     * Copyright (c) 2001, 2002, 2003 Marco Schmidt.
005     * All rights reserved.
006     */
007    
008    package net.sourceforge.jiu.color.data;
009    
010    /**
011     * An interface for a co-occurrence frequency matrix.
012     * Also provides access to some statistical data.
013     * This class is not a pure data type for it also demands a method {@link #computeStatistics}
014     * which takes the matrix coefficients and computes mean, standard deviation and
015     * other properties from it.
016     * @author Marco Schmidt
017     */
018    public interface CoOccurrenceFrequencyMatrix
019    {
020            /**
021             * Sets all frequency values in this matrix to <code>0.0</code>.
022             */
023            void clear();
024    
025            /**
026             * Computes mean, standard deviation and the sum of those two
027             * so that these values can be queried by the appropriate 
028             * get methods.
029             */
030            void computeStatistics();
031    
032            /**
033             * Returns the sum of mean and standard deviation for all pairs (index, x), with x running from 0 to getDimension() - 1.
034             * The result is equal to {@link #getMean} + {@link #getStddev}
035             */ 
036            double getScofMean();
037    
038            /**
039             * Returns the mean for all pairs (index, i), with i running from 0 to {@link #getDimension()} - 1.
040             */ 
041            double getMean(int index);
042    
043            /**
044             * Returns the standard deviation of the values getValue(index, i)
045             * with i running from 0 to {@link #getDimension()} - 1.
046             * @param index first argument to all calls of getValue used to determine the standard deviation
047             */ 
048            double getStddev(int index);
049    
050            /**
051             * Returns the standard deviation for all pairs (i, i), with i running from 0 to getDimension() - 1.
052             * @return standard deviation for pairs
053             */ 
054            double getScofStddev();
055    
056            double getScofSum();
057    
058            /**
059             * Returns the dimension of this matrix.
060             */
061            int getDimension();
062    
063            /**
064             * Returns the value for the self co-occurrence frequency of i (i being from
065             * 0 to {@link #getDimension()} - 1).
066             * The result is the same as a call to <code>getValue(i, i)</code>.
067             * @param i index into the matrix, must be larger than or equal to 0 and smaller than {@link #getDimension()}
068             */
069            double getValue(int i);
070    
071            double getValue(int i, int j);
072    
073            void setValue(int i, int j, double newValue);
074    }