Scilab Home page | Wiki | Bug tracker | Forge | Mailing list archives | ATOMS | File exchange
Please login or create an account
Change language to: English - Français - Português - 日本語
Справка Scilab >> Optimization and Simulation > Simplex > optimsimplex_size

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

Scilab Enterprises
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Tue Feb 14 15:13:25 CET 2017