Initializing help system before first use

# XPRS_msp_getsol

Purpose
Returns the solution values for a solution stored in the MIP solution pool.
Synopsis
`int XPRS_CC XPRS_msp_getsol(XPRSmipsolpool msp, const int iSolutionId, int * const iSolutionIdStatus, double x[], const int iColFirst, const int iColLast, int * const nValuesReturned)`
Arguments

Msp | The current MIP solution pool.
iSolutionId | The id of the required solution.
iSolutionIdStatus | Pointer to an int where the status of the iSolutionId will be returned. The returned value is one of:
-2 | Solution id does not exist;
-1 | Solution with the given id is already deleted;
0 | Solution id was for an active solution.
x | Double array where the values of the solution will be returned. May be NULL if not required.
iColFirst | Index of the column whose solution value is to be returned in the first element of array x. If iColLast > iColFirst then any subsequent columns are to have their values written to the subsequent elements of x.
iColLast | If x is non-NULL then at most iColLast - iColFirst + 1 solution values will be written to x. There will be fewer solution values written if iColLast is greater than or equal to the number of columns in the solution.
nValuesReturned | Pointer to an integer where the number of solution values that were available to be written is returned. This number will always be less than or equal to iColLast - iColFirst + 1. A value is returned for this parameter regardless of whether x is passed as NULL. May be NULL if not required.

Further information
1. It is an error condition if iColLast < iColFirst or iColFirst < 0 or if iColFirst is greater than or equal to the number of columns in the solution.
2. The user will obtain the solution id iSolutionId from interaction with the MIP solution pool via functions such as XPRS_msp_findsolbyname, XPRS_msp_getdblattribprobextreme, XPRS_msp_getintattribprobextreme and XPRS_msp_getsollist.
3. By passing x as NULL and setting iColFirst to 0 and iColLast to a large positive integer it is possible to use XPRS_msp_getsol to obtain in the nValuesReturned parameter the number of columns in the solution.
Related topics
XPRS_msp_findsolbyname, XPRS_msp_getdblattribprobextreme, XPRS_msp_getintattribprobextreme, XPRS_msp_getsollist.
Parent Topic MSP Functions

© 2001-2026 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.