Commit 7eeaa262 authored by wongkai junttajit's avatar wongkai junttajit

seng

parent aec3860a
def Ab2Uc(A,b):
import numpy
A=numpy.array(A,float)
b=numpy.array(b,float)
n = len(b)
for j in range(0, n-1):
for i in range(j+1, n):
lam = A[i,j]/A[j,j]
A[i,j:n] = A[i, j:n] - lam*A[j, j:n]
b[i] = b[i] - lam*b[j]
print('U =',A)
print('c =',b)
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