Returns the function value.
f=intprb_getfcn(m,n,x,nprob)
a 1-by-1 matrix of doubles, integer value, the number of experiments
a 1-by-1 matrix of doubles, integer value, the dimension of the space
a m-by-n matrix of doubles, the point where to compute f.
a matrix of doubles, the parameters of the problem
a 1-by-1 matrix of doubles, integer value, the problem number
a m-by-1 matrix of doubles, the function value
This function computes the function value at the point x
.
Internally, it is an interface function which calls the function
getfunc
, which selects
appropriate test fuction based on nprob
.
See the "Integration Problems User's Manual" available in the doc directory of this toolbox for a detailed description of this function.
// Get function value at [1 1 1] for Sum test case nprob = 1 [n,p] = intprb_getsetup(nprob) x = ones(1,n) m = 1 f = intprb_getfcn(m,n,x,p,nprob) // Get function value for randomized experiments for Sum test case nprob = 1 [n,p] = intprb_getsetup(nprob) m = 10 x = grand(m,n,"def") f = intprb_getfcn(m,n,x,p,nprob) // Print summary statistics [min(f) max(f) mean(f) st_deviation(f)] // Perform a Monte-Carlo on Sum nprob = 1; [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); end | ![]() | ![]() |
"Integration Problems User's Manual", Michael Baudin, 2010