Skip to content

Commit b53d534

Browse files
Merge pull request #249 from JuliaDiffEq/ChrisRackauckas-patch-2
Remove type mapping
2 parents 1c982e8 + 11dc663 commit b53d534

File tree

5 files changed

+4
-4
lines changed

5 files changed

+4
-4
lines changed

src/function_registration.jl

+1
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,4 @@ Base.:^(x::Expression,y::T) where T <: Rational = Operation(Base.:^, Expression[
5959
@register Base.conj(x)
6060
@register Base.getindex(x,i)
6161
Base.getindex(x::Operation,i::Int64) = Operation(getindex,[x,i])
62+
Base.one(::Operation) = 1

src/simplify.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ end
1414
simplify_constants(x, shorten_tree) = x
1515
simplify_constants(x) = simplify_constants(x, true)
1616

17-
17+
Base.isone(x::Operation) = x.op == one || x.op == Constant && isone(x.args)
1818
const AC_OPERATORS = (*, +)
1919

2020
function _simplify_constants(O::Operation, shorten_tree)

src/utils.jl

-2
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,6 @@ function build_function(rhss, vs, ps = (), args = (), conv = simplified_expr, ex
9090
return $arr_bounds_block
9191
else
9292
X = $bounds_block
93-
T = promote_type(map(typeof,X)...)
94-
map(T,X)
9593
construct = $_constructor
9694
return construct(X)
9795
end

test/direct.jl

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ for i in 1:3
2626
= ModelingToolkit.gradient(eqs[i],[x,y,z])
2727
@test isequal(∂[i,:],∇)
2828
end
29+
2930
@test all(isequal.(ModelingToolkit.gradient(eqs[1],[x,y,z]),[σ * -1,σ,0]))
3031
@test all(isequal.(ModelingToolkit.hessian(eqs[1],[x,y,z]),0))
3132

test/runtests.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ using ModelingToolkit, Test
99
@testset "Constraints Test" begin include("constraints.jl") end
1010
@testset "PDE Construction Test" begin include("pde.jl") end
1111
@testset "Distributed Test" begin include("distributed.jl") end
12-
#@testset "Latexify recipes Test" begin include("latexify.jl") end
12+
@testset "Latexify recipes Test" begin include("latexify.jl") end

0 commit comments

Comments
 (0)