Skip to content

add nlsolve method for scalar functions? #272

Open
@stevengj

Description

@stevengj

Would be nice to have a method for scalar functions, simply by dispatching on scalar initial values. In its simplest form, this could be:

nlsolve(f, initial_x::Number; kwargs...) =
    nlsolve(x -> f(x[]), fill(initial_x); kwargs...)

which works by wrapping and unwrapping 0-dimensional arrays. (Note: this requires JuliaNLSolvers/NLSolversBase.jl#141.) That way, for the case of scalar functions you wouldn't have to go to the trouble of wrapping in an array yourself.

Of course, in the longer run you could have optimized methods for the scalar (0-dimensional) case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions