Click or drag to resize

OptimizerMultivariableFunctionComputeGradientsNumerically Method

Computes the gradients of an OptimizerMultivariableFunction numerically. This will call the appropriate events on the functions as they are computed.

Namespace:  AGI.Foundation.NumericalMethods
Assembly:  AGI.Foundation.Core (in AGI.Foundation.Core.dll) Version: 23.2.417.0 (23.2.417.0)
public static NumericallyComputedOptimizerFunctionDerivativeResults ComputeGradientsNumerically(
	OptimizerMultivariableFunction function,
	double[] variables,
	double[] perturbationValues,
	FiniteDifferenceMethod differenceMethod,
	bool multithreaded,
	OptimizerMultivariableFunctionResults precomputedValueResults,
	ITrackCalculationProgress progressTracker


Type: AGI.Foundation.NumericalMethodsOptimizerMultivariableFunction
The OptimizerMultivariableFunction to compute the gradients for.
Type: SystemDouble
The independent variables that are used to compute the gradients.
Type: SystemDouble
How much each of the variables should be perturbed while computing the gradients.
Type: AGI.Foundation.NumericalMethodsFiniteDifferenceMethod
The differencing method to use to numerically compute the derivatives.
Type: SystemBoolean
Should this routine use a multithreaded algorithm. Usually the multithreaded algorithm will be faster, however in cases where there are very few variables and the function evaluates very quickly, it may be faster to set this to false.
Type: AGI.Foundation.NumericalMethodsOptimizerMultivariableFunctionResults
The function results at the variables. This is optional; if this is then the function will be evaluated at the variables.
Type: AGI.FoundationITrackCalculationProgress
An optional progress tracker.

Return Value

Type: NumericallyComputedOptimizerFunctionDerivativeResults
The evaluated gradients of the cost function, equality constraints, and inequality constraints.
See Also