Skip to content

Commit c6599ca

Browse files
authored
Use compat for unsafe_convert (#42)
* Use compat for unsafe_convert * v0.4.8
1 parent 3ad4aa4 commit c6599ca

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

Project.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
name = "ArrayLayouts"
22
uuid = "4c555306-a7a7-4459-81d9-ec55ddd5c99a"
33
authors = ["Sheehan Olver <[email protected]>"]
4-
version = "0.4.7"
4+
version = "0.4.8"
55

66
[deps]
7+
Compat = "34da2185-b29b-5c13-b0c7-acf172513d20"
78
FillArrays = "1a297f60-69ca-5386-bcde-b61e274b549b"
89
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
910
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
1011

1112
[compat]
13+
Compat = "3.16"
1214
FillArrays = "0.9.1"
1315
julia = "1"
1416

src/ArrayLayouts.jl

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module ArrayLayouts
2-
using Base, Base.Broadcast, LinearAlgebra, FillArrays, SparseArrays
2+
using Base, Base.Broadcast, LinearAlgebra, FillArrays, SparseArrays, Compat
33
import LinearAlgebra.BLAS
44

55
import Base: AbstractArray, AbstractMatrix, AbstractVector,
@@ -83,10 +83,6 @@ struct ConjPtr{T}
8383
ptr::Ptr{T}
8484
end
8585

86-
if VERSION < v"1.5-"
87-
unsafe_convert(::Type{Ptr{T}}, A::Adjoint{<:Real}) where T<:Real = unsafe_convert(Ptr{T}, parent(A))
88-
unsafe_convert(::Type{Ptr{T}}, A::Transpose) where T = unsafe_convert(Ptr{T}, parent(A))
89-
end
9086

9187
# work-around issue with complex conjugation of pointer
9288
unsafe_convert(::Type{Ptr{T}}, Ac::Adjoint{<:Complex}) where T<:Complex = unsafe_convert(ConjPtr{T}, parent(Ac))

test/test_muladd.jl

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
using ArrayLayouts, FillArrays, Random, Test
2-
import ArrayLayouts: DenseColumnMajor, AbstractStridedLayout, AbstractColumnMajor, DiagonalLayout, mul, Mul
2+
import ArrayLayouts: DenseColumnMajor, AbstractStridedLayout, AbstractColumnMajor, DiagonalLayout, mul, Mul, zero!
33

44
Random.seed!(0)
55
@testset "Multiplication" begin
6+
@testset "zero!" begin
7+
for A in (randn(5,5), [randn(5,5),randn(4,4)])
8+
zero!(A)
9+
@test iszero(A)
10+
end
11+
end
12+
613
@testset "Matrix * Vector" begin
714
@testset "eltype" begin
815
v = MulAdd(1,zeros(Int,2,2), zeros(Float64,2),0,zeros(2))

0 commit comments

Comments
 (0)