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

feat: add NonlinearSolveHomotopyContinuation.jl #523

Merged
merged 24 commits into from
Jan 31, 2025
Merged
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
879fbd3
feat: add `NonlinearSolveHomotopyContinuation.jl`
AayushSabharwal Dec 26, 2024
6addac3
feat: add `solve` implementations
AayushSabharwal Dec 26, 2024
12ea884
test: add tests for all roots solve
AayushSabharwal Dec 26, 2024
c83c95a
fix: fix jacobian implementation, add taylor implementation
AayushSabharwal Jan 6, 2025
fea7609
fix: fix system evaluate and jacobian
AayushSabharwal Jan 10, 2025
a048ca0
fix: fix inplace system taylor
AayushSabharwal Jan 10, 2025
80ff4a7
fix: fix homotopy and implement taylor
AayushSabharwal Jan 10, 2025
48d0f7a
fix: fix jacobian building for systems
AayushSabharwal Jan 10, 2025
af30f5e
fix: fix single root solve implementation
AayushSabharwal Jan 10, 2025
2026034
build: add TaylorSeries as a dependency
AayushSabharwal Jan 10, 2025
db21cf8
fix: fix jacobian and taylor implementations
AayushSabharwal Jan 26, 2025
75aabbb
test: add tests for single roots, fix allroots tests
AayushSabharwal Jan 26, 2025
d7972af
build: add compat entries
AayushSabharwal Jan 26, 2025
4a8def3
docs: add docstrings to NonlinearSolveHomotopyContinuation.jl
AayushSabharwal Jan 26, 2025
c2aa812
ci: add NonlinearSolveHomotopyContinuation.jl to CI
AayushSabharwal Jan 26, 2025
a6f6e7b
docs: add NonlinearSolveHomotopyContinuation to docs
AayushSabharwal Jan 26, 2025
9c9bc79
build: fix LinearAlgebra compat
AayushSabharwal Jan 26, 2025
d9b3378
test: do not rely on singular roots for tests
AayushSabharwal Jan 27, 2025
f66af4e
test: sort roots in `allroots` test
AayushSabharwal Jan 27, 2025
ac6c3dc
refactor: format
AayushSabharwal Jan 27, 2025
8fa843c
test: do not rely on singular roots
AayushSabharwal Jan 27, 2025
1decea6
Update homotopycontinuation.md
ChrisRackauckas Jan 28, 2025
5426e99
docs: add `NonlinearSolveHomotopyContinuation` to doc build
AayushSabharwal Jan 29, 2025
d2e8ec6
refactor: use TaylorDiff.jl instead of TaylorSeries.jl
AayushSabharwal Jan 29, 2025
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
Prev Previous commit
Next Next commit
fix: fix system evaluate and jacobian
AayushSabharwal committed Jan 26, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit fea76097fc603ea9ec853b894ab679aee39ff5ee
Original file line number Diff line number Diff line change
@@ -18,15 +18,18 @@ HC.ModelKit.variables(sys::HomotopySystemWrapper) = sys.vars

function HC.ModelKit.evaluate!(u, sys::HomotopySystemWrapper{Inplace}, x, p = nothing)
sys.prob.f.f(u, x, parameter_values(sys.prob))
return u
end

function HC.ModelKit.evaluate!(u, sys::HomotopySystemWrapper{OutOfPlace}, x, p = nothing)
values = sys.prob.f.f(x, parameter_values(sys.prob))
copyto!(u, values)
return u
end

function HC.ModelKit.evaluate!(u, sys::HomotopySystemWrapper{Scalar}, x, p = nothing)
u[1] = sys.prob.f.f(only(x), parameter_values(sys.prob))
return u
end

function HC.ModelKit.evaluate_and_jacobian!(u, U, sys::HomotopySystemWrapper{Inplace}, x, p = nothing)
@@ -43,6 +46,7 @@ function HC.ModelKit.evaluate_and_jacobian!(u, U, sys::HomotopySystemWrapper{Inp
DI.value_and_jacobian!(f.f, u_tmp, U_tmp, sys.prep, sys.autodiff, x_tmp, DI.Constant(p))
copyto!(u, u_tmp)
copyto!(U, U_tmp)
return u, U
end

function HC.ModelKit.evaluate_and_jacobian!(u, U, sys::HomotopySystemWrapper{OutOfPlace}, x, p = nothing)
@@ -60,6 +64,7 @@ function HC.ModelKit.evaluate_and_jacobian!(u, U, sys::HomotopySystemWrapper{Out
u_tmp, _ = DI.value_and_jacobian!(f.f, U_tmp, sys.prep, sys.autodiff, x_tmp, DI.Constant(p))
copyto!(u, u_tmp)
copyto!(U, U_tmp)
return u, U
end

function HC.ModelKit.evaluate_and_jacobian!(u, U, sys::HomotopySystemWrapper{Scalar}, x, p = nothing)
@@ -72,7 +77,7 @@ function HC.ModelKit.evaluate_and_jacobian!(u, U, sys::HomotopySystemWrapper{Sca
x = real(first(x))
u[1], U[1] = DI.value_and_derivative(f.f, sys.prep, sys.autodiff, x, DI.Constant(p))
end
return nothing
return u, U
end

function HC.ModelKit.taylor!(u::AbstractVector, ::Val{N}, sys::HomotopySystemWrapper{Inplace}, x::HC.ModelKit.TaylorVector{M}, p = nothing) where {N, M}