Skip to content

Commit 6c51514

Browse files
authored
Change exact comparison with LAPACK.gesv to approx (#206)
* Change exact comparison with LAPACK.gesv to approx * Bump version to v1.6.1 * Fix types in unsafe_convert
1 parent 1b70bd2 commit 6c51514

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
*.jl.mem
44
deps/deps.jl
55
Manifest.toml
6+
Manifest-v*.*.toml
67
.DS_Store

Project.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "ArrayLayouts"
22
uuid = "4c555306-a7a7-4459-81d9-ec55ddd5c99a"
33
authors = ["Sheehan Olver <[email protected]>"]
4-
version = "1.6.0"
4+
version = "1.6.1"
55

66
[deps]
77
FillArrays = "1a297f60-69ca-5386-bcde-b61e274b549b"

test/test_layoutarray.jl

+4-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ Base.setindex!(A::MyMatrix, v, k::Int, j::Int) = setindex!(A.A, v, k, j)
1313
Base.size(A::MyMatrix) = size(A.A)
1414
Base.strides(A::MyMatrix) = strides(A.A)
1515
Base.elsize(::Type{MyMatrix}) = sizeof(Float64)
16-
Base.unsafe_convert(::Type{Ptr{T}}, A::MyMatrix) where T = Base.unsafe_convert(Ptr{T}, A.A)
16+
Base.cconvert(::Type{Ptr{Float64}}, A::MyMatrix) = A.A
17+
Base.unsafe_convert(::Type{Ptr{Float64}}, A::MyMatrix) = Base.unsafe_convert(Ptr{Float64}, A.A)
1718
MemoryLayout(::Type{MyMatrix}) = DenseColumnMajor()
1819
Base.copy(A::MyMatrix) = MyMatrix(copy(A.A))
1920

@@ -26,7 +27,8 @@ Base.setindex!(A::MyVector, v, k::Int) = setindex!(A.A, v, k)
2627
Base.size(A::MyVector) = size(A.A)
2728
Base.strides(A::MyVector) = strides(A.A)
2829
Base.elsize(::Type{MyVector}) = sizeof(Float64)
29-
Base.unsafe_convert(::Type{Ptr{T}}, A::MyVector) where T = Base.unsafe_convert(Ptr{T}, A.A)
30+
Base.cconvert(::Type{Ptr{T}}, A::MyVector{T}) where {T} = A.A
31+
Base.unsafe_convert(::Type{Ptr{T}}, A::MyVector{T}) where T = Base.unsafe_convert(Ptr{T}, A.A)
3032
MemoryLayout(::Type{MyVector}) = DenseColumnMajor()
3133

3234
# These need to test dispatch reduces to ArrayLayouts.mul, etc.

test/test_ldiv.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ import ArrayLayouts: ApplyBroadcastStyle, QRCompactWYQLayout, QRCompactWYLayout,
4444
b = randn(T,5)
4545
@test copyto!(similar(b), Ldiv(A,b)) ==
4646
(similar(b) .= Ldiv(A,b)) ==
47-
(A\b) == (b̃ = copy(b); LAPACK.gesv!(copy(A), b̃); b̃)
47+
(A\b) (b̃ = copy(b); LAPACK.gesv!(copy(A), b̃); b̃)
4848

4949
@test copyto!(similar(b), Ldiv(UpperTriangular(A) , b)) UpperTriangular(A) \ b
5050
@test copyto!(similar(b), Ldiv(UpperTriangular(A) , b)) ==

0 commit comments

Comments
 (0)