JAL-2403 additional methods to support distance/similarity score
[jalview.git] / src / jalview / math / MatrixI.java
1 package jalview.math;
2
3 import java.io.PrintStream;
4
5 public interface MatrixI
6 {
7   /**
8    * Answers the number of columns
9    * 
10    * @return
11    */
12   int width();
13
14   /**
15    * Answers the number of rows
16    * 
17    * @return
18    */
19   int height();
20
21   /**
22    * Answers the value at row i, column j
23    * 
24    * @param i
25    * @param j
26    * @return
27    */
28   double getValue(int i, int j);
29
30   /**
31    * Sets the value at row i, colum j
32    * 
33    * @param i
34    * @param j
35    * @param d
36    */
37   void setValue(int i, int j, double d);
38
39   /**
40    * Answers a copy of the values in the i'th row
41    * 
42    * @return
43    */
44   double[] getRow(int i);
45   
46   MatrixI copy();
47
48   MatrixI transpose();
49
50   MatrixI preMultiply(MatrixI m);
51
52   MatrixI postMultiply(MatrixI m);
53
54   double[] getD();
55
56   double[] getE();
57
58   void print(PrintStream ps, String format);
59
60   void printD(PrintStream ps, String format);
61
62   void printE(PrintStream ps, String format);
63
64   void tqli() throws Exception;
65
66   void tred();
67
68   double getMaxValue();
69
70   /**
71    * Update each value in the matrix by subtracting it from the given value
72    * 
73    * @param val
74    */
75   void subtractAllFrom(double val);
76 }