hide long namesshow long names
hide short namesshow short names
Integer type:  int32  int64  nag_int  show int32  show int32  show int64  show int64  show nag_int  show nag_int

PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

NAG Toolbox: nag_mip_ilp_print (h02bv)

 Contents

    1  Purpose
    2  Syntax
    7  Accuracy
    9  Example

Purpose

nag_mip_ilp_print (h02bv) prints the solution to a linear or integer programming problem computed by nag_opt_lp_solve (e04mf) or nag_mip_ilp_dense (h02bb) and nag_mip_ilp_info (h02bz), with user-supplied names for the rows and columns.

Syntax

[ifail] = h02bv(a, bl, bu, x, clamda, istate, crname, 'n', n, 'm', m)
[ifail] = nag_mip_ilp_print(a, bl, bu, x, clamda, istate, crname, 'n', n, 'm', m)

Description

nag_mip_ilp_print (h02bv) prints the solution to a linear or integer programming problem with user-supplied names for the rows and columns. All output is written to the current advisory message unit (as defined by nag_file_set_unit_advisory (x04ab)). The function must be preceded in the same program by calls to either nag_opt_lp_solve (e04mf) (if an LP problem has been solved) or nag_mip_ilp_dense (h02bb) and nag_mip_ilp_info (h02bz) (if an IP problem has been solved). The documents for nag_opt_lp_solve (e04mf) and/or nag_mip_ilp_dense (h02bb) and nag_mip_ilp_info (h02bz) should be consulted for further details.

References

IBM (1971) MPSX – Mathematical programming system Program Number 5734 XM4 IBM Trade Corporation, New York

Parameters

Compulsory Input Parameters

1:     alda: – double array
The first dimension of the array a must be at least max1,m.
The second dimension of the array a must be at least n if m>0 and at least 1 if m=0.
The matrix of general linear constraints.
2:     bln+m – double array
The lower bounds for all the constraints, as returned by nag_opt_lp_solve (e04mf) or nag_mip_ilp_info (h02bz).
3:     bun+m – double array
The upper bounds for all the constraints, as returned by nag_opt_lp_solve (e04mf) or nag_mip_ilp_info (h02bz).
4:     xn – double array
The solution to the problem, as returned by nag_opt_lp_solve (e04mf) or nag_mip_ilp_dense (h02bb).
5:     clamdan+m – double array
The Lagrange-multipliers (reduced costs) for each constraint with respect to the working set, as returned by nag_opt_lp_solve (e04mf) or nag_mip_ilp_info (h02bz).
6:     istaten+m int64int32nag_int array
The status of every constraint in the working set at the solution, as returned by nag_opt_lp_solve (e04mf) or nag_mip_ilp_info (h02bz).
7:     crnamen+m – cell array of strings
The user-defined names for all the variables and constraints.

Optional Input Parameters

1:     n int64int32nag_int scalar
Default: the dimension of the array x.
The number of variables.
Constraint: n>0.
2:     m int64int32nag_int scalar
Default: the first dimension of the array a.
The number of general linear constraints.
Constraint: m0.

Output Parameters

1:     ifail int64int32nag_int scalar
ifail=0 unless the function detects an error (see Error Indicators and Warnings).

Error Indicators and Warnings

Errors or warnings detected by the function:
   ifail=1
On entry,n0,
orm<0,
orlda<max1,m.
   ifail=-99
An unexpected error has been triggered by this routine. Please contact NAG.
   ifail=-399
Your licence key may have expired or may not have been installed correctly.
   ifail=-999
Dynamic memory allocation failed.

Accuracy

Not applicable.

Further Comments

None.

Example

function h02bv_example


fprintf('h02bv example results\n\n');

n = int64(6);
m = int64(3);
big = 1e+20;
a    = [ 110,     205,      160,    160,    420,    260;
           4,      32,       13,      8,      4,     14;
           2,      12,       54,    285,     22,     80];
cvec = [   3;      24;       13;      9;     20;     19];
bl   = [   0;       0;        0;      0;      0;      0;
        2000;      55;      800];
bu   = [   4;       3;        2;      8;      2;      2;
         big;     big;      big];
intvar(1:n) = int64(1);

crname = {'Oatmeal ';'Chicken ';'Eggs    ';'Milk    ';'Pie     ';'Bacon   ';
          'Energy  ';'Protein ';'Calcium '};

itmax  = int64(0);
msglvl = int64(1);
maxnod = int64(0);
intfst = int64(0);
toliv  = 0;
tolfes = 0;
x = zeros(n,1);

[itmax, toliv, tolfes, big, x, objmip, iwork, rwork, ifail] = ...
h02bb( ...
       itmax, msglvl, a, bl, bu, intvar, cvec, maxnod, intfst, toliv, ...
       tolfes, big, x);

[bl, bu, clamda, istate, ifail] = ...
h02bz(n, m, iwork, rwork);

[ifail] = h02bv( ...
                 a, bl, bu, x, clamda, istate, crname);


h02bv example results


 *** IP solver

 Parameters
 ----------

 Linear constraints......         3        First integer solution..       OFF
 Variables...............         6        Max depth of the tree...         9

 Feasibility tolerance...  1.05E-08        Print level.............         1
 Infinite bound size.....  1.00E+20        EPS (machine precision).  1.11E-16

 Integer feasibility tol.  1.00E-05        Iteration limit.........        50
 Max number of nodes.....      NONE

 ** Workspace provided with MAXDPT =     9: LRWORK =   215  LIWORK =   343
 ** Workspace required with MAXDPT =     9: LRWORK =   215  LIWORK =   343



 Total of    43 nodes investigated.

 Exit IP solver - Optimum IP solution found.

 Final IP objective value =    97.00000



 Varbl State     Value     Lower Bound   Upper Bound    Lagr Mult   Residual

 V  1    EQ    4.00000       4.00000       4.00000       3.000       0.000
 V  2    LL    0.00000       0.00000       3.00000       24.00       0.000
 V  3    LL    0.00000       0.00000       2.00000       13.00       0.000
 V  4    LL    5.00000       5.00000       8.00000       9.000       0.000
 V  5    EQ    2.00000       2.00000       2.00000       20.00       0.000
 V  6    LL    0.00000       0.00000       2.00000       19.00       0.000


 L Con State     Value     Lower Bound   Upper Bound    Lagr Mult   Residual

 L  1    FR    2080.00       2000.00         None        0.000       80.00
 L  2    FR    64.0000       55.0000         None        0.000       9.000
 L  3    FR    1477.00       800.000         None        0.000       677.0


 Varbl   State     Value     Lower Bound   Upper Bound    Lagr Mult   Residual

 Oatmeal  EQ    4.00000       4.00000       4.00000       3.000       0.000
 Chicken  LL    0.00000       0.00000       3.00000       24.00       0.000
 Eggs     LL    0.00000       0.00000       2.00000       13.00       0.000
 Milk     LL    5.00000       5.00000       8.00000       9.000       0.000
 Pie      EQ    2.00000       2.00000       2.00000       20.00       0.000
 Bacon    LL    0.00000       0.00000       2.00000       19.00       0.000


 L Con   State     Value     Lower Bound   Upper Bound    Lagr Mult   Residual

 Energy   FR    2080.00       2000.00         None        0.000       80.00
 Protein  FR    64.0000       55.0000         None        0.000       9.000
 Calcium  FR    1477.00       800.000         None        0.000       677.0

PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015