Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RecursiveArrayTools.jl Support #384

Open
anicusan opened this issue Oct 2, 2023 · 1 comment
Open

RecursiveArrayTools.jl Support #384

anicusan opened this issue Oct 2, 2023 · 1 comment

Comments

@anicusan
Copy link

anicusan commented Oct 2, 2023

Is there any way to use LinearSolve.jl algorithms with RecursiveArrayTools.ArrayPartition? Concrete example:

using RecursiveArrayTools
using DifferentialEquations
f!(du, u, p, t) = du .= 1.01 .* u
u0 = ArrayPartition([0.25, 0.5], [0.5, 0.75])
tspan = (0.0, 1.0)
prob = ODEProblem(f, u0, tspan)
sol = solve(prob, KenCarp47(linsolve = KrylovJL_GMRES()))

Fails with:

ERROR: LoadError: MethodError: no method matching ArrayPartition{Float64, Tuple{Vector{Float64}, Vector{Float64}}}(::UndefInitializer, ::Int64)

Closest candidates are:
  (::Type{ArrayPartition{T, S}} where {T, S<:Tuple})(::Any)
   @ RecursiveArrayTools ~/.julia/packages/RecursiveArrayTools/X30HP/src/array_partition.jl:27

<Stacktrace truncated>

Which - at a first glance - does not seem too horrible to fix. But would this be performant?

@ChrisRackauckas
Copy link
Member

I think this could be made fast. The * operation can be done lazily so there's really no impediment here other than generalizing whatever computation is getting stuck

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants