From 45e7d7c69f366667742326cd8b4d2bada41b25f4 Mon Sep 17 00:00:00 2001 From: Jutho Haegeman Date: Fri, 7 Jun 2024 15:29:45 +0200 Subject: [PATCH] fix --- src/eigsolve/eigsolve.jl | 11 ++++++++++- src/linsolve/linsolve.jl | 4 ++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/eigsolve/eigsolve.jl b/src/eigsolve/eigsolve.jl index bc50ac1..f88916b 100644 --- a/src/eigsolve/eigsolve.jl +++ b/src/eigsolve/eigsolve.jl @@ -206,7 +206,16 @@ function eigsolve(f, x₀, howmany::Int=1, which::Selector=:LM; kwargs...) `λ` and `conj(λ)` equally: work in complex arithmetic by providing a complex starting vector `x₀`") end end - return eigsolve(f, x₀, howmany, which, alg) + if haskey(kwargs, :alg_rrule) + alg_rrule = kwargs[:alg_rrule] + else + alg_rrule = Arnoldi(; tol=alg.tol, + krylovdim=alg.krylovdim, + maxiter=alg.maxiter, + eager=alg.eager, + orth=alg.orth) + end + return eigsolve(f, x₀, howmany, which, alg; alg_rrule=alg_rrule) end function eigselector(f, diff --git a/src/linsolve/linsolve.jl b/src/linsolve/linsolve.jl index 025b6a2..0752e0e 100644 --- a/src/linsolve/linsolve.jl +++ b/src/linsolve/linsolve.jl @@ -111,8 +111,8 @@ function linsolve(f, b, x₀, a₀::Number=0, a₁::Number=1; kwargs...) T = promote_type(Core.Compiler.return_type(inner, Tuple{Tb,Tfx}), typeof(a₀), typeof(a₁)) alg = linselector(f, b, T; kwargs...) - if haskey(kwargs, alg_rrule) - alg_rrule = kwargs[alg_rrule] + if haskey(kwargs, :alg_rrule) + alg_rrule = kwargs[:alg_rrule] else alg_rrule = alg end