@@ -316,7 +316,7 @@ function find_transformation_matrix(t::SVector{D,T}) where {D,T}
316316 elseif D == 2
317317 push! (images, SA[one (T), zero (T)], SA[zero (T), one (T)])
318318 n += 2
319- transformation2 = zero (MMatrix{2 ,2 ,T,4 })
319+ transformation2 = zero (T == Rational{BigInt} ? SizedMatrix{ 2 , 2 ,T, 2 ,Matrix{T}} : MMatrix{2 ,2 ,T,4 })
320320 mindet2 = (typemax (Int)- 1 )// 1
321321 best2 = (0 ,0 )
322322 for i in 1 : (n- 1 )
@@ -336,7 +336,7 @@ function find_transformation_matrix(t::SVector{D,T}) where {D,T}
336336 oT = one (T); zT = zero (T)
337337 push! (images, SA[oT, zT, zT], SA[zT, oT, zT], SA[zT, zT, oT])
338338 n += 3
339- transformation3 = zero (MMatrix{3 ,3 ,T,9 })
339+ transformation3 = zero (T == Rational{BigInt} ? SizedMatrix{ 3 , 3 ,T, 2 ,Matrix{T}} : MMatrix{3 ,3 ,T,9 })
340340 mindet3 = (typemax (Int)- 1 )// 1
341341 best3 = (0 ,0 ,0 )
342342 for i in 1 : (n- 1 )
@@ -872,13 +872,13 @@ function reduce_with_matrix(c::Crystal{Nothing}, _mat)
872872 cell = Cell (c. pge. cell, c. pge. cell. mat * mat)
873873
874874 imat = round .(Int, inv (mat)) # The inverse should only have integer coefficients
875- poscol = ( imat,) .* c. pge. pos # position in the new reference, will be in [0,1)
875+ poscol = [ imat * round .(x; digits = 12 ) for x in c. pge. pos] # position in the new reference, will be in [0,1)
876876 n = length (poscol)
877877 offset = Vector {SVector{D,Int}} (undef, n) # offsets in the new reference
878878 for (i, pos) in enumerate (poscol)
879879 ofs = floor .(Int, pos)
880880 offset[i] = ofs
881- poscol[i] = pos .- ofs
881+ poscol[i] = round .( pos .- ofs; digits = 12 )
882882 end
883883 I_sort = sort (1 : n; by= i-> (poscol[i], hash_position (offset[i])))
884884 _i = popfirst! (I_sort)
0 commit comments