Skip to content

Instantly share code, notes, and snippets.

@cc7768
Created January 9, 2015 22:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cc7768/77e4b81cce34895262d8 to your computer and use it in GitHub Desktop.
Save cc7768/77e4b81cce34895262d8 to your computer and use it in GitHub Desktop.
n = 10
srand(42)
ad = randn(n, n)
bd = randn(n, n)
ac = randn(n, n) + randn(n, n)im
bc = randn(n, n) + randn(n, n)im
# This is the "not sorted" schur
sfd_ns = schurfact(ad, bd)
sfc_ns = schurfact(ac, bc)
# Find which are less than unity
selctgd(a, b, c) = (a+b)/c < 1. ? 1. : 0.
selctgd(a, b, c) = real(a/b * conj(a/b)) < 1.0 ? 1. : 0.
sfd_s = schurfact(ad, bd, selctgd)
sfc_s = schurfact(ac, bc, selctgc)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment