Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def CreateW(A: list, B: list, column: list, headers: list) -> list:
- W = [0]*(len(A[0])+1)
- for i in range(len(A)):
- if column[i][0] == 'y':
- for j in range(len(A[0])):
- W[j] += A[i][j]
- W[len(A[0])] += B[i]
- for j in range( len( A[0] ) ):
- if headers[j][0] == 'y':
- W[j] += 1
- return W
- def ChangeFunctional(column: list, Functional_koeff: list) -> list:
- new_Functional = list(Functional_koeff)
- for i in range(len(column)):
- new_Functional[i] = Functional_koeff[int(column[i][2])-1]
- return new_Functional
- def CreateF(A: list, B: list, Functional_koeff: list) -> list:
- F = [0]*(len(A[0])+1)
- for i in range(len(A)):
- for j in range(len(A[0])):
- F[j] += Functional_koeff[i]*A[i][j]
- for i in range(len(A)):
- F[len(F)-1] += B[i]*Functional_koeff[i]
- return F
- def ChangeF(A: list, B: list, F: list, stroka_number: int, stolbec_number: int):
- F[len(F)-1] += B[stroka_number]*F[stolbec_number]
- for j in range(len(A[0])):
- for i in range(len(A)):
- pass
- if j == stolbec_number:
- #print(f'A: {A[stroka_number][stolbec_number]}')#отладка
- #print(f'F[j]: {F[j]}')#отладка
- F[j] *= A[stroka_number][stolbec_number]
- else:
- F[j] += F[stolbec_number]*A[stroka_number][j]
- return F
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement