用 Gauss-Jordan 法求解 Ax = b,並列出 A-1,其中

A =

1 0 1 0
0 1 0 1
2 0 4 0
0 0 0 1

b =

1
1
1
1

A 與 b 需要先打成檔案 a.dat 與 b.dat 再由程式讀入。

 

 

參考答案: