Skip to content

Change exact comparison with LAPACK.gesv to approx #206

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading