LeastSquaresOptimizer.JacobianFunction Property

Gets or sets a delegate that computes the Jacobian of the problem.

Definition

Namespace: Numerics.NET.Optimization
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.9.0
C#
public Func<Vector<double>, Matrix<double>?, Matrix<double>> JacobianFunction { get; set; }

Property Value

Func<Vector<Double>, Matrix<Double>, Matrix<Double>>
A function returning the Jacobian evaluated at its first argument. The second argument is a reusable matrix buffer.

Remarks

The Jacobian contains the derivative of each residual with respect to each variable. A residual is one of the values returned by ObjectiveFunction. The returned matrix must have one row per residual and one column per variable. The callback may update the supplied buffer or return another matrix. The callback must return a non-null matrix and overwrite entries that change, including derivatives that become zero. Its dimensions must remain fixed during a solve. Both standard least-squares optimizers support sparse Jacobians; UseSparseJacobian avoids its initial dense buffer.

Exceptions

InvalidOperationExceptionA calculation is in progress.

See Also