Purpose
Writes the current
basis to a file for later input into the Optimizer.
Synopsis
int XPRS_CC XPRSwritebasis(XPRSprob prob, const char *filename, const char *flags);
WRITEBASIS [-flags] [filename]
Arguments
prob
|
The current problem.
|
filename
|
A string of up to
MAXPROBNAMELENGTH characters containing the file name from which the basis is to be written. If omitted, the default
problem_name is used with a
.bss extension.
|
flags
|
Flags to pass to
XPRSwritebasis (
WRITEBASIS):
i
|
output the internal presolved basis;
|
t
|
output a compact advanced form of the basis;
|
n
|
output basis file containing current solution values;
|
h
|
output values in single precision;
|
p
|
output values in full precision (obsolete as this is now default behavior);
|
v
|
use the provided filename verbatim, without appending the
.bss extension;
|
z
|
compress the output file.
|
|
Example 1 (Library)
After an LP has been solved it may be desirable to save the basis for future input as an advanced starting point for other similar problems. This may save significant amounts of time if the LP is complex. The Optimizer input commands might then be:
XPRSreadprob(prob, "myprob", "");
XPRSlpoptimize(prob, "");
XPRSwritebasis(prob, "", "");
This reads in a matrix file, maximizes the LP and saves the basis. Loading a basis for a MIP problem can disable some MIP presolve operations which can result in a large increase in solution times so it is generally not recommended.
See also example
addmipsol.c.
Example 2 (Console)
An equivalent set of commands to the above for console users would be:
READPROB
LPOPTIMIZE
WRITEBASIS
Further information
1. The
t flag is only useful for later input to a similar problem using the
t flag with
XPRSreadbasis (
READBASIS).
2. If the Newton barrier or hybrid gradient algorithms have been used for optimization then crossover must have been performed before there is a valid basis. This basis can then be used for restarting the simplex (primal or dual) or the hybrid gradient algorithms.
3.
XPRSwritebasis (
WRITEBASIS) will output the basis for the original problem even if the matrix has been presolved.
Related topics
© 2001-2024 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.