y in range(1, n + 1):
row.append(1 / (x + y - 1))
h.append(row)
return h
雅克比迭代法...R = abs(x[i] - x0[i])
if R <= sigma:
print("精确度等于",sigma,"时,jacobi迭代法需要迭代...R = abs(x[i] - x0[i])
if R <= sigma:
print("精确度等于",sigma,"时,gauss_seidel迭代法需要迭代...R = abs(x[i] - x0[i])
if R <= sigma:
print("精确度等于",sigma,"时,松弛因子为",omega,"时,sor迭代法需要迭代...迭代法:',gauss_seidel(H,b,0.00001,20))