MCPcopy Create free account
hub / github.com/algorithmzuo/algorithm-journey / f2

Method f2

src/class098/Code02_BigShow.java:135–144  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

133
134 // 矩阵快速幂用法的展示
135 public static void f2() {
136 // 只有正方形矩阵可以求幂
137 int[][] a = { { 1, 2 }, { 3, 4 } };
138 // 连乘得到矩阵a的5次方
139 int[][] b = multiply(a, multiply(a, multiply(a, multiply(a, a))));
140 print(b);
141 System.out.println("======");
142 // 矩阵快速幂得到矩阵a的5次方
143 print(power(a, 5));
144 }
145
146 // 用矩阵乘法解决斐波那契第n项的问题
147 public static void f3() {

Callers 1

mainMethod · 0.95

Calls 4

multiplyMethod · 0.95
printMethod · 0.95
powerMethod · 0.95
printlnMethod · 0.45

Tested by

no test coverage detected