moved nonpb.pm
[PsN.git] / modules / Math-Random / Random.xs
blobff57e540741a0ff3bd957214cb6d0534d6298e91
1 #ifdef __cplusplus
2 extern "C" {
3 #endif
4 #include "EXTERN.h"
5 #include "perl.h"
6 #include "XSUB.h"
7 #ifdef __cplusplus
9 #endif
11 #include "randlib.h"
12 #include "helper.h"
14 static int
15 not_here(s)
16 char *s;
18     croak("%s not implemented on this architecture", s);
19     return -1;
22 static double
23 constant(name, arg)
24 char *name;
25 int arg;
27     errno = 0;
28     switch (*name) {
29     }
30     errno = EINVAL;
31     return 0;
33 not_there:
34     errno = ENOENT;
35     return 0;
39 MODULE = Math::Random           PACKAGE = Math::Random          
42 double
43 genbet (aa,bb)
44         INPUT:
45         double  aa
46         double  bb
48 double
49 genchi (df)
50         INPUT:
51         double  df
53 double
54 genexp (av)
55         INPUT:
56         double  av
58 double
59 genf (dfn,dfd)
60         INPUT:
61         double  dfn
62         double  dfd
64 double
65 gengam (a,r)
66         INPUT:
67         double  a
68         double  r
70 int
71 psetmn (p)
72         INPUT:
73         long  p
75 int
76 pgenmn ()
77         PROTOTYPE:
78         INPUT:
79         CODE:
80         RETVAL = pgenmn();
81         OUTPUT:
82         RETVAL
84 int
85 rspriw (size)
86         INPUT:
87         long  size
89 int
90 rsprfw (size)
91         INPUT:
92         long  size
94 void
95 svprfw (index,value)
96         INPUT:
97         long  index
98         double  value
100 void
101 pgnmul (n,ncat)
102         INPUT:
103         long  n
104         long  ncat
106 long
107 gvpriw (index)
108         INPUT:
109         long  index
111 double
112 gennch (df,xnonc)
113         INPUT:
114         double  df
115         double  xnonc
117 double
118 gennf (dfn,dfd,xnonc)
119         INPUT:
120         double  dfn
121         double  dfd
122         double  xnonc
124 double
125 gennor (av,sd)
126         INPUT:
127         double  av
128         double  sd
130 void
131 pgnprm (n)
132         PROTOTYPE: $
133         INPUT:
134         long  n
135         CODE:
136         pgnprm(n);
137         OUTPUT:
139 double
140 genunf (low,high)
141         INPUT:
142         double  low
143         double  high
145 long
146 ignpoi (mu)
147         INPUT:
148         double  mu
150 long
151 ignuin (low,high)
152         INPUT:
153         long  low
154         long  high
156 long
157 ignnbn (n,p)
158         INPUT:
159         long  n
160         double  p
162 long
163 ignbin (n,pp)
164         INPUT:
165         long  n
166         double  pp
168 void
169 phrtsd (phrase)
170         PROTOTYPE: $
171         INPUT:
172         char *  phrase
173         PREINIT:
174         long  newseed1;
175         long  newseed2;
176         PPCODE:
177         phrtsd(phrase,&newseed1,&newseed2);
178         EXTEND(sp, 2);
179         PUSHs(sv_2mortal(newSViv(newseed1)));
180         PUSHs(sv_2mortal(newSViv(newseed2)));
182 void
183 getsd ()
184         PROTOTYPE:
185         PREINIT:
186         long  newseed1;
187         long  newseed2;
188         PPCODE:
189         getsd(&newseed1,&newseed2);
190         EXTEND(sp, 2);
191         PUSHs(sv_2mortal(newSViv(newseed1)));
192         PUSHs(sv_2mortal(newSViv(newseed2)));
194 void
195 salfph (phrase)
196         PROTOTYPE: $
197         INPUT:
198         char *  phrase
199         CODE:
200         salfph(phrase);
201         OUTPUT:
203 void
204 setall (iseed1,iseed2)
205         PROTOTYPE: $$
206         INPUT:
207         long  iseed1
208         long  iseed2
209         CODE:
210         setall(iseed1,iseed2);
211         OUTPUT:
213 double
214 gvprfw (index)
215         INPUT:
216         long  index