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

#75 - Truncated exponential sum #123

Merged
merged 3 commits into from
Feb 10, 2020
Merged

#75 - Truncated exponential sum #123

merged 3 commits into from
Feb 10, 2020

Conversation

schillic
Copy link
Member

@schillic schillic commented Feb 7, 2020

This is the first step for #75. The proposed starting index i0 is missing.

  • first commit: just a refactoring of the old code (plus adding assertions p < 2 that were not checked before)
  • second commit: use the new IntervalMatrixPower type
  • third commit: generalize code to nonnegative p

An example shows that the simple use of square in IntervalMatrixPower already pays off.

julia> A = rand(IntervalMatrix)
2×2 IntervalMatrix{Float64,Interval{Float64},Array{Interval{Float64},2}}:
 [-0.152272, 1.1966]   [-0.340722, 1.00641]
 [-0.688822, 1.30464]  [-1.08989, 2.67171]

julia> exp_overapproximation(A, 1.0, 10)  # master
2×2 IntervalMatrix{Float64,Interval{Float64},Array{Interval{Float64},2}}:
 [-1.39748, 7.5724]   [-3.65965, 9.33968]
 [-6.39121, 12.0942]  [-5.87441, 21.2407]

julia> d1 = diam(exp_overapproximation(A, 1.0, 10))
2×2 Array{Float64,2}:
  8.96987  12.9993
 18.4854   27.115 

julia> exp_overapproximation(A, 1.0, 10)  # this branch
2×2 IntervalMatrix{Float64,Interval{Float64},Array{Interval{Float64},2}}:
 [-1.23017, 7.5724]   [-3.46151, 9.33968]
 [-6.39121, 12.0942]  [-4.36419, 21.2407]

julia> d2 = diam(exp_overapproximation(A, 1.0, 10))
2×2 Array{Float64,2}:
  8.80256  12.8012
 18.4854   25.6048

julia> d1 - d2
2×2 Array{Float64,2}:
 0.167307  0.198139
 0.0       1.51022 

@schillic schillic requested a review from mforets February 7, 2020 21:18
Copy link
Member

@mforets mforets left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, very nice!

@mforets
Copy link
Member

mforets commented Feb 10, 2020

This is the first step for #75. The proposed starting index i0 is missing.

Can you open an issue (or update #75?) so that we don't forget what remains?

@schillic schillic merged commit 2c77108 into master Feb 10, 2020
@schillic schillic deleted the schillic/75 branch February 10, 2020 22:02
@mforets mforets mentioned this pull request Feb 10, 2020
2 tasks
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

Successfully merging this pull request may close these issues.

2 participants