Skip to content

Commit 3765bfd

Browse files
committed
fix SqSMatrix ambiguity that impacted a KVec constructor
1 parent f3e04a0 commit 3765bfd

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "Crystalline"
22
uuid = "ae5e2be0-a263-11e9-351e-f94dad1eb351"
33
authors = ["Thomas Christensen <[email protected]>"]
4-
version = "0.3.4"
4+
version = "0.3.5"
55

66
[deps]
77
Combinatorics = "861a8166-3701-5b0c-9a16-15d98fcdc6aa"

src/SquareStaticMatrices.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ end
7272
D = checksquare(A)
7373
@inbounds SqSMatrix{D}(A::AbstractMatrix{T})
7474
end
75+
SqSMatrix{D,T}(A::SqSMatrix{D,T}) where {D,T} = A # resolve an ambiguity (StaticMatrix vs. AbstractMatrix)
7576

7677
function flatten_nested(cols::NTuple{D, NTuple{D, T}}) where {D,T}
7778
ntuple(Val{D*D}()) do idx

test/kvecs.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ using Test, Crystalline, StaticArrays, LinearAlgebra
2222
@test KVec{3}("u,v,0.5")([.7,.2,.3]) == [.7,.2,.5]
2323
@test KVec{3}("v,u,0.5")([.7,.2,.3]) == [.2,.7,.5]
2424

25+
@test KVec([0.0,1//1,2]) == KVec{3}("0,1,2")
26+
2527
@test zero(KVec{3}) == KVec{3}("0,0,0") == zero(KVec{3}("1,2,3"))
2628
end
2729

0 commit comments

Comments
 (0)