11/*
2- * Copyright 2018-2019 Vincent A. Cicirello, <https://www.cicirello.org/>.
2+ * Copyright 2018-2021 Vincent A. Cicirello, <https://www.cicirello.org/>.
33 *
44 * This file is part of JavaPermutationTools (https://jpt.cicirello.org/).
55 *
2727 * represented as 2-D Java arrays.
2828 *
2929 * @author <a href=https://www.cicirello.org/ target=_top>Vincent A. Cicirello</a>, <a href=https://www.cicirello.org/ target=_top>https://www.cicirello.org/</a>
30- * @version 1.19.5.16
31- * @since 1.3
30+ * @version 2.13.2021
3231 */
3332public final class MatrixOps {
3433
@@ -38,7 +37,8 @@ private MatrixOps() {}
3837 /**
3938 * Transpose a square matrix inline.
4039 * @param matrix the matrix to transpose, with result replacing contents of matrix.
41- * @return The matrix is returned for convenience for passing to other methods requiring a matrix as parameter. It is the same
40+ * @return The matrix is returned for convenience for passing to other
41+ * methods requiring a matrix as parameter. It is the same
4242 * object reference that was passed as a parameter.
4343 */
4444 public static int [][] transposeSquareMatrixInline (int [][] matrix ) {
@@ -237,7 +237,7 @@ public static double[][] difference(double[][] A, double[][] B) {
237237 public static int [][] product (int [][] A , int [][] B , int [][] C ) {
238238 if (A .length == 0 && B .length > 0 || A .length > 0 && B .length == 0 ) {
239239 throw new IllegalArgumentException ("If either matrix has 0 rows, both must." );
240- } else if (A .length == 0 && B . length == 0 ) {
240+ } else if (A .length == 0 ) {
241241 if (C ==null ) return new int [0 ][0 ];
242242 else if (C .length ==0 ) return C ;
243243 else throw new IllegalArgumentException ("C's dimensions are inconsistent with A and B." );
@@ -269,7 +269,7 @@ public static int[][] product(int[][] A, int[][] B, int[][] C) {
269269 public static double [][] product (double [][] A , double [][] B , double [][] C ) {
270270 if (A .length == 0 && B .length > 0 || A .length > 0 && B .length == 0 ) {
271271 throw new IllegalArgumentException ("If either matrix has 0 rows, both must." );
272- } else if (A .length == 0 && B . length == 0 ) {
272+ } else if (A .length == 0 ) {
273273 if (C ==null ) return new double [0 ][0 ];
274274 else if (C .length ==0 ) return C ;
275275 else throw new IllegalArgumentException ("C's dimensions are inconsistent with A and B." );
0 commit comments