File tree Expand file tree Collapse file tree 3 files changed +24
-3
lines changed Expand file tree Collapse file tree 3 files changed +24
-3
lines changed Original file line number Diff line number Diff line change 1
1
name = " IntervalArithmetic"
2
2
uuid = " d1acc4aa-44c8-5952-acd4-ba5d80a2a253"
3
3
repo = " https://github.com/JuliaIntervals/IntervalArithmetic.jl.git"
4
- version = " 0.19.0 "
4
+ version = " 0.19.1 "
5
5
6
6
[deps ]
7
7
CRlibm = " 96374032-68de-5a5b-8d9e-752f78720389"
Original file line number Diff line number Diff line change 1
1
2
- ⊆ (x:: Complex{Interval{T}} , y:: Complex{Interval{T}} ) where T = real (x) ⊆ real (y) && imag (x) ⊆ imag (y)
2
+ for op in (:⊆ , :⊂ )
3
+ @eval function $ (op)(x:: Complex{Interval{T}} , y:: Complex{Interval{S}} ) where {T, S}
4
+ return $ (op)(real (x), real (y)) && $ (op)(imag (x), imag (y))
5
+ end
6
+ end
3
7
4
8
function ^ (x:: Complex{Interval{T}} , n:: Integer ) where {T}
5
9
if n < 0
116
120
# # \left( |x|^p \right)^{1/p}.
117
121
# function norm(z::Complex{T}, p=2) where T<:Interval
118
122
# return (abs(z)^(p))^(1 / p)
119
- # end
123
+ # end
124
+
125
+ # real functions
126
+ mid (z:: Complex{T} ) where {T <: Interval } = mid (real (z)) + mid (imag (z)) * im
127
+ mag (z:: Complex{T} ) where {T <: Interval } = sup (abs (z))
128
+ mig (z:: Complex{T} ) where {T <: Interval } = inf (abs (z))
Original file line number Diff line number Diff line change @@ -8,6 +8,11 @@ using LinearAlgebra
8
8
b = @interval 4im + 3
9
9
c = (@interval - 1 4 ) + (@interval 0 2 )* im
10
10
11
+ @test a ⊂ c
12
+ @test a ⊆ c
13
+ @test (b ⊂ c) == false
14
+ @test (b ⊆ c) == false
15
+
11
16
@test typeof (a) == Complex{IntervalArithmetic. Interval{Float64}}
12
17
@test a == Interval (0 ) + Interval (1 )* im
13
18
@test a * a == Interval (- 1 )
58
63
@test abs (y). lo == 0.0
59
64
@test abs2 (y). lo == 0.0
60
65
end
66
+
67
+ @testset " real functions" begin
68
+ x = (0 .. 3 ) + (0 .. 4 )* im
69
+ @test mag (x) == 5
70
+ @test mig (x) == 0
71
+ @test mid (x) == 1.5 + 2im
72
+ end
You can’t perform that action at this time.
0 commit comments