Skip to content

Commit

Permalink
Change exact comparison with LAPACK.gesv to approx (#206)
Browse files Browse the repository at this point in the history
* Change exact comparison with LAPACK.gesv to approx

* Bump version to v1.6.1

* Fix types in unsafe_convert
  • Loading branch information
jishnub authored Mar 5, 2024
1 parent 1b70bd2 commit 6c51514
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
*.jl.mem
deps/deps.jl
Manifest.toml
Manifest-v*.*.toml
.DS_Store
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "ArrayLayouts"
uuid = "4c555306-a7a7-4459-81d9-ec55ddd5c99a"
authors = ["Sheehan Olver <[email protected]>"]
version = "1.6.0"
version = "1.6.1"

[deps]
FillArrays = "1a297f60-69ca-5386-bcde-b61e274b549b"
Expand Down
6 changes: 4 additions & 2 deletions test/test_layoutarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ Base.setindex!(A::MyMatrix, v, k::Int, j::Int) = setindex!(A.A, v, k, j)
Base.size(A::MyMatrix) = size(A.A)
Base.strides(A::MyMatrix) = strides(A.A)
Base.elsize(::Type{MyMatrix}) = sizeof(Float64)
Base.unsafe_convert(::Type{Ptr{T}}, A::MyMatrix) where T = Base.unsafe_convert(Ptr{T}, A.A)
Base.cconvert(::Type{Ptr{Float64}}, A::MyMatrix) = A.A
Base.unsafe_convert(::Type{Ptr{Float64}}, A::MyMatrix) = Base.unsafe_convert(Ptr{Float64}, A.A)
MemoryLayout(::Type{MyMatrix}) = DenseColumnMajor()
Base.copy(A::MyMatrix) = MyMatrix(copy(A.A))

Expand All @@ -26,7 +27,8 @@ Base.setindex!(A::MyVector, v, k::Int) = setindex!(A.A, v, k)
Base.size(A::MyVector) = size(A.A)
Base.strides(A::MyVector) = strides(A.A)
Base.elsize(::Type{MyVector}) = sizeof(Float64)
Base.unsafe_convert(::Type{Ptr{T}}, A::MyVector) where T = Base.unsafe_convert(Ptr{T}, A.A)
Base.cconvert(::Type{Ptr{T}}, A::MyVector{T}) where {T} = A.A
Base.unsafe_convert(::Type{Ptr{T}}, A::MyVector{T}) where T = Base.unsafe_convert(Ptr{T}, A.A)
MemoryLayout(::Type{MyVector}) = DenseColumnMajor()

# These need to test dispatch reduces to ArrayLayouts.mul, etc.
Expand Down
2 changes: 1 addition & 1 deletion test/test_ldiv.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import ArrayLayouts: ApplyBroadcastStyle, QRCompactWYQLayout, QRCompactWYLayout,
b = randn(T,5)
@test copyto!(similar(b), Ldiv(A,b)) ==
(similar(b) .= Ldiv(A,b)) ==
(A\b) == (b̃ = copy(b); LAPACK.gesv!(copy(A), b̃); b̃)
(A\b) (b̃ = copy(b); LAPACK.gesv!(copy(A), b̃); b̃)

@test copyto!(similar(b), Ldiv(UpperTriangular(A) , b)) UpperTriangular(A) \ b
@test copyto!(similar(b), Ldiv(UpperTriangular(A) , b)) ==
Expand Down

2 comments on commit 6c51514

@jishnub
Copy link
Member Author

@jishnub jishnub commented on 6c51514 Mar 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/102271

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v1.6.1 -m "<description of version>" 6c51514f2a6a687e2a5cc2722c562c34efb52b91
git push origin v1.6.1

Please sign in to comment.