Skip to content

Instantly share code, notes, and snippets.

@Shogun89
Created July 14, 2019 22:56
Show Gist options
  • Save Shogun89/cdadfb78d33fd0a4c73f23bcdf67cdfe to your computer and use it in GitHub Desktop.
Save Shogun89/cdadfb78d33fd0a4c73f23bcdf67cdfe to your computer and use it in GitHub Desktop.
import numpy as np
A = np.array([[1,2],[4,3]])
x0 = np.array([[1],[0]])
def iterate(A,x):
rho = np.dot(A,x)
nk = np.max(np.absolute(rho))
xk = 1/nk* rho
return rho, nk, xk
rho, nk, xk = iterate(A,x0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment