MCPcopy Create free account
hub / github.com/E869120/math-algorithm-book / copyMatrix

Method copyMatrix

editorial/chap4-7/prob4-7-2.java:18–27  ·  view source on GitHub ↗
(long[][] A)

Source from the content-addressed store, hash-verified

16 }
17 static final int MOD = 1000000007;
18 static long[][] copyMatrix(long[][] A) {
19 // 行列のコピー(そのまま「M = A;」とコピーすると、参照がコピーされるだけなので注意)
20 long[][] M = new long[2][2];
21 for (int i = 0; i < 2; i++) {
22 for (int j = 0; j < 2; j++) {
23 M[i][j] = A[i][j];
24 }
25 }
26 return M;
27 }
28 static long[][] multiplication(long[][] A, long[][] B) {
29 // 2×2 行列 A, B の積を返す関数
30 long[][] C = new long[2][2];

Callers 2

mainMethod · 0.95
powerMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected