Purpose
Reads an ASCII solution file (
.slx) created by the
XPRSwriteslxsol function.
Topic areas
Synopsis
int XPRSreadslxsol(XPRSprob prob, const char *filename, const char *flags);
READSLXSOL -[flags] [filename]
Arguments
|
prob
|
The current problem.
|
|
filename
|
A string of up to
MAXPROBNAMELENGTH characters containing the file name to which the solution is to be read. If omitted, the default
problem_name is used with a
.slx extension.
|
|
flags
|
Flags to pass to
XPRSreadslxsol (
READSLXSOL):
|
a
|
read multiple MIP solutions from the
.slx file and add them to the MIP problem;
|
|
l
|
read the solution as an LP solution in case of a MIP problem;
|
|
m
|
read the solution as a solution for the MIP problem;
|
|
p
|
interpret the solution as partial: use
XPRSaddmipsol for solutions with undefined column values, potentially triggering a large neighborhood search heuristic to complete the solution. Overrides the solution type given in the file;
|
|
q
|
interpret the solution as sparse: fill undefined column values with zero. Overrides the solution type given in the file;
|
|
v
|
use the provided filename verbatim, without appending the
.slx extension;
|
|
z
|
read a compressed input file;
|
|
Example 1 (Library)
XPRSreadslxsol(prob,"lpsolution","");
This loads the solution to the MIP problem if the problem contains MIP entities, or otherwise loads it as an LP (barrier in case of quadratic problems) solution into the problem.
Example 2 (Console)
Which is equivalent to the library example above.
Further information
1. When
XPRSreadslxsol is called before a MIP solve, the loaded solutions will not be checked before calling
XPRSmipoptimize. By default, only the last MIP solution read from the
.slx file will be stored. Use the
a flag to store all MIP solutions read from the file.
2. When using the
a flag, read solutions will be queued similarly to the user of the
XPRSaddmipsol function. Each name string given by the
NAME field in the
.slx file will be associated with the corresponding solution. Any registered
usersolnotify callback will be fired when the solution has been checked, and will include the read name string as one of its arguments.
3. Note that when solving with FICO Xpress Global (including non-convex quadratic problems), the
a flag always needs to be provided.
4. Solutions can have different types such as sparse or dense, and
XPRSreadslxsol respects the type specified in the file. For backwards compatibility, solutions that omit the type are treated as sparse solutions, and missing solution values are set to zero.
Related topics
© 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.