Finish pod separation and add stub tests for remaining subsystems
[Math-GSL.git] / swig / Randist.i
blob28460b66103710fe651570f2efe1968ff9d692b9
1 %module "Math::GSL::Randist"
2 %include "typemaps.i"
4 void gsl_ran_dir_2d (const gsl_rng * r, double *OUTPUT, double *OUTPUT);
5 void gsl_ran_dir_2d_trig_method (const gsl_rng * r, double *OUTPUT, double *OUTPUT);
6 void gsl_ran_dir_3d (const gsl_rng * r, double *OUTPUT, double *OUTPUT, double *OUTPUT);
7 void gsl_ran_bivariate_gaussian (const gsl_rng * r, double sigma_x, double sigma_y, double rho, double *OUTPUT, double *OUTPUT);
9 %typemap(in) void * {
10 AV *tempav;
11 I32 len;
12 int i,x;
13 SV **tv;
15 if (!SvROK($input))
16 croak("Argument $argnum is not a reference.");
17 if (SvTYPE(SvRV($input)) != SVt_PVAV)
18 croak("Argument $argnum is not an array.");
20 tempav = (AV*)SvRV($input);
21 len = av_len(tempav);
22 $1 = (int **) malloc((len+2)*sizeof(int *));
23 for (i = 0; i <= len; i++) {
24 tv = av_fetch(tempav, i, 0);
25 x = SvIV(*tv);
26 memset((int*)($1+i), x , 1);
27 //printf("curr = %d\n", (int)($1+i) );
30 %typemap(freearg) void * {
31 free($1);
35 #include "gsl/gsl_randist.h"
37 %include "gsl/gsl_randist.h"
38 %include "../pod/Randist.pod"