def stvori_A(B):#pretvaranje matrice prethodno stvorene s punjenjem u matricu A A = c(B) #print(A) return A
def stvori_A(B): A = c(B) #print(A) return A
import numpy as n import math import matplotlib.pyplot as plt broj=[] def pisi(xk): broj.append(xk) i=2 B = n.arange(1,10001).reshape(100,100) for i in range(100): for j in range(100): B[i][j]=B[i][j]**2 A=c(B) x0former=[0]*100 x0now=n.reshape(x0former,(100,1)) x0=x0now b=B[:,99] #b=n.array(b1) print('A', A.shape, type(A)) print('x', x0.shape, type(x0)) print('b', b.shape, type(b)) x=ln.minres(A,b,x0,0.0,1e-8,None,None,pisi)