Skip to content

Commit 4edb83a

Browse files
authored
Remove istriu/istril methods (#572)
These removed methods are not necessary (the generic fallback works) and are actually wrong in the case of affine units.
1 parent 1b4b54d commit 4edb83a

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

Diff for: src/quantities.jl

-4
Original file line numberDiff line numberDiff line change
@@ -171,10 +171,6 @@ function inv(x::StridedMatrix{T}) where {T <: AbstractQuantity}
171171
reinterpret(Quantity{iq, inv(dimension(T)), typeof(inv(unit(T)))}, m)
172172
end
173173

174-
for x in (:istriu, :istril)
175-
@eval ($x)(A::AbstractMatrix{T}) where {T <: AbstractQuantity} = ($x)(ustrip(A))
176-
end
177-
178174
# Other mathematical functions
179175

180176
# `fma` and `muladd`

Diff for: test/runtests.jl

+10-2
Original file line numberDiff line numberDiff line change
@@ -1393,8 +1393,16 @@ end
13931393
SymTridiagonal{Int}
13941394
end
13951395
@testset ">> Linear algebra" begin
1396-
@test istril([1 1; 0 1]u"m") == false
1397-
@test istriu([1 1; 0 1]u"m") == true
1396+
@test istril(1m) === true
1397+
@test istril([1 1; 0 1]m) === false
1398+
@test istril([1 0; 1 1]K) === true
1399+
@test istril([1 0; 1 1]°C) === false
1400+
@test istril([1//1 -5463//20; 1//1 1//1]°C) === true
1401+
@test istriu(1m) === true
1402+
@test istriu([1 1; 0 1]m) === true
1403+
@test istriu([1 1; 0 1]K) === true
1404+
@test istriu([1 1; 0 1]°C) === false
1405+
@test istriu([1//1 1//1; -5463//20 1//1]°C) === true
13981406
end
13991407

14001408
@testset ">> Array initialization" begin

0 commit comments

Comments
 (0)