Skip to content
Open
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
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "NamedDims"
uuid = "356022a1-0364-5f58-8944-0da4b18d706f"
authors = ["Invenia Technical Computing Corporation"]
version = "1.2.1"
version = "1.2.2"

[deps]
AbstractFFTs = "621f4979-c628-5d54-868e-fcf4e3e8185c"
Expand Down
5 changes: 5 additions & 0 deletions src/functions_linearalgebra.jl
Original file line number Diff line number Diff line change
Expand Up @@ -178,3 +178,8 @@ LinearAlgebra.:\(A::Diagonal, B::NamedDimsArray) = LinearAlgebra.:\(A, parent(B)
for f in [:isposdef, :eigen, :eigvals, :det, :logdet, :logabsdet]
@eval LinearAlgebra.$f(A::NamedDimsArray) = $f(parent(A))
end

# fix issue #212 copy_oftype should defer to method for parent array
function LinearAlgebra.copy_oftype(A::NamedDimsArray, ::Type{T}) where {T}
return NamedDimsArray(LinearAlgebra.copy_oftype(parent(A), T), dimnames(A))
end
6 changes: 6 additions & 0 deletions test/functions_linearalgebra.jl
Original file line number Diff line number Diff line change
Expand Up @@ -222,3 +222,9 @@ end
B = Float64.(A)
@test isposdef!(NamedDimsArray{(:foo, :foo)}(B))
end

@testset "#212 copy_oftype should defer to method for parent array" begin
# https://github.com/invenia/NamedDims.jl/issues/212
nda = NamedDimsArray{(:foo, :bar)}(Symmetric([1 2 3; 4 5 4; 3 2 1])) # Int eltype
@test LinearAlgebra.copy_oftype(nda, Float64) == nda
end

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's also (in a seperate test set) add a test for the MWE of nda + I to avoid regression