Skip to content

Commit a07ec08

Browse files
Merge pull request #461 from SciML/reshape
fix reshaped ldiv
2 parents 69a26b0 + 728e09a commit a07ec08

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/operations.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ Base.convert(::Type{Operation}, x::Number) = Operation(identity, Expression[Cons
6666
Base.convert(::Type{Operation}, x::Operation) = x
6767
Base.convert(::Type{Operation}, x::Expression) = Operation(identity, Expression[x])
6868
Operation(x) = convert(Operation, x)
69+
Operation(x::Operation) = x
6970
Base.Symbol(O::Operation) = Symbol(convert(Variable,O))
7071
Base.convert(::Type{Symbol},O::Operation) = Symbol(convert(Variable,O))
7172

test/operation_overloads.jl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,14 @@ J = [Dx(eqs[1].rhs) Dy(eqs[1].rhs) Dz(eqs[1].rhs)
4646
J = expand_derivatives.(J)
4747
using LinearAlgebra
4848
luJ = lu(J,Val(false))
49+
50+
using ModelingToolkit
51+
@variables M[1:2,1:2]
52+
inv(M)
53+
54+
@variables b[1:2]
55+
M = [1 0; 0 2]
56+
M \ b
57+
M \ reshape(b,2,1)
58+
M = [1 1; 0 2]
59+
M \ reshape(b,2,1)

0 commit comments

Comments
 (0)