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

Smolyak Grid + Time Iteration gives Method Error #158

Open
ShlokG opened this issue Oct 6, 2020 · 0 comments
Open

Smolyak Grid + Time Iteration gives Method Error #158

ShlokG opened this issue Oct 6, 2020 · 0 comments

Comments

@ShlokG
Copy link

ShlokG commented Oct 6, 2020

Related to issues with reinterpret (#143 ), I get a type error whenever I try to run time iteration with a Smolyak Grid approximation. For example, I take the rbc_iid.jl model in examples and change the Cartesian grid to
options: grid: !Smolyak mu: [2,2]

I then run in Julia-1.3.1,
model = yaml_import("rbc_iid.jl") Dolo.time_iteration(model)

I get the following error in the time iteration step:

ERROR: MethodError: no method matching (::Dolo.ConstantDecisionRule{3})(::Int64, ::Base.ReinterpretArray{StaticArrays.SArray{Tuple{30},Float64,1,30},1,Float64,Array{Float64,1}}) Closest candidates are: Any(::Int64, ::Union{Array{StaticArrays.SArray{Tuple{d},Float64,1,d},1}, StaticArrays.SArray{Tuple{d},Float64,1,d}}) where d at /home/rcesxg39/.julia/packages/Dolo/d0Rro/src/numeric/decision_rules/core.jl:29 Any(::Int64, ::Int64, ::Union{Array{StaticArrays.SArray{Tuple{d},Float64,1,d},1}, StaticArrays.SArray{Tuple{d},Float64,1,d}}) where d at /home/rcesxg39/.julia/packages/Dolo/d0Rro/src/numeric/decision_rules/core.jl:30

The code suggests that the init_dr(i, endo_nodes) step takes the SArray array but calling nodes for the SmolyakGrid runs (in src/numeric/grid.jl) reinterpret(Point{d}, vec(copy(grid.nodes')))

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

1 participant