<< intprb_getname Intprbs intprb_getsetup >>

Intprbs >> Intprbs > intprb_getproblems

intprb_getproblems

Lists the problems.

Calling Sequence

nprobmax = intprb_getproblems()
str = intprb_getproblems(prbmat)
str = intprb_getproblems(prbmat,verbose)

Parameters

nprobmax:

a 1-by-1 matrix of doubles, integer value, the maximum problem number. Valid problem numbers are then produced by 1:nprobmax.

prbmat:

a matrix of doubles, integer value, the indices of the problem numbers

verbose:

a 1-by-1 matrix of booleans, if true then prints the problem description (default = true).

str:

a 1-by-1 matrix of strings, a description of the problem

Description

This function lists the respective information associated with the test function number in prbmat. There is a direct map from the problem name to the function name. For example, the "SUM" problem corresponds to the intprb_sum function which is in the intprb_sum.sci file. The numbers in parenthesis (n) means that the files include parameters for varying the dimension of the problem.

Examples

// Display one problem at a time
intprb_getproblems(1);
intprb_getproblems(3);

// Display all problems
nprobmax = intprb_getproblems()
intprb_getproblems(1:nprobmax);

// Get all problems
nprobmax = intprb_getproblems()
str = intprb_getproblems(1:nprobmax,%f)

// Do a Monte-Carlo on all problems
stacksize("max");
nprobmax = intprb_getproblems();
for nprob = 1 : nprobmax
shortname = intprb_getname(nprob);
longname = intprb_getname(nprob,%t);
mprintf("=======================\n");
mprintf("Problem #%d : %s (%s)\n",nprob,longname,shortname);
[n,p]=intprb_getsetup(nprob);
e = intprb_getexpect(n,p,nprob);
v = intprb_getvariance(n,p,nprob);
for m = logspace(3,5,3)
x = grand(m,n,"def");
f = intprb_getfcn(m,n,x,p,nprob);
meanm = mean(f);
varm = variance(f);
mprintf("%10d %+7.5f %.7f %.7f\n",m,meanm,varm,varm/m);
clear("f");
clear("x");
end
end

Authors


Report an issue
<< intprb_getname Intprbs intprb_getsetup >>