4308
|
1 /* |
|
2 |
|
3 Copyright (C) 2003 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 the |
|
9 Free Software Foundation; either version 2, or (at your option) any |
|
10 later version. |
|
11 |
|
12 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
15 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, write to the Free |
5307
|
19 Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
|
20 02110-1301, USA. |
4308
|
21 |
|
22 */ |
|
23 |
|
24 #if !defined (octave_rand_h) |
|
25 #define octave_rand_h 1 |
|
26 |
|
27 #include <string> |
|
28 |
|
29 #include "dMatrix.h" |
4543
|
30 #include "dNDArray.h" |
4308
|
31 |
|
32 struct |
|
33 octave_rand |
|
34 { |
|
35 // Return the current seed. |
|
36 static double seed (void); |
|
37 |
|
38 // Set the seed. |
|
39 static void seed (double s); |
|
40 |
|
41 // Return the current distribution. |
|
42 static std::string distribution (void); |
|
43 |
|
44 // Set the current distribution. May be either "uniform" (the |
|
45 // default) or "normal". |
|
46 static void distribution (const std::string& d); |
|
47 |
|
48 static void uniform_distribution (void); |
|
49 |
|
50 static void normal_distribution (void); |
|
51 |
|
52 // Return the next number from the sequence. |
|
53 static double scalar (void); |
|
54 |
|
55 // Return a matrix of numbers from the sequence, filled in column |
|
56 // major order. |
5275
|
57 static Matrix matrix (octave_idx_type r, octave_idx_type c); |
4308
|
58 |
4543
|
59 // Return an N-dimensional array of numbers from the sequence, |
|
60 // filled in column major order. |
|
61 static NDArray nd_array (const dim_vector& dims); |
|
62 |
4308
|
63 // Return an array of numbers from the sequence. |
5275
|
64 static Array<double> vector (octave_idx_type n); |
4308
|
65 }; |
|
66 |
|
67 #endif |
|
68 |
|
69 /* |
|
70 ;;; Local Variables: *** |
|
71 ;;; mode: C++ *** |
|
72 ;;; End: *** |
|
73 */ |