GNU Octave
3.8.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
|
#include "oct-rand.h"
Public Member Functions | |
~octave_rand (void) |
Static Public Member Functions | |
static std::string | distribution (void) |
static void | distribution (const std::string &d) |
static void | exponential_distribution (void) |
static FloatNDArray | float_nd_array (const dim_vector &dims, float a=1.0) |
static float | float_scalar (float a=1.0) |
static Array< float > | float_vector (octave_idx_type n, float a=1.0) |
static void | gamma_distribution (void) |
static bool | instance_ok (void) |
static NDArray | nd_array (const dim_vector &dims, double a=1.0) |
static void | normal_distribution (void) |
static void | poisson_distribution (void) |
static void | reset (void) |
static void | reset (const std::string &d) |
static double | scalar (double a=1.0) |
static double | seed (void) |
static void | seed (double s) |
static ColumnVector | state (const std::string &d=std::string()) |
static void | state (const ColumnVector &s, const std::string &d=std::string()) |
static void | uniform_distribution (void) |
static Array< double > | vector (octave_idx_type n, double a=1.0) |
Protected Member Functions | |
octave_rand (void) |
Private Types | |
enum | { unknown_dist, uniform_dist, normal_dist, expon_dist, poisson_dist, gamma_dist } |
Static Private Member Functions | |
static void | cleanup_instance (void) |
Private Attributes | |
int | current_distribution |
std::map< int, ColumnVector > | rand_states |
bool | use_old_generators |
Static Private Attributes | |
static octave_rand * | instance = 0 |
Definition at line 34 of file oct-rand.h.
|
private |
Definition at line 179 of file oct-rand.h.
|
protected |
Definition at line 78 of file oct-rand.cc.
References initialize_mersenne_twister(), and initialize_ranlib_generators().
Referenced by instance_ok().
|
inline |
Definition at line 44 of file oct-rand.h.
Definition at line 177 of file oct-rand.h.
Referenced by instance_ok().
|
inlinestatic |
Definition at line 90 of file oct-rand.h.
Referenced by do_rand(), EigsComplexNonSymmetricFunc(), EigsComplexNonSymmetricMatrix(), EigsComplexNonSymmetricMatrixShift(), EigsRealNonSymmetricFunc(), EigsRealNonSymmetricMatrix(), EigsRealNonSymmetricMatrixShift(), EigsRealSymmetricFunc(), EigsRealSymmetricMatrix(), and EigsRealSymmetricMatrixShift().
|
inlinestatic |
Definition at line 97 of file oct-rand.h.
|
private |
Definition at line 231 of file oct-rand.cc.
References current_distribution, expon_dist, gamma_dist, normal_dist, poisson_dist, and uniform_dist.
|
private |
Definition at line 267 of file oct-rand.cc.
References expon_dist, exponential_distribution(), gamma_dist, gamma_distribution(), get_dist_id(), normal_dist, normal_distribution(), poisson_dist, poisson_distribution(), uniform_dist, and uniform_distribution().
Definition at line 317 of file oct-rand.cc.
References expon_dist, F77_FUNC(), and switch_to_generator().
|
private |
Definition at line 557 of file oct-rand.cc.
References dim_vector::all_zero(), Array< T >::capacity(), Array< T >::clear(), fill(), and Array< T >::fortran_vec().
Definition at line 423 of file oct-rand.cc.
References current_distribution, dgenexp(), dgengam(), dgennor(), dgenunf(), dignpoi(), expon_dist, F77_FUNC(), gamma_dist, normal_dist, oct_float_rande(), oct_float_randg(), oct_float_randn(), oct_float_randu(), oct_randp(), octave_NaN, poisson_dist, save_state(), uniform_dist, use_old_generators, and xfinite().
|
private |
Definition at line 525 of file oct-rand.cc.
References Array< T >::capacity(), Array< T >::clear(), fill(), and Array< T >::fortran_vec().
Definition at line 333 of file oct-rand.cc.
References F77_FUNC(), gamma_dist, and switch_to_generator().
|
private |
Definition at line 542 of file oct-rand.cc.
References dim_vector::all_zero(), Array< T >::capacity(), Array< T >::clear(), fill(), and Array< T >::fortran_vec().
Definition at line 309 of file oct-rand.cc.
References F77_FUNC(), normal_dist, and switch_to_generator().
Definition at line 325 of file oct-rand.cc.
References F77_FUNC(), poisson_dist, and switch_to_generator().
Definition at line 175 of file oct-rand.cc.
References initialize_ranlib_generators(), and use_old_generators.
|
private |
Definition at line 210 of file oct-rand.cc.
References current_distribution, get_dist_id(), get_internal_state(), oct_init_by_entropy(), rand_states, and use_old_generators.
Definition at line 342 of file oct-rand.cc.
References current_distribution, dgenexp(), dgengam(), dgennor(), dgenunf(), dignpoi(), expon_dist, F77_FUNC(), gamma_dist, normal_dist, oct_rande(), oct_randg(), oct_randn(), oct_randp(), oct_randu(), octave_NaN, poisson_dist, save_state(), uniform_dist, use_old_generators, and xfinite().
Definition at line 112 of file oct-rand.cc.
References d, F77_FUNC(), oct_mach_info::flt_fmt_ieee_big_endian, getsd(), and oct_mach_info::native_float_format().
Definition at line 148 of file oct-rand.cc.
References d, F77_FUNC(), oct_mach_info::flt_fmt_ieee_big_endian, force_to_fit_range(), oct_mach_info::native_float_format(), setsd(), and use_old_generators.
|
private |
Definition at line 182 of file oct-rand.cc.
References current_distribution, get_dist_id(), and rand_states.
|
private |
Definition at line 188 of file oct-rand.cc.
References current_distribution, get_dist_id(), get_internal_state(), rand_states, set_internal_state(), and use_old_generators.
Definition at line 301 of file oct-rand.cc.
References F77_FUNC(), switch_to_generator(), and uniform_dist.
|
private |
Definition at line 508 of file oct-rand.cc.
References Array< T >::capacity(), Array< T >::clear(), fill(), and Array< T >::fortran_vec().
Definition at line 115 of file oct-rand.h.
Referenced by do_distribution(), and do_rand().
|
private |
Definition at line 732 of file oct-rand.cc.
References current_distribution, dignpoi(), expon_dist, F77_FUNC(), gamma_dist, MAKE_RAND, normal_dist, oct_fill_rande(), oct_fill_randg(), oct_fill_randn(), oct_fill_randp(), oct_fill_randu(), poisson_dist, save_state(), uniform_dist, use_old_generators, and xfinite().
Referenced by do_float_nd_array(), do_float_vector(), do_nd_array(), and do_vector().
|
private |
Definition at line 821 of file oct-rand.cc.
References current_distribution, dignpoi(), expon_dist, F77_FUNC(), gamma_dist, MAKE_RAND, normal_dist, oct_fill_float_rande(), oct_fill_float_randg(), oct_fill_float_randn(), oct_fill_float_randp(), oct_fill_float_randu(), poisson_dist, save_state(), uniform_dist, use_old_generators, and xfinite().
|
inlinestatic |
|
inlinestatic |
Definition at line 152 of file oct-rand.h.
Definition at line 127 of file oct-rand.h.
Referenced by do_distribution(), and do_rand().
|
private |
Definition at line 645 of file oct-rand.cc.
References current_liboctave_error_handler, expon_dist, gamma_dist, normal_dist, poisson_dist, uniform_dist, and unknown_dist.
Referenced by do_distribution(), do_reset(), and do_state().
|
private |
Definition at line 624 of file oct-rand.cc.
References Array< T >::elem(), MT_N, oct_get_state(), and OCTAVE_LOCAL_BUFFER.
Referenced by do_reset(), do_state(), initialize_mersenne_twister(), and save_state().
Definition at line 598 of file oct-rand.cc.
References expon_dist, gamma_dist, get_internal_state(), normal_dist, oct_init_by_entropy(), poisson_dist, rand_states, and uniform_dist.
Referenced by octave_rand().
Definition at line 577 of file oct-rand.cc.
References current_distribution, F77_FUNC(), force_to_fit_range(), octave_base_tm::hour(), octave_base_tm::mday(), octave_base_tm::min(), octave_base_tm::sec(), setall(), and uniform_dist.
Referenced by do_reset(), and octave_rand().
Definition at line 88 of file oct-rand.cc.
References singleton_cleanup_list::add(), cleanup_instance(), instance, and octave_rand().
|
inlinestatic |
Definition at line 159 of file oct-rand.h.
References NDArray.
Referenced by do_rand(), and Frandperm().
Definition at line 109 of file oct-rand.h.
Referenced by do_distribution(), and do_rand().
Definition at line 121 of file oct-rand.h.
Referenced by do_distribution(), and do_rand().
Definition at line 62 of file oct-rand.h.
Referenced by do_rand().
|
inlinestatic |
Definition at line 83 of file oct-rand.h.
Definition at line 639 of file oct-rand.cc.
References current_distribution, get_internal_state(), and rand_states.
Referenced by do_float_scalar(), do_scalar(), and fill().
Definition at line 55 of file oct-rand.h.
|
private |
Definition at line 691 of file oct-rand.cc.
References double2uint32(), Array< T >::elem(), Array< T >::length(), MT_N, oct_init_by_array(), oct_set_state(), and OCTAVE_LOCAL_BUFFER.
Referenced by do_state(), and switch_to_generator().
|
inlinestatic |
|
inlinestatic |
Definition at line 75 of file oct-rand.h.
References d.
Definition at line 708 of file oct-rand.cc.
References current_distribution, rand_states, and set_internal_state().
Referenced by do_exponential_distribution(), do_gamma_distribution(), do_normal_distribution(), do_poisson_distribution(), and do_uniform_distribution().
Definition at line 103 of file oct-rand.h.
Referenced by do_distribution(), and do_rand().
|
inlinestatic |
Definition at line 146 of file oct-rand.h.
Referenced by EigsComplexNonSymmetricFunc(), EigsComplexNonSymmetricMatrix(), EigsComplexNonSymmetricMatrixShift(), EigsRealNonSymmetricFunc(), EigsRealNonSymmetricMatrix(), EigsRealNonSymmetricMatrixShift(), EigsRealSymmetricFunc(), EigsRealSymmetricMatrix(), and EigsRealSymmetricMatrixShift().
|
private |
Definition at line 190 of file oct-rand.h.
Referenced by do_distribution(), do_float_scalar(), do_reset(), do_scalar(), do_state(), fill(), initialize_ranlib_generators(), save_state(), and switch_to_generator().
|
staticprivate |
Definition at line 175 of file oct-rand.h.
Referenced by instance_ok().
|
private |
Definition at line 197 of file oct-rand.h.
Referenced by do_reset(), do_state(), initialize_mersenne_twister(), save_state(), and switch_to_generator().
|
private |
Definition at line 194 of file oct-rand.h.
Referenced by do_float_scalar(), do_reset(), do_scalar(), do_seed(), do_state(), and fill().