HessianFunction.FromProduct Method

Adapts an objective Hessian-vector product to an optimizer Hessian function.

Definition

Namespace: Numerics.NET.Optimization
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.10.0
C#
public static Func<Vector<double>, LinearOperator<double>?, LinearOperator<double>> FromProduct(
	Action<Vector<double>, Vector<double>, Vector<double>> multiply
)

Parameters

multiply  Action<Vector<Double>, Vector<Double>, Vector<Double>>
A callback receiving the point, direction and destination. Write every component of the objective Hessian times the direction into the destination.

Return Value

Func<Vector<Double>, LinearOperator<Double>, LinearOperator<Double>>
A function assignable to Hessian.

Remarks

Each evaluation copies the point into a protected snapshot and returns a new operator. The previous-operator argument is ignored. An earlier operator remains valid after later evaluations or changes to the original point.

The callback must represent a real symmetric Hessian. Transpose and conjugate transpose products use the same callback; symmetry is a caller obligation and is not checked. Use the original objective sign, including when maximizing.

The point and direction are read-only inputs. The destination belongs to the operator's caller; fully overwrite it and do not retain it. A destination is allocated when none is supplied. The adapter separates a direction and destination that are the same vector instance. Callback exceptions propagate. Concurrent products require a thread-safe callback.

The operator provides multiplication only. It supplies no explicit matrix entries, direct solves or sparse preconditioner. Use a matrix Hessian when these are needed.

Exceptions

ArgumentNullExceptionmultiply is null, or the returned function is evaluated with a null point.

See Also