83 #if defined (HAVE_CONFIG_H)
99 const T
d = (a < 1. ? 1.+a : a) - 1./3.;
100 const T c = 1./std::sqrt (9.*
d);
105 for (i=0; i <
n; i++)
110 for (i=0; i <
n; i++)
114 x = rand_normal<T> ();
119 u = rand_uniform<T> ();
121 if (u >= 1.-0.0331*xsq*xsq && std::log (u) >= 0.5*xsq +
d*(1-v+std::log (v)))
129 for (i = 0; i <
n; i++)
130 r[i] *= exp (-rand_exponential<T> () / a);
137 OCTAVE_END_NAMESPACE(
octave)
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE * d
F77_RET_T const F77_DBLE * x
void rand_gamma(T a, octave_idx_type n, T *r)