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_iqp_sparse_optstr (h02cg)

Purpose

To supply individual optional parameters to nag_mip_iqp_sparse (h02ce).

Syntax

h02cg(str)
nag_mip_iqp_sparse_optstr(str)

Description

nag_mip_iqp_sparse_optstr (h02cg) may be used to supply values for optional parameters to nag_mip_iqp_sparse (h02ce). It is only necessary to call nag_mip_iqp_sparse_optstr (h02cg) for those parameters whose values are to be different from their default values. One call to nag_mip_iqp_sparse_optstr (h02cg) sets one parameter value.
Each optional parameter is defined by a single character string of up to 7272 characters, consisting of one or more items. The items associated with a given option must be separated by spaces, or equal signs [ = ][=]. Alphabetic characters may be upper or lower case. The string
 Print level = 1
is an example of a string used to set an optional parameter. For each option the string contains one or more of the following items:
a mandatory keyword;
a phrase that qualifies the keyword;
a number that specifies an integer or double value. Such numbers may be up to 1616 contiguous characters in Fortran 77's I, F, E or D formats, terminated by a space if this is not the last item on the line.
Blank strings and comments are ignored. A comment begins with an asterisk (*) and all subsequent characters in the string are regarded as part of the comment.
Normally, each user-specified option is printed as it is defined, on the current advisory message unit (see nag_file_set_unit_advisory (x04ab)), but this printing may be suppressed using the keyword Nolist. Thus the statement
h02cg('Nolist')
suppresses printing of this and subsequent options. Printing will automatically be turned on again after a call to nag_mip_iqp_sparse (h02ce), and may be turned on again at any time using the keyword List.
Optional parameter settings are preserved following a call to nag_mip_iqp_sparse (h02ce), and so the keyword Defaults is provided to allow you to reset all the optional parameters to their default values by the statement
h02cg('Defaults')
prior to a subsequent call to nag_mip_iqp_sparse (h02ce).
A complete list of optional parameters, their abbreviations, synonyms and default values is given in Section [Optional Parameters] in (h02ce).

References

None.

Parameters

Compulsory Input Parameters

1:     str – string
A single valid option string (as described in Section [Description] above and in Section [Optional Parameters] in (h02ce)).

Optional Input Parameters

None.

Input Parameters Omitted from the MATLAB Interface

None.

Output Parameters

None.

Error Indicators and Warnings

Accuracy

Not applicable.

Further Comments

None.

Example

function nag_mip_iqp_sparse_optstr_example
n = int64(7);
m = int64(8);
iobj = int64(8);
ncolh = int64(7);
a = [0.02;
     0.02;
     0.03;
     1;
     0.7;
     0.02;
     0.15;
     -200;
     0.06;
     0.75;
     0.03;
     0.04;
     0.05;
     0.04;
     1;
     -2000;
     0.02;
     1;
     0.01;
     0.08;
     0.08;
     0.8;
     -2000;
     1;
     0.12;
     0.02;
     0.02;
     0.75;
     0.04;
     -2000;
     0.01;
     0.8;
     0.02;
     1;
     0.02;
     0.06;
     0.02;
     -2000;
     1;
     0.01;
     0.01;
     0.97;
     0.01;
     400;
     0.97;
     0.03;
     1;
     400];
ha = [int64(7);5;3;1;6;4;2;8;7;6;5;4;3;2;1;8;2;1;4;3;7;6;8;1;7;3;4;6; ...
      2;8;5;6;7;1;2;3;4;8;1;2;3;6;7;8;7;2;1;8];
ka = [int64(1);9;17;24;31;39;45;49];
bl = [0;
     0;
     400;
     100;
     0;
     0;
     0;
     2000;
     -1e+25;
     -1e25;
     -1e25;
     -1e25;
     1500;
     250;
     -1e25];
bu = [200;
     2500;
     800;
     700;
     1500;
     1e25;
     1e25;
     2000;
     60;
     100;
     40;
     30;
     1e25;
     300;
     1e25];
start = 'C';
names = {'        '; '        '; '        '; '        '; '        '};
crname = {'...X1...'; '...X2...'; '...X3...'; '...X4...'; '...X5...'; ...
          '...X6...'; '...X7...'; '..ROW1..'; '..ROW2..'; '..ROW3..'; ...
          '..ROW4..'; '..ROW5..'; '..ROW6..'; '..ROW7..'; '..COST..'};
ns = int64(24641422);
xs = [0;
     0;
     0;
     0;
     0;
     0;
     0;
     0;
     0;
     0;
     0;
     0;
     0;
     0;
     0];
intvar = [int64(2);3;4;5;6;7;-1;0;0;0];
istate = zeros(15, 1, 'int64');
strtgy = int64(3);
leniz = int64(100000);
lenz = int64(100000);
nag_mip_iqp_sparse_optstr('Nolist');
nag_mip_iqp_sparse_optstr('Print Level = 0');
[nsOut, xsOut, istateOut, miniz, minz, obj, clamda, ifail] = ...
     nag_mip_iqp_sparse(n, m, iobj, ncolh, @qphx, a, ha, ka, bl, bu, start, names, ...
     crname, ns, xs, intvar, istate, strtgy, leniz, lenz, @monit)

function [hx] = qphx(nstate, ncolh, x)
  hx = zeros(ncolh,1);
  hx(1) = 2*x(1);
  hx(2) = 2*x(2);
  hx(3) = 2*(x(3)+x(4));
  hx(4) = hx(3);
  hx(5) = 2*x(5);
  hx(6) = 2*(x(6)+x(7));
  hx(7) = hx(6);
function [bstval, halt, count] = monit(intfnd,nodes,depth,obj,x,bstval, ...
                                             bstsol,bl,bu,n,halt,count)
  halt = false;
  if intfnd == 0
    bstval = -1847510;
  end
 

nsOut =

                    0


xsOut =

   1.0e+06 *

         0
    0.0004
    0.0006
    0.0002
    0.0004
    0.0003
    0.0002
    0.0020
    0.0000
    0.0001
    0.0000
    0.0000
    0.0015
    0.0003
   -2.9800


istateOut =

                    0
                    0
                    3
                    0
                    0
                    3
                    3
                    0
                    3
                    3
                    3
                    3
                    0
                    0
                    3


miniz =

                  497


minz =

                  502


obj =

  -1.8475e+06


clamda =

   1.0e+04 *

    0.2812
    0.0225
   -0.0000
    0.0157
    0.0204
   -0.0000
   -0.0000
   -1.4823
         0
         0
         0
         0
    1.6400
    1.6571
   -0.0001


ifail =

                    0


function h02cg_example
n = int64(7);
m = int64(8);
iobj = int64(8);
ncolh = int64(7);
a = [0.02;
     0.02;
     0.03;
     1;
     0.7;
     0.02;
     0.15;
     -200;
     0.06;
     0.75;
     0.03;
     0.04;
     0.05;
     0.04;
     1;
     -2000;
     0.02;
     1;
     0.01;
     0.08;
     0.08;
     0.8;
     -2000;
     1;
     0.12;
     0.02;
     0.02;
     0.75;
     0.04;
     -2000;
     0.01;
     0.8;
     0.02;
     1;
     0.02;
     0.06;
     0.02;
     -2000;
     1;
     0.01;
     0.01;
     0.97;
     0.01;
     400;
     0.97;
     0.03;
     1;
     400];
ha = [int64(7);5;3;1;6;4;2;8;7;6;5;4;3;2;1;8;2;1;4;3;7;6;8;1;7;3;4;6; ...
      2;8;5;6;7;1;2;3;4;8;1;2;3;6;7;8;7;2;1;8];
ka = [int64(1);9;17;24;31;39;45;49];
bl = [0;
     0;
     400;
     100;
     0;
     0;
     0;
     2000;
     -1e+25;
     -1e25;
     -1e25;
     -1e25;
     1500;
     250;
     -1e25];
bu = [200;
     2500;
     800;
     700;
     1500;
     1e25;
     1e25;
     2000;
     60;
     100;
     40;
     30;
     1e25;
     300;
     1e25];
start = 'C';
names = {'        '; '        '; '        '; '        '; '        '};
crname = {'...X1...'; '...X2...'; '...X3...'; '...X4...'; '...X5...'; ...
          '...X6...'; '...X7...'; '..ROW1..'; '..ROW2..'; '..ROW3..'; ...
          '..ROW4..'; '..ROW5..'; '..ROW6..'; '..ROW7..'; '..COST..'};
ns = int64(24641422);
xs = [0;
     0;
     0;
     0;
     0;
     0;
     0;
     0;
     0;
     0;
     0;
     0;
     0;
     0;
     0];
intvar = [int64(2);3;4;5;6;7;-1;0;0;0];
istate = zeros(15, 1, 'int64');
strtgy = int64(3);
leniz = int64(100000);
lenz = int64(100000);
h02cg('Nolist');
h02cg('Print Level = 0');
[nsOut, xsOut, istateOut, miniz, minz, obj, clamda, ifail] = ...
     h02ce(n, m, iobj, ncolh, @qphx, a, ha, ka, bl, bu, start, names, ...
     crname, ns, xs, intvar, istate, strtgy, leniz, lenz, @monit)

function [hx] = qphx(nstate, ncolh, x)
  hx = zeros(ncolh,1);
  hx(1) = 2*x(1);
  hx(2) = 2*x(2);
  hx(3) = 2*(x(3)+x(4));
  hx(4) = hx(3);
  hx(5) = 2*x(5);
  hx(6) = 2*(x(6)+x(7));
  hx(7) = hx(6);
function [bstval, halt, count] = monit(intfnd,nodes,depth,obj,x,bstval, ...
                                             bstsol,bl,bu,n,halt,count)
  halt = false;
  if intfnd == 0
    bstval = -1847510;
  end
 

nsOut =

                    0


xsOut =

   1.0e+06 *

         0
    0.0004
    0.0006
    0.0002
    0.0004
    0.0003
    0.0002
    0.0020
    0.0000
    0.0001
    0.0000
    0.0000
    0.0015
    0.0003
   -2.9800


istateOut =

                    0
                    0
                    3
                    0
                    0
                    3
                    3
                    0
                    3
                    3
                    3
                    3
                    0
                    0
                    3


miniz =

                  497


minz =

                  502


obj =

  -1.8475e+06


clamda =

   1.0e+04 *

    0.2812
    0.0225
   -0.0000
    0.0157
    0.0204
   -0.0000
   -0.0000
   -1.4823
         0
         0
         0
         0
    1.6400
    1.6571
   -0.0001


ifail =

                    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–2013