Jacobian Wrappers
NonlinearSolve.AbstractNonlinearSolveJacobianCache
— TypeAbstractNonlinearSolveJacobianCache{iip} <: Function
Abstract Type for all Jacobian Caches used in NonlinearSolve.jl.
NonlinearSolve.JacobianCache
— TypeJacobianCache(prob, alg, f::F, fu, u, p; autodiff = nothing,
vjp_autodiff = nothing, jvp_autodiff = nothing, linsolve = missing) where {F}
Construct a cache for the Jacobian of f
w.r.t. u
.
Arguments
prob
: ANonlinearProblem
or aNonlinearLeastSquaresProblem
.alg
: AAbstractNonlinearSolveAlgorithm
. Used to check forconcrete_jac
.f
: The function to compute the Jacobian of.fu
: The evaluation off(u, p)
orf(_, u, p)
. Used to determine the size of the result cache and Jacobian.u
: The current value of the state.p
: The current value of the parameters.
Keyword Arguments
autodiff
: Automatic Differentiation or Finite Differencing backend for computing the jacobian. By default, selects a backend based on sparsity parameters, type of state, function properties, etc.vjp_autodiff
: Automatic Differentiation or Finite Differencing backend for computing the vector-Jacobian product.jvp_autodiff
: Automatic Differentiation or Finite Differencing backend for computing the Jacobian-vector product.linsolve
: Linear Solver Algorithm used to determine if we need a concrete jacobian or if possible we can just use aNonlinearSolve.JacobianOperator
instead.
SimpleNonlinearSolve functions
SimpleNonlinearSolve.jacobian_cache
— Functionjacobian_cache(ad, f, y, x, p) --> J, cache
Returns a Jacobian Matrix and a cache for the Jacobian computation.
SimpleNonlinearSolve.value_and_jacobian
— Functionvalue_and_jacobian(ad, f, y, x, p, cache; J = nothing)
Compute f(x), d/dx f(x)
in the most efficient way based on ad
. None of the arguments except cache
(& J
if not nothing) are mutated.