<< uncprb_getname Unconstrained Optimization Problems Toolbox uncprb_getopt >>

Unconstrained Optimization Problems Toolbox >> Unconstrained Optimization Problems Toolbox > uncprb_getobjfcn

uncprb_getobjfcn

Returns the function value.

Calling Sequence

f=uncprb_getobjfcn(n,m,x,nprob)

Parameters

n:

the number of variables, i.e. the size of x

m:

the number of functions, i.e. the size of fvec

x:

a n x 1 matrix of doubles, the point where to compute f

nprob:

the problem number

f:

a 1x1 matrix of doubles, the function value

Description

It is an interface function which calls the function func(which selects appropriate test fuction based on nprob) to return fvec, then it calculates the objective function by fvec'*fvec.

Examples

// Get function value at x0 for Rosenbrock's test case
nprob = 1
[n,m,x0]=uncprb_getinitf(nprob)
f = uncprb_getobjfcn(n,m,x0,nprob)

// Check function value at x* for Rosenbrock's test case
[fopt,xopt] = uncprb_getopt(nprob,n,m)
f = uncprb_getobjfcn(n,m,xopt,nprob)

Authors

<< uncprb_getname Unconstrained Optimization Problems Toolbox uncprb_getopt >>