Skip to content

Test of low overhead mode #87

New issue

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

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

Already on GitHub? # to your account

Closed
ChrisRackauckas opened this issue Sep 15, 2022 · 0 comments
Closed

Test of low overhead mode #87

ChrisRackauckas opened this issue Sep 15, 2022 · 0 comments

Comments

@ChrisRackauckas
Copy link
Member

using NonlinearSolve
N = 100_000;
levels = 1.5 .* rand(N);
out = zeros(N);
myfun(x, lv) = x * sin(x) - lv

function f(out, levels, u0)
    for i in 1:N
        out[i] = solve(NonlinearProblem{false}(NonlinearFunction{false}(myfun),
                u0, levels[i]), Falsi()).u
    end
end

function f2(out, levels, u0)
    for i in 1:N
        out[i] = solve(NonlinearProblem{false}(NonlinearFunction{false}(myfun),
                u0, levels[i]), NewtonRaphson()).u
    end
end
@time f(out, levels, (0.0, 2.0))
@time f2(out, levels, 1.0)
avik-pal pushed a commit that referenced this issue Nov 1, 2024
Add matrix resizing and fix cases with u0 as a matrix
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant