public RationalMatrix2x2 mult RationalMatrix2x2 rmatr RationalMatrix2x

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
public RationalMatrix2x2 mult(RationalMatrix2x2 rmatr) {
RationalMatrix2x2 result = new RationalMatrix2x2();
for (int i = 0; i < 2; i++) {
for (int j = 0; j < 2; j++) {
for (int k = 0; k < 2; k++) {
result.matrix[i][j] += this.matrix[i][k].mult(rmatr.getMatrix()[k][j]);
}
}
}
return result;
}