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

Add "in" for IntervalBox #244

Merged
merged 8 commits into from
Dec 8, 2018
Merged

Add "in" for IntervalBox #244

merged 8 commits into from
Dec 8, 2018

Conversation

dpsanders
Copy link
Member

@dpsanders dpsanders commented Nov 28, 2018

Fixes #240.

Defines for IntervalBox correctly.

cc @Kolaru

@dpsanders dpsanders changed the title Rewrite arithmetic to take account of 0 * Inf == 0 Add "in" for IntervalBox Nov 28, 2018
@Kolaru
Copy link
Collaborator

Kolaru commented Dec 6, 2018

Looks globally good to me, I only have some minor improvement propositions:

  • Defining in for Vector as well, so that [0, 0] in IntervalBox(-1..1, -1..1) does not error.
  • Testing a case where v in X is false.

@dpsanders
Copy link
Member Author

OK, will define for AbstractVector{T}.

I realised that the problem is that the type T inside the vector should not be allowed to be an interval though? Or maybe that's not important.

@dpsanders
Copy link
Member Author

The reason for restricting to SVector{N} was that then you guarantee that the vector is of the correct length.

Also, is there any particular reason why you are using standard Julia vectors instead of SVectors?

@codecov-io
Copy link

codecov-io commented Dec 6, 2018

Codecov Report

Merging #244 into master will increase coverage by 0.06%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #244      +/-   ##
==========================================
+ Coverage    82.7%   82.76%   +0.06%     
==========================================
  Files          24       24              
  Lines        1139     1143       +4     
==========================================
+ Hits          942      946       +4     
  Misses        197      197
Impacted Files Coverage Δ
src/IntervalArithmetic.jl 50% <ø> (ø) ⬆️
src/multidim/intervalbox.jl 90.9% <100%> (+0.58%) ⬆️
src/intervals/complex.jl 72.54% <100%> (+0.54%) ⬆️
src/intervals/set_operations.jl 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4835e16...07490f6. Read the comment docs.

@dpsanders dpsanders force-pushed the fix_membership_intervalbox branch 2 times, most recently from 2aa685c to 6c77dc5 Compare December 7, 2018 09:55
@dpsanders dpsanders force-pushed the fix_membership_intervalbox branch from 6c77dc5 to 07490f6 Compare December 7, 2018 10:11
@coveralls
Copy link

coveralls commented Dec 8, 2018

Coverage Status

Coverage increased (+0.06%) to 82.765% when pulling 07490f6 on fix_membership_intervalbox into 4835e16 on master.

@Kolaru
Copy link
Collaborator

Kolaru commented Dec 8, 2018

I realised that the problem is that the type T inside the vector should not be allowed to be an interval though? Or maybe that's not important.

Technically you want T to be a type that can be a bound for an interval. Disallowing Interval is good but does not cover all cases. Doing so probably requires something like what is proposed in #185.

Also, is there any particular reason why you are using standard Julia vectors instead of SVectors?

Only when testing stuff in REPL as standard vectors are quicker to type.

@dpsanders
Copy link
Member Author

Yes I agree that something more is required, but I think this is as far as this PR needs to go. Do you agree?

@Kolaru
Copy link
Collaborator

Kolaru commented Dec 8, 2018

Yes, the "more" should be dealt with in a separate PR (I'll look in renaming/polishing my proposal soon).

The current PR looks good to me, by the way.

@lbenet
Copy link
Member

lbenet commented Dec 8, 2018

Is this ready for reviewing/merging? I actually agree with @Kolaru's view that this is already ok.

@dpsanders
Copy link
Member Author

Yes, in my opinion it's ready to merge.

@lbenet lbenet merged commit de1cc11 into master Dec 8, 2018
@lbenet
Copy link
Member

lbenet commented Dec 8, 2018

Thanks!

@lbenet lbenet deleted the fix_membership_intervalbox branch October 11, 2022 18:51
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.

5 participants