/* Matrix Math in Java */ import java.lang.Math; // needed for random numbers. /* Matrices are represented as two-dimensional arrays. We shall confine ourselfs to square (NXN) matrices for simplicity. All binary relations that has the same domain as range are square matrices */ public class mmx { static matrix madd(matrix A, matrix B) { int i, j; // loop counters matrix C = new matrix(A.size); for (i=0;i 0) m[i][j] = 1; else m[i][j] = 0; } boolean equals(matrix A) { int i, j; boolean ax = true; for (i=0;i