Given the vectors (breaks[1],...,breaks[n])
and the list of IBMPopSim
compatible
functions funs = (f[0],f[1],...,f[n])
(one value more!), piecewise_x(breaks, funs)
returns
the function
f(x)=f0(x)1x≤breaks[1]+n−1∑k=1fk(x)1[breaksk,breaksk+1)(x)+fn(x)1x≥breaks[n]
piecewise_x(breaks, funs)
Piecewise function built with the given intervals and functions.
A C++ version of this function is available. See vignette('IBMPopSim_cpp')
for more details.