Skip to content

Commit dbc1db1

Browse files
authored
Fix type-instability in lattice-field of Cell
`MMatrix{3,3,L}` is not a concrete type, unfortunately. I figured I'd suggest changing this so inference of `getfield(::Cell, :lattice)` isn't poisoned. The same problem affects the `positions` but it cannot be fixed simply while retaining the `MMatrix` approach cf. JuliaLang/julia#18466: personally, I think it'd make more sense to treat that as a `Vector{MVector{3,P}}` - it doesn't seem worthwhile to specialize to how many atoms are in a cell. Anyway, that is a larger change and I just wanted to do the minimal change here.
1 parent 9ec8ed5 commit dbc1db1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/model.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ The collinear polarizations `magmoms` only work with `get_symmetry` and are give
1717
as a list of ``N`` floating point values.
1818
"""
1919
struct Cell{N,L,P,T,M}
20-
lattice::MMatrix{3,3,L}
20+
lattice::MMatrix{3,3,L,9}
2121
positions::MMatrix{3,N,P}
2222
types::MVector{N,T}
2323
magmoms::MVector{N,M}

0 commit comments

Comments
 (0)