Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from math import *
- print('Введите размерность матрицы')
- n = int(input())
- print('Введите eps')
- eps = float(input())
- A = [0 for _ in range(n)]
- T = [ [0 for i in range(n)] for j in range(n)]
- for i in range(n):
- T[i][i] = 1
- for i in range(n):
- print('Введите %d строку матрицы' % i+1)
- line = list(map(float,input().split()))
- A[i] = line
- def getIndexOfMaxElement():
- pre = 0
- ans = 0,0
- for i in range(n):
- for j in range(n):
- if i==j:
- continue
- if pre<abs(A[i][j]):
- pre = abs(A[i][j])
- ans = i,j
- return i,j
- def getPhi(i,j):
- if A[i][i]==A[j][j]:
- return 0.5**0.5
- return 0.5 * atan(2*A[i][j]/(A[i][i]-A[j][j]))
- def updateA:
- def updateT:
- def getLyambda():
- for i in range(itr):
- l,k = getIndexOfMaxElement()
- if abs(A[l][k]) < eps:
- break
- phi = getPhi(l,k)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement