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 |
|
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
20 |
|
21 */ |
|
22 |
|
23 #if !defined (octave_rand_h) |
|
24 #define octave_rand_h 1 |
|
25 |
|
26 #include <string> |
|
27 |
|
28 #include "dMatrix.h" |
4543
|
29 #include "dNDArray.h" |
4308
|
30 |
|
31 struct |
|
32 octave_rand |
|
33 { |
|
34 // Return the current seed. |
|
35 static double seed (void); |
|
36 |
|
37 // Set the seed. |
|
38 static void seed (double s); |
|
39 |
|
40 // Return the current distribution. |
|
41 static std::string distribution (void); |
|
42 |
|
43 // Set the current distribution. May be either "uniform" (the |
|
44 // default) or "normal". |
|
45 static void distribution (const std::string& d); |
|
46 |
|
47 static void uniform_distribution (void); |
|
48 |
|
49 static void normal_distribution (void); |
|
50 |
|
51 // Return the next number from the sequence. |
|
52 static double scalar (void); |
|
53 |
|
54 // Return a matrix of numbers from the sequence, filled in column |
|
55 // major order. |
|
56 static Matrix matrix (int r, int c); |
|
57 |
4543
|
58 // Return an N-dimensional array of numbers from the sequence, |
|
59 // filled in column major order. |
|
60 static NDArray nd_array (const dim_vector& dims); |
|
61 |
4308
|
62 // Return an array of numbers from the sequence. |
|
63 static Array<double> vector (int n); |
|
64 }; |
|
65 |
|
66 #endif |
|
67 |
|
68 /* |
|
69 ;;; Local Variables: *** |
|
70 ;;; mode: C++ *** |
|
71 ;;; End: *** |
|
72 */ |