objfun must calculate the objective function and (optionally) its gradient for a specified -vector .
Syntax
C# |
---|
public delegate void E04WD_OBJFUN( ref int mode, int n, double[] x, ref double objf, double[] grad, int nstate ) |
Visual Basic |
---|
Public Delegate Sub E04WD_OBJFUN ( _ ByRef mode As Integer, _ n As Integer, _ x As Double(), _ ByRef objf As Double, _ grad As Double(), _ nstate As Integer _ ) |
Visual C++ |
---|
public delegate void E04WD_OBJFUN( int% mode, int n, array<double>^ x, double% objf, array<double>^ grad, int nstate ) |
F# |
---|
type E04WD_OBJFUN = delegate of mode : int byref * n : int * x : float[] * objf : float byref * grad : float[] * nstate : int -> unit |
Parameters
- mode
- Type: System..::..Int32%On entry: is set by e04wd to indicate which values must be assigned during each call of objfun. Only the following values need be assigned:On exit: may be used to indicate that you are unable or unwilling to evaluate the objective function at the current .During the linesearch, the function is evaluated at points of the form after they have already been evaluated satisfactorily at . For any such , if you set , e04wd will reduce and evaluate the functions again (closer to , where they are more likely to be defined).If for some reason you wish to terminate the current problem, set .
- n
- Type: System..::..Int32On entry: , the number of variables.
- x
- Type: array<System..::..Double>[]()[][]On entry: , the vector of variables at which the objective function and/or all available elements of its gradient are to be evaluated.
- objf
- Type: System..::..Double%On exit: if or , objf must be set to the value of the objective function at .
- grad
- Type: array<System..::..Double>[]()[][]On entry: the elements of grad are set to special values.On exit: if or , grad must return the available elements of the gradient evaluated at , i.e., contains the partial derivative .
- nstate
- Type: System..::..Int32