Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

autospecialize rather than full specialize by default for the various NonlinearProblems #681

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions src/problems/basic_problems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@
This is determined automatically, but not inferred.
"""
function IntervalNonlinearProblem{iip}(f, tspan, p = NullParameters()) where {iip}
IntervalNonlinearProblem{iip}(IntervalNonlinearFunction{iip}(f), tspan, p)
IntervalNonlinearProblem{iip}(IntervalNonlinearFunction{iip, DEFAULT_SPECIALIZATION}(f), tspan, p)
end
end

Expand All @@ -180,7 +180,8 @@
end

function IntervalNonlinearProblem(f, tspan, p = NullParameters(); kwargs...)
IntervalNonlinearProblem(IntervalNonlinearFunction(f), tspan, p; kwargs...)
iip = isinplace(f, 3)
IntervalNonlinearProblem(IntervalNonlinearFunction{iip, DEFAULT_SPECIALIZATION}(f), tspan, p; kwargs...)
end

@doc doc"""
Expand Down Expand Up @@ -262,7 +263,7 @@
This is determined automatically, but not inferred.
"""
function NonlinearProblem{iip}(f, u0, p = NullParameters(); kwargs...) where {iip}
NonlinearProblem{iip}(NonlinearFunction{iip}(f), u0, p; kwargs...)
NonlinearProblem{iip}(NonlinearFunction{iip, DEFAULT_SPECIALIZATION}(f), u0, p; kwargs...)
end
end

Expand All @@ -277,7 +278,8 @@
end

function NonlinearProblem(f, u0, p = NullParameters(); kwargs...)
NonlinearProblem(NonlinearFunction(f), u0, p; kwargs...)
iip = isinplace(f, 3)
NonlinearProblem(NonlinearFunction{iip, DEFAULT_SPECIALIZATION}(f), u0, p; kwargs...)
end

"""
Expand Down Expand Up @@ -372,7 +374,7 @@
end

function NonlinearLeastSquaresProblem{iip}(f, u0, p = NullParameters()) where {iip}
return NonlinearLeastSquaresProblem{iip}(NonlinearFunction{iip}(f), u0, p)
return NonlinearLeastSquaresProblem{iip}(NonlinearFunction{iip, DEFAULT_SPECIALIZATION}(f), u0, p)

Check warning on line 377 in src/problems/basic_problems.jl

View check run for this annotation

Codecov / codecov/patch

src/problems/basic_problems.jl#L377

Added line #L377 was not covered by tests
end
end

Expand All @@ -388,7 +390,8 @@
end

function NonlinearLeastSquaresProblem(f, u0, p = NullParameters(); kwargs...)
return NonlinearLeastSquaresProblem(NonlinearFunction(f), u0, p; kwargs...)
iip = isinplace(f, 3)
return NonlinearLeastSquaresProblem(NonlinearFunction{iip, DEFAULT_SPECIALIZATION}(f), u0, p; kwargs...)

Check warning on line 394 in src/problems/basic_problems.jl

View check run for this annotation

Codecov / codecov/patch

src/problems/basic_problems.jl#L393-L394

Added lines #L393 - L394 were not covered by tests
end

@doc doc"""
Expand Down
Loading