Commit db66499e authored by sumet's avatar sumet

ส่งงานครับ hw06

parent d4a2c1b6
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.6.1 (~/anaconda3/bin/python3.6)" project-jdk-type="Python SDK" />
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.6" project-jdk-type="Python SDK" />
</project>
\ No newline at end of file
......@@ -2,7 +2,7 @@
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="jdk" jdkName="Python 3.6" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="TestRunnerService">
......
This diff is collapsed.
def Ab2Uc(A , b):
import numpy as np
A = np.array(A,float)
b = np.array(b,float)
n = len(b)
for k in range(0, n-1):
for i in range(k+1, n):
lam = A[i,k]/A[k,k]
A[i, k+1:n] = A [i,k+1:n] - lam*A[k, k+1:n]
b[i] -= lam*b[k]
U = A.copy()
c = b.copy()
print (U)
print (c)
m,n,_= map(int,input().split('x'))
print(m,n)
A = []
for i in range(m):
A.append(list(map(int, input().split(','))))
print(n,_)
b = list(map(int, input().split(',')))
Ab2Uc(A,b)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment