Skip to content
This repository has been archived by the owner on Jun 24, 2022. It is now read-only.

Detection with complex fails #21

Open
ChrisRackauckas opened this issue Mar 11, 2020 · 4 comments
Open

Detection with complex fails #21

ChrisRackauckas opened this issue Mar 11, 2020 · 4 comments

Comments

@ChrisRackauckas
Copy link
Member

using SparsityDetection
function f(du, u, p, t)
    Q = reinterpret(Complex{Float64}, u)
    dQ = reinterpret(Complex{Float64}, du)
    dQ .= Q
end

input = rand(Float64, 4)
output = similar(input)
sparsity_pattern = sparsity!((dx, x) -> f(dx, x, [], 0), output, input)
jac = Float64.(sparse(sparsity_pattern))
colors = matrix_colors(jac)
@atombear
Copy link

sorry it took me a few hours to get to this!

@ChrisRackauckas
Copy link
Member Author

@shashi might this have a quick solution?

@shashi
Copy link
Collaborator

shashi commented Apr 3, 2020

So each complex element comes from 2 inputs?

I think the problem is reinterpret. It would work if you just used 1.0 + 2.0im.

@atombear
Copy link

atombear commented Apr 3, 2020 via email

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

No branches or pull requests

3 participants