// Path: app/src/main/java/io/whz/synapse/matrix/MatrixChecker.java
// static void checkDimensions(int row, int col) {
//     checkExpression(row > 0 && col > 0,
//             "Row and column should be positive");
// }
// 
// Path: app/src/main/java/io/whz/synapse/matrix/MatrixChecker.java
// static void checkExpression(boolean expression, String message) {
//     Precondition.checkArgument(expression, message);
// }
// 
// Path: app/src/main/java/io/whz/synapse/matrix/MatrixChecker.java
// static void checkInnerDimensions(@NonNull Matrix a, @NonNull Matrix b) {
//     checkExpression(a.getCol() == b.getRow(),
//             "Matrix inner dimensions must agree");
// }
// 
// Path: app/src/main/java/io/whz/synapse/matrix/MatrixChecker.java
// static void checkNotNull(Object o) {
//     Precondition.checkNotNull(o);
// }
// 
// Path: app/src/main/java/io/whz/synapse/matrix/MatrixChecker.java
// static void verifyArrays(@NonNull double[][] arrays) {
//     checkNotNull(arrays);
// 
//     final int m = arrays.length;
//     checkExpression(m > 0,
//             "Row should be positive");
// 
//     final int n = arrays[0].length;
//     for (int i = 1; i < m; ++i) {
//         checkExpression(arrays[i].length == n,
//                 "All rows must have the same length");
//     }
// }


import android.support.annotation.NonNull;
import java.io.Serializable;
import java.util.Random;
import static io.whz.synapse.matrix.MatrixChecker.checkDimensions;
import static io.whz.synapse.matrix.MatrixChecker.checkExpression;
import static io.whz.synapse.matrix.MatrixChecker.checkInnerDimensions;
import static io.whz.synapse.matrix.MatrixChecker.checkNotNull;
import static io.whz.synapse.matrix.MatrixChecker.verifyArrays;

        return a;
    }

    public static Matrix minus(@NonNull Matrix a,@NonNull Matrix b) {
        checkNotNull(a);
        checkNotNull(b);
        checkDimensions(a, b);

        return minusTo(a.copy(), b);
    }

    public static Matrix minusTo(@NonNull Matrix a, @NonNull Matrix b) {
        checkNotNull(a);
        checkNotNull(b);
        checkDimensions(a, b);

        final double[] aArr = a.getArray();
        final double[] bArr = b.getArray();

        for (int i = 0, len = aArr.length; i < len; ++i) {
            aArr[i] -= bArr[i];
        }

        return a;
    }

    public static Matrix times(@NonNull Matrix a, @NonNull Matrix b) {
        checkNotNull(a);
        checkNotNull(b);
// Path: app/src/main/java/io/whz/synapse/matrix/MatrixChecker.java
// static void checkDimensions(int row, int col) {
//     checkExpression(row > 0 && col > 0,
//             "Row and column should be positive");
// }
// 
// Path: app/src/main/java/io/whz/synapse/matrix/MatrixChecker.java
// static void checkExpression(boolean expression, String message) {
//     Precondition.checkArgument(expression, message);
// }
// 
// Path: app/src/main/java/io/whz/synapse/matrix/MatrixChecker.java
// static void checkInnerDimensions(@NonNull Matrix a, @NonNull Matrix b) {
//     checkExpression(a.getCol() == b.getRow(),
//             "Matrix inner dimensions must agree");
// }
// 
// Path: app/src/main/java/io/whz/synapse/matrix/MatrixChecker.java
// static void checkNotNull(Object o) {
//     Precondition.checkNotNull(o);
// }
// 
// Path: app/src/main/java/io/whz/synapse/matrix/MatrixChecker.java
// static void verifyArrays(@NonNull double[][] arrays) {
//     checkNotNull(arrays);
// 
//     final int m = arrays.length;
//     checkExpression(m > 0,
//             "Row should be positive");
// 
//     final int n = arrays[0].length;
//     for (int i = 1; i < m; ++i) {
//         checkExpression(arrays[i].length == n,
//                 "All rows must have the same length");
//     }
// }


// Path: app/src/main/java/io/whz/synapse/matrix/Matrix.java
import android.support.annotation.NonNull;
import java.io.Serializable;
import java.util.Random;
import static io.whz.synapse.matrix.MatrixChecker.checkDimensions;
import static io.whz.synapse.matrix.MatrixChecker.checkExpression;
import static io.whz.synapse.matrix.MatrixChecker.checkInnerDimensions;
import static io.whz.synapse.matrix.MatrixChecker.checkNotNull;
import static io.whz.synapse.matrix.MatrixChecker.verifyArrays;


        return a;
    }

    public static Matrix minus(@NonNull Matrix a,@NonNull Matrix b) {
        checkNotNull(a);
        checkNotNull(b);
        checkDimensions(a, b);

        return minusTo(a.copy(), b);
    }

    public static Matrix minusTo(@NonNull Matrix a, @NonNull Matrix b) {
        checkNotNull(a);
        checkNotNull(b);
        checkDimensions(a, b);

        final double[] aArr = a.getArray();
        final double[] bArr = b.getArray();

        for (int i = 0, len = aArr.length; i < len; ++i) {
            aArr[i] -= bArr[i];
        }

        return a;
    }

    public static Matrix times(@NonNull Matrix a, @NonNull Matrix b) {
        checkNotNull(a);
        checkNotNull(b);
        checkDimensions(a, b);