CompactQuasiNewtonModel.GradientEvaluator Property

Gets or sets the gradient callback function that the solver invokes periodically in order to obtain gradient information for different variable values.

Namespace:  Microsoft.SolverFoundation.Solvers
Assembly:  Microsoft.Solver.Foundation (in Microsoft.Solver.Foundation.dll)

Syntax

'Declaration
Public Property GradientEvaluator As Action
    Get
    Set
public Action GradientEvaluator { get; set; }
public:
virtual property Action^ GradientEvaluator {
    Action^ get () sealed;
    void set (Action^ value) sealed;
}
abstract GradientEvaluator : Action with get, set
override GradientEvaluator : Action with get, set
final function get GradientEvaluator () : Action
final function set GradientEvaluator (value : Action)

Property Value

Type: System.Action<T1, T2, T3, T4, T5>
The gradient callback function.

Implements

INonlinearModel.GradientEvaluator

Remarks

The gradient callback function should set the ValuesByIndex gradient values for all variables that were previously declared as active by the SetActiveVariables method.

The gradient callback function has the following arguments:

The first argument is the INonlinearModel that is being solved.

The second argument is an Int32 that represents the row variable index to be evaluated, which is a goal or constraint.

The third argument is a ValuesByIndex that contains the current variable values that are accessible by index.

The fourth argument is a Boolean that indicates whether this is the first evaluator call that has the current variable values.

The fifth argument is a ValuesByIndex object that should contain the passed-in gradient values when the function returns.

.NET Framework Security

See Also

Reference

CompactQuasiNewtonModel Class

Microsoft.SolverFoundation.Solvers Namespace