From 241378e33084bd34e59dbb12aa8adf64fda69e53 Mon Sep 17 00:00:00 2001 From: Leandro Martinez Date: Thu, 26 Jan 2023 12:02:02 -0300 Subject: [PATCH] make unitcell matrix column major --- src/UnitCell.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/UnitCell.jl b/src/UnitCell.jl index 351ba11..21c23fa 100644 --- a/src/UnitCell.jl +++ b/src/UnitCell.jl @@ -35,6 +35,7 @@ Create an `UnitCell` from the given 3x3 cell `matrix`. """ function UnitCell(matrix::Array{Float64,2}) @assert size(matrix) == (3, 3) + matrix = Matrix(transpose(matrix)) ptr = @__check_ptr(lib.chfl_cell_from_matrix(pointer(matrix))) return UnitCell(CxxPointer(ptr, is_const=false)) end @@ -107,7 +108,7 @@ three base vectors as: function matrix(cell::UnitCell) result = Array{Float64}(undef, 3, 3) __check(lib.chfl_cell_matrix(__const_ptr(cell), pointer(result))) - return result + return Matrix(transpose(result)) end """