c1 = np.linalg.norm(B, np.inf)
for j in range(m_star):
B = t * np.dot(A, B) / float(s*(j+1))
c2 = np.linalg.norm(B, np.inf)
F = F + B
if c1 + c2 <= tol * np.linalg.norm(F, np.inf):
break
c1 = c2
After Change
raise ValueError("expected A to be like a square matrix")
if A.shape[1] != B.shape[0]:
raise ValueError("the matrices A and B have incompatible shapes")
if B.ndim not in (1, 2):
raise ValueError("expected B to be like a matrix or a vector")
n = A.shape[0]
n0 = B.shape[-1]
u_d = 2**-53
tol = u_d
mu = _trace(A) / float(n)
A = A - mu * np.identity(n)
A_1_norm = _exact_1_norm(A)
if t*A_1_norm == 0:
m_star, s = 0, 1
else:
ell = 2
norm_info = LazyOperatorNormInfo(t*A, A_1_norm=t*A_1_norm, ell=ell)
m_star, s = _fragment_3_1(norm_info, n0, tol, ell=ell)
F = B
eta = math.exp(t*mu / float(s))
for i in range(s):
c1 = _exact_inf_norm(B)
for j in range(m_star):
print(type(t))
print(type(s))
print(type(j))
print(type(A), type(B))
print()
coeff = t / float(s*(j+1))
B = coeff * np.dot(A, B)
c2 = _exact_inf_norm(B)
F = F + B
if c1 + c2 <= tol * _exact_inf_norm(F):
break