Computation of Function Value(s)

Description

These functions compute the value of the function at the vertices points stored in the current simplex object and stored them back into the simplex object. optimsimplex.computefv determines how many vertices are stored in the simplex object and delegates the calculation of the function values to optimsimplex.compsomefv.

Usage

1
2
  optimsimplex.computefv(this = NULL, fun = NULL, data = NULL)
  optimsimplex.compsomefv(this = NULL, fun = NULL, indices = NULL, data = NULL)

Arguments

this

The current simplex object, containing the nbve x n matrix of vertice coordinates (i.e. x element), where n is the dimension of the space and nbve the number of vertices.

fun

The function to compute at vertices. The function is expected to have the following input and output arguments:

myfunction <- function(x, this){
...
return(list(f=f,this=this))
}

where x is a row vector and this a user-defined data, i.e. the data argument.

data

A user-defined data passed to the function. If data is provided, it is passed to the callback function both as an input and output argument. data may be used if the function uses some additionnal parameters. It is returned as an output parameter because the function may modify the data while computing the function value. This feature may be used, for example, to count the number of times that the function has been called.

indices

A vector of increasing integers from 1 to nbve.

Value

optimsimplex.computefv and optimsimplex.compsomefv return a list with the following elements:

this

The updated simplex object.

data

The updated user-defined data.

Author(s)

Author of Scilab optimsimplex module: Michael Baudin (INRIA - Digiteo)

Author of R adaptation: Sebastien Bihorel (sb.pmlab@gmail.com)

See Also

optimsimplex