A = np.array([[2,4,6,8,10], [3,8,7,6,2], [5,7,21,44,25]]) b = np.array([[6],[15],[24]]) piA = np.linalg.pinv(A) x = np.dot(piA, b) print(x) print(np.dot(A, x))
[vagrant@localhost python]$ python myapp.py
[[ 0.34401851]
[ 1.0376735 ]
[ 0.68374091]
[ 0.33377396]
[-0.56113681]]
[[ 6.]
[15.]
[24.]]
連立一次方程式、というか、行列の計算か。
keep going, do not stop