From 0e213fc62f246c192213eee494d23442cb295bce Mon Sep 17 00:00:00 2001 From: eswagel <73608467+eswagel@users.noreply.github.com> Date: Wed, 13 Nov 2024 15:41:57 -0500 Subject: [PATCH] Fix matrix expression conversion to use row-major order --- src/Header/expr_to_mathematica.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Header/expr_to_mathematica.jl b/src/Header/expr_to_mathematica.jl index 2404fc8..df2b8a7 100644 --- a/src/Header/expr_to_mathematica.jl +++ b/src/Header/expr_to_mathematica.jl @@ -64,7 +64,7 @@ end (expr_to_mathematica(num::T)::T) where {T<:Mtypes}=num expr_to_mathematica(eq::Equation)::MathLink.WExpr=MathLink.WSymbol("Equal")(expr_to_mathematica(Symbolics.toexpr(eq.lhs)::Union{Expr, Symbol, Int, Float64, Rational}),expr_to_mathematica(Symbolics.toexpr(eq.rhs)::Union{Expr, Symbol, Int, Float64, Rational})) (expr_to_mathematica(vect::Vector{T})::MathLink.WExpr) where T=MathLink.WSymbol("List")(expr_to_mathematica.(vect)...) -(expr_to_mathematica(mat::Matrix{T})::MathLink.WExpr) where T = expr_to_mathematica([mat[:,i] for i in 1:size(mat,2)]) +(expr_to_mathematica(mat::Matrix{T})::MathLink.WExpr) where T = expr_to_mathematica([mat[i, :] for i in 1:size(mat,1)]) expr_to_mathematica(num::Num)::Mtypes=expr_to_mathematica(Symbolics.toexpr(num)::Union{Expr, Symbol, Int, Float64, Rational}) expr_to_mathematica(dict::Dict)::MathLink.WExpr=begin rules = MathLink.WExpr[]