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

Fix inference problems in linear solvers #66

Open
mforets opened this issue Mar 31, 2020 · 2 comments
Open

Fix inference problems in linear solvers #66

mforets opened this issue Mar 31, 2020 · 2 comments

Comments

@mforets
Copy link
Member

mforets commented Mar 31, 2020

No description provided.

@mforets
Copy link
Member Author

mforets commented Apr 14, 2020

  • If the algorithm is not passed directly, there is an inference problem because the default depends on the dimension and there is (in general) no such information at compile time INT for 1d and GLGM06 for ND. Of course if it's worth it we can just keep GLGM06 as default, given that it works with 1d as well.

@mforets
Copy link
Member Author

mforets commented Apr 19, 2020

for reference,

julia> versioninfo()

Julia Version 1.4.0
Commit b8e9a9ecc6 (2020-03-21 16:36 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Core(TM) i7-8705G CPU @ 3.10GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-8.0.1 (ORCJIT, skylake)
Environment:
  JULIA_LOAD_PATH = :/home/mforets/Tools/GMSH/gmsh-4.5.4-Linux64-sdk/lib

INT

julia> include("/home/mforets/.julia/dev/ReachabilityAnalysis/test/models/linear/exponential1D.jl")

julia> prob, tspan = exponential_1d()

julia> @inferred solve(prob, (0.0, 1.0), INT=1e-3)); # OK

juila> @inferred solve(prob, (0.0, 1.0)); # fails
return type ReachabilityAnalysis.ReachSolution{Flowpipe{Float64,ReachSet{Float64,Interval{Float64,IntervalArithmetic.Interval{Float64}}}},INT{Float64,Forward}} does not match inferred return type ReachabilityAnalysis.ReachSolution

Stacktrace:
 [1] error(::String) at ./error.jl:33
 [2] top-level scope at In[35]:1

julia> @btime solve($prob, (0.0, 1.0));
  2.246 μs (18 allocations: 4.92 KiB)

julia> @btime solve($prob, (0.0, 1.0), INT=0.01));
  2.150 μs (18 allocations: 4.92 KiB)

GLGM06

julia> include("/home/mforets/.julia/dev/ReachabilityAnalysis/test/models/linear/motor.jl")

julia> prob, tspan = motor_homog()

julia> @inferred solve(prob, (0.0, 1.0), GLGM06=1e-3, max_order=3)); # fails but it shouldn't
return type ReachabilityAnalysis.ReachSolution{Flowpipe{Float64,ReachSet{Float64,Zonotope{Float64,Array{Float64,1},Array{Float64,2}}}},GLGM06{Float64,Forward}} does not match inferred return type ReachabilityAnalysis.ReachSolution{_A,GLGM06{Float64,Forward}} where _A<:ReachabilityAnalysis.AbstractFlowpipe

Stacktrace:
 [1] error(::String) at ./error.jl:33
 [2] top-level scope at In[28]:2

julia> @btime solve($prob, (0.0, 1.0), GLGM06=1e-3, max_order=3));
  590.537 μs (4306 allocations: 1002.36 KiB)

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