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

Improve alignment display #676

Merged
merged 4 commits into from
Sep 3, 2024
Merged

Conversation

OlivierHnt
Copy link
Member

This PR improves the alignment display when working with arrays of Complex{<:Interval}.
Somehow when the imaginary part contains a negative sign, the alignment is off.
To fix it when the imaginary part is an interval only containing negative values, the sign can be taken outside of the displayed interval.

E.g. before this PR:

julia> [1.2 - im * interval(1e-77, 1e-75) ; interval(0.1) ; interval(-0.1) ; 1.2 + im*interval(1e-77, 1e-75)]
4-element Vector{Complex{Interval{Float64}}}:
 [1.19999, 1.20001]_com_NG + ([-1.00001e-75, -0.999999e-77]_com_NG)im
                   [0.0999999, 0.100001]_com + ([0.0, 0.0]_com)im
                 [-0.100001, -0.0999999]_com + ([0.0, 0.0]_com)im
                   [1.19999, 1.20001]_com_NG + ([0.999999e-77, 1.00001e-75]_com_NG)im

after this PR:

4-element Vector{Complex{Interval{Float64}}}:
   [1.19999, 1.20001]_com_NG - im*[0.999999e-77, 1.00001e-75]_com_NG
   [0.0999999, 0.100001]_com + im*[0.0, 0.0]_com
 [-0.100001, -0.0999999]_com + im*[0.0, 0.0]_com
   [1.19999, 1.20001]_com_NG + im*[0.999999e-77, 1.00001e-75]_com_NG

The issue remains if the imaginary part is an interval containing both positive and negative values.

OlivierHnt and others added 4 commits August 21, 2024 17:07
@OlivierHnt OlivierHnt merged commit 3bf7b4c into JuliaIntervals:master Sep 3, 2024
16 checks passed
@OlivierHnt OlivierHnt deleted the display branch September 3, 2024 15:49
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