GAMSlinks
0.4
|
Go to the source code of this file.
Functions | |
int | smagSingleHessians (smagHandle_t prob, int *hesRowIdx, int *hesColIdx, double *hesValue, int hesSize, int *rowStart) |
Gives the structure of the Hessian of the objective and each constraint separately. More... | |
int | smagEvalObjGradProd (smagHandle_t prob, double *x, double *d, double *f, double *df_d) |
EXPERIMENTAL FUNCTION: Computes the directional derivative of the objective function. More... | |
int smagSingleHessians | ( | smagHandle_t | prob, |
int * | hesRowIdx, | ||
int * | hesColIdx, | ||
double * | hesValue, | ||
int | hesSize, | ||
int * | rowStart | ||
) |
Gives the structure of the Hessian of the objective and each constraint separately.
The user provides space to store the row/col indices and values of hessian entries. The Hessians of all constraints and the objective are stored in one contiguous array. Only the values from the lower-left part of the Hessian are returned. rowStart indicates where the entries for which constraint of the Hessian start. The entries for the objective are found at index rowstart[smagRowCount()]. That is, hesRowIdx[rowStart[connr]..rowStart[connr]-1] are the row indices of the elements in the Hessian of constraint connr if connr<smagRowCount() or the objective if connr==smagRowCount(). Similar for hesColIdx. The Hessian values are computed in the initial level values of the variables and are stored in hesValue. Giving NULL for hesValue switches off the computation of hessian entry values. hesSize should be large enough to store the indices and columns of all Hessians. GAMS uses the estimate 10*prob->gms.nnz*prob->gms.workfactor for the size of the Hessian of the Lagrangian.
prob | Pointer to smag structure. |
hesRowIdx | Storage for row indices for each Hessian of size at least hesSize. |
hesColIdx | Storage for column indices for each Hessian of size at least hesSize. |
hesValue | Storage for values each Hessian of size at least hesSize or NULL. |
hesSize | The size of the first three arrays. |
rowStart | Storage for indices where the Hessian of objective and each constraint starts of size at least smagRowCount()+2. |
int smagEvalObjGradProd | ( | smagHandle_t | prob, |
double * | x, | ||
double * | d, | ||
double * | f, | ||
double * | df_d | ||
) |
EXPERIMENTAL FUNCTION: Computes the directional derivative of the objective function.
Given a vector x and a direction d, computes the function value f(x) and the product <grad f(x), d>.
prob | Pointer to smag structure. |
x | Array of length smagColCount(prob) containing the point where f(x) is evaluated. |
d | Array of length smagColCount(prob) containing the direction in which the derivative is computed. |
f | Storage for function value. |
df_d | Storage for directional derivative. |