The following example sets the validation tolerance parameters, validates the
converged solution and retrieves the validation indices.
double IndexA, IndexR;
XSLPsetdblcontrol(Prob, XSLP_VALIDATIONTOL_A, 0.001);
XSLPsetdblcontrol(Prob, XSLP_VALIDATIONTOL_R, 0.001);
XSLPvalidate(Prob);
XSLPgetdblattrib(Prob, XSLP_VALIDATIONINDEX_A, &IndexA);
XSLPgetdblattrib(Prob, XSLP_VALIDATIONINDEX_R, &IndexA);
XSLPvalidate checks the feasibility of a converged solution
against relative and absolute tolerances for each constraint. The left hand side and the
right hand side of the constraint are calculated using the converged solution values. If
the calculated values imply that the constraint is infeasible, then the difference
(
D) is tested against the absolute and relative validation tolerances.
If
D < XSLP_VALIDATIONTOL_A
then the constraint is within the absolute validation tolerance. The total positive
(
TPos) and negative contributions (
TNeg) to the left
hand side are also calculated.
If
D < MAX(ABS(TPos), ABS(TNeg))* XSLP_VALIDATIONTOL_R
then the constraint is within the relative validation tolerance. For each constraint which
is outside both the absolute and relative validation tolerances, validation factors are
calculated which are the factors by which the infeasibility exceeds the corresponding
validation tolerance; the smallest factor is printed in the validation report.
The validation index
XSLP_VALIDATIONINDEX_A is the largest absolute
validation factor multiplied by the absolute validation tolerance;
the validation index
XSLP_VALIDATIONINDEX_R is the largest relative
validation factor multiplied by the relative validation tolerance.