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_glopt_optget (e05zl)

Purpose

nag_glopt_optget (e05zl) is used to query the value of optional parameters available to supported problem solving functions in Chapter E05. Currently the following routines are supported:

Syntax

[ivalue, rvalue, cvalue, optype, ifail] = e05zl(optstr, iopts, opts)
[ivalue, rvalue, cvalue, optype, ifail] = nag_glopt_optget(optstr, iopts, opts)

Description

nag_glopt_optget (e05zl) is used to query the current values of options. It is necessary to initialize optional parameter arrays using nag_glopt_optset (e05zk) before any options are queried.
nag_glopt_optget (e05zl) will normally return either an integer, real or character value dependent upon the type associated with the optional parameter being queried. Some real and integer options also return additional information in cvalue. Whether the option queried is of integer, real or character type, and whether additional information is returned in cvalue, is indicated by the returned value of optype.
Information on optional parameter names and whether these options are real, integer or character can be found in Section [Optional Parameters] in (e05sa), (e05sb), (e05uc) and (e05us).

References

None.

Parameters

Compulsory Input Parameters

1:     optstr – string
A string identifying the option whose current value is required. See Section [Optional Parameters] in (e05sa) and (e05sb) for information on valid options. In addition, the following is a valid option:
IdentifyIdentify
nag_glopt_optget (e05zl) returns in cvalue the function name supplied to nag_glopt_optset (e05zk) when the optional parameter arrays iopts and opts were initialized.
2:     iopts( : :) – int64int32nag_int array
Note: the contents of iopts must not have been altered between calls to nag_glopt_optset (e05zk), nag_glopt_optget (e05zl) and the selected problem solving routine.
3:     opts( : :) – double array
Note: the contents of opts must not have been altered between calls to nag_glopt_optset (e05zk), nag_glopt_optget (e05zl) and the selected problem solving routine.

Optional Input Parameters

None.

Input Parameters Omitted from the MATLAB Interface

None.

Output Parameters

1:     ivalue – int64int32nag_int scalar
If the optional parameter supplied in optstr is an integer valued parameter, ivalue will hold its current value.
2:     rvalue – double scalar
If the optional parameter supplied in optstr is a real valued parameter, rvalue will hold its current value.
3:     cvalue – string
Note: the string returned in cvalue will never exceed 4040 characters in length.
If the optional parameter supplied in optstr is a character valued parameter, cvalue will hold its current value. cvalue will also contain additional information for some integer and real valued parameters, as indicated by optype.
4:     optype – int64int32nag_int scalar
Indicates whether the optional parameter supplied in optstr is an integer, real or character valued parameter and hence which of ivalue, rvalue or cvalue holds the current value.
optype = 1optype=1
optstr is an integer valued optional parameter, its current value has been returned in ivalue.
optype = 2optype=2
optstr is a real valued optional parameter, its current value has been returned in rvalue.
optype = 3optype=3
optstr is a character valued optional parameter, its current value has been returned in cvalue.
optype = 4optype=4
optstr is an integer valued optional parameter, its current value has been returned in ivalue. Additional information has been returned in cvalue.
optype = 5optype=5
optstr is a real valued optional parameter, its current value has been returned in rvalue. Additional information has been returned in cvalue.
5:     ifail – int64int32nag_int scalar
ifail = 0ifail=0 unless the function detects an error (see [Error Indicators and Warnings]).

Error Indicators and Warnings

Errors or warnings detected by the function:
  ifail = 11ifail=11
On entry, the option in optstr has not been recognized.
  ifail = 41ifail=41
On entry, optstr indicates a character optional parameter, but cvalue is too short to hold the stored value. The returned value will be truncated.
  ifail = 61ifail=61
The arrays iopts and opts have either not been initialized, have become corrupted, or are not compatible with this option setting function. The arrays iopts and opts have either not been initialized, have become corrupted, or are not compatible with this option setting function. The arrays iopts and opts have either not been initialized, have become corrupted, or are not compatible with this option setting function. The arrays iopts and opts have either not been initialized, have become corrupted, or are not compatible with this option setting function. The arrays iopts and opts have either not been initialized, have become corrupted, or are not compatible with this option setting function.
  ifail = 999ifail=-999
Dynamic memory allocation failed.

Accuracy

Not applicable.

Further Comments

Some options have default values which are problem dependent. For example the option Maximum Iterations Completed for nag_glopt_bnd_pso (e05sa) has the default value 1000 × ndim1000×ndim. If options such as this are queried before being set, or before the problem solving function has been called, they will return misleading information in ivalue or rvalue. In some cases, the value of cvalue will be set to DEFAULT to indicate that the real or integer valued optional parameter supplied in optstr is at its default value.

Example

function nag_glopt_optget_example
npar = int64(5);
bu = [ 500,  500];
bl = [-500, -500];

x_target = [-420.9687463599820;-420.9687463599820];
f_target = -837.9657745448674;

iopts = zeros(100, 1, 'int64');
opts  = zeros(100, 1);


% Initialize the option arrays for nag_glopt_bnd_pso
[iopts, opts, ifail] = nag_glopt_optset('Initialize = nag_glopt_bnd_pso', iopts, opts);

% Query some default option values.
fprintf('\nDefault Option Queries:\n\n');
[ivalue, rvalue, cvalue, optype, ifail] = ...
      nag_glopt_optget('Boundary', iopts, opts);
fprintf('Boundary                     : %s\n', cvalue);
[ivalue, rvalue, cvalue, optype, ifail] = ...
      nag_glopt_optget('Maximum Iterations Completed', iopts, opts);
fprintf('Maximum Iterations Completed : %d (%s)\n', ivalue, strtrim(cvalue));
[ivalue, rvalue, cvalue, optype, ifail] = ...
      nag_glopt_optget('Distance Tolerance', iopts, opts);
fprintf('Distance Tolerance           : %15.4e\n', rvalue);

fprintf('\n1. Solution without using coupled local minimizer.\n');

% Set various options to non-default values if required.
[iopts, opts, ifail] = nag_glopt_optset('Repeatability = On', iopts, opts);
[iopts, opts, ifail] = nag_glopt_optset('Verify Gradients = Off', iopts, opts);
[iopts, opts, ifail] = nag_glopt_optset('Boundary = Hyperspherical', iopts, opts);
[iopts, opts, ifail] = nag_glopt_optset('Maximum iterations static = 150', iopts, opts);
[iopts, opts, ifail] = nag_glopt_optset('Repulsion Initialize = 30', iopts, opts);
[iopts, opts, ifail] = nag_glopt_optset('Repulsion Finalize = 30', iopts, opts);

% Call nag_glopt_bnd_pso to search for the global optimum.
[xb, fb, iopts, opts, user, itt, inform, ifail] = ...
      nag_glopt_bnd_pso(bl, bu, @objfun, 'nag_glopt_bnd_pso_dummy_monmod', ...
                        iopts, opts, 'npar', npar);

switch ifail
  case {0,1}
    % nag_glopt_bnd_pso encountered no errors during operation,
    % and will have returned the best optimum found.
    display_result(x_target, f_target, xb,fb,itt,inform);
  case 3
    % An instruction to exit was received by nag_glopt_bnd_pso from objfun or monmod.
    % The exit flag will have been returned in inform.
    display_result(x_target, f_target, xb,fb,itt,inform);
  otherwise
    % An error was detected, and a warning has been displayed
end


fprintf('\n2. Solution using coupled local minimizer nag_opt_uncon_simplex.\n');

% Set an objective target
optstr = sprintf('Target Objective Value = %32.16e', f_target);
[iopts, opts, ifail] = nag_glopt_optset(optstr, iopts, opts);
[iopts, opts, ifail] = ...
    nag_glopt_optset('Target Objective Tolerance = 1.0e-5', iopts, opts);
[iopts, opts, ifail] = ...
    nag_glopt_optset('Target Objective Safeguard = 1.0e-8', iopts, opts);

% Set the local minimizer to be nag_opt_uncon_simplex and set corresponding options
[iopts, opts, ifail] = ...
    nag_glopt_optset('Local Minimizer = nag_opt_uncon_simplex', iopts, opts);
[iopts, opts, ifail] = ...
    nag_glopt_optset('Local Interior Iterations = 10', iopts, opts);
[iopts, opts, ifail] = ...
    nag_glopt_optset('Local Exterior Iterations = 20', iopts, opts);
[iopts, opts, ifail] = ...
    nag_glopt_optset('Local Interior Tolerance = 1.0e-4', iopts, opts);
[iopts, opts, ifail] = ...
    nag_glopt_optset('Local Exterior Tolerance = 1.0e-4', iopts, opts);

% Call nag_glopt_bnd_pso to search for the global optimum.
[xb, fb, iopts, opts, user, itt, inform, ifail] = ...
      nag_glopt_bnd_pso(bl, bu, @objfun, 'nag_glopt_bnd_pso_dummy_monmod', ...
                        iopts, opts, 'npar', npar);

switch ifail
  case {0,1}
    % nag_glopt_bnd_pso encountered no errors during operation,
    % and will have returned the best optimum found.
    display_result(x_target, f_target, xb,fb,itt,inform);
  case 3
    % An instruction to exit was received by nag_glopt_bnd_pso from objfun or monmod.
    % The exit flag will have been returned in inform.
    display_result(x_target, f_target, xb,fb,itt,inform);
  otherwise
    % An error was detected, and a warning has been displayed
end


fprintf('\n3. Solution using coupled local minimizer nag_opt_uncon_conjgrd_comp.\n');

% Set the local minimizer to be nag_opt_uncon_conjgrd_comp and set corresponding options
[iopts, opts, ifail] = ...
    nag_glopt_optset('Local Minimizer = nag_opt_uncon_conjgrd_comp', iopts, opts);
[iopts, opts, ifail] = ...
    nag_glopt_optset('Local Interior Iterations = 5', iopts, opts);
[iopts, opts, ifail] = ...
    nag_glopt_optset('Local Exterior Iterations = 20', iopts, opts);

%[iopts, opts, ifail] = nag_glopt_optset('Verify Gradients = off', iopts, opts);
% Call nag_glopt_bnd_pso to search for the global optimum.
[xb, fb, iopts, opts, user, itt, inform, ifail] = ...
      nag_glopt_bnd_pso(bl, bu, @objfun, 'nag_glopt_bnd_pso_dummy_monmod', ...
                        iopts, opts, 'npar', npar);

switch ifail
  case {0,1}
    % nag_glopt_bnd_pso encountered no errors during operation,
    % and will have returned the best optimum found.
    display_result(x_target, f_target, xb,fb,itt,inform);
  case 3
    % An instruction to exit was received by nag_glopt_bnd_pso from objfun or monmod.
    % The exit flag will have been returned in inform.
    display_result(x_target, f_target, xb,fb,itt,inform);
  otherwise
    % An error was detected, and a warning has been displayed
end



function [mode, objf, vecout, user] = objfun(mode, ndim, x, objf, vecout, nstate, user)
  % Test nstate to indicate what stage of computation has been reached.
  switch nstate
    case (2)
      % objfun is called for the very first time.
    case (-1)
      % objfun is called for the first time on a new slave thread.
      % This will never happen if running in a serial context.
    case (1)
      % objfun is called on entry to a NAG local minimiser.
    case (0)
      % This will be the normal value of NSTATE.
    otherwise
      % This is extremely unlikely, and indicates that an error has
      % occurred on the system
      mode = int64(-1);
      error('*** Error detected in objfun');
  end

  % Test mode to determine whether to calculate objf and/or objgrd.
  evalobjf = false;
  evalobjg = false;
  switch mode
    case {0,5}
      % Only the value of the objective function is needed.
      evalobjf = true;
    case {1,6}
      % Only the values of the NDIM gradients are required.
      evalobjg = true;
    case {2,7}
      % Both the objective function and the NDIM gradients are required.
      evalobjf = true;
      evalobjg = true;
    otherwise
      mode = int64(-1);
      error('*** Illegal value of mode (%d) in objfun', mode);
  end

  if evalobjf
    % Evaluate the objective function.
    objf = sum(x(1:double(ndim)).*sin(sqrt(abs(x(1:double(ndim))))));
  end

  if evalobjg
    % Calculate the gradient of the objective function,
    % and return the result in vecout.
    vecout = sqrt(abs(x));
    for i=1:double(ndim)
      if abs(x(i)) < nag_machine_precision
        vecout(i) = 0;
      else
        vecout(i) = sin(vecout(i)) + ...
                      signtransfer(x(i)*cos(vecout(i))/(2.0*vecout(i)), x(i));
      end
    end
  end
  function [r] = signtransfer(x, y)
    if y >= 0
      r = abs(x);
    else
      r = -abs(x);
    end
function [] = display_result(x_target, f_target, xb,fb,itt,inform)

  % Display final counters.
  fprintf('\nAlgorithm Statistics\n--------------------\n');
  fprintf('Total complete iterations             : %d\n', itt(1));
  fprintf('Complete iterations since improvement : %d\n', itt(2));
  fprintf('Total particles converged to xb       : %d\n', itt(3));
  fprintf('Total improvements to global optimum  : %d\n', itt(4));
  fprintf('Total function evaluations            : %d\n', itt(5));
  fprintf('Total particles re-initialized        : %d\n\n', itt(6));

  % Display why finalization occurred.
  switch inform
  case 0
     fprintf('Solution Status : An error was detected by nag_glopt_bnd_pso\n');
  case 1
     fprintf('Solution Status : Target value achieved\n');
  case 2
     fprintf('Solution Status : Minimum swarm standard deviation obtained\n');
  case 3
     fprintf('Solution Status : Sufficient particles converged\n');
  case 4
     fprintf('Solution Status : No improvement in preset iteration limit\n');
  case 5
     fprintf('Solution Status : Maximum complete iterations attained\n');
  case 6
     fprintf('Solution Status : Maximum function evaluations exceeded\n');
  otherwise
     fprintf('User termination case:  %d\n', inform);
  end

  % Display final objective value and location.
  fprintf('\n  Known objective optimum  : %13.5f\n', f_target);
  fprintf('  Achieved objective value : %13.5f\n\n', fb);

  title = 'Comparison between known and achieved optima.';
  clabs = {'x_target'; 'xb      '};
  [ifail] = ...
    nag_file_print_matrix_real_gen_comp('G', 'N', [x_target, xb], 'f9.2', title, 'I', clabs, ...
                  'C', clabs, int64(80), int64(0));
  fprintf('\n');
 

Default Option Queries:

Boundary                     : FLOATING                        
Maximum Iterations Completed : 1000 (DEFAULT)
Distance Tolerance           :      1.0000e-04

1. Solution without using coupled local minimizer.
Warning: nag_glopt_bnd_pso (e05sa) returned a warning indicator (1) 

Algorithm Statistics
--------------------
Total complete iterations             : 395
Complete iterations since improvement : 152
Total particles converged to xb       : 2
Total improvements to global optimum  : 59
Total function evaluations            : 2773
Total particles re-initialized        : 2

Solution Status : No improvement in preset iteration limit

  Known objective optimum  :    -837.96577
  Achieved objective value :    -837.96567

 Comparison between known and achieved optima.
    x_target       xb
 1   -420.97  -420.95
 2   -420.97  -420.94


2. Solution using coupled local minimizer nag_opt_uncon_simplex.

Algorithm Statistics
--------------------
Total complete iterations             : 51
Complete iterations since improvement : 1
Total particles converged to xb       : 0
Total improvements to global optimum  : 12
Total function evaluations            : 537
Total particles re-initialized        : 0

Solution Status : Target value achieved

  Known objective optimum  :    -837.96577
  Achieved objective value :    -837.96577

 Comparison between known and achieved optima.
    x_target       xb
 1   -420.97  -420.97
 2   -420.97  -420.97


3. Solution using coupled local minimizer nag_opt_uncon_conjgrd_comp.

Algorithm Statistics
--------------------
Total complete iterations             : 8
Complete iterations since improvement : 1
Total particles converged to xb       : 0
Total improvements to global optimum  : 10
Total function evaluations            : 120
Total particles re-initialized        : 0

Solution Status : Target value achieved

  Known objective optimum  :    -837.96577
  Achieved objective value :    -837.96561

 Comparison between known and achieved optima.
    x_target       xb
 1   -420.97  -420.94
 2   -420.97  -420.98


function e05zl_example
npar = int64(5);
bu = [ 500,  500];
bl = [-500, -500];

x_target = [-420.9687463599820;-420.9687463599820];
f_target = -837.9657745448674;

iopts = zeros(100, 1, 'int64');
opts  = zeros(100, 1);


% Initialize the option arrays for e05sa
[iopts, opts, ifail] = e05zk('Initialize = e05sa', iopts, opts);

% Query some default option values.
fprintf('\nDefault Option Queries:\n\n');
[ivalue, rvalue, cvalue, optype, ifail] = ...
      e05zl('Boundary', iopts, opts);
fprintf('Boundary                     : %s\n', cvalue);
[ivalue, rvalue, cvalue, optype, ifail] = ...
      e05zl('Maximum Iterations Completed', iopts, opts);
fprintf('Maximum Iterations Completed : %d (%s)\n', ivalue, strtrim(cvalue));
[ivalue, rvalue, cvalue, optype, ifail] = ...
      e05zl('Distance Tolerance', iopts, opts);
fprintf('Distance Tolerance           : %15.4e\n', rvalue);

fprintf('\n1. Solution without using coupled local minimizer.\n');

% Set various options to non-default values if required.
[iopts, opts, ifail] = e05zk('Repeatability = On', iopts, opts);
[iopts, opts, ifail] = e05zk('Verify Gradients = Off', iopts, opts);
[iopts, opts, ifail] = e05zk('Boundary = Hyperspherical', iopts, opts);
[iopts, opts, ifail] = e05zk('Maximum iterations static = 150', iopts, opts);
[iopts, opts, ifail] = e05zk('Repulsion Initialize = 30', iopts, opts);
[iopts, opts, ifail] = e05zk('Repulsion Finalize = 30', iopts, opts);

% Call e05sa to search for the global optimum.
[xb, fb, iopts, opts, user, itt, inform, ifail] = ...
      e05sa(bl, bu, @objfun, 'e05sxm', iopts, opts, 'npar', npar);

switch ifail
  case {0,1}
    % e05sa encountered no errors during operation,
    % and will have returned the best optimum found.
    display_result(x_target, f_target, xb,fb,itt,inform);
  case 3
    % An instruction to exit was received by e05sa from objfun or monmod.
    % The exit flag will have been returned in inform.
    display_result(x_target, f_target, xb,fb,itt,inform);
  otherwise
    % An error was detected, and a warning has been displayed
end


fprintf('\n2. Solution using coupled local minimizer e04cb.\n');

% Set an objective target
optstr = sprintf('Target Objective Value = %32.16e', f_target);
[iopts, opts, ifail] = e05zk(optstr, iopts, opts);
[iopts, opts, ifail] = e05zk('Target Objective Tolerance = 1.0e-5', iopts, opts);
[iopts, opts, ifail] = e05zk('Target Objective Safeguard = 1.0e-8', iopts, opts);

% Set the local minimizer to be e04cb and set corresponding options
[iopts, opts, ifail] = e05zk('Local Minimizer = e04cb', iopts, opts);
[iopts, opts, ifail] = e05zk('Local Interior Iterations = 10', iopts, opts);
[iopts, opts, ifail] = e05zk('Local Exterior Iterations = 20', iopts, opts);
[iopts, opts, ifail] = e05zk('Local Interior Tolerance = 1.0e-4', iopts, opts);
[iopts, opts, ifail] = e05zk('Local Exterior Tolerance = 1.0e-4', iopts, opts);

% Call e05sa to search for the global optimum.
[xb, fb, iopts, opts, user, itt, inform, ifail] = ...
      e05sa(bl, bu, @objfun, 'e05sxm', iopts, opts, 'npar', npar);

switch ifail
  case {0,1}
    % e05sa encountered no errors during operation,
    % and will have returned the best optimum found.
    display_result(x_target, f_target, xb,fb,itt,inform);
  case 3
    % An instruction to exit was received by e05sa from objfun or monmod.
    % The exit flag will have been returned in inform.
    display_result(x_target, f_target, xb,fb,itt,inform);
  otherwise
    % An error was detected, and a warning has been displayed
end


fprintf('\n3. Solution using coupled local minimizer e04dg.\n');

% Set the local minimizer to be e04dg and set corresponding options
[iopts, opts, ifail] = e05zk('Local Minimizer = e04dg', iopts, opts);
[iopts, opts, ifail] = e05zk('Local Interior Iterations = 5', iopts, opts);
[iopts, opts, ifail] = e05zk('Local Exterior Iterations = 20', iopts, opts);

%[iopts, opts, ifail] = e05zk('Verify Gradients = off', iopts, opts);
% Call e05sa to search for the global optimum.
[xb, fb, iopts, opts, user, itt, inform, ifail] = ...
      e05sa(bl, bu, @objfun, 'e05sxm', iopts, opts, 'npar', npar);

switch ifail
  case {0,1}
    % e05sa encountered no errors during operation,
    % and will have returned the best optimum found.
    display_result(x_target, f_target, xb,fb,itt,inform);
  case 3
    % An instruction to exit was received by e05sa from objfun or monmod.
    % The exit flag will have been returned in inform.
    display_result(x_target, f_target, xb,fb,itt,inform);
  otherwise
    % An error was detected, and a warning has been displayed
end



function [mode, objf, vecout, user] = objfun(mode, ndim, x, objf, vecout, nstate, user)
  % Test nstate to indicate what stage of computation has been reached.
  switch nstate
    case (2)
      % objfun is called for the very first time.
    case (-1)
      % objfun is called for the first time on a new slave thread.
      % This will never happen if running in a serial context.
    case (1)
      % objfun is called on entry to a NAG local minimiser.
    case (0)
      % This will be the normal value of NSTATE.
    otherwise
      % This is extremely unlikely, and indicates that an error has
      % occurred on the system
      mode = int64(-1);
      error('*** Error detected in objfun');
  end

  % Test mode to determine whether to calculate objf and/or objgrd.
  evalobjf = false;
  evalobjg = false;
  switch mode
    case {0,5}
      % Only the value of the objective function is needed.
      evalobjf = true;
    case {1,6}
      % Only the values of the NDIM gradients are required.
      evalobjg = true;
    case {2,7}
      % Both the objective function and the NDIM gradients are required.
      evalobjf = true;
      evalobjg = true;
    otherwise
      mode = int64(-1);
      error('*** Illegal value of mode (%d) in objfun', mode);
  end

  if evalobjf
    % Evaluate the objective function.
    objf = sum(x(1:double(ndim)).*sin(sqrt(abs(x(1:double(ndim))))));
  end

  if evalobjg
    % Calculate the gradient of the objective function,
    % and return the result in vecout.
    vecout = sqrt(abs(x));
    for i=1:double(ndim)
      if abs(x(i)) < x02aj
        vecout(i) = 0;
      else
        vecout(i) = sin(vecout(i)) + ...
                      signtransfer(x(i)*cos(vecout(i))/(2.0*vecout(i)), x(i));
      end
    end
  end
  function [r] = signtransfer(x, y)
    if y >= 0
      r = abs(x);
    else
      r = -abs(x);
    end
function [] = display_result(x_target, f_target, xb,fb,itt,inform)

  % Display final counters.
  fprintf('\nAlgorithm Statistics\n--------------------\n');
  fprintf('Total complete iterations             : %d\n', itt(1));
  fprintf('Complete iterations since improvement : %d\n', itt(2));
  fprintf('Total particles converged to xb       : %d\n', itt(3));
  fprintf('Total improvements to global optimum  : %d\n', itt(4));
  fprintf('Total function evaluations            : %d\n', itt(5));
  fprintf('Total particles re-initialized        : %d\n\n', itt(6));

  % Display why finalization occurred.
  switch inform
  case 0
     fprintf('Solution Status : An error was detected by e05sa\n');
  case 1
     fprintf('Solution Status : Target value achieved\n');
  case 2
     fprintf('Solution Status : Minimum swarm standard deviation obtained\n');
  case 3
     fprintf('Solution Status : Sufficient particles converged\n');
  case 4
     fprintf('Solution Status : No improvement in preset iteration limit\n');
  case 5
     fprintf('Solution Status : Maximum complete iterations attained\n');
  case 6
     fprintf('Solution Status : Maximum function evaluations exceeded\n');
  otherwise
     fprintf('User termination case:  %d\n', inform);
  end

  % Display final objective value and location.
  fprintf('\n  Known objective optimum  : %13.5f\n', f_target);
  fprintf('  Achieved objective value : %13.5f\n\n', fb);

  title = 'Comparison between known and achieved optima.';
  clabs = {'x_target'; 'xb      '};
  [ifail] = x04cb('G', 'N', [x_target, xb], 'f9.2', title, 'I', clabs, ...
                  'C', clabs, int64(80), int64(0));
  fprintf('\n');
 

Default Option Queries:

Boundary                     : FLOATING                        
Maximum Iterations Completed : 1000 (DEFAULT)
Distance Tolerance           :      1.0000e-04

1. Solution without using coupled local minimizer.
Warning: nag_glopt_bnd_pso (e05sa) returned a warning indicator (1) 

Algorithm Statistics
--------------------
Total complete iterations             : 395
Complete iterations since improvement : 152
Total particles converged to xb       : 2
Total improvements to global optimum  : 59
Total function evaluations            : 2773
Total particles re-initialized        : 2

Solution Status : No improvement in preset iteration limit

  Known objective optimum  :    -837.96577
  Achieved objective value :    -837.96567

 Comparison between known and achieved optima.
    x_target       xb
 1   -420.97  -420.95
 2   -420.97  -420.94


2. Solution using coupled local minimizer e04cb.

Algorithm Statistics
--------------------
Total complete iterations             : 51
Complete iterations since improvement : 1
Total particles converged to xb       : 0
Total improvements to global optimum  : 12
Total function evaluations            : 537
Total particles re-initialized        : 0

Solution Status : Target value achieved

  Known objective optimum  :    -837.96577
  Achieved objective value :    -837.96577

 Comparison between known and achieved optima.
    x_target       xb
 1   -420.97  -420.97
 2   -420.97  -420.97


3. Solution using coupled local minimizer e04dg.

Algorithm Statistics
--------------------
Total complete iterations             : 8
Complete iterations since improvement : 1
Total particles converged to xb       : 0
Total improvements to global optimum  : 10
Total function evaluations            : 120
Total particles re-initialized        : 0

Solution Status : Target value achieved

  Known objective optimum  :    -837.96577
  Achieved objective value :    -837.96561

 Comparison between known and achieved optima.
    x_target       xb
 1   -420.97  -420.94
 2   -420.97  -420.98



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