I know how to use randn! to sample from the standard normal distribution and perform an in-place update. For example,
rng = MersenneTwister(1234);
A = zeros(5);
randn!(rng, A)
updates A with five numbers sampled from the standard normal.
However, suppose I used Distributions.jl and created a custom distribution, called dist. I know how to sample from it using rand, but it does not perform an in-place update. If I need to repeatedly sample from dist and store the values in A, I would end up with a huge memory allocation. Is there a function like randn! that allows me to sample from a custom distribution?