X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fmath%2FMatrixI.java;h=dd7aaf139c8560e63bfa00c89a1013f1fc3a23e7;hb=e33dce78f446dd3ba3d83d82731e42c70c0d2cb5;hp=5b93c76ca121ea3a9e57a02ffdfe37a2cd6376af;hpb=f6123f656fa387e11f506dedd09672a0d0ff5ac5;p=jalview.git diff --git a/src/jalview/math/MatrixI.java b/src/jalview/math/MatrixI.java index 5b93c76..dd7aaf1 100644 --- a/src/jalview/math/MatrixI.java +++ b/src/jalview/math/MatrixI.java @@ -22,6 +22,10 @@ package jalview.math; import java.io.PrintStream; +/** + * An interface that describes a rectangular matrix of double values and + * operations on it + */ public interface MatrixI { /** @@ -63,12 +67,49 @@ public interface MatrixI */ double[] getRow(int i); + /** + * Answers a new matrix with a copy of the values in this one + * + * @return + */ MatrixI copy(); + /** + * Returns a new matrix which is the transpose of this one + * + * @return + */ MatrixI transpose(); + /** + * Returns a new matrix which is the result of premultiplying this matrix by + * the supplied argument. If this of size AxB (A rows and B columns), and the + * argument is CxA (C rows and A columns), the result is of size CxB. + * + * @param in + * + * @return + * @throws IllegalArgumentException + * if the number of columns in the pre-multiplier is not equal to + * the number of rows in the multiplicand (this) + */ MatrixI preMultiply(MatrixI m); + /** + * Returns a new matrix which is the result of postmultiplying this matrix by + * the supplied argument. If this of size AxB (A rows and B columns), and the + * argument is BxC (B rows and C columns), the result is of size AxC. + *

+ * This method simply returns the result of in.preMultiply(this) + * + * @param in + * + * @return + * @throws IllegalArgumentException + * if the number of rows in the post-multiplier is not equal to the + * number of columns in the multiplicand (this) + * @see #preMultiply(Matrix) + */ MatrixI postMultiply(MatrixI m); double[] getD();