Skip to content

Commit c9f69a5

Browse files
Merge pull request #259 from JuliaDiffEq/det
Overload det
2 parents 5f06c73 + 55b5256 commit c9f69a5

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

src/operations.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,5 @@ Base.:*(A::SparseMatrixCSC{Tx,S}, x::StridedVector{Operation}) where {Tx,S} =
7878
(T = LinearAlgebra.promote_op(LinearAlgebra.matprod, Operation, Tx); mul!(similar(x, T, A.m), A, x, true, false))
7979
Base.:*(A::SparseMatrixCSC{Operation,S}, x::StridedVector{Tx}) where {Tx,S} =
8080
(T = LinearAlgebra.promote_op(LinearAlgebra.matprod, Operation, Tx); mul!(similar(x, T, A.m), A, x, true, false))
81+
82+
LinearAlgebra.lu(O::AbstractMatrix{<:Operation};kwargs...) = lu(O,Val(false);kwargs...)

test/operation_overloads.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
using ModelingToolkit
2+
using LinearAlgebra
3+
@variables a,b,c,d
4+
X = [a b;c d]
5+
det(X)
6+
lu(X)
7+
inv(X)

test/runtests.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ using ModelingToolkit, Test
33
@testset "Parsing Test" begin include("variable_parsing.jl") end
44
@testset "Differentiation Test" begin include("derivatives.jl") end
55
@testset "Simplify Test" begin include("simplify.jl") end
6+
@testset "Operation Overloads Test" begin include("operation_overloads.jl") end
67
@testset "Direct Usage Test" begin include("direct.jl") end
78
@testset "System Construction Test" begin include("system_construction.jl") end
89
@testset "Build Targets Test" begin include("build_targets.jl") end

0 commit comments

Comments
 (0)