<< uncprb_getfunc Unconstrained Optimization Problems Toolbox uncprb_getgrdfd >>

Unconstrained Optimization Problems Toolbox >> Unconstrained Optimization Problems Toolbox > uncprb_getgrdfcn

uncprb_getgrdfcn

Returns the gradient.

Calling Sequence

g=uncprb_getgrdfcn(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

g:

a 1 x n matrix of doubles, the gradient

Description

It is an interface function which calls the function func(which selects appropriate test fuction based on nprob) to return fvec and J then it calculates the gradient function's value.

Examples

// Get gradient at x0 for Rosenbrock's test case
nprob = 1
[n,m,x0]=uncprb_getinitf(nprob)
g=uncprb_getgrdfcn(n,m,x0,nprob)

// Get gradient at x* for Rosenbrock's test case
nprob = 1
[fopt,xopt] = uncprb_getopt(nprob,n,m)
g=uncprb_getgrdfcn(n,m,xopt,nprob)

Authors

<< uncprb_getfunc Unconstrained Optimization Problems Toolbox uncprb_getgrdfd >>