Generated (staged) function to avoid initializing an array multiple times for Monte Carlo simulations

@musm
After a too long investigation it turns out that it is not type stable
because draw_samples2 which I presume is the name you gave the generated function, is not const.

if you declare it using:

const draw_samples2 = fsamples_prealoc(draw_samples!,n)

then foo2 becomes type_stable.

1 Like