3 import java.io.PrintStream;
5 public interface MatrixI
8 * Answers the number of columns
15 * Answers the number of rows
22 * Answers the value at row i, column j
28 double getValue(int i, int j);
31 * Sets the value at row i, colum j
37 void setValue(int i, int j, double d);
40 * Answers a copy of the values in the i'th row
44 double[] getRow(int i);
50 MatrixI preMultiply(MatrixI m);
52 MatrixI postMultiply(MatrixI m);
58 void print(PrintStream ps, String format);
60 void printD(PrintStream ps, String format);
62 void printE(PrintStream ps, String format);
64 void tqli() throws Exception;
69 * Reverses the range of the matrix values, so that the smallest values become
70 * the largest, and the largest become the smallest. This operation supports
71 * using a distance measure as a similarity measure, or vice versa.
73 * If parameter <code>maxToZero</code> is true, then the maximum value becomes
74 * zero, i.e. all values are subtracted from the maximum. This is consistent
75 * with converting an identity similarity score to a distance score - the most
76 * similar (identity) corresponds to zero distance. However note that the
77 * operation is not reversible (unless the original minimum value is zero).
78 * For example a range of 10-40 would become 30-0, which would reverse a
79 * second time to 0-30. Also note that a general similarity measure (such as
80 * BLOSUM) may give different 'identity' scores for different sequences, so
81 * they cannot all convert to zero distance.
83 * If parameter <code>maxToZero</code> is false, then the values are reflected
84 * about the average of {min, max} (effectively swapping min and max). This
85 * operation <em>is</em> reversible.
89 void reverseRange(boolean maxToZero);
92 * Multiply all entries by the given value
96 void multiply(double d);