Skip to content

Commit eb695fb

Browse files
committed
fix import issues
1 parent 6a1951a commit eb695fb

File tree

6 files changed

+32
-32
lines changed

6 files changed

+32
-32
lines changed

src/IntervalMatrices.jl

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
11
module IntervalMatrices
22

3-
using LinearAlgebra
4-
using LinearAlgebra: checksquare
5-
6-
using Random: AbstractRNG, GLOBAL_RNG, seed!
7-
import Random: rand
8-
9-
import Base: copy,
3+
import Base: copy, rand,
104
+, -, *, /, \,
115
size, IndexStyle, getindex, setindex!,
126
similar, , , , , real, imag
137

14-
using Reexport
8+
import LinearAlgebra
9+
using LinearAlgebra: Diagonal, I, UniformScaling, checksquare, opnorm
10+
using Random: AbstractRNG, GLOBAL_RNG
11+
using Reexport: @reexport
1512

1613
# =================================
1714
# Interface with IntervalArithmetic

src/exponential.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ end
8080
function _exp_remainder(A::IntervalMatrix{T}, t, p; n=checksquare(A)) where {T}
8181
C = max.(abs.(inf(A)), abs.(sup(A)))
8282
# compute Q = I + Ct + (Ct)^2/2! + ... + (Ct)^p/p!
83-
Q = Matrix(LinearAlgebra.Diagonal(ones(T, n)))
83+
Q = Matrix(Diagonal(ones(T, n)))
8484

8585
tⁱ = 1
8686
i! = 1

src/matrix.jl

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -173,19 +173,20 @@ julia> [1 2; 3 4] ± [1 2; 4 5]
173173
"""
174174
function ±(C::MT, S::MT) where {T,MT<:AbstractMatrix{T}}
175175
size(C) == size(S) || throw(ArgumentError("the sizes of the center matrix and the " *
176-
"radii matrix should match, but they are $(size(C)) " *
177-
"and $(size(S)) respectively"))
176+
"radii matrix should match, but they are " *
177+
"$(size(C)) and $(size(S)) respectively"))
178178

179179
return IntervalMatrix(map((x, y) -> interval(x - y, x + y), C, S))
180180
end
181181

182-
for op in (:Adjoint, :Bidiagonal, :Diagonal, :Hermitian,
183-
:SymTridiagonal, :Symmetric, :Transpose, :Tridiagonal)
184-
@eval LinearAlgebra.$op(A::IntervalMatrix) = IntervalMatrix($op(A.mat))
182+
for op in (:Adjoint, :Bidiagonal, :Diagonal, :Hermitian, :SymTridiagonal, :Symmetric, :Transpose,
183+
:Tridiagonal)
184+
@eval LinearAlgebra.$op(A::IntervalMatrix) = IntervalMatrix(LinearAlgebra.$op(A.mat))
185185
end
186186

187187
if VERSION >= v"1.3"
188-
LinearAlgebra.UpperHessenberg(A::IntervalMatrix) = IntervalMatrix(UpperHessenberg(A.mat))
188+
LinearAlgebra.UpperHessenberg(A::IntervalMatrix) =
189+
IntervalMatrix(LinearAlgebra.UpperHessenberg(A.mat))
189190
end
190191

191192
@static if vIA >= v"0.22"

src/operations/arithmetic.jl

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,24 +34,26 @@
3434
# (there exist more precise approaches but are currently not implemented here)
3535
\(M1::IntervalMatrix, M2::IntervalMatrix) = IntervalMatrix(M1.mat \ M2.mat)
3636
# COV_EXCL_START
37-
for T in (:AbstractMatrix, :Diagonal, :(Union{UpperTriangular,LowerTriangular}),
38-
:(Union{UnitUpperTriangular,UnitLowerTriangular}), :SymTridiagonal, :Bidiagonal,
39-
:(LinearAlgebra.HermOrSym), :(LinearAlgebra.AdjOrTrans{<:Any,<:Bidiagonal}))
37+
for T in (:AbstractMatrix, :(LinearAlgebra.Diagonal),
38+
:(Union{LinearAlgebra.UpperTriangular,LinearAlgebra.LowerTriangular}),
39+
:(Union{LinearAlgebra.UnitUpperTriangular,LinearAlgebra.UnitLowerTriangular}),
40+
:(LinearAlgebra.SymTridiagonal), :(LinearAlgebra.Bidiagonal), :(LinearAlgebra.HermOrSym),
41+
:(LinearAlgebra.AdjOrTrans{<:Any,<:LinearAlgebra.Bidiagonal})) # NOTE: these are internal functions
4042
@eval begin
4143
\(M1::IntervalMatrix, M2::$T) = IntervalMatrix(M1.mat \ M2)
4244
\(M1::$T, M2::IntervalMatrix) = IntervalMatrix(M1 \ M2.mat)
4345
end
4446
end
4547
@static if VERSION >= v"1.3"
46-
for T in [:(Union{LinearAlgebra.Adjoint{T,
47-
S} where {T,
48-
S<:(LinearAlgebra.UpperHessenberg{T,
49-
S} where {S<:AbstractMatrix{T}})},
50-
LinearAlgebra.Transpose{T,
51-
S} where {T,
52-
S<:(LinearAlgebra.UpperHessenberg{T,
53-
S} where {S<:AbstractMatrix{T}})},
54-
LinearAlgebra.UpperHessenberg})]
48+
for T in [:(LinearAlgebra.Adjoint{T,
49+
S} where {T,
50+
S<:(LinearAlgebra.UpperHessenberg{T,
51+
S} where {S<:AbstractMatrix{T}})}),
52+
:(LinearAlgebra.Transpose{T,
53+
S} where {T,
54+
S<:(LinearAlgebra.UpperHessenberg{T,
55+
S} where {S<:AbstractMatrix{T}})}),
56+
:(LinearAlgebra.UpperHessenberg)]
5557
@eval begin
5658
\(M1::IntervalMatrix, M2::$T) = IntervalMatrix(M1.mat \ M2)
5759
\(M1::$T, M2::IntervalMatrix) = IntervalMatrix(M1 \ M2.mat)

src/operations/mult.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ function set_multiplication_mode(multype)
3838

3939
# AbstractMatrix, incl. disambiguations
4040
for T in (:AbstractMatrix, :(LinearAlgebra.AbstractTriangular), # COV_EXCL_LINE
41-
:(Transpose{T,<:AbstractVector} where {T}), :Diagonal,
41+
:(LinearAlgebra.Transpose{T,<:AbstractVector} where {T}), :Diagonal,
4242
:(LinearAlgebra.Adjoint{T,<:AbstractVector} where {T}))
4343
@eval begin # COV_EXCL_LINE
4444
*(A::IntervalMatrix, B::$T) = *($type, A, B)

test/constructors.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,15 @@ end
4848
A = rand(IntervalMatrix)
4949
@test A isa IntervalMatrix
5050

51-
Aₛ = Symmetric(A)
51+
Aₛ = LinearAlgebra.Symmetric(A)
5252
@test Aₛ isa IntervalMatrix
53-
@test Aₛ.mat isa Symmetric
53+
@test Aₛ.mat isa LinearAlgebra.Symmetric
5454
@test Matrix(Aₛ) isa Matrix
5555

5656
@static if VERSION >= v"1.3"
57-
Aₕ = UpperHessenberg(A)
57+
Aₕ = LinearAlgebra.UpperHessenberg(A)
5858
@test Aₕ isa IntervalMatrix
59-
@test Aₕ.mat isa UpperHessenberg
59+
@test Aₕ.mat isa LinearAlgebra.UpperHessenberg
6060
@test Matrix(Aₕ) isa Matrix
6161
end
6262
end

0 commit comments

Comments
 (0)