GNU Octave  4.4.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
oct-rand.cc
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 2003-2018 John W. Eaton
4 
5 This file is part of Octave.
6 
7 Octave is free software: you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11 
12 Octave is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16 
17 You should have received a copy of the GNU General Public License
18 along with Octave; see the file COPYING. If not, see
19 <https://www.gnu.org/licenses/>.
20 
21 */
22 
23 #if defined (HAVE_CONFIG_H)
24 # include "config.h"
25 #endif
26 
27 #include <cassert>
28 #include <cstdint>
29 
30 #include <limits>
31 
32 #include "lo-error.h"
33 #include "lo-ieee.h"
34 #include "lo-mappers.h"
35 #include "lo-ranlib-proto.h"
36 #include "mach-info.h"
37 #include "oct-locbuf.h"
38 #include "oct-rand.h"
39 #include "oct-time.h"
40 #include "quit.h"
41 #include "randgamma.h"
42 #include "randmtzig.h"
43 #include "randpoisson.h"
44 #include "singleton-cleanup.h"
45 
47 
49  : current_distribution (uniform_dist), use_old_generators (false),
50  rand_states ()
51 {
53 
55 }
56 
57 bool
59 {
60  bool retval = true;
61 
62  if (! instance)
63  {
64  instance = new octave_rand ();
65 
66  if (instance)
68  }
69 
70  if (! instance)
71  (*current_liboctave_error_handler)
72  ("unable to create octave_rand object!");
73 
74  return retval;
75 }
76 
77 double
79 {
80  union d2i { double d; int32_t i[2]; };
81  union d2i u;
82 
84 
85  switch (ff)
86  {
88  F77_FUNC (getsd, GETSD) (u.i[1], u.i[0]);
89  break;
90 
91  default:
92  F77_FUNC (getsd, GETSD) (u.i[0], u.i[1]);
93  break;
94  }
95 
96  return u.d;
97 }
98 
99 static int32_t
100 force_to_fit_range (int32_t i, int32_t lo, int32_t hi)
101 {
102  assert (hi > lo && lo >= 0 && hi > lo);
103 
104  i = (i > 0 ? i : -i);
105 
106  if (i < lo)
107  i = lo;
108  else if (i > hi)
109  i = i % hi;
110 
111  return i;
112 }
113 
114 void
116 {
117  use_old_generators = true;
118 
119  int i0, i1;
120  union d2i { double d; int32_t i[2]; };
121  union d2i u;
122  u.d = s;
123 
125 
126  switch (ff)
127  {
129  i1 = force_to_fit_range (u.i[0], 1, 2147483563);
130  i0 = force_to_fit_range (u.i[1], 1, 2147483399);
131  break;
132 
133  default:
134  i0 = force_to_fit_range (u.i[0], 1, 2147483563);
135  i1 = force_to_fit_range (u.i[1], 1, 2147483399);
136  break;
137  }
138 
139  F77_FUNC (setsd, SETSD) (i0, i1);
140 }
141 
142 void
144 {
145  use_old_generators = true;
147 }
148 
151 {
152  return rand_states[d.empty () ? current_distribution : get_dist_id (d)];
153 }
154 
155 void
157 {
158  use_old_generators = false;
159 
160  int old_dist = current_distribution;
161 
162  int new_dist = (d.empty () ? current_distribution : get_dist_id (d));
163 
164  uint32NDArray saved_state;
165 
166  if (old_dist != new_dist)
167  saved_state = get_internal_state ();
168 
170 
171  rand_states[new_dist] = get_internal_state ();
172 
173  if (old_dist != new_dist)
174  rand_states[old_dist] = saved_state;
175 }
176 
177 void
179 {
180  use_old_generators = false;
181 
182  int old_dist = current_distribution;
183 
184  int new_dist = (d.empty () ? current_distribution : get_dist_id (d));
185 
186  uint32NDArray saved_state;
187 
188  if (old_dist != new_dist)
189  saved_state = get_internal_state ();
190 
192  rand_states[new_dist] = get_internal_state ();
193 
194  if (old_dist != new_dist)
195  rand_states[old_dist] = saved_state;
196 }
197 
200 {
202 
203  switch (current_distribution)
204  {
205  case uniform_dist:
206  retval = "uniform";
207  break;
208 
209  case normal_dist:
210  retval = "normal";
211  break;
212 
213  case expon_dist:
214  retval = "exponential";
215  break;
216 
217  case poisson_dist:
218  retval = "poisson";
219  break;
220 
221  case gamma_dist:
222  retval = "gamma";
223  break;
224 
225  default:
226  (*current_liboctave_error_handler)
227  ("rand: invalid distribution ID = %d", current_distribution);
228  break;
229  }
230 
231  return retval;
232 }
233 
234 void
236 {
237  int id = get_dist_id (d);
238 
239  switch (id)
240  {
241  case uniform_dist:
243  break;
244 
245  case normal_dist:
247  break;
248 
249  case expon_dist:
251  break;
252 
253  case poisson_dist:
255  break;
256 
257  case gamma_dist:
259  break;
260 
261  default:
262  (*current_liboctave_error_handler)
263  ("rand: invalid distribution ID = %d", id);
264  break;
265  }
266 }
267 
268 void
270 {
272 
273  F77_FUNC (setcgn, SETCGN) (uniform_dist);
274 }
275 
276 void
278 {
280 
281  F77_FUNC (setcgn, SETCGN) (normal_dist);
282 }
283 
284 void
286 {
288 
289  F77_FUNC (setcgn, SETCGN) (expon_dist);
290 }
291 
292 void
294 {
296 
297  F77_FUNC (setcgn, SETCGN) (poisson_dist);
298 }
299 
300 void
302 {
304 
305  F77_FUNC (setcgn, SETCGN) (gamma_dist);
306 }
307 
308 double
310 {
311  double retval = 0.0;
312 
313  if (use_old_generators)
314  {
315  switch (current_distribution)
316  {
317  case uniform_dist:
318  F77_FUNC (dgenunf, DGENUNF) (0.0, 1.0, retval);
319  break;
320 
321  case normal_dist:
322  F77_FUNC (dgennor, DGENNOR) (0.0, 1.0, retval);
323  break;
324 
325  case expon_dist:
326  F77_FUNC (dgenexp, DGENEXP) (1.0, retval);
327  break;
328 
329  case poisson_dist:
330  if (a < 0.0 || ! octave::math::isfinite (a))
332  else
333  {
334  // workaround bug in ignpoi, by calling with different Mu
335  F77_FUNC (dignpoi, DIGNPOI) (a + 1, retval);
336  F77_FUNC (dignpoi, DIGNPOI) (a, retval);
337  }
338  break;
339 
340  case gamma_dist:
341  if (a <= 0.0 || ! octave::math::isfinite (a))
343  else
344  F77_FUNC (dgengam, DGENGAM) (1.0, a, retval);
345  break;
346 
347  default:
348  (*current_liboctave_error_handler)
349  ("rand: invalid distribution ID = %d", current_distribution);
350  break;
351  }
352  }
353  else
354  {
355  switch (current_distribution)
356  {
357  case uniform_dist:
358  retval = oct_randu ();
359  break;
360 
361  case normal_dist:
362  retval = oct_randn ();
363  break;
364 
365  case expon_dist:
366  retval = oct_rande ();
367  break;
368 
369  case poisson_dist:
370  retval = oct_randp (a);
371  break;
372 
373  case gamma_dist:
374  retval = oct_randg (a);
375  break;
376 
377  default:
378  (*current_liboctave_error_handler)
379  ("rand: invalid distribution ID = %d", current_distribution);
380  break;
381  }
382 
383  save_state ();
384  }
385 
386  return retval;
387 }
388 
389 float
391 {
392  float retval = 0.0;
393 
394  if (use_old_generators)
395  {
396  switch (current_distribution)
397  {
398  case uniform_dist:
399  F77_FUNC (fgenunf, FGENUNF) (0.0f, 1.0f, retval);
400  break;
401 
402  case normal_dist:
403  F77_FUNC (fgennor, FGENNOR) (0.0f, 1.0f, retval);
404  break;
405 
406  case expon_dist:
407  F77_FUNC (fgenexp, FGENEXP) (1.0f, retval);
408  break;
409 
410  case poisson_dist:
411  if (a < 0.0f || ! octave::math::isfinite (a))
413  else
414  {
415  // workaround bug in ignpoi, by calling with different Mu
416  F77_FUNC (fignpoi, FIGNPOI) (a + 1, retval);
417  F77_FUNC (fignpoi, FIGNPOI) (a, retval);
418  }
419  break;
420 
421  case gamma_dist:
422  if (a <= 0.0f || ! octave::math::isfinite (a))
424  else
425  F77_FUNC (fgengam, FGENGAM) (1.0, a, retval);
426  break;
427 
428  default:
429  (*current_liboctave_error_handler)
430  ("rand: invalid distribution ID = %d", current_distribution);
431  break;
432  }
433  }
434  else
435  {
436  switch (current_distribution)
437  {
438  case uniform_dist:
439  retval = oct_float_randu ();
440  break;
441 
442  case normal_dist:
443  retval = oct_float_randn ();
444  break;
445 
446  case expon_dist:
447  retval = oct_float_rande ();
448  break;
449 
450  case poisson_dist:
451  // Keep poisson distribution in double precision for accuracy
452  retval = oct_randp (a);
453  break;
454 
455  case gamma_dist:
457  break;
458 
459  default:
460  (*current_liboctave_error_handler)
461  ("rand: invalid distribution ID = %d", current_distribution);
462  break;
463  }
464 
465  save_state ();
466  }
467 
468  return retval;
469 }
470 
473 {
475 
476  if (n > 0)
477  {
478  retval.clear (n, 1);
479 
480  fill (retval.numel (), retval.fortran_vec (), a);
481  }
482  else if (n < 0)
483  (*current_liboctave_error_handler) ("rand: invalid negative argument");
484 
485  return retval;
486 }
487 
490 {
492 
493  if (n > 0)
494  {
495  retval.clear (n, 1);
496 
497  fill (retval.numel (), retval.fortran_vec (), a);
498  }
499  else if (n < 0)
500  (*current_liboctave_error_handler) ("rand: invalid negative argument");
501 
502  return retval;
503 }
504 
505 NDArray
507 {
508  NDArray retval;
509 
510  if (! dims.all_zero ())
511  {
512  retval.clear (dims);
513 
514  fill (retval.numel (), retval.fortran_vec (), a);
515  }
516 
517  return retval;
518 }
519 
522 {
524 
525  if (! dims.all_zero ())
526  {
527  retval.clear (dims);
528 
529  fill (retval.numel (), retval.fortran_vec (), a);
530  }
531 
532  return retval;
533 }
534 
535 // Make the random number generator give us a different sequence every
536 // time we start octave unless we specifically set the seed. The
537 // technique used below will cycle monthly, but it does seem to
538 // work ok to give fairly different seeds each time Octave starts.
539 
540 void
542 {
544  int stored_distribution = current_distribution;
545  F77_FUNC (setcgn, SETCGN) (uniform_dist);
546 
547  int hour = tm.hour () + 1;
548  int minute = tm.min () + 1;
549  int second = tm.sec () + 1;
550 
551  int32_t s0 = tm.mday () * hour * minute * second;
552  int32_t s1 = hour * minute * second;
553 
554  s0 = force_to_fit_range (s0, 1, 2147483563);
555  s1 = force_to_fit_range (s1, 1, 2147483399);
556 
557  F77_FUNC (setall, SETALL) (s0, s1);
558  F77_FUNC (setcgn, SETCGN) (stored_distribution);
559 }
560 
561 void
563 {
565 
567  s = get_internal_state ();
569 
571  s = get_internal_state ();
573 
575  s = get_internal_state ();
577 
579  s = get_internal_state ();
581 
583  s = get_internal_state ();
585 
586  // All of the initializations above have messed with the internal state.
587  // Restore the state of the currently selected distribution.
589 }
590 
593 {
594  uint32NDArray s (dim_vector (MT_N + 1, 1));
595 
596  oct_get_state (reinterpret_cast<uint32_t *> (s.fortran_vec ()));
597 
598  return s;
599 }
600 
601 void
603 {
605 }
606 
607 int
609 {
610  int retval = unknown_dist;
611 
612  if (d == "uniform" || d == "rand")
614  else if (d == "normal" || d == "randn")
616  else if (d == "exponential" || d == "rande")
617  retval = expon_dist;
618  else if (d == "poisson" || d == "randp")
620  else if (d == "gamma" || d == "randg")
621  retval = gamma_dist;
622  else
624  ("rand: invalid distribution '%s'", d.c_str ());
625 
626  return retval;
627 }
628 
629 void
631 {
632  octave_idx_type len = s.numel ();
633 
634  const uint32_t *sdata = reinterpret_cast <const uint32_t *> (s.data ());
635 
636  if (len == MT_N + 1 && sdata[MT_N] <= MT_N && sdata[MT_N] > 0)
637  oct_set_state (sdata);
638  else
639  oct_init_by_array (sdata, len);
640 }
641 
642 void
644 {
645  if (dist != current_distribution)
646  {
647  current_distribution = dist;
648 
650  }
651 }
652 
653 void
654 octave_rand::fill (octave_idx_type len, double *v, double a)
655 {
656  if (len < 1)
657  return;
658 
659  switch (current_distribution)
660  {
661  case uniform_dist:
662  if (use_old_generators)
663  std::generate_n (v, len, [](void) { double x; F77_FUNC (dgenunf, DGENUNF) (0.0, 1.0, x); return x; });
664  else
665  oct_fill_randu (len, v);
666  break;
667 
668  case normal_dist:
669  if (use_old_generators)
670  std::generate_n (v, len, [](void) { double x; F77_FUNC (dgennor, DGENNOR) (0.0, 1.0, x); return x; });
671  else
672  oct_fill_randn (len, v);
673  break;
674 
675  case expon_dist:
676  if (use_old_generators)
677  std::generate_n (v, len, [](void) { double x; F77_FUNC (dgenexp, DGENEXP) (1.0, x); return x; });
678  else
679  oct_fill_rande (len, v);
680  break;
681 
682  case poisson_dist:
683  if (use_old_generators)
684  {
685  if (a < 0.0 || ! octave::math::isfinite (a))
686  std::fill_n (v, len, octave::numeric_limits<double>::NaN ());
687  else
688  {
689  // workaround bug in ignpoi, by calling with different Mu
690  double tmp;
691  F77_FUNC (dignpoi, DIGNPOI) (a + 1, tmp);
692  std::generate_n (v, len, [a](void) { double x; F77_FUNC (dignpoi, DIGNPOI) (a, x); return x; });
693  }
694  }
695  else
696  oct_fill_randp (a, len, v);
697  break;
698 
699  case gamma_dist:
700  if (use_old_generators)
701  {
702  if (a <= 0.0 || ! octave::math::isfinite (a))
703  std::fill_n (v, len, octave::numeric_limits<double>::NaN ());
704  else
705  std::generate_n (v, len, [a](void) { double x; F77_FUNC (dgengam, DGENGAM) (1.0, a, x); return x; });
706  }
707  else
708  oct_fill_randg (a, len, v);
709  break;
710 
711  default:
712  (*current_liboctave_error_handler)
713  ("rand: invalid distribution ID = %d", current_distribution);
714  break;
715  }
716 
717  save_state ();
718 
719  return;
720 }
721 
722 void
723 octave_rand::fill (octave_idx_type len, float *v, float a)
724 {
725  if (len < 1)
726  return;
727 
728  switch (current_distribution)
729  {
730  case uniform_dist:
731  if (use_old_generators)
732  std::generate_n (v, len, [](void) { float x; F77_FUNC (fgenunf, FGENUNF) (0.0f, 1.0f, x); return x; });
733  else
734  oct_fill_float_randu (len, v);
735  break;
736 
737  case normal_dist:
738  if (use_old_generators)
739  std::generate_n (v, len, [](void) { float x; F77_FUNC (fgennor, FGENNOR) (0.0f, 1.0f, x); return x; });
740  else
741  oct_fill_float_randn (len, v);
742  break;
743 
744  case expon_dist:
745  if (use_old_generators)
746  std::generate_n (v, len, [](void) { float x; F77_FUNC (fgenexp, FGENEXP) (1.0f, x); return x; });
747  else
748  oct_fill_float_rande (len, v);
749  break;
750 
751  case poisson_dist:
752  if (use_old_generators)
753  {
754  if (a < 0.0f || ! octave::math::isfinite (a))
755  std::fill_n (v, len, octave::numeric_limits<float>::NaN ());
756  else
757  {
758  // workaround bug in ignpoi, by calling with different Mu
759  float tmp;
760  F77_FUNC (fignpoi, FIGNPOI) (a + 1, tmp);
761  std::generate_n (v, len, [a](void) { float x; F77_FUNC (fignpoi, FIGNPOI) (a, x); return x; });
762  }
763  }
764  else
765  oct_fill_float_randp (a, len, v);
766  break;
767 
768  case gamma_dist:
769  if (use_old_generators)
770  {
771  if (a <= 0.0f || ! octave::math::isfinite (a))
772  std::fill_n (v, len, octave::numeric_limits<float>::NaN ());
773  else
774  std::generate_n (v, len, [a](void) { float x; F77_FUNC (fgengam, FGENGAM) (1.0f, a, x); return x; });
775  }
776  else
777  oct_fill_float_randg (a, len, v);
778  break;
779 
780  default:
781  (*current_liboctave_error_handler)
782  ("rand: invalid distribution ID = %d", current_distribution);
783  break;
784  }
785 
786  save_state ();
787 
788  return;
789 }
uint32_t id
Definition: graphics.cc:12193
for fields that display a single padding can be changed or inhibited by following the hour(hh:mm:ss [AP]M). tem %R Time
double oct_rande(void)
Definition: randmtzig.cc:622
subroutine setsd(iseed1, iseed2)
Definition: setsd.f:2
double oct_randu(void)
Definition: randmtzig.cc:403
Array< float > do_float_vector(octave_idx_type n, float a=1.)
Definition: oct-rand.cc:489
static bool instance_ok(void)
Definition: oct-rand.cc:58
NDArray do_nd_array(const dim_vector &dims, double a=1.)
Definition: oct-rand.cc:506
float oct_float_randu(void)
Definition: randmtzig.cc:410
static void exponential_distribution(void)
Definition: oct-rand.h:121
void save_state(void)
Definition: oct-rand.cc:602
int hour(void) const
Definition: oct-time.h:229
subroutine dignpoi(mu, result)
Definition: wrap.f:30
void do_poisson_distribution(void)
Definition: oct-rand.cc:293
void oct_get_state(uint32_t *save)
Definition: randmtzig.cc:299
F77_RET_T const F77_REAL const F77_REAL F77_REAL &F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE &F77_RET_T const F77_DBLE F77_DBLE &F77_RET_T const F77_REAL F77_REAL &F77_RET_T const F77_DBLE const F77_DBLE * f
void do_exponential_distribution(void)
Definition: oct-rand.cc:285
OCTAVE_NORETURN liboctave_error_handler current_liboctave_error_handler
Definition: lo-error.c:38
#define MT_N
Definition: randmtzig.h:69
uint32NDArray do_state(const std::string &d)
Definition: oct-rand.cc:150
static void cleanup_instance(void)
Definition: oct-rand.h:184
subroutine fgenunf(low, high, result)
Definition: wrap.f:44
void initialize_ranlib_generators(void)
Definition: oct-rand.cc:541
void set_internal_state(const uint32NDArray &s)
Definition: oct-rand.cc:630
void oct_fill_randg(double a, octave_idx_type n, double *r)
Definition: randgamma.cc:96
void do_reset()
Definition: oct-rand.cc:143
u
Definition: lu.cc:138
s
Definition: file-io.cc:2729
octave_rand(void)
Definition: oct-rand.cc:48
int current_distribution
Definition: oct-rand.h:197
void do_normal_distribution(void)
Definition: oct-rand.cc:277
int sec(void) const
Definition: oct-time.h:227
double do_scalar(double a=1.)
Definition: oct-rand.cc:309
void oct_fill_float_randu(octave_idx_type n, float *p)
Definition: randmtzig.cc:834
void oct_set_state(const uint32_t *save)
Definition: randmtzig.cc:291
F77_RET_T const F77_REAL const F77_REAL F77_REAL &F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE &F77_RET_T const F77_DBLE F77_DBLE &F77_RET_T const F77_REAL F77_REAL &F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE * d
calling an anonymous function involves an overhead quite comparable to the overhead of an m file function Passing a handle to a built in function is because the interpreter is not involved in the internal loop For a
Definition: cellfun.cc:400
void fill(octave_idx_type len, double *v, double a)
Definition: oct-rand.cc:654
void oct_fill_randu(octave_idx_type n, double *p)
Definition: randmtzig.cc:816
void initialize_mersenne_twister(void)
Definition: oct-rand.cc:562
void switch_to_generator(int dist)
Definition: oct-rand.cc:643
double oct_randp(double L)
Definition: randpoisson.cc:497
double do_seed(void)
Definition: oct-rand.cc:78
float do_float_scalar(float a=1.)
Definition: oct-rand.cc:390
int get_dist_id(const std::string &d)
Definition: oct-rand.cc:608
subroutine dgenunf(low, high, result)
Definition: wrap.f:9
void do_gamma_distribution(void)
Definition: oct-rand.cc:301
static std::string current_distribution
Definition: rand.cc:541
float oct_float_randn(void)
Definition: randmtzig.cc:747
subroutine dgenexp(av, result)
Definition: wrap.f:16
octave_idx_type numel(const octave_value_list &idx)
Definition: ov.h:412
int min(void) const
Definition: oct-time.h:228
static void gamma_distribution(void)
Definition: oct-rand.h:133
static void add(fptr f)
float_format native_float_format(void)
Definition: mach-info.cc:62
FloatNDArray do_float_nd_array(const dim_vector &dims, float a=1.)
Definition: oct-rand.cc:521
double tmp
Definition: data.cc:6252
Array< double > do_vector(octave_idx_type n, double a=1.)
Definition: oct-rand.cc:472
is false
Definition: cellfun.cc:400
octave_value retval
Definition: data.cc:6246
float oct_float_randg(float a)
Definition: randgamma.cc:191
static void poisson_distribution(void)
Definition: oct-rand.h:127
void oct_fill_randn(octave_idx_type n, double *p)
Definition: randmtzig.cc:822
subroutine dgengam(a, r, result)
Definition: wrap.f:23
the exceeded dimensions are set to if fewer subscripts than dimensions are the exceeding dimensions are merged into the final requested dimension For consider the following dims
Definition: sub2ind.cc:255
double oct_randg(double a)
Definition: randgamma.cc:136
void oct_fill_float_randp(float FL, octave_idx_type n, float *p)
Definition: randpoisson.cc:536
F77_RET_T F77_FUNC(xerbla, XERBLA)
Definition: xerbla.c:57
subroutine fgenexp(av, result)
Definition: wrap.f:51
subroutine setall(iseed1, iseed2)
Definition: setall.f:2
subroutine fgennor(av, sd, result)
Definition: wrap.f:37
void oct_fill_float_randn(octave_idx_type n, float *p)
Definition: randmtzig.cc:840
N Dimensional Array with copy-on-write semantics.
Definition: Array.h:125
void do_uniform_distribution(void)
Definition: oct-rand.cc:269
void oct_fill_float_randg(float a, octave_idx_type n, float *r)
Definition: randgamma.cc:151
static octave_rand * instance
Definition: oct-rand.h:182
OCTAVE_EXPORT octave_value_list or N dimensional array whose elements are all equal to the IEEE symbol NaN(Not a Number). NaN is the result of operations which do not produce a well defined 0 result. Common operations which produce a NaN are arithmetic with infinity ex($\infty - \infty$)
static void normal_distribution(void)
Definition: oct-rand.h:115
std::map< int, uint32NDArray > rand_states
Definition: oct-rand.h:204
subroutine dgennor(av, sd, result)
Definition: wrap.f:2
float oct_float_rande(void)
Definition: randmtzig.cc:788
subroutine getsd(iseed1, iseed2)
Definition: getsd.f:2
bool isfinite(double x)
Definition: lo-mappers.h:201
bool use_old_generators
Definition: oct-rand.h:201
void oct_fill_rande(octave_idx_type n, double *p)
Definition: randmtzig.cc:828
std::string do_distribution(void)
Definition: oct-rand.cc:199
void oct_init_by_entropy(void)
Definition: randmtzig.cc:253
subroutine fignpoi(mu, result)
Definition: wrap.f:65
for i
Definition: data.cc:5264
subroutine fgengam(a, r, result)
Definition: wrap.f:58
Vector representing the dimensions (size) of an Array.
Definition: dim-vector.h:87
double oct_randn(void)
Definition: randmtzig.cc:557
static void uniform_distribution(void)
Definition: oct-rand.h:109
If this string is the system will ring the terminal sometimes it is useful to be able to print the original representation of the string
Definition: utils.cc:888
void oct_fill_float_rande(octave_idx_type n, float *p)
Definition: randmtzig.cc:846
static int32_t force_to_fit_range(int32_t i, int32_t lo, int32_t hi)
Definition: oct-rand.cc:100
int mday(void) const
Definition: oct-time.h:230
void oct_init_by_array(const uint32_t *init_key, const int key_length)
Definition: randmtzig.cc:212
F77_RET_T const F77_REAL const F77_REAL F77_REAL &F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE &F77_RET_T const F77_DBLE F77_DBLE &F77_RET_T const F77_REAL F77_REAL &F77_RET_T const F77_DBLE * x
void oct_fill_randp(double L, octave_idx_type n, double *p)
Definition: randpoisson.cc:465
uint32NDArray get_internal_state(void)
Definition: oct-rand.cc:592