1 %module
"Math::GSL::Randist"
3 %include
"gsl_typemaps.i"
5 void gsl_ran_dir_2d
(const gsl_rng
* r
, double
*OUTPUT, double
*OUTPUT);
6 void gsl_ran_dir_2d_trig_method
(const gsl_rng
* r
, double
*OUTPUT, double
*OUTPUT);
7 void gsl_ran_dir_3d
(const gsl_rng
* r
, double
*OUTPUT, double
*OUTPUT, double
*OUTPUT);
8 void gsl_ran_bivariate_gaussian
(const gsl_rng
* r
, double sigma_x
, double sigma_y
, double rho
, double
*OUTPUT, double
*OUTPUT);
17 croak
("Argument $argnum is not a reference.");
18 if
(SvTYPE
(SvRV
($input
)) != SVt_PVAV
)
19 croak
("Argument $argnum is not an array.");
21 tempav
= (AV
*)SvRV
($input
);
23 $
1 = (int
**) malloc
((len
+2)*sizeof
(int
*));
24 for
(i
= 0; i
<= len
; i
++) {
25 tv
= av_fetch
(tempav
, i
, 0);
27 memset
((int
*)($
1+i
), x
, 1);
28 //printf
("curr = %d\n", (int
)($
1+i
) );
31 %typemap
(freearg
) void
* {
36 #include
"gsl/gsl_randist.h"
38 %include
"gsl/gsl_randist.h"
39 %include
"../pod/Randist.pod"