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

Nested containers in the system function #72

Closed
dextorious opened this issue Jun 29, 2017 · 5 comments
Closed

Nested containers in the system function #72

dextorious opened this issue Jun 29, 2017 · 5 comments

Comments

@dextorious
Copy link
Contributor

Currently, using a nested container such as a Vector{SVector{2,Float64}} produces the following error when using a method with an adaptive timestep:

ERROR: DimensionMismatch("Cannot left-divide transposed vector by matrix")
Stacktrace:
 [1] /(::Array{Float64,1}, ::Array{Float64,1}) at .\linalg\generic.jl:823
 [2] broadcast_t(::Function, ::Type{Any}, ::Tuple{Base.OneTo{Int64}}, ::CartesianRange{CartesianIndex{1}}, ::Array{Array{Float64,1},1}, ::Array{Array{Float64,1},1}) at .\broadcast.jl:256
 [3] broadcast_c at .\broadcast.jl:319 [inlined]
 [4] broadcast at .\broadcast.jl:434 [inlined]
 [5] ode_determine_initdt(::Array{Array{Float64,1},1}, ::Float64, ::Float64, ::Float64, ::Float64, ::Float64, ::DiffEqBase.#ODE_DEFAULT_NORM, ::DiffEqBase.ODEProblem{Array{Array{Float64,1},1},Float64,false,DiffEqBase.ParameterizedFunction{false,BacterialEnsembles.#ensemble_dynamics#2,Tuple{Int64,Float64}},Void,UniformScaling{Int64}}, ::Int64) at C:\Users\admin\.julia\v0.6\OrdinaryDiffEq\src\initdt.jl:57
 [6] #init#134(::Int64, ::Array{Float64,1}, ::Array{Float64,1}, ::Array{Float64,1}, ::Void, ::Bool, ::Void, ::Bool, ::Bool, ::Bool, ::Float64, ::Bool, ::Rational{Int64}, ::Void, ::Void, ::Int64, ::Rational{Int64}, ::Rational{Int64}, ::Bool, ::Rational{Int64}, ::Rational{Int64}, ::Int64, ::Float64, ::Float64, ::DiffEqBase.#ODE_DEFAULT_NORM, ::DiffEqBase.#ODE_DEFAULT_ISOUTOFDOMAIN, ::DiffEqBase.#ODE_DEFAULT_UNSTABLE_CHECK, ::Bool, ::Bool, ::Bool, ::Bool, ::Bool, ::Bool, ::Bool, ::Int64, ::String, ::DiffEqBase.#ODE_DEFAULT_PROG_MESSAGE, ::Void, ::Void, ::Bool, ::Bool, ::Array{Any,1}, ::DiffEqBase.#init, ::DiffEqBase.ODEProblem{Array{Array{Float64,1},1},Float64,false,DiffEqBase.ParameterizedFunction{false,BacterialEnsembles.#ensemble_dynamics#2,Tuple{Int64,Float64}},Void,UniformScaling{Int64}}, ::OrdinaryDiffEq.Tsit5, ::Array{Any,1}, ::Array{Any,1}, ::Array{Any,1}, ::Type{Val{true}}) at C:\Users\admin\.julia\v0.6\OrdinaryDiffEq\src\solve.jl:137

The problem does not affect methods with a fixed timestep.

@ChrisRackauckas
Copy link
Member

Can't reproduce your exact error. Are you using out of place?

@dextorious
Copy link
Contributor Author

Yes, that was out of place.

@ChrisRackauckas
Copy link
Member

ChrisRackauckas commented Jun 29, 2017

./ is a hack in the adaptivity that makes out-of-place work with array equations even though it's written for Number. To make that work for "infinite nests", there needs to be a "recursive broadcast".

In-place is easier here: a one-line change makes it work. I need to see what exactly that effects in terms of AbstractArray types though.

@ChrisRackauckas
Copy link
Member

JuliaLang/julia#22622

We'll see who comes just to say that the application is just too bizarre to care.

@ChrisRackauckas
Copy link
Member

We're going to take that the proper way to handle this is by using a VectorOfArray or an ArrayPartition. Vector{SVector} won't be possible to support in general because it will not broadcast correctly, while those containers will do it well.

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