1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<HEAD>
<TITLE>read_params</TITLE>
<style TYPE="text/css"> BODY { font-family:verdana,arial,helvetica; margin:0; }
</style>
</HEAD>
<BODY>
<TABLE STYLE="TABLE-LAYOUT:fixed" class="clsContainer" CELLPADDING="15" CELLSPACING="0"
WIDTH="100%" BORDER="0">
<TR>
<TD VALIGN="top">
<h1>read_params</h1>
<p>Read settings from a parameter file.</p>
<P><B>unsigned char read_params(lprec </b>*<i>lp</i>, <b>char </B>*<I>filename</I><B>, char </B>*<I>options</I><B>);</B></P>
<p class="label">
<b>Return Value</b></p>
<p>Returns TRUE (1) if parameters could be read, else FALSE (0).</p>
<p class="label">
<b>Parameters</b></p>
<p class="dt">
<i>lp</i></p>
<p class="indent">
Pointer to previously created lp model. See return value of <A HREF="make_lp.htm">make_lp</A>, <A HREF="copy_lp.htm">copy_lp</A>,
<A HREF="read_lp.htm">read_lp, read_LP</A>, <A HREF="read_mps.htm">read_mps, read_freemps, read_MPS, read_freeMPS</A>, <A HREF="read_XLI.htm">read_XLI</A></p>
<P class="dt"><I>filename</I></P>
<P class="indent">
Filename to read the parameters from.
<P class="indent">
<i>options</i>
<p class="indent">Optional options. Can be:<br>
-h header: Read parameters at specified header. By default this is Default</p>
<p class="label">
<b>Remarks</b></p>
<p>lp_solve parameters (options) are read from a parameter file.
This file has an ini-format as used by Windows applications.
All parameters are read from a header. This is by default [Default].
The header can be specified in the <i>options</i> parameter.
Other headers are ignored.</p>
<P>Example parameter file:</P>
<pre>[Default]
; lp_solve version 5.5 settings
anti_degen=ANTIDEGEN_FIXEDVARS + ANTIDEGEN_STALLING + ANTIDEGEN_INFEASIBLE
basiscrash=CRASH_NONE
improve=IMPROVE_DUALFEAS + IMPROVE_THETAGAP
maxpivot=250
negrange=-1e+006
pivoting=PRICER_DEVEX + PRICE_ADAPTIVE
presolve=PRESOLVE_NONE
presolveloops=2147483647
scalelimit=5
scaling=SCALE_GEOMETRIC + SCALE_EQUILIBRATE + SCALE_INTEGERS
simplextype=SIMPLEX_DUAL_PRIMAL
bb_depthlimit=-50
bb_floorfirst=BRANCH_AUTOMATIC
bb_rule=NODE_PSEUDONONINTSELECT + NODE_GREEDYMODE + NODE_DYNAMICMODE + NODE_RCOSTFIXING
;break_at_first=0
;break_at_value=-1e+030
mip_gap_abs=1e-011
mip_gap_rel=1e-011
epsint=1e-007
epsb=1e-010
epsd=1e-009
epsel=1e-012
epsperturb=1e-005
epspivot=2e-007
infinite=1e+030
;debug=0
;obj_bound=1e+030
;print_sol=0
;timeout=0
;trace=0
;verbose=NORMAL</pre>
<P>Note that there are some options commented out (;). This is done because these
options can not be used in general for all models or because they are debug/trace/print
options. These options can be made active and will be read by <i>read_params</i>
but note again that they are possible dangerous to be used in general (except for the
debug/trace/print options). Note that there are two kind of entries:</P>
<ul>
<li>Numerical values</li>
<li>Options</li>
</ul>
<p>Numercial values can be integer values like maxpivot or floating point values like epsel</p>
<p>Options are a combination of constants as defined in the manual. Multiple options are added with +.
For example option anti_degen.</p>
<p class="label">
<b>Example</b></p>
<pre><code>#include <stdio.h>
#include <stdlib.h>
#include "lp_lib.h"
int main(void)
{
lprec *lp;
/* Create a new LP model */
lp = make_lp(0, 0);
if(lp == NULL) {
fprintf(stderr, "Unable to create new LP model\n");
return(1);
}
read_params(lp, "a.ini", "-h MyParams"); /* Will read parameters from file a.ini under section MyParams */
delete_lp(lp);
return(0);
}
</code></pre>
<p>
<A HREF="lp_solveAPIreference.htm">lp_solve API reference</A></p>
<p>
<b>See Also</b> <A HREF="make_lp.htm">make_lp</A>, <A HREF="copy_lp.htm">copy_lp</A>,
<A href="read_lp.htm">read_lp, read_LP</A>, <A HREF="read_mps.htm">read_mps,
read_freemps, read_MPS, read_freeMPS</A>, <A HREF="read_XLI.htm">read_XLI</A>,
<A href="write_params.htm">write_params</A>,
<A href="reset_params.htm">reset_params</A></p>
</TD>
</TR>
</TABLE>
</BODY>
</html>
|