/usr/share/doc/lp-solve-doc/is_scalemode.htm is in lp-solve-doc 5.5.0.13-7.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<HEAD>
<TITLE>is_scalemode</TITLE>
<style TYPE="text/css"> BODY { font-family:verdana,arial,helvetica; margin:0; }
</style>
</HEAD>
<BODY>
<TABLE class="clsContainer" style="TABLE-LAYOUT: fixed" cellSpacing="0" cellPadding="15"
width="100%" border="0">
<TR>
<TD vAlign="top">
<h1>is_scalemode</h1>
<p>Returns if scaling mode specified in <i>testmask</i> is active.</p>
<p><b>unsigned char is_scalemode(lprec </b>*<i>lp</i><b>, int </b><i>testmask</i><b>);</b></p>
<p class="label"><b>Return Value</b></p>
<p><b>is_scalemode</b> returns if scaling mode specified in <i>testmask</i>
is active.
<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>testmask</i></p>
<TABLE id="Table3" cellSpacing="1" cellPadding="1" width="100%" border="1">
<TR>
<TD>SCALE_EXTREME (1)</TD>
<TD>Scale to convergence using largest absolute value</TD>
</TR>
<TR>
<TD>SCALE_RANGE (2)</TD>
<TD>Scale based on the simple numerical range</TD>
</TR>
<TR>
<TD>
SCALE_MEAN (3)</TD>
<TD>Numerical range-based scaling</TD>
</TR>
<TR>
<TD>SCALE_GEOMETRIC (4)</TD>
<TD>Geometric scaling</TD>
</TR>
<TR>
<TD>SCALE_CURTISREID (7)</TD>
<TD>Curtis-reid scaling</TD>
</TR>
</TABLE>
<p>
Additionally, the value can be OR-ed with any combination of one of the
following values:</p>
<TABLE id="Table4" cellSpacing="1" cellPadding="1" width="100%" border="1">
<TR>
<TD>SCALE_QUADRATIC (8)</TD>
<TD> </TD>
</TR>
<TR>
<TD>SCALE_LOGARITHMIC (16)</TD>
<TD>Scale to convergence using logarithmic mean of all values</TD>
</TR>
<TR>
<TD>SCALE_USERWEIGHT (31)</TD>
<TD>User can specify scalars</TD>
</TR>
<TR>
<TD>SCALE_POWER2 (32)</TD>
<TD>also do Power scaling</TD>
</TR>
<TR>
<TD>SCALE_EQUILIBRATE (64)</TD>
<TD>Make sure that no scaled number is above 1</TD>
</TR>
<TR>
<TD>SCALE_INTEGERS (128)</TD>
<TD>also scaling integer variables</TD>
</TR>
<TR>
<TD>SCALE_DYNUPDATE (256)</TD>
<TD>dynamic update</TD>
</TR>
<TR>
<TD>SCALE_ROWSONLY (512)</TD>
<TD>scale only rows</TD>
</TR>
<TR>
<TD>SCALE_COLSONLY (1024)</TD>
<TD>scale only columns</TD>
</TR>
</TABLE>
<p class="label"><b>Remarks</b></p>
<p>The <b>is_scalemode</b> function returns if scaling mode specified in <i>testmask</i>.
This can influence numerical stability considerably. It is advisable to always
use some sort of scaling.<br>
<A HREF="set_scaling.htm">set_scaling</A> must be called before <A HREF="solve.htm">
solve</A> is called.<br>
SCALE_EXTREME, SCALE_RANGE, SCALE_MEAN, SCALE_GEOMETRIC, SCALE_CURTISREID are
the possible scaling algorithms. SCALE_QUADRATIC, SCALE_LOGARITHMIC,
SCALE_USERWEIGHT, SCALE_POWER2, SCALE_EQUILIBRATE, SCALE_INTEGERS are possible
additional scaling parameters.<br>
SCALE_POWER2 results in creating a scalar of power 2. May improve stability.<br>
SCALE_INTEGERS results also in scaling Integer columns. Default they are not
scaled.<br>
SCALE_DYNUPDATE is new from version 5.1.1.0<br>
It has always been so that scaling is done only once on the original model. If a solve
is done again (most probably after changing some data in the model), the scaling factors
aren't computed again. The scalars of the original model are used. This is not always
good, especially if the data has changed considerably. One way to solve this was/is call
<a href="unscale.htm">unscale</a> before a next solve. In that case, scale factors are recomputed.<br>
From version 5.1.1.0 on, there is another
way to make sure that scaling factors are recomputed and this is by settings SCALE_DYNUPDATE. In
that case, the scaling factors are recomputed also when a restart is done. Note
that they are then always recalculated with each solve, even when no change was made to the model, or
a change that doesn't influence the scaling factors like changing the RHS (Right Hand Side) values
or the bounds/ranges. This can influence performance. It is up to you to decide
if scaling factors must be recomputed or not for a new solve, but by default it still isn't so.
It is possible to set/unset this flag at each next solve and it is even allowed to choose
a new scaling algorithm between each solve. Note that the scaling done by the SCALE_DYNUPDATE is incremental
and the resulting scalarsĀ are typically different from scalars recomputed from scratch.
</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;
int scalemode;
/* Create a new LP model */
lp = make_lp(0, 0);
if(lp == NULL) {
fprintf(stderr, "Unable to create new LP model\n");
return(1);
}
scalemode = is_scalemode(lp, SCALE_MEAN);
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="set_scaling.htm">set_scaling</A>, <A HREF="get_scaling.htm">
get_scaling</A>, <A HREF="set_scalelimit.htm">set_scalelimit</A>, <A HREF="get_scalelimit.htm">
get_scalelimit</A>, <A HREF="is_integerscaling.htm">is_integerscaling</A>, <A HREF="is_scaletype.htm">is_scaletype</A>
</p>
</TD>
</TR>
</TABLE>
</BODY>
</html>
|