Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
2024.0.0 - Português


optimsimplex_size

Computes the size.

Syntax

ssize = optimsimplex_size(opt, [method])

Argument

opt

The current simplex object of TSIMPLEX type (tlist).

method

The method to use to compute the size (optional).

The available methods are the following:

  • "sigmaplus". This is the default.

    The sigmaplus size is the maximum 2-norm length of the vector from each vertex to the first vertex. It requires one loop over the vertices.

  • "sigmaminus".

    The sigmaminus size is the minimum 2-norm length of the vector from each vertex to the first vertex. It requires on loop over the vertices.

  • "Nash".

    The Nash size is the sum of the norm of the norm-1 length of the vector form the given vertex to the first vertex. It requires one loop over the vertices.

  • "diameter".

    The diameter size is the maximum norm-2 length of all the edges of the simplex. It requires 2 nested loops over the vertices.

ssize

A scalar.

Description

The optimsimplex_size function returns the size of the simplex.

Example

function y=rosenbrock(x)
  y = 100*(x(2)-x(1)^2)^2 + (1-x(1))^2;
endfunction

simplex = [...
    0.    0.
    1.    0.
    0.    2.
];
s1 = optimsimplex_new();
s1 = optimsimplex_setn ( s1 , 2 );
s1 = optimsimplex_setnbve ( s1 , 3 );
s1 = optimsimplex_setallx ( s1 , simplex );
// Method = "Nash"
ssize = optimsimplex_size ( s1 , "Nash" );
disp(ssize)

// Method = "diameter"
ssize = optimsimplex_size ( s1 , "diameter" );
disp(ssize)

// Method = "sigmaplus"
ssize = optimsimplex_size ( s1 , "sigmaplus" );
disp(ssize)

// Method = "sigmaminus"
ssize = optimsimplex_size ( s1 , "sigmaminus" );
disp(ssize)

s1 = optimsimplex_destroy(s1);

See also

Report an issue
<< optimsimplex_shrink Simplex optimsimplex_sort >>

Copyright (c) 2022-2024 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Tue Oct 24 14:35:26 CEST 2023