1
Fork 0

python(denoising): Complexity questions done

Signed-off-by: prescientmoon <git@moonythm.dev>
This commit is contained in:
Matei Adriel 2023-03-30 02:36:40 +02:00 committed by prescientmoon
parent 81292e70f1
commit 7cf93fd66f
Signed by: prescientmoon
SSH key fingerprint: SHA256:UUF9JT2s8Xfyv76b8ZuVL7XrmimH4o49p4b+iexbVH4
2 changed files with 67 additions and 29 deletions

File diff suppressed because one or more lines are too long

View file

@ -156,7 +156,7 @@ def largest_eigenvalue(a, c, e, initial_x, kmax):
x = initial_x x = initial_x
for _ in range(kmax): for _ in range(kmax):
q = multiply_vector(a, c, e, x) q = multiply_vector(a, c, e, x)
assert not np.allclose(q, 0) assert not np.allclose(q, 0) # Sanity check
x = q/np.linalg.norm(q) x = q/np.linalg.norm(q)
# Computes the eigenvalue from the eigenvector # Computes the eigenvalue from the eigenvector