Skip to content

Instantly share code, notes, and snippets.

@fgerick
Last active March 27, 2021 10:50
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 fgerick/360840c15a065be36633c77af5ba31ac to your computer and use it in GitHub Desktop.
Save fgerick/360840c15a065be36633c77af5ba31ac to your computer and use it in GitHub Desktop.
Quadruple precision sparse generalized eigen problem in Julia
# Solve for largest |λ| in Ax = λBx using quadruple precision :
# (B)^-1 Ax = λx
#as of now requires https://github.com/fgerick/ArnoldiMethod.jl and Julia >v1.4
using LinearAlgebra, SparseArrays, ArnoldiMethod, IncompleteLU, DoubleFloats, LinearMaps
n=100
T=Double64
A = sprandn(T,n,n,0.1)
B = sprandn(T,n,n,0.1) + I(n)
P = ilu(B,τ=zero(T))
L = LinearMap{Complex{T}}((y,x) -> ldiv!(y,P,A*x),n)
pschur,history=partialschur(L,which=LM(),nev=5)
λ,u = partialeigen(pschur)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment