XPRSgetlpsol


Purpose
Used to obtain the LP solution values following optimization.
Synopsis
int XPRS_CC XPRSgetlpsol(XPRSprob prob, double x[], double slack[], double dual[], double dj[]);
Arguments
prob 
The current problem.
Double array of length COLS where the values of the primal variables will be returned. May be NULL if not required.
slack 
Double array of length ROWS where the values of the slack variables will be returned. May be NULL if not required.
dual 
Double array of length ROWS where the values of the dual variables will be returned. May be NULL if not required.
dj 
Double array of length COLS where the reduced cost for each variable will be returned. May be NULL if not required.
Example
The following sequence of commands will get the LP solution (x) at the top node of a MIP and the optimal MIP solution (y):
int cols;
double *x, *y;
...
XPRSmaxim(prob,"");
XPRSgetintattrib(prob,XPRS_ORIGINALCOLS,&cols);
x = malloc(cols*sizeof(double));
XPRSgetlpsol(prob,x,NULL,NULL,NULL);
XPRSglobal(prob);
y = malloc(cols*sizeof(double));
XPRSgetmipsol(prob,y,NULL);
Further information
1. If called during an XPRSglobal callback the solution of the current node will be returned.
2. If the matrix is modified after calling XPRSmaxim or XPRSminim, then the solution will no longer be available.
3. If the problem has been presolved, then XPRSgetlpsol returns the solution to the original problem. The only way to obtain the presolved solution is to call the related function, XPRSgetpresolvesol.
Related topics
XPRSgetpresolvesol, XPRSgetmipsol, XPRSwriteprtsol, XPRSwritesol.


If you have any comments or suggestions about these pages, please send mail to docs@dashoptimization.com.