Jacobian Wrappers

NonlinearSolveBase.construct_jacobian_cache — Function
construct_jacobian_cache(
    prob, alg, f, fu, u = prob.u0, p = prob.p;
    autodiff = nothing, vjp_autodiff = nothing, jvp_autodiff = nothing,
    linsolve = missing
)

Construct a cache for the Jacobian of f w.r.t. u.

Arguments

  • prob: A NonlinearProblem or a NonlinearLeastSquaresProblem from SciMLBase.
  • alg: A AbstractNonlinearSolveAlgorithm. Used to check for concrete_jac.
  • f: The function to compute the Jacobian of.
  • fu: The evaluation of f(u, p) or f(_, 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 a JacobianOperator instead.
source
NonlinearSolveBase.reused_jacobian — Function
reused_jacobian(cache, u)

Return the Jacobian object from cache for reuse at the current state u.

For concrete Jacobian caches this returns the stored matrix-like object. For matrix-free JacobianOperator caches it returns a StatefulJacobianOperator bound to u and the cache parameters.

Arguments

Returns

A matrix-like Jacobian or stateful Jacobian operator suitable for descent and linear solve initialization.

source