|
template<class RNGTYPE>
Generate a
This function returns a pseudo-random variate drawn from the
// Return Gamma(nu/2, 1/2) variate report = rgamma (df / 2, .5); return (report); } template <matrix_order O, matrix_style S> Matrix< double , O, S> rchisq (unsigned int rows, unsigned int cols, __VA_ARGS__) { Matrix< double , O, Concrete> ret(rows, cols, false); typename Matrix< double ,O,Concrete>::forward_iterator it; typename Matrix< double ,O,Concrete>::forward_iterator last = ret.end_f(); for (it = ret.begin_f(); it != last; ++it) *it = rchisq ( df ); SCYTHE_VIEW_RETURN( double , O, S, ret) } Matrix< double , Col, Concrete> rchisq (unsigned int rows, unsigned int cols, __VA_ARGS__) { return rchisq <Col,Concrete> (rows, cols, df ); } double df); /*! This function returns a pseudo-random variate drawn from the exponential distribution described by the inverse scale parameter invscale.
report = -stdlog (runif ()) / invscale; return (report); } template <matrix_order O, matrix_style S> Matrix< double , O, S> rexp (unsigned int rows, unsigned int cols, __VA_ARGS__) { Matrix< double , O, Concrete> ret(rows, cols, false); typename Matrix< double ,O,Concrete>::forward_iterator it; typename Matrix< double ,O,Concrete>::forward_iterator last = ret.end_f(); for (it = ret.begin_f(); it != last; ++it) *it = rexp ( invscale ); SCYTHE_VIEW_RETURN( double , O, S, ret) } Matrix< double , Col, Concrete> rexp (unsigned int rows, unsigned int cols, __VA_ARGS__) { return rexp <Col,Concrete> (rows, cols, invscale ); } double invscale); /*! This function returns a pseudo-random variate drawn from the F distribution with degress of freedom df1 and df2.
|
1.4.7