PDL-GSL-2.103/0000755000175000017500000000000015160062236012510 5ustar osboxesosboxesPDL-GSL-2.103/META.json0000644000175000017500000000252215160062236014132 0ustar osboxesosboxes{ "abstract" : "unknown", "author" : [ "PerlDL Developers " ], "dynamic_config" : 1, "generated_by" : "ExtUtils::MakeMaker version 7.72, CPAN::Meta::Converter version 2.150010", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : 2 }, "name" : "PDL-GSL", "no_index" : { "directory" : [ "t", "inc" ] }, "prereqs" : { "build" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "configure" : { "requires" : { "ExtUtils::MakeMaker" : "0", "PDL" : "2.096" } }, "runtime" : { "requires" : { "PDL" : "2.096", "perl" : "5.016" } } }, "release_status" : "stable", "resources" : { "bugtracker" : { "web" : "https://github.com/PDLPorters/PDL-GSL/issues" }, "homepage" : "http://pdl.perl.org/", "repository" : { "type" : "git", "url" : "git://github.com/PDLPorters/PDL-GSL.git", "web" : "https://github.com/PDLPorters/PDL-GSL" }, "x_IRC" : "irc://irc.perl.org/#pdl" }, "version" : "2.103", "x_serialization_backend" : "JSON::PP version 4.04" } PDL-GSL-2.103/typemap0000644000175000017500000000044114736061645014124 0ustar osboxesosboxesTYPEMAP GslSpline * T_PTROBJ GslAccel * T_PTROBJ gsl_spline * T_PTR gsl_interp_accel * T_PTR gsl_rng * ANY_OBJ gsl_ran_discrete_t * T_PTROBJ OUTPUT ANY_OBJ sv_setref_pv($arg, CLASS, (void *) $var); INPUT ANY_OBJ $var = INT2PTR($type, SvIV((SV*)SvRV($arg))) PDL-GSL-2.103/gslerr.h0000644000175000017500000000030314725502373014162 0ustar osboxesosboxes#include #define GSLERR(x,y) \ { \ int status = x y; \ if (status) \ return PDL->make_error(PDL_EUSERERROR, "Error in %s: %s", #x, gsl_strerror(status)); \ } PDL-GSL-2.103/MANIFEST.SKIP0000644000175000017500000000145214736061645014423 0ustar osboxesosboxes\.DS_Store %$ -stamp$ .*/TAGS$ .*Version_check$ .*\#$ .*\.0$ .*\.orig$ .*\.rej$ \.swp$ .exe$ /\.\#.* /pm_to_blib$ /tmp.* MANIFEST\.bak$ MANIFEST\.old META\.json META\.yml Makefile$ Makefile\.aperl Makefile\.old \.(tmp|new|diff|ori)$ \.BAK$ \.bck$ \.bs \.bundle$ \.lck$ \.m$ \.o$ \.out$ \.patch$ \.so$ \.tar\.gz$ \b_eumm/ ^lib/PDL/GSL/CDF(\.(pm|xs|c)$|-pp-) ^lib/PDL/GSL/DIFF(\.(pm|xs|c)$|-pp-) ^lib/PDL/GSL/INTEG(\.(pm|xs|c)$|-pp-) ^lib/PDL/GSL/INTERP(\.(pm|xs|c)$|-pp-) ^lib/PDL/GSL/LINALG(\.(pm|xs|c)$|-pp-) ^lib/PDL/GSL/MROOT(\.(pm|xs|c)$|-pp-) ^lib/PDL/GSL/RNG(\.(pm|xs|c)$|-pp-) ^lib/PDL/GSL/SF(\.(pm|xs|c)$|-pp-) ^lib/PDL/Stats/Distr(\.(pm|xs|c)$|-pp-) ^\.\#.* ^\.exists ^\.git \.gitignore$ ^blib/ ^pm_to_blib$ ~$ ^xt/ ^\.github/ ^\.cirrus\.yml cover_db/ ^nytprof(/|\.out) \.gc(ov|no|da)$ pp-\w*\.c$ PDL-GSL-2.103/t/0000755000175000017500000000000015160062236012753 5ustar osboxesosboxesPDL-GSL-2.103/t/gsl_diff.t0000644000175000017500000000137414736061645014735 0ustar osboxesosboxes# Test Script for the PDL interface to the GSL library # This tests mainly that the interface is working, i.e. that the # functions can be called. # The GSL library already has a extensive test suite, and we # do not want to duplicate that effort here. use strict; use warnings; use Test::More; use PDL::LiteF; use PDL::GSL::DIFF; my @res = gsldiff(\&myf,1.5); ok(abs($res[0]- 28.4632075095177) < 1e-6 ); @res = gsldiff(\&myf,1.5,{Method => 'central'}); ok(abs($res[0]- 28.4632075095177) < 1e-6 ); @res = gsldiff(\&myf,1.5,{Method => 'forward'}); ok(abs($res[0]- 28.4632852673531) < 1e-6 ); @res = gsldiff(\&myf,1.5,{Method => 'backward'}); ok(abs($res[0]-28.4631297516823 ) < 1e-6 ); done_testing; sub myf{ my ($x) = @_; return exp($x**2); } PDL-GSL-2.103/t/gsl_rng.t0000644000175000017500000000605114736061645014610 0ustar osboxesosboxes# Test Script for the PDL interface to the GSL library # This tests only that the interface is working, i.e. that the # functions can be called. The actual return values are not # checked. # The GSL library already has a extensive test suite, and we # do not want to duplicate that effort here. use strict; use warnings; use Test::More; use PDL::LiteF; use PDL::GSL::RNG; my $image = zeroes(10,10); my $ndim = 2; my $name = ''; my $sigma = 1; # new() function Test: my $rng = PDL::GSL::RNG->new('taus'); pass('new() function'); # set_seed(); function Test: $rng->set_seed(666); pass('set_seed(); function'); my $rng2 = PDL::GSL::RNG->new('taus')->set_seed(666); is(ref $rng2, 'PDL::GSL::RNG', 'PDL::GSL::RNG->new(..)->set_seed(..)'); # min() function Test: my $min = $rng->min(); my $max = $rng->max(); pass('min() function'); # rmax() function Test: $min = $rng->min(); $max = $rng->max(); pass('rmax() function'); # name() function Test: $name = $rng->name(); pass('name() function'); # get_uniform() function Test: my $x = zeroes 5,6; $max=100; my $o = $rng->get_uniform(10,10); $rng->get_uniform($x); pass('get_uniform() function'); # get_uniform_pos() function Test: $x = zeroes 5,6; $o = $rng->get_uniform_pos(10,10); $rng->get_uniform_pos($x); pass('get_uniform_pos() function'); # get() function Test: $x = zeroes 5,6; $o = $rng->get(10,10); $rng->get($x); pass('get() function'); # get_int() function Test: $x = zeroes 5,6; $max=100; $o = $rng->get(10,10); $rng->get($x); pass('get_int() function'); # ran_gaussian() function Test: $o = $rng->ran_gaussian($sigma,10,10); $rng->ran_gaussian($sigma,$x); pass('ran_gaussian() function'); # $rng->ran_gaussian_var() function Test: my $sigma_pdl = rvals zeroes 11,11; $o = $rng->ran_gaussian_var($sigma_pdl); pass('ran_gaussian_var() method'); # ran_additive_gaussian() function Test: $rng->ran_additive_gaussian(1,$image); pass('ran_additive_gaussian() method'); # ran_additive_poisson() function Test: $rng->ran_additive_poisson(1,$image); pass('ran_additive_poisson() method'); # ran_feed_poisson() function Test: $rng->ran_feed_poisson($image); pass('ran_feed_poisson() method'); # ran_bivariate_gaussian() function Test: $o = $rng->ran_bivariate_gaussian(1,2,0.5,1000); pass('ran_bivariate_gaussian() method'); # ran_dir() function Test: $o = $rng->ran_dir($ndim,12); pass('ran_dir() method'); # ran_discrete_preproc() function Test: my $prob = pdl [0.1,0.3,0.6]; my $discrete_dist_handle = $rng->ran_discrete_preproc($prob); $o = $rng->ran_discrete($discrete_dist_handle,100); pass('ran_discrete_preproc() method'); # ran_discrete() function Test: $prob = pdl [0.1,0.3,0.6]; $discrete_dist_handle = $rng->ran_discrete_preproc($prob); $o = $rng->ran_discrete($discrete_dist_handle,100); pass('ran_discrete() method'); my $vec2d = sequence(10,10); $rng->ran_shuffle($_) for $vec2d->dog; ok any($vec2d != sequence(10,10)), 'ran_shuffle() method'; $vec2d = sequence(10,10); $rng->ran_shuffle_1d($vec2d); ok any($vec2d != sequence(10,10)), 'ran_shuffle_1d() method'; done_testing; PDL-GSL-2.103/t/gsl_sf.t0000644000175000017500000000245614736061645014437 0ustar osboxesosboxes# Test Script for the PDL interface to the GSL library # This tests only that the interface is working, i.e. that the # functions can be called. The actual return values are not # checked. # The GSL library already has a extensive test suite, and we # do not want to duplicate that effort here. use strict; use warnings; use Test::More; use Test::PDL; use PDL::LiteF; use PDL::GSL::SF; my ($y,$err) = gsl_sf_bessel_Jn(5.0, 0); is_pdl $y, pdl(-0.17759677131433830434739701), "GSL SF Bessel function"; chomp(my $version = `gsl-config --version`); if ((split /\./, $version)[0] >= 2) { my $Ylm = gsl_sf_legendre_array(xvals(21)/10-1,'Y',4,-1); ok($Ylm->slice("(0)")->uniq->nelem == 1, "Legendre Y00 is constant"); is_pdl $Ylm->slice("(0),(0)"), pdl(0.5/sqrt(3.141592654)), "Y00 value is correct"; } { # Check that the PDL error handler gets called instead of aborting # Failure is an abort. my @warning; local $SIG{__WARN__} = sub { push @warning, @_ }; my $err_test = eval {gsl_sf_lngamma(pdl(0))}; isnt $@, '', "Got an error for invalid input"; ok !@warning, 'no warnings' or diag explain \@warning; } ($y, my $e) = gsl_sf_airy_Ai(sequence(4)); is_pdl $y, pdl([0.35502805, 0.13529242, 0.03492413, 0.0065911394]); is_pdl $e, pdl([8.3366727e-17, 5.6151774e-17, 3.9261626e-17, 1.0852712e-17]); done_testing; PDL-GSL-2.103/t/cdf.t0000644000175000017500000003640314736061645013715 0ustar osboxesosboxesuse strict; use warnings; use Test::More; use PDL::LiteF; use PDL::GSL::CDF; use Test::PDL; { my $a = sequence 5; my $a_bad = $a->append(pdl 'BAD'); is_pdl $a->gsl_cdf_tdist_P(1999), my $texp = pdl('0.5 0.841284230695725 0.977182329566921 0.998633419750658 0.999967176033837'); is_pdl $a_bad->gsl_cdf_tdist_P(1999), $texp->append(pdl 'BAD'); is_pdl $a->gsl_cdf_fdist_P(1,1999), my $fexp = pdl('0 0.682568461391451 0.842545068166059 0.916581225902023 0.95436465913384'); is_pdl $a_bad->gsl_cdf_fdist_P(1,1999), $fexp->append(pdl 'BAD'); } { my $x = pdl('[0.185 0.242 0.385 0.528 0.671 0.814]'); is_pdl gsl_cdf_gaussian_P ($x, 0.6) , pdl([ 0.621085647787498, 0.656648488459185, 0.739455181655133, 0.810570345223288, 0.868287672230057, 0.912556425780295 ]); is_pdl gsl_cdf_gaussian_Q ($x, 0.6) , pdl([ 0.378914352212502, 0.343351511540815, 0.260544818344867, 0.189429654776712, 0.131712327769943, 0.0874435742197054 ]); is_pdl gsl_cdf_gaussian_Pinv ($x, 0.6) , pdl([ -0.53788401840115, -0.419930160118405, -0.175424937736083, 0.04214598829315, 0.265605686522293, 0.535639994592513 ]); is_pdl gsl_cdf_gaussian_Qinv ($x, 0.6) , pdl([ 0.53788401840115, 0.419930160118405, 0.175424937736083, -0.04214598829315, -0.265605686522293, -0.535639994592513 ]); is_pdl gsl_cdf_ugaussian_P ($x) , pdl([ 0.573385482213374, 0.5956099183852, 0.649881292234724, 0.701250332027385, 0.748889735236971, 0.792177524517595 ]); is_pdl gsl_cdf_ugaussian_Q ($x) , pdl([ 0.426614517786626, 0.4043900816148, 0.350118707765276, 0.298749667972615, 0.251110264763029, 0.207822475482405 ]); is_pdl gsl_cdf_ugaussian_Pinv ($x) , pdl([ -0.896473364001916, -0.699883600197341, -0.292374896226804, 0.0702433138219167, 0.442676144203822, 0.892733324320856 ]); is_pdl gsl_cdf_ugaussian_Qinv ($x) , pdl([ 0.896473364001916, 0.699883600197341, 0.292374896226804, -0.0702433138219167, -0.442676144203822, -0.892733324320856 ]); is_pdl gsl_cdf_exponential_Pinv ($x, 0.25) , pdl([ 0.0511417914353186, 0.0692679733349413, 0.121533252793905, 0.187694073349145, 0.277924382054191, 0.420502151317234 ]); is_pdl gsl_cdf_exponential_Q ($x, 0.25) , pdl([ 0.477113915521034, 0.379841962851379, 0.214381101426978, 0.120995732814878, 0.0682894493122845, 0.0385422591266925 ]); is_pdl gsl_cdf_exponential_P ($x, 0.25) , pdl([ 0.522886084478966, 0.620158037148621, 0.785618898573022, 0.879004267185122, 0.931710550687715, 0.961457740873307 ]); is_pdl gsl_cdf_exponential_Qinv ($x, 0.25) , pdl([ 0.421849863475953, 0.354704388206363, 0.238627986173588, 0.159664748818969, 0.0997465355026138, 0.0514487282448992 ]); is_pdl gsl_cdf_laplace_P ($x, 100) , pdl([ 0.500924144902391, 0.501208537080327, 0.501921299125978, 0.502633042650321, 0.5033437691088, 0.504053479954779 ]); is_pdl gsl_cdf_laplace_Q ($x, 100) , pdl([ 0.499075855097609, 0.498791462919674, 0.498078700874022, 0.497366957349679, 0.4966562308912, 0.495946520045221 ]); is_pdl gsl_cdf_laplace_Pinv ($x, 100) , pdl([ -99.4252273343867, -72.5670372265505, -26.1364764134408, 5.76291128366364, 41.855034765682, 98.886142470899 ]); is_pdl gsl_cdf_laplace_Qinv ($x, 100) , pdl([ 99.4252273343867, 72.5670372265505, 26.1364764134408, -5.76291128366364, -41.855034765682, -98.886142470899 ]); is_pdl gsl_cdf_exppow_P ($x, 10, 20) , pdl([ 0.509501756003763, 0.512429324069787, 0.51977392465648, 0.527118525243172, 0.534463125829865, 0.541807726416557 ]); is_pdl gsl_cdf_exppow_Q ($x, 10, 20) , pdl([ 0.490498243996237, 0.487570675930213, 0.48022607534352, 0.472881474756828, 0.465536874170135, 0.458192273583443 ]); is_pdl gsl_cdf_cauchy_P ($x, 10) , pdl([ 0.505888061226044, 0.507701596026139, 0.512248881040388, 0.516791169875417, 0.521326624632281, 0.525853424029018 ]); is_pdl gsl_cdf_cauchy_Q ($x, 10) , pdl([ 0.494111938773956, 0.492298403973861, 0.487751118959612, 0.483208830124583, 0.478673375367719, 0.474146575970982 ]); is_pdl gsl_cdf_cauchy_Pinv ($x, 10) , pdl([ -15.2235450689613, -10.5157249987904, -3.77868511775821, 0.881921819968596, 5.95646629389323, 15.1198164986352 ]); is_pdl gsl_cdf_cauchy_Qinv ($x, 10) , pdl([ 15.2235450689613, 10.5157249987904, 3.77868511775821, -0.881921819968596, -5.95646629389323, -15.1198164986352 ]); is_pdl gsl_cdf_rayleigh_P ($x, 0.6) , pdl([ 0.0464226377672899, 0.078118776801827, 0.1860595358795, 0.321044709711432, 0.46491770539411, 0.601589429889673 ]); is_pdl gsl_cdf_rayleigh_Q ($x, 0.6) , pdl([ 0.95357736223271, 0.921881223198173, 0.8139404641205, 0.678955290288568, 0.53508229460589, 0.398410570110327 ]); is_pdl gsl_cdf_rayleigh_Pinv ($x, 0.6) , pdl([ 0.383781655806681, 0.44664500803729, 0.591621304591413, 0.735227129019012, 0.894663188197699, 1.10047544079531 ]); is_pdl gsl_cdf_rayleigh_Qinv ($x, 0.6) , pdl([ 1.10223754554576, 1.01071689311811, 0.829004583931798, 0.678110961862902, 0.535975766474127, 0.384931600866063 ]); is_pdl gsl_cdf_gamma_P ($x, 1, 2) , pdl([ 0.0883507890355383, 0.113966040407124, 0.175105681796397, 0.232026460343294, 0.285019493288257, 0.334355809698479 ]); is_pdl gsl_cdf_gamma_Q ($x, 1, 2) , pdl([ 0.911649210964462, 0.886033959592876, 0.824894318203603, 0.767973539656706, 0.714980506711743, 0.665644190301521 ]); is_pdl gsl_cdf_gamma_Pinv ($x, 1, 2) , pdl([ 0.409134331482549, 0.554143786679531, 0.972266022351238, 1.50155258679316, 2.22339505643353, 3.36401721053787 ]); is_pdl gsl_cdf_gamma_Qinv ($x, 1, 2) , pdl([ 3.37479890780762, 2.8376351056509, 1.90902388938871, 1.27731799055175, 0.79797228402091, 0.411589825959194 ]); is_pdl gsl_cdf_flat_P ($x, 0, 2) , pdl([0.0925, 0.121, 0.1925, 0.264, 0.3355, 0.407]); is_pdl gsl_cdf_flat_Q ($x, 0, 2) , pdl([0.9075, 0.879, 0.8075, 0.736, 0.6645, 0.593]); is_pdl gsl_cdf_flat_Pinv ($x, 1, 2) , pdl([1.185, 1.242, 1.385, 1.528, 1.671, 1.814]); is_pdl gsl_cdf_flat_Qinv ($x, 1, 2) , pdl([1.815, 1.758, 1.615, 1.472, 1.329, 1.186]); is_pdl gsl_cdf_lognormal_P ($x, 0.3, 0.6), pdl([ 0.000462607682986099, 0.00208704926075921, 0.0182706108740019, 0.0588581153586641, 0.122014171048952, 0.199616592770584 ]); is_pdl gsl_cdf_lognormal_Q ($x, 0.3, 0.6), pdl([ 0.999537392317014, 0.997912950739241, 0.981729389125998, 0.941141884641336, 0.877985828951048, 0.800383407229416 ]); is_pdl gsl_cdf_lognormal_Pinv ($x, 0.3, 0.6), pdl([ 0.788294113403652, 0.886982381298518, 1.13266703782153, 1.40796582903933, 1.76051377932779, 2.30628958893332 ]); is_pdl gsl_cdf_lognormal_Qinv ($x, 0.3, 0.6), pdl([ 2.31147076885183, 2.05428973428196, 1.60869764860025, 1.29414987410153, 1.03499263782317, 0.790065050431614 ]); is_pdl gsl_cdf_chisq_P ($x, 0.9) , pdl([ 0.376001891123672, 0.420680573652885, 0.507543979704043, 0.573017615826538, 0.625398070381443, 0.668713631235268 ]); is_pdl gsl_cdf_chisq_Q ($x, 0.9) , pdl([ 0.623998108876328, 0.579319426347115, 0.492456020295957, 0.426982384173462, 0.374601929618557, 0.331286368764732 ]); is_pdl gsl_cdf_chisq_Pinv ($x, 0.9) , pdl([ 0.0363724832898845, 0.0667572490273275, 0.195682928939501, 0.425980141237634, 0.822286592027187, 1.57020451220134 ]); is_pdl gsl_cdf_chisq_Qinv ($x, 0.9) , pdl([ 1.57778431676383, 1.21061535673313, 0.640242963605861, 0.320808004604559, 0.135209087406343, 0.0368164405929002 ]); is_pdl gsl_cdf_fdist_P ($x, 0.5, 0.8), pdl([ 0.395899685715852, 0.421622763059381, 0.468763623791231, 0.502470355270446, 0.528704043285766, 0.550125367078533 ]); is_pdl gsl_cdf_fdist_Q ($x, 0.5, 0.8), pdl([ 0.604100314284148, 0.578377236940619, 0.531236376208769, 0.497529644729554, 0.471295956714234, 0.449874632921467 ]); is_pdl gsl_cdf_fdist_Pinv ($x, 1.5, 1.8), pdl([ 0.159905620801234, 0.241769364468725, 0.535256991978199, 1.04012738093102, 2.03748438382058, 4.73267894511171 ]); is_pdl gsl_cdf_fdist_Qinv ($x, 1.5, 1.8), pdl([ 4.76724629388056, 3.2748615203822, 1.55210103408465, 0.806318097041121, 0.402458766933549, 0.161204550680556 ]); is_pdl gsl_cdf_tdist_P ($x, 0.7) , pdl([ 0.553772454538094, 0.569686093296725, 0.607329840803688, 0.641083174744614, 0.670718124690489, 0.696452396237433 ]); is_pdl gsl_cdf_tdist_Q ($x, 0.7) , pdl([ 0.446227545461906, 0.430313906703275, 0.392670159196312, 0.358916825255386, 0.329281875309511, 0.303547603762567 ]); is_pdl gsl_cdf_tdist_Pinv ($x, 2) , pdl([ -1.14725744068977, -0.851907453506246, -0.33422960488652, 0.079320431592384, 0.514697310821784, 1.1412373360793 ]); is_pdl gsl_cdf_tdist_Qinv ($x, 2) , pdl([ 1.14725744068977, 0.851907453506246, 0.33422960488652, -0.079320431592384, -0.514697310821784, -1.1412373360793 ]); is_pdl gsl_cdf_beta_P ($x, 1, 2) , pdl([ 0.335775, 0.425436, 0.621775, 0.777216, 0.891759, 0.965404 ]); is_pdl gsl_cdf_beta_Q ($x, 1, 2) , pdl([ 0.664225, 0.574564, 0.378225, 0.222784, 0.108241, 0.034596 ]); is_pdl gsl_cdf_beta_Pinv ($x, 1, 2) , pdl([ 0.0972264957366104, 0.129368045612843, 0.215780642932094, 0.312977438507293, 0.426414784012001, 0.568722826943044 ]); is_pdl gsl_cdf_beta_Qinv ($x, 1, 2) , pdl([ 0.569883736647869, 0.508065044950046, 0.379516317700457, 0.273363915016602, 0.180854103349104, 0.097780514508803 ]); is_pdl gsl_cdf_logistic_P ($x, 2) , pdl([ 0.523108525489089, 0.53021314643553, 0.547976937636796, 0.565619324932982, 0.583097006692731, 0.600368317448984 ]); is_pdl gsl_cdf_logistic_Q ($x, 2) , pdl([ 0.476891474510911, 0.46978685356447, 0.452023062363204, 0.434380675067018, 0.416902993307269, 0.399631682551016 ]); is_pdl gsl_cdf_logistic_Pinv ($x, 2) , pdl([ -2.96566457632508, -2.28349131897137, -0.936757867037467, 0.224234596241412, 1.42542277241262, 2.95242738457868 ]); is_pdl gsl_cdf_logistic_Qinv ($x, 2) , pdl([ 2.96566457632508, 2.28349131897137, 0.936757867037467, -0.224234596241412, -1.42542277241262, -2.95242738457868 ]); is_pdl gsl_cdf_pareto_P ($x, 0.1, .05), pdl([ 0.122635965393589, 0.145886740885255, 0.184637135967562, 0.209988145413383, 0.228697483330511, 0.243455357847612 ]); is_pdl gsl_cdf_pareto_Q ($x, 0.1, .05), pdl([ 0.877364034606411, 0.854113259114745, 0.815362864032438, 0.790011854586617, 0.771302516669489, 0.756544642152388 ]); is_pdl gsl_cdf_pareto_Pinv ($x, 11, 22) , pdl([ 22.4129623633136, 22.5611817388298, 22.994070157874, 23.553980832887, 24.3396294860749, 25.6348390467721 ]); is_pdl gsl_cdf_pareto_Qinv ($x, 11, 22) , pdl([ 25.6474051745322, 25.0287675983915, 23.9942991451309, 23.3151266418161, 22.8126206663786, 22.4154640895281 ]); is_pdl gsl_cdf_weibull_P ($x, 1, 2) , pdl([ 0.0336459494865304, 0.0568821210761311, 0.137762910230166, 0.243296666516025, 0.362525498247215, 0.484488671492325 ]); is_pdl gsl_cdf_weibull_Q ($x, 1, 2) , pdl([ 0.96635405051347, 0.943117878923869, 0.862237089769834, 0.756703333483975, 0.637474501752785, 0.515511328507675 ]); is_pdl gsl_cdf_weibull_Pinv ($x, 1, 2) , pdl([ 0.452291018859842, 0.526376189943813, 0.6972323939517, 0.866473481069433, 1.05437067875428, 1.29692274452603 ]); is_pdl gsl_cdf_weibull_Qinv ($x, 1, 2) , pdl([ 1.29899940488971, 1.19114128163936, 0.976991271554845, 0.799161432550317, 0.631653498375854, 0.453646242108977 ]); is_pdl gsl_cdf_gumbel1_P ($x, 1, 2) , pdl([ 0.189719508676777, 0.208021808732089, 0.256429559887203, 0.307411906647793, 0.359732618472373, 0.412233898397574 ]); is_pdl gsl_cdf_gumbel1_Q ($x, 1, 2) , pdl([ 0.810280491323223, 0.791978191267911, 0.743570440112797, 0.692588093352207, 0.640267381527627, 0.587766101602426 ]); is_pdl gsl_cdf_gumbel1_Pinv ($x, 1, 2) , pdl([ 0.169958621442342, 0.343323365119587, 0.73970230236935, 1.14153180132375, 1.61197577505875, 2.27402235471976 ]); is_pdl gsl_cdf_gumbel1_Qinv ($x, 1, 2) , pdl([ 2.28000609915082, 1.9766254442873, 1.4144201875401, 0.979794730452658, 0.58725902873148, 0.173158502928973 ]); is_pdl gsl_cdf_gumbel2_P ($x, 1, 2) , pdl([ 2.01801560369643e-05, 0.000257507217296498, 0.00554529646233709, 0.0226435827865344, 0.0507610509809621, 0.0856914301179353 ]); is_pdl gsl_cdf_gumbel2_Q ($x, 1, 2) , pdl([ 0.999979819843963, 0.999742492782704, 0.994454703537663, 0.977356417213466, 0.949238949019038, 0.914308569882065 ]); is_pdl gsl_cdf_gumbel2_Pinv ($x, 1, 2) , pdl([ 1.18525580612995, 1.40962451163448, 2.09531165232346, 3.13156162332933, 5.0127054286201, 9.71841320586135 ]); is_pdl gsl_cdf_gumbel2_Qinv ($x, 1, 2) , pdl([ 9.77674003915904, 7.21834313792145, 4.11410036764091, 2.6639093663331, 1.79905050540872, 1.18905455877868 ]); my $y = long('[7 8 9 10 11 12 14]'); is_pdl gsl_cdf_poisson_P ($y, 10) , pdl([ 0.220220646601699, 0.332819678750718, 0.457929714471852, 0.583039750192985, 0.696776146303107, 0.791556476394874, 0.916541527065337 ]); is_pdl gsl_cdf_poisson_Q ($y, 10) , pdl([ 0.779779353398301, 0.667180321249282, 0.542070285528148, 0.416960249807015, 0.303223853696893, 0.208443523605126, 0.0834584729346629 ]); is_pdl gsl_cdf_binomial_P ($y, 0.3, 33) , pdl([ 0.182152437649663, 0.304315672104686, 0.449748094074962, 0.599335728101516, 0.733381789761681, 0.838703695351808, 0.956260798765594 ]); is_pdl gsl_cdf_binomial_Q ($y, 0.3, 33) , pdl([ 0.817847562350337, 0.695684327895314, 0.550251905925038, 0.400664271898484, 0.266618210238319, 0.161296304648192, 0.0437392012344063 ]); is_pdl gsl_cdf_negative_binomial_P ($y, 0.3, 3.3), pdl([ 0.559244604008049, 0.633219417269081, 0.69823505870183, 0.754213525975423, 0.801591665095168, 0.841112929477554, 0.900208316084222 ]); is_pdl gsl_cdf_negative_binomial_Q ($y, 0.3, 3.3), pdl([ 0.440755395991951, 0.366780582730919, 0.30176494129817, 0.245786474024577, 0.198408334904832, 0.158887070522446, 0.0997916839157782 ]); is_pdl gsl_cdf_pascal_P ($y, 0.3, 3) , pdl([ 0.617217213599996, 0.687259545750001, 0.747184652145002, 0.7975217415168, 0.839164242724381, 0.873172285377237, 0.922614747387929 ]); is_pdl gsl_cdf_pascal_Q ($y, 0.3, 3) , pdl([ 0.382782786400004, 0.312740454249998, 0.252815347854998, 0.2024782584832, 0.160835757275619, 0.126827714622763, 0.077385252612071 ]); is_pdl gsl_cdf_geometric_P ($y, 0.3) , pdl([ 0.9176457, 0.94235199, 0.959646393, 0.9717524751, 0.98022673257, 0.986158712799, 0.99321776927151 ]); is_pdl gsl_cdf_geometric_Q ($y, 0.3) , pdl([ 0.0823543, 0.05764801, 0.040353607, 0.0282475249, 0.01977326743, 0.013841287201, 0.00678223072849001 ]); my $z = long('[6 7 8 9 10]'); is_pdl gsl_cdf_hypergeometric_P ($z, 25, 5, 11), pdl([ 0.00324196875921016, 0.0472401162056337, 0.24523177971454, 0.61921603300914, 0.918403435644814 ]); is_pdl gsl_cdf_hypergeometric_Q ($z, 25, 5, 11), pdl([ 0.99675803124079, 0.952759883794366, 0.75476822028546, 0.38078396699086, 0.0815965643551856 ]); } done_testing; PDL-GSL-2.103/t/stats_distr.t0000644000175000017500000001035314736061645015520 0ustar osboxesosboxesuse strict; use warnings; use Test::More; use PDL::Stats::Distr; use PDL::LiteF; use Test::PDL; { my $a = sequence(5) / 10; is_pdl pdl($a->mme_beta), pdl(1.4, 5.6); is_pdl $a->pdf_beta(1, 3), pdl '3 2.43 1.92 1.47 1.08'; } { my $a = sequence 5; $a %= 2; is_pdl pdl($a->mme_binomial), pdl(1, .4); is_pdl $a->pmf_binomial(2,.4), pdl '0.36 0.48 0.36 0.48 0.36'; } { my $a = sequence 5; is_pdl pdl($a->mle_exp), pdl .5; is_pdl $a->pdf_exp(2.5), pdl '2.5 0.205212 0.016844 0.001382 0.000113'; } { my $a = sequence 5; is_pdl pdl($a->mle_gaussian), pdl(2,2); is_pdl $a->pdf_gaussian(1,2), pdl '0.219695644733861 0.282094791773878 0.219695644733861 0.103776874355149 0.0297325723059073'; } { my $a = sequence 5; is_pdl pdl($a->mle_geo), pdl 0.333333333333333; is_pdl $a->pmf_geo(.5), pdl '0.5 0.25 0.125 0.0625 0.03125'; } { my $a = sequence 5; $a += 1; is_pdl pdl($a->mle_geosh), pdl 0.333333333333333; is_pdl $a->pmf_geosh(.5), pdl '0.5 0.25 0.125 0.0625 0.03125'; } { my $a = sequence(5) + 1; is_pdl pdl($a->mle_lognormal), pdl(0.957498348556409, 0.323097797388514); is_pdl pdl($a->mme_lognormal), pdl(2.19722457733622, 0.200670695462151); is_pdl $a->pdf_lognormal(1,2), pdl '0.219695644733861 0.137765961149997 0.0938032750793072 0.0679412228146167 0.0514161127408299'; } { my $a = sequence 5; $a *= $a; is_pdl pdl($a->mme_nbd), pdl(1.25, 0.172413793103448); is_pdl $a->pmf_nbd(2, .4), pdl '0.16 0.192 0.10368 0.0161243136 0.000767341894828032'; } { my $a = sequence 5; $a += 1; is_pdl pdl($a->mme_pareto), pdl(1.4, 0.857142857142857); is_pdl $a->pdf_pareto(2, .4), pdl '0.32 0.04 0.0118518518518519 0.005 0.00256'; } { my $a = sequence 5; $a %= 2; is_pdl pdl($a->mle_poisson), pdl .4; is_pdl $a->pmf_poisson(.4), pdl '0.670320046035639 0.268128018414256 0.670320046035639 0.268128018414256 0.670320046035639'; } { my $a = sequence 6; $a->setbadat(-1); $a /= 10; is_pdl pdl($a->mme_beta), pdl(1.4, 5.6); is_pdl $a->pdf_beta(1, 3), pdl '3 2.43 1.92 1.47 1.08 BAD'; } { my $a = sequence 6; $a->setbadat(-1); $a %= 2; is_pdl pdl($a->mme_binomial), pdl(1, .4); is_pdl $a->pmf_binomial(2,.4), pdl '0.36 0.48 0.36 0.48 0.36 BAD'; } { my $a = sequence 6; $a->setbadat(-1); is_pdl pdl($a->mle_exp), pdl .5; is_pdl $a->pdf_exp(2.5), pdl '2.5 0.205212496559747 0.0168448674977137 0.00138271092536958 0.000113499824406212 BAD'; } { my $a = sequence 6; $a->setbadat(-1); is_pdl pdl($a->mle_gaussian), pdl(2,2); is_pdl $a->pdf_gaussian(1,2), pdl '0.219695644733861 0.282094791773878 0.219695644733861 0.103776874355149 0.0297325723059073 BAD'; } { my $a = sequence 6; $a->setbadat(-1); is_pdl pdl($a->mle_geo), pdl 0.333333333333333; is_pdl $a->pmf_geo(.5), pdl '0.5 0.25 0.125 0.0625 0.03125 BAD'; } { my $a = sequence 6; $a->setbadat(-1); $a += 1; is_pdl pdl($a->mle_geosh), pdl 0.333333333333333; is_pdl $a->pmf_geosh(.5), pdl '0.5 0.25 0.125 0.0625 0.03125 BAD'; } { my $a = sequence 6; $a->setbadat(-1); $a += 1; is_pdl pdl($a->mle_lognormal), pdl(0.957498348556409, 0.323097797388514); is_pdl pdl($a->mme_lognormal), pdl(2.19722457733622, 0.200670695462151); is_pdl $a->pdf_lognormal(1,2), pdl '0.219695644733861 0.137765961149997 0.0938032750793072 0.0679412228146167 0.0514161127408299 BAD'; } { my $a = sequence 6; $a->setbadat(-1); $a *= $a; is_pdl pdl($a->mme_nbd), pdl(1.25, 0.172413793103448); is_pdl $a->pmf_nbd(2, .4), pdl '0.16 0.192 0.10368 0.0161243136 0.000767341894828032 BAD'; } { my $a = sequence 6; $a->setbadat(-1); $a += 1; is_pdl pdl($a->mme_pareto), pdl(1.4, 0.857142857142857); is_pdl $a->pdf_pareto(2, .4), pdl '0.32 0.04 0.0118518518518519 0.005 0.00256 BAD'; } { my $a = sequence 6; $a->setbadat(-1); $a %= 2; is_pdl pdl($a->mle_poisson), pdl .4; is_pdl $a->pmf_poisson(.4), pdl '0.670320046035639 0.268128018414256 0.670320046035639 0.268128018414256 0.670320046035639 BAD'; is_pdl $a->pmf_poisson_factorial(.4), pdl '0.670320046035639 0.268128018414256 0.670320046035639 0.268128018414256 0.670320046035639 BAD'; is_pdl $a->pmf_poisson_stirling(.4), pdl '0.670320046035639 0.268050878476493 0.670320046035639 0.268050878476493 0.670320046035639 BAD'; $a += 171; is_pdl $a->pmf_poisson_stirling(10), pdl '0 0 0 0 0 BAD'; } done_testing; PDL-GSL-2.103/t/gsl_mroot.t0000644000175000017500000000140614736061645015161 0ustar osboxesosboxes# Test Script for the PDL interface to the GSL library # This tests mainly that the interface is working, i.e. that the # functions can be called. # The GSL library already has a extensive test suite, and we # do not want to duplicate that effort here. use strict; use warnings; use PDL::LiteF; use PDL::GSL::MROOT; use Test::More; my $init = pdl (-10.00, -5.0); my $epsabs = 1e-7; my $res = gslmroot_fsolver($init, \&rosenbrock,{Method => 0, EpsAbs => $epsabs}); my @res = list ($res); ok(abs($res[0]- 1) < 1e-6 ); ok(abs($res[1]- 1) < 1e-6 ); done_testing; sub rosenbrock{ my ($x) = @_; my $a1 = 1; my $b1 = 10; my $y = zeroes($x); $y->slice(0) .= $a1 * (1 - $x->slice(0)); $y->slice(1) .= $b1 * ($x->slice(1) - $x->slice(0)**2); return $y; } PDL-GSL-2.103/t/gsl_interp.t0000644000175000017500000000274514736061645015331 0ustar osboxesosboxes # Test Script for the PDL interface to the GSL library # This tests mainly that the interface is working, i.e. that the # functions can be called. # The GSL library already has a extensive test suite, and we # do not want to duplicate that effort here. use strict; use warnings; use PDL::LiteF; use PDL::GSL::INTERP; use Test::More; my $x = sequence(10); my $y = exp($x); my $spl = PDL::GSL::INTERP->init('cspline',$x,$y); ok(defined $spl, 'create cspline'); my $spl2 = PDL::GSL::INTERP->init('cspline',$x,$y,{Sort => 0}); ok(defined $spl2, 'create cspline no sort'); ok(abs($spl->eval(5.5)-237.641810667697) < 1e-6, 'eval 5.5' ); ok(abs($spl->deriv(5.5)-237.669424604497) < 1e-6, 'deriv 5.5' ); ok(abs($spl->deriv2(5.5)-306.23332503967) < 1e-6, 'deriv2 5.5' ); ok(abs($spl->integ(3.2,8.5)-4925.23555581654) < 1e-6, 'integ 3.2 to 8.5' ); eval { $spl->eval(10) }; isnt($@,'', 'eval 10 (extrapolation not allowed)') ; eval { $spl->deriv(10) }; isnt($@,'', 'deriv 10 (extrapolation not allowed)' ); eval { $spl->deriv2(10) }; isnt($@,'', 'deriv2 10 (extrapolation not allowed)'); eval { $spl->integ(8.5,10)}; isnt($@,'', 'integ 8.5 to 10 (extrapolation not allowed)'); # Bad value test added 5/31/2005 D. Hunt ok ($spl->eval(pdl(0)->setbadat(0))->isbad, 'cspline eval w badvalue'); my $nx = ($x)*($x<=3) + ($x-1)*($x>3); # x value not monotonically increasing my $i; eval { $i = PDL::GSL::INTERP->init('cspline',$nx, $y) }; isnt($@,'',"module exception handling"); done_testing; PDL-GSL-2.103/t/gsl_integ.t0000644000175000017500000000735514736061645015140 0ustar osboxesosboxes# Test Script for the PDL interface to the GSL library # This tests mainly that the interface is working, i.e. that the # functions can be called. # The GSL library already has a extensive test suite, and we # do not want to duplicate that effort here. use strict; use warnings; use Test::More; use PDL::LiteF; use PDL::GSL::INTEG; my $alfa = 2.6; my ($res,$abserr,$neval,$ierr) = gslinteg_qng(\&f1,0,1,0,1e-9); ok(abs($res - 0.0771604938270651) < 1e-6); ($res,$abserr,$neval,$ierr) = gslinteg_qng(\&f1,0,1,0,1e-9,{Warn => 'y'}); ok(abs($res - 0.0771604938270651) < 1e-6); ($res,$abserr,$ierr) = gslinteg_qag(\&f1,0,1,0,1e-10,1000,1); ok(abs($res - 0.0771604938271586) < 1e-6); ($res,$abserr,$ierr) = gslinteg_qag(\&f1,0,1,0,1e-10,1000,1,{Warn => 'y'}); ok(abs($res - 0.0771604938271586) < 1e-6); ($res,$abserr,$ierr) = gslinteg_qags(\&f1,0,1,0,1e-10,1000); ok(abs($res - 0.0771604938271579) < 1e-6); ($res,$abserr,$ierr) = gslinteg_qags(\&f1,0,1,0,1e-10,1000,{Warn => 'y'}); ok(abs($res - 0.0771604938271579) < 1e-6); my $points = pdl(0,1,sqrt(2),3); ($res,$abserr,$ierr) = gslinteg_qagp(\&f454,$points,0,1e-3,1000); ok(abs($res - 52.7408061167272) < 1e-6); ($res,$abserr,$ierr) = gslinteg_qagp(\&f454,$points,0,1e-3,1000,{Warn => 'y'}); ok(abs($res - 52.7408061167272) < 1e-6); ($res,$abserr,$ierr) = gslinteg_qagi(\&myfn1,1e-7,0,1000); ok(abs($res -2.27587579446875 ) < 1e-6); ($res,$abserr,$ierr) = gslinteg_qagi(\&myfn1,1e-7,0,1000,{Warn => 'y'}); ok(abs($res -2.27587579446875 ) < 1e-6); $alfa = 1; ($res,$abserr,$ierr) = gslinteg_qagiu(\&f16,99.9,1e-7,0,1000); ok(abs($res -0.000100000000000671) < 1e-6); ($res,$abserr,$ierr) = gslinteg_qagiu(\&f16,99.9,1e-7,0,1000,{Warn => 'y'}); ok(abs($res -0.000100000000000671) < 1e-6); ($res,$abserr,$ierr) = gslinteg_qagil(\&myfn2,1.0,1e-7,0,1000); ok(abs($res -2.71828182845905) < 1e-6); ($res,$abserr,$ierr) = gslinteg_qagil(\&myfn2,1.0,1e-7,0,1000,{Warn => 'y'}); ok(abs($res -2.71828182845905) < 1e-6); ($res,$abserr,$ierr) = gslinteg_qawc(\&f459,-1,5,0,0,1e-3,1000); ok(abs($res + 0.08994400695837) < 1e-6); ($res,$abserr,$ierr) = gslinteg_qawc(\&f459,-1,5,0,0,1e-3,1000,{Warn => 'y'}); ok(abs($res + 0.08994400695837) < 1e-6); ($res,$abserr,$ierr) = gslinteg_qaws(\&f458,0,0,1,0,0,1,0,1e-7,1000); ok(abs($res + 0.18927518534894) < 1e-6); ($res,$abserr,$ierr) = gslinteg_qaws(\&f458,0,0,1,0,0,1,0,1e-7,1000,{Warn => 'y'}); ok(abs($res + 0.18927518534894) < 1e-6); my $PI = 3.14159265358979323846264338328; ($res,$abserr,$ierr) = gslinteg_qawo(\&f456,10*$PI,'sin',0,1,0,1e-7,1000); ok(abs($res + 0.128136848399167) < 1e-6); ($res,$abserr,$ierr) = gslinteg_qawo(\&f456,10*$PI,'sin',0,1,0,1e-7,1000,{Warn => 'y'}); ok(abs($res + 0.128136848399167) < 1e-6); ($res,$abserr,$ierr) = gslinteg_qawf(\&f457,$PI/2.0,'cos',0,1e-7,1000); ok(abs($res -0.999999999927978) < 1e-6); ($res,$abserr,$ierr) = gslinteg_qawf(\&f457,$PI/2.0,'cos',0,1e-7,1000,{Warn => 'y'}); ok(abs($res -0.999999999927978) < 1e-6); done_testing; sub f1{ my ($x) = @_; return ($x**$alfa)*log(1.0/$x); } sub f454{ my ($x) = @_; my $x2 = $x**2; my $x3 = $x**3; return $x3 * log(abs(($x2-1.0)*($x2-2.0))); } sub myfn1{ my ($x) = @_; return exp(-$x - $x*$x) ; } sub f16 { my ($x) = @_; if (($x==0) && ($alfa == 1)) {return 1;} if (($x==0) && ($alfa > 1)) {return 0;} return ($x**($alfa-1))/((1+10*$x)**2); } sub myfn2{ my ($x) = @_; return exp($alfa*$x); } sub f459{ my ($x) = @_; return 1.0 / (5.0 * $x * $x * $x + 6.0) ; } sub f458{ my ($x) = @_; if($x==0){return 0;} else{ my $u = log($x); my $v = 1 + $u*$u; return 1.0/($v*$v); } } sub f456{ my ($x) = @_; if($x==0){return 0;} else{ return log($x);} } sub f457{ my ($x) = @_; if ($x == 0){return 0;} return 1.0/sqrt($x) } PDL-GSL-2.103/t/gsl_linalg.t0000644000175000017500000000247115160062002015246 0ustar osboxesosboxesuse strict; use warnings; use Test::More; use Test::PDL; use PDL::LiteF; use PDL::GSL::LINALG; my $A = pdl [ [0.18, 0.60, 0.57, 0.96], [0.41, 0.24, 0.99, 0.58], [0.14, 0.30, 0.97, 0.66], [0.51, 0.13, 0.19, 0.85], ]; my $B = sequence(2,4); # column vectors, but must transpose for GSL LU_decomp(my $lu=$A->copy, my $p=null, my $signum=null); LU_solve($lu, $p, $B->transpose, my $x=null); $x = $x->transpose; is_pdl $A x $x, $B; is_pdl LU_det($lu, $signum), $lu->diagonal(0,1)->prodover * $signum; my $D = 3; #solve (1 + i)(b_{n + 1} - b_n)=1 - i with homogeneous BCs my $c=zeroes($D); # subdiag my $d=-ones($D); # diagonal my $e=ones($D); $e->slice('(-1)').=0; # superdiag my $b=ones($D); $b->slice('(-1)').=(1-$D); ($b, my $info) = solve_tridiag($d, $e, $c, $b, $x=null); is_pdl $x, sequence($D), "tridiag"; # now complex $A = czip($A, 1e-9); $B = czip($B, 2); LU_decomp($lu=$A->copy, $p=null, $signum=null); is_pdl $lu, pdl ' 0.51+0i 0.13 0.19 0.85; 0.352941176470588 0.554117647058823 0.502941176470588 0.66; 0.803921568627451 0.244515215852795 0.71427813163482 -0.264713375796178; 0.274509803921569 0.476999292285916 0.949126848480345 0.363093705877982'; LU_solve($lu, $p, $B->transpose, $x=null); $x = $x->transpose; is_pdl $A x $x, $B; is_pdl LU_det($lu, $signum), $lu->diagonal(0,1)->prodover * $signum; done_testing; PDL-GSL-2.103/GENERATED/0000755000175000017500000000000015160062236014006 5ustar osboxesosboxesPDL-GSL-2.103/GENERATED/PDL/0000755000175000017500000000000015160062241014421 5ustar osboxesosboxesPDL-GSL-2.103/GENERATED/PDL/GSL/0000755000175000017500000000000015160062241015046 5ustar osboxesosboxesPDL-GSL-2.103/GENERATED/PDL/GSL/RNG.pm0000644000175000017500000025563515160062240016051 0ustar osboxesosboxes# # GENERATED WITH PDL::PP from lib/PDL/GSL/RNG.pd! Don't modify! # package PDL::GSL::RNG; our @EXPORT_OK = qw( ran_bernoulli_pdf ran_beta_pdf ran_binomial_pdf ran_bivariate_gaussian_pdf ran_cauchy_pdf ran_chisq_pdf ran_dirichlet_pdf ran_erlang_pdf ran_exponential_pdf ran_exppow_pdf ran_fdist_pdf ran_flat_pdf ran_gamma_pdf ran_gaussian_pdf ran_gaussian_tail_pdf ran_geometric_pdf ran_gumbel1_pdf ran_gumbel2_pdf ran_hypergeometric_pdf ran_landau_pdf ran_laplace_pdf ran_logarithmic_pdf ran_logistic_pdf ran_lognormal_pdf ran_multinomial_pdf ran_negative_binomial_pdf ran_pareto_pdf ran_pascal_pdf ran_poisson_pdf ran_rayleigh_pdf ran_rayleigh_tail_pdf ran_tdist_pdf ran_ugaussian_pdf ran_ugaussian_tail_pdf ran_weibull_pdf ); our %EXPORT_TAGS = (Func=>\@EXPORT_OK); use PDL::Core qw/ zeroes long barf /; use PDL::Exporter; use DynaLoader; our @ISA = ( 'PDL::Exporter','DynaLoader' ); push @PDL::Core::PP, __PACKAGE__; bootstrap PDL::GSL::RNG ; #line 9 "lib/PDL/GSL/RNG.pd" use strict; use warnings; =head1 NAME PDL::GSL::RNG - PDL interface to RNG and randist routines in GSL =head1 DESCRIPTION This is an interface to the rng and randist packages present in the GNU Scientific Library. =head1 SYNOPSIS use PDL; use PDL::GSL::RNG; $rng = PDL::GSL::RNG->new('taus'); $rng->set_seed(time()); $x=zeroes(5,5,5) $rng->get_uniform($x); # inplace $y=$rng->get_uniform(3,4,5); # creates new pdl =head1 NOMENCLATURE Throughout this documentation we strive to use the same variables that are present in the original GSL documentation (see L). Oftentimes those variables are called C and C. Since good Perl coding practices discourage the use of Perl variables C<$a> and C<$b>, here we refer to Parameters C and C as C<$pa> and C<$pb>, respectively, and Limits (of domain or integration) as C<$la> and C<$lb>. =cut #line 67 "lib/PDL/GSL/RNG.pm" =head1 FUNCTIONS =cut #line 50 "lib/PDL/GSL/RNG.pd" =head2 new =for ref The new method initializes a new instance of the RNG. The available RNGs are: =over =item coveyou =item cmrg =item fishman18 =item fishman20 =item fishman2x =item gfsr4 =item knuthran =item knuthran2 =item knuthran2002 =item lecuyer21 =item minstd =item mrg =item mt19937 =item mt19937_1999 =item mt19937_1998 =item r250 =item ran0 =item ran1 =item ran2 =item ran3 =item rand =item rand48 =item random128_bsd =item random128_glibc2 =item random128_libc5 =item random256_bsd =item random256_glibc2 =item random256_libc5 =item random32_bsd =item random32_glibc2 =item random32_libc5 =item random64_bsd =item random64_glibc2 =item random64_libc5 =item random8_bsd =item random8_glibc2 =item random8_libc5 =item random_bsd =item random_glibc2 =item random_libc5 =item randu =item ranf =item ranlux =item ranlux389 =item ranlxd1 =item ranlxd2 =item ranlxs0 =item ranlxs1 =item ranlxs2 =item ranmar =item slatec =item taus =item taus2 =item taus113 =item transputer =item tt800 =item uni =item uni32 =item vax =item waterman14 =item zuf =item default =back The last one (default) uses the environment variable GSL_RNG_TYPE. Note that only a few of these rngs are recommended for general use. Please check the GSL documentation for more information. =for usage Usage: $blessed_ref = PDL::GSL::RNG->new($RNG_name); Example: =for example $rng = PDL::GSL::RNG->new('taus'); =head2 set_seed =for ref Sets the RNG seed. Usage: =for usage $rng->set_seed($integer); # or $rng = PDL::GSL::RNG->new('taus')->set_seed($integer); Example: =for example $rng->set_seed(666); =head2 min =for ref Return the minimum value generable by this RNG. Usage: =for usage $integer = $rng->min(); Example: =for example $min = $rng->min(); $max = $rng->max(); =head2 max =for ref Return the maximum value generable by the RNG. Usage: =for usage $integer = $rng->max(); Example: =for example $min = $rng->min(); $max = $rng->max(); =head2 name =for ref Returns the name of the RNG. Usage: =for usage $string = $rng->name(); Example: =for example $name = $rng->name(); =head2 ran_shuffle =for ref Shuffles values in ndarray, treating it as flat. Usage: =for usage $rng->ran_shuffle($ndarray); =head2 ran_shuffle_vec =for ref Returns values in Perl list, shuffled. Usage: =for usage @shuffled = $rng->ran_shuffle_vec(@vec); =head2 ran_choose =for ref Chooses values from C<$inndarray> to C<$outndarray>, treating both as flat. Usage: =for usage $rng->ran_choose($inndarray,$outndarray); =head2 ran_choose_vec =for ref Chooses C<$n> values from C<@vec>. Usage: =for usage @chosen = $rng->ran_choose_vec($n,@vec); =head2 ran_dir =for ref Returns C<$n> random vectors in C<$ndim> dimensions. Usage: =for usage $ndarray = $rng->ran_dir($ndim,$n); Example: =for example $o = $rng->ran_dir($ndim,$n); =head2 ran_discrete_preproc =for ref This method returns a handle that must be used when calling L. You specify the probability of the integer number that are returned by L. Usage: =for usage $discrete_dist_handle = $rng->ran_discrete_preproc($double_ndarray_prob); Example: =for example $prob = pdl [0.1,0.3,0.6]; $ddh = $rng->ran_discrete_preproc($prob); $o = $rng->ran_discrete($discrete_dist_handle,100); =cut #line 396 "lib/PDL/GSL/RNG.pm" =head2 ran_bernoulli_pdf =for sig Signature: (uint k(); p(); [o]out()) Types: (double) =for usage $out = ran_bernoulli_pdf($k, $p); ran_bernoulli_pdf($k, $p, $out); # all arguments given $out = $k->ran_bernoulli_pdf($p); # method call $k->ran_bernoulli_pdf($p, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *ran_bernoulli_pdf = \&PDL::GSL::RNG::ran_bernoulli_pdf; =head2 ran_beta_pdf =for sig Signature: (x(); a(); b(); [o]out()) Types: (double) =for usage $out = ran_beta_pdf($x, $a, $b); ran_beta_pdf($x, $a, $b, $out); # all arguments given $out = $x->ran_beta_pdf($a, $b); # method call $x->ran_beta_pdf($a, $b, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *ran_beta_pdf = \&PDL::GSL::RNG::ran_beta_pdf; =head2 ran_binomial_pdf =for sig Signature: (uint k(); p(); uint n(); [o]out()) Types: (double) =for usage $out = ran_binomial_pdf($k, $p, $n); ran_binomial_pdf($k, $p, $n, $out); # all arguments given $out = $k->ran_binomial_pdf($p, $n); # method call $k->ran_binomial_pdf($p, $n, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *ran_binomial_pdf = \&PDL::GSL::RNG::ran_binomial_pdf; =head2 ran_bivariate_gaussian_pdf =for sig Signature: (x(); y(); sigma_x(); sigma_y(); rho(); [o]out()) Types: (double) =for usage $out = ran_bivariate_gaussian_pdf($x, $y, $sigma_x, $sigma_y, $rho); ran_bivariate_gaussian_pdf($x, $y, $sigma_x, $sigma_y, $rho, $out); # all arguments given $out = $x->ran_bivariate_gaussian_pdf($y, $sigma_x, $sigma_y, $rho); # method call $x->ran_bivariate_gaussian_pdf($y, $sigma_x, $sigma_y, $rho, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *ran_bivariate_gaussian_pdf = \&PDL::GSL::RNG::ran_bivariate_gaussian_pdf; =head2 ran_cauchy_pdf =for sig Signature: (x(); a(); [o]out()) Types: (double) =for usage $out = ran_cauchy_pdf($x, $a); ran_cauchy_pdf($x, $a, $out); # all arguments given $out = $x->ran_cauchy_pdf($a); # method call $x->ran_cauchy_pdf($a, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *ran_cauchy_pdf = \&PDL::GSL::RNG::ran_cauchy_pdf; =head2 ran_chisq_pdf =for sig Signature: (x(); nu(); [o]out()) Types: (double) =for usage $out = ran_chisq_pdf($x, $nu); ran_chisq_pdf($x, $nu, $out); # all arguments given $out = $x->ran_chisq_pdf($nu); # method call $x->ran_chisq_pdf($nu, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *ran_chisq_pdf = \&PDL::GSL::RNG::ran_chisq_pdf; =head2 ran_dirichlet_pdf =for sig Signature: (alpha(k); theta(k); [o]out()) Types: (double) =for usage $out = ran_dirichlet_pdf($alpha, $theta); ran_dirichlet_pdf($alpha, $theta, $out); # all arguments given $out = $alpha->ran_dirichlet_pdf($theta); # method call $alpha->ran_dirichlet_pdf($theta, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *ran_dirichlet_pdf = \&PDL::GSL::RNG::ran_dirichlet_pdf; =head2 ran_erlang_pdf =for sig Signature: (x(); a(); n(); [o]out()) Types: (double) =for usage $out = ran_erlang_pdf($x, $a, $n); ran_erlang_pdf($x, $a, $n, $out); # all arguments given $out = $x->ran_erlang_pdf($a, $n); # method call $x->ran_erlang_pdf($a, $n, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *ran_erlang_pdf = \&PDL::GSL::RNG::ran_erlang_pdf; =head2 ran_exponential_pdf =for sig Signature: (x(); mu(); [o]out()) Types: (double) =for usage $out = ran_exponential_pdf($x, $mu); ran_exponential_pdf($x, $mu, $out); # all arguments given $out = $x->ran_exponential_pdf($mu); # method call $x->ran_exponential_pdf($mu, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *ran_exponential_pdf = \&PDL::GSL::RNG::ran_exponential_pdf; =head2 ran_exppow_pdf =for sig Signature: (x(); a(); b(); [o]out()) Types: (double) =for usage $out = ran_exppow_pdf($x, $a, $b); ran_exppow_pdf($x, $a, $b, $out); # all arguments given $out = $x->ran_exppow_pdf($a, $b); # method call $x->ran_exppow_pdf($a, $b, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *ran_exppow_pdf = \&PDL::GSL::RNG::ran_exppow_pdf; =head2 ran_fdist_pdf =for sig Signature: (x(); nua(); nub(); [o]out()) Types: (double) =for usage $out = ran_fdist_pdf($x, $nua, $nub); ran_fdist_pdf($x, $nua, $nub, $out); # all arguments given $out = $x->ran_fdist_pdf($nua, $nub); # method call $x->ran_fdist_pdf($nua, $nub, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *ran_fdist_pdf = \&PDL::GSL::RNG::ran_fdist_pdf; =head2 ran_flat_pdf =for sig Signature: (x(); a(); b(); [o]out()) Types: (double) =for usage $out = ran_flat_pdf($x, $a, $b); ran_flat_pdf($x, $a, $b, $out); # all arguments given $out = $x->ran_flat_pdf($a, $b); # method call $x->ran_flat_pdf($a, $b, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *ran_flat_pdf = \&PDL::GSL::RNG::ran_flat_pdf; =head2 ran_gamma_pdf =for sig Signature: (x(); a(); b(); [o]out()) Types: (double) =for usage $out = ran_gamma_pdf($x, $a, $b); ran_gamma_pdf($x, $a, $b, $out); # all arguments given $out = $x->ran_gamma_pdf($a, $b); # method call $x->ran_gamma_pdf($a, $b, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *ran_gamma_pdf = \&PDL::GSL::RNG::ran_gamma_pdf; =head2 ran_gaussian_pdf =for sig Signature: (x(); sigma(); [o]out()) Types: (double) =for usage $out = ran_gaussian_pdf($x, $sigma); ran_gaussian_pdf($x, $sigma, $out); # all arguments given $out = $x->ran_gaussian_pdf($sigma); # method call $x->ran_gaussian_pdf($sigma, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *ran_gaussian_pdf = \&PDL::GSL::RNG::ran_gaussian_pdf; =head2 ran_gaussian_tail_pdf =for sig Signature: (x(); a(); sigma(); [o]out()) Types: (double) =for usage $out = ran_gaussian_tail_pdf($x, $a, $sigma); ran_gaussian_tail_pdf($x, $a, $sigma, $out); # all arguments given $out = $x->ran_gaussian_tail_pdf($a, $sigma); # method call $x->ran_gaussian_tail_pdf($a, $sigma, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *ran_gaussian_tail_pdf = \&PDL::GSL::RNG::ran_gaussian_tail_pdf; =head2 ran_geometric_pdf =for sig Signature: (uint k(); p(); [o]out()) Types: (double) =for usage $out = ran_geometric_pdf($k, $p); ran_geometric_pdf($k, $p, $out); # all arguments given $out = $k->ran_geometric_pdf($p); # method call $k->ran_geometric_pdf($p, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *ran_geometric_pdf = \&PDL::GSL::RNG::ran_geometric_pdf; =head2 ran_gumbel1_pdf =for sig Signature: (x(); a(); b(); [o]out()) Types: (double) =for usage $out = ran_gumbel1_pdf($x, $a, $b); ran_gumbel1_pdf($x, $a, $b, $out); # all arguments given $out = $x->ran_gumbel1_pdf($a, $b); # method call $x->ran_gumbel1_pdf($a, $b, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *ran_gumbel1_pdf = \&PDL::GSL::RNG::ran_gumbel1_pdf; =head2 ran_gumbel2_pdf =for sig Signature: (x(); a(); b(); [o]out()) Types: (double) =for usage $out = ran_gumbel2_pdf($x, $a, $b); ran_gumbel2_pdf($x, $a, $b, $out); # all arguments given $out = $x->ran_gumbel2_pdf($a, $b); # method call $x->ran_gumbel2_pdf($a, $b, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *ran_gumbel2_pdf = \&PDL::GSL::RNG::ran_gumbel2_pdf; =head2 ran_hypergeometric_pdf =for sig Signature: (uint k(); uint na(); uint nb(); uint t(); [o]out()) Types: (double) =for usage $out = ran_hypergeometric_pdf($k, $na, $nb, $t); ran_hypergeometric_pdf($k, $na, $nb, $t, $out); # all arguments given $out = $k->ran_hypergeometric_pdf($na, $nb, $t); # method call $k->ran_hypergeometric_pdf($na, $nb, $t, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *ran_hypergeometric_pdf = \&PDL::GSL::RNG::ran_hypergeometric_pdf; =head2 ran_landau_pdf =for sig Signature: (x(); [o]out()) Types: (double) =for usage $out = ran_landau_pdf($x); ran_landau_pdf($x, $out); # all arguments given $out = $x->ran_landau_pdf; # method call $x->ran_landau_pdf($out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *ran_landau_pdf = \&PDL::GSL::RNG::ran_landau_pdf; =head2 ran_laplace_pdf =for sig Signature: (x(); a(); [o]out()) Types: (double) =for usage $out = ran_laplace_pdf($x, $a); ran_laplace_pdf($x, $a, $out); # all arguments given $out = $x->ran_laplace_pdf($a); # method call $x->ran_laplace_pdf($a, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *ran_laplace_pdf = \&PDL::GSL::RNG::ran_laplace_pdf; =head2 ran_logarithmic_pdf =for sig Signature: (uint k(); p(); [o]out()) Types: (double) =for usage $out = ran_logarithmic_pdf($k, $p); ran_logarithmic_pdf($k, $p, $out); # all arguments given $out = $k->ran_logarithmic_pdf($p); # method call $k->ran_logarithmic_pdf($p, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *ran_logarithmic_pdf = \&PDL::GSL::RNG::ran_logarithmic_pdf; =head2 ran_logistic_pdf =for sig Signature: (x(); a(); [o]out()) Types: (double) =for usage $out = ran_logistic_pdf($x, $a); ran_logistic_pdf($x, $a, $out); # all arguments given $out = $x->ran_logistic_pdf($a); # method call $x->ran_logistic_pdf($a, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *ran_logistic_pdf = \&PDL::GSL::RNG::ran_logistic_pdf; =head2 ran_lognormal_pdf =for sig Signature: (x(); zeta(); sigma(); [o]out()) Types: (double) =for usage $out = ran_lognormal_pdf($x, $zeta, $sigma); ran_lognormal_pdf($x, $zeta, $sigma, $out); # all arguments given $out = $x->ran_lognormal_pdf($zeta, $sigma); # method call $x->ran_lognormal_pdf($zeta, $sigma, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *ran_lognormal_pdf = \&PDL::GSL::RNG::ran_lognormal_pdf; =head2 ran_multinomial_pdf =for sig Signature: (p(k); uint n(k); [o]out()) Types: (double) =for usage $out = ran_multinomial_pdf($p, $n); ran_multinomial_pdf($p, $n, $out); # all arguments given $out = $p->ran_multinomial_pdf($n); # method call $p->ran_multinomial_pdf($n, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *ran_multinomial_pdf = \&PDL::GSL::RNG::ran_multinomial_pdf; =head2 ran_negative_binomial_pdf =for sig Signature: (uint k(); p(); n(); [o]out()) Types: (double) =for usage $out = ran_negative_binomial_pdf($k, $p, $n); ran_negative_binomial_pdf($k, $p, $n, $out); # all arguments given $out = $k->ran_negative_binomial_pdf($p, $n); # method call $k->ran_negative_binomial_pdf($p, $n, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *ran_negative_binomial_pdf = \&PDL::GSL::RNG::ran_negative_binomial_pdf; =head2 ran_pareto_pdf =for sig Signature: (x(); a(); b(); [o]out()) Types: (double) =for usage $out = ran_pareto_pdf($x, $a, $b); ran_pareto_pdf($x, $a, $b, $out); # all arguments given $out = $x->ran_pareto_pdf($a, $b); # method call $x->ran_pareto_pdf($a, $b, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *ran_pareto_pdf = \&PDL::GSL::RNG::ran_pareto_pdf; =head2 ran_pascal_pdf =for sig Signature: (uint k(); p(); uint n(); [o]out()) Types: (double) =for usage $out = ran_pascal_pdf($k, $p, $n); ran_pascal_pdf($k, $p, $n, $out); # all arguments given $out = $k->ran_pascal_pdf($p, $n); # method call $k->ran_pascal_pdf($p, $n, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *ran_pascal_pdf = \&PDL::GSL::RNG::ran_pascal_pdf; =head2 ran_poisson_pdf =for sig Signature: (uint k(); mu(); [o]out()) Types: (double) =for usage $out = ran_poisson_pdf($k, $mu); ran_poisson_pdf($k, $mu, $out); # all arguments given $out = $k->ran_poisson_pdf($mu); # method call $k->ran_poisson_pdf($mu, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *ran_poisson_pdf = \&PDL::GSL::RNG::ran_poisson_pdf; =head2 ran_rayleigh_pdf =for sig Signature: (x(); sigma(); [o]out()) Types: (double) =for usage $out = ran_rayleigh_pdf($x, $sigma); ran_rayleigh_pdf($x, $sigma, $out); # all arguments given $out = $x->ran_rayleigh_pdf($sigma); # method call $x->ran_rayleigh_pdf($sigma, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *ran_rayleigh_pdf = \&PDL::GSL::RNG::ran_rayleigh_pdf; =head2 ran_rayleigh_tail_pdf =for sig Signature: (x(); a(); sigma(); [o]out()) Types: (double) =for usage $out = ran_rayleigh_tail_pdf($x, $a, $sigma); ran_rayleigh_tail_pdf($x, $a, $sigma, $out); # all arguments given $out = $x->ran_rayleigh_tail_pdf($a, $sigma); # method call $x->ran_rayleigh_tail_pdf($a, $sigma, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *ran_rayleigh_tail_pdf = \&PDL::GSL::RNG::ran_rayleigh_tail_pdf; =head2 ran_tdist_pdf =for sig Signature: (x(); nu(); [o]out()) Types: (double) =for usage $out = ran_tdist_pdf($x, $nu); ran_tdist_pdf($x, $nu, $out); # all arguments given $out = $x->ran_tdist_pdf($nu); # method call $x->ran_tdist_pdf($nu, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *ran_tdist_pdf = \&PDL::GSL::RNG::ran_tdist_pdf; =head2 ran_ugaussian_pdf =for sig Signature: (x(); [o]out()) Types: (double) =for usage $out = ran_ugaussian_pdf($x); ran_ugaussian_pdf($x, $out); # all arguments given $out = $x->ran_ugaussian_pdf; # method call $x->ran_ugaussian_pdf($out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *ran_ugaussian_pdf = \&PDL::GSL::RNG::ran_ugaussian_pdf; =head2 ran_ugaussian_tail_pdf =for sig Signature: (x(); a(); [o]out()) Types: (double) =for usage $out = ran_ugaussian_tail_pdf($x, $a); ran_ugaussian_tail_pdf($x, $a, $out); # all arguments given $out = $x->ran_ugaussian_tail_pdf($a); # method call $x->ran_ugaussian_tail_pdf($a, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *ran_ugaussian_tail_pdf = \&PDL::GSL::RNG::ran_ugaussian_tail_pdf; =head2 ran_weibull_pdf =for sig Signature: (x(); a(); b(); [o]out()) Types: (double) =for usage $out = ran_weibull_pdf($x, $a, $b); ran_weibull_pdf($x, $a, $b, $out); # all arguments given $out = $x->ran_weibull_pdf($a, $b); # method call $x->ran_weibull_pdf($a, $b, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *ran_weibull_pdf = \&PDL::GSL::RNG::ran_weibull_pdf; =head2 ran_shuffle_1d =for sig Signature: ([io]a(n); gsl_rng *rng) Types: (sbyte byte short ushort long ulong indx ulonglong longlong float double ldouble cfloat cdouble cldouble) =for ref Takes n-dimensional ndarray, and shuffles it along its zero-th dimension. Usage: =for usage $vec2d = sequence(10,10); $rng->ran_shuffle_1d($vec2d); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub ran_shuffle_1d { _ran_shuffle_1d_int(@_[1,0]) } *ran_shuffle_1d = \&PDL::GSL::RNG::ran_shuffle_1d; =head2 get_uniform =for sig Signature: ([o]a(); gsl_rng *rng) Types: (float double) =for ref This function creates an ndarray with given dimensions or accepts an existing ndarray and fills it. get_uniform() returns values 0<=x<1, Usage: =for usage $ndarray = $rng->get_uniform($list_of_integers) $rng->get_uniform($ndarray); Example: =for example $x = zeroes 5,6; $max=100; $o = $rng->get_uniform(10,10); $rng->get_uniform($x); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub get_uniform { my ($obj,@var) = @_;if (ref($var[0]) eq 'PDL') { _get_uniform_int($var[0],$obj); return $var[0]; } else { my $p; $p = zeroes @var; _get_uniform_int($p,$obj); return $p; } } *get_uniform = \&PDL::GSL::RNG::get_uniform; =head2 get_uniform_pos =for sig Signature: ([o]a(); gsl_rng *rng) Types: (float double) =for ref This function creates an ndarray with given dimensions or accepts an existing ndarray and fills it. get_uniform_pos() returns values 0get_uniform_pos($list_of_integers) $rng->get_uniform_pos($ndarray); Example: =for example $x = zeroes 5,6; $o = $rng->get_uniform_pos(10,10); $rng->get_uniform_pos($x); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub get_uniform_pos { my ($obj,@var) = @_;if (ref($var[0]) eq 'PDL') { _get_uniform_pos_int($var[0],$obj); return $var[0]; } else { my $p; $p = zeroes @var; _get_uniform_pos_int($p,$obj); return $p; } } *get_uniform_pos = \&PDL::GSL::RNG::get_uniform_pos; =head2 get =for sig Signature: ([o]a(); gsl_rng *rng) Types: (float double) =for ref This function creates an ndarray with given dimensions or accepts an existing ndarray and fills it. get() returns integer values between a minimum and a maximum specific to every RNG. Usage: =for usage $ndarray = $rng->get($list_of_integers) $rng->get($ndarray); Example: =for example $x = zeroes 5,6; $o = $rng->get(10,10); $rng->get($x); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub get { my ($obj,@var) = @_;if (ref($var[0]) eq 'PDL') { _get_int($var[0],$obj); return $var[0]; } else { my $p; $p = zeroes @var; _get_int($p,$obj); return $p; } } *get = \&PDL::GSL::RNG::get; =head2 get_int =for sig Signature: ([o]a(); IV n; gsl_rng *rng) Types: (float double) =for ref This function creates an ndarray with given dimensions or accepts an existing ndarray and fills it. get_int() returns integer values between 0 and $max. Usage: =for usage $ndarray = $rng->get($max, $list_of_integers) $rng->get($max, $ndarray); Example: =for example $x = zeroes 5,6; $max=100; $o = $rng->get(10,10); $rng->get($x); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub get_int { my ($obj,$n,@var) = @_;if (!($n>0)) {barf("first parameter must be an int >0")};if (ref($var[0]) eq 'PDL') { _get_int_int($var[0],$n,$obj); return $var[0]; } else { my $p; $p = zeroes @var; _get_int_int($p,$n,$obj); return $p; } } *get_int = \&PDL::GSL::RNG::get_int; =head2 ran_gaussian =for sig Signature: ([o]output(); double sigma; gsl_rng *rng) Types: (float double) =for ref Fills output ndarray with random values from Gaussian distribution with mean zero and standard deviation C<$sigma>. Usage: =for usage $ndarray = $rng->ran_gaussian($sigma,[list of integers = output ndarray dims]); $rng->ran_gaussian($sigma, $output_ndarray); Example: =for example $o = $rng->ran_gaussian($sigma,10,10); $rng->ran_gaussian($sigma,$o); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub ran_gaussian { my ($obj,$sigma,@var) = @_; if (ref($var[0]) eq 'PDL') { _ran_gaussian_int($var[0],$sigma,$obj); return $var[0]; } else { my $p; $p = zeroes @var; _ran_gaussian_int($p,$sigma,$obj); return $p; } } *ran_gaussian = \&PDL::GSL::RNG::ran_gaussian; =head2 ran_gaussian_var =for sig Signature: (sigma();[o]output(); gsl_rng *rng) Types: (float double) =for ref Similar to L except that it takes the distribution parameters as an ndarray and returns an ndarray of equal dimensions. Usage: =for usage $ndarray = $rng->ran_gaussian_var($sigma_ndarray); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub ran_gaussian_var { my ($obj,@var) = @_; if (scalar(@var) != 1) {barf("Bad number of parameters!");} _ran_gaussian_var_int(@var,my $x=PDL->null,$obj); return $x; } *ran_gaussian_var = \&PDL::GSL::RNG::ran_gaussian_var; =head2 ran_ugaussian_tail =for sig Signature: ([o]output(); double tail; gsl_rng *rng) Types: (float double) =for ref Fills output ndarray with random variates from the upper tail of a Gaussian distribution with C (AKA unit Gaussian distribution). Usage: =for usage $ndarray = $rng->ran_ugaussian_tail($tail,[list of integers = output ndarray dims]); $rng->ran_ugaussian_tail($tail, $output_ndarray); Example: =for example $o = $rng->ran_ugaussian_tail($tail,10,10); $rng->ran_ugaussian_tail($tail,$o); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub ran_ugaussian_tail { my ($obj,$tail,@var) = @_; if (ref($var[0]) eq 'PDL') { _ran_ugaussian_tail_int($var[0],$tail,$obj); return $var[0]; } else { my $p; $p = zeroes @var; _ran_ugaussian_tail_int($p,$tail,$obj); return $p; } } *ran_ugaussian_tail = \&PDL::GSL::RNG::ran_ugaussian_tail; =head2 ran_ugaussian_tail_var =for sig Signature: (tail();[o]output(); gsl_rng *rng) Types: (float double) =for ref Similar to L except that it takes the distribution parameters as an ndarray and returns an ndarray of equal dimensions. Usage: =for usage $ndarray = $rng->ran_ugaussian_tail_var($tail_ndarray); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub ran_ugaussian_tail_var { my ($obj,@var) = @_; if (scalar(@var) != 1) {barf("Bad number of parameters!");} _ran_ugaussian_tail_var_int(@var,my $x=PDL->null,$obj); return $x; } *ran_ugaussian_tail_var = \&PDL::GSL::RNG::ran_ugaussian_tail_var; =head2 ran_exponential =for sig Signature: ([o]output(); double mu; gsl_rng *rng) Types: (float double) =for ref Fills output ndarray with random variates from the exponential distribution with mean C<$mu>. Usage: =for usage $ndarray = $rng->ran_exponential($mu,[list of integers = output ndarray dims]); $rng->ran_exponential($mu, $output_ndarray); Example: =for example $o = $rng->ran_exponential($mu,10,10); $rng->ran_exponential($mu,$o); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub ran_exponential { my ($obj,$mu,@var) = @_; if (ref($var[0]) eq 'PDL') { _ran_exponential_int($var[0],$mu,$obj); return $var[0]; } else { my $p; $p = zeroes @var; _ran_exponential_int($p,$mu,$obj); return $p; } } *ran_exponential = \&PDL::GSL::RNG::ran_exponential; =head2 ran_exponential_var =for sig Signature: (mu();[o]output(); gsl_rng *rng) Types: (float double) =for ref Similar to L except that it takes the distribution parameters as an ndarray and returns an ndarray of equal dimensions. Usage: =for usage $ndarray = $rng->ran_exponential_var($mu_ndarray); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub ran_exponential_var { my ($obj,@var) = @_; if (scalar(@var) != 1) {barf("Bad number of parameters!");} _ran_exponential_var_int(@var,my $x=PDL->null,$obj); return $x; } *ran_exponential_var = \&PDL::GSL::RNG::ran_exponential_var; =head2 ran_laplace =for sig Signature: ([o]output(); double pa; gsl_rng *rng) Types: (float double) =for ref Fills output ndarray with random variates from the Laplace distribution with width C<$pa>. Usage: =for usage $ndarray = $rng->ran_laplace($pa,[list of integers = output ndarray dims]); $rng->ran_laplace($pa, $output_ndarray); Example: =for example $o = $rng->ran_laplace($pa,10,10); $rng->ran_laplace($pa,$o); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub ran_laplace { my ($obj,$pa,@var) = @_; if (ref($var[0]) eq 'PDL') { _ran_laplace_int($var[0],$pa,$obj); return $var[0]; } else { my $p; $p = zeroes @var; _ran_laplace_int($p,$pa,$obj); return $p; } } *ran_laplace = \&PDL::GSL::RNG::ran_laplace; =head2 ran_laplace_var =for sig Signature: (pa();[o]output(); gsl_rng *rng) Types: (float double) =for ref Similar to L except that it takes the distribution parameters as an ndarray and returns an ndarray of equal dimensions. Usage: =for usage $ndarray = $rng->ran_laplace_var($pa_ndarray); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub ran_laplace_var { my ($obj,@var) = @_; if (scalar(@var) != 1) {barf("Bad number of parameters!");} _ran_laplace_var_int(@var,my $x=PDL->null,$obj); return $x; } *ran_laplace_var = \&PDL::GSL::RNG::ran_laplace_var; =head2 ran_exppow =for sig Signature: ([o]output(); double pa; double pb; gsl_rng *rng) Types: (float double) =for ref Fills output ndarray with random variates from the exponential power distribution with scale parameter C<$pa> and exponent C<$pb>. Usage: =for usage $ndarray = $rng->ran_exppow($pa, $pb,[list of integers = output ndarray dims]); $rng->ran_exppow($pa, $pb, $output_ndarray); Example: =for example $o = $rng->ran_exppow($pa, $pb,10,10); $rng->ran_exppow($pa, $pb,$o); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub ran_exppow { my ($obj,$pa,$pb,@var) = @_; if (ref($var[0]) eq 'PDL') { _ran_exppow_int($var[0],$pa,$pb,$obj); return $var[0]; } else { my $p; $p = zeroes @var; _ran_exppow_int($p,$pa,$pb,$obj); return $p; } } *ran_exppow = \&PDL::GSL::RNG::ran_exppow; =head2 ran_exppow_var =for sig Signature: (pa();pb();[o]output(); gsl_rng *rng) Types: (float double) =for ref Similar to L except that it takes the distribution parameters as an ndarray and returns an ndarray of equal dimensions. Usage: =for usage $ndarray = $rng->ran_exppow_var($pa_ndarray,$pb_ndarray); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub ran_exppow_var { my ($obj,@var) = @_; if (scalar(@var) != 2) {barf("Bad number of parameters!");} _ran_exppow_var_int(@var,my $x=PDL->null,$obj); return $x; } *ran_exppow_var = \&PDL::GSL::RNG::ran_exppow_var; =head2 ran_cauchy =for sig Signature: ([o]output(); double pa; gsl_rng *rng) Types: (float double) =for ref Fills output ndarray with random variates from the Cauchy distribution with scale parameter C<$pa>. Usage: =for usage $ndarray = $rng->ran_cauchy($pa,[list of integers = output ndarray dims]); $rng->ran_cauchy($pa, $output_ndarray); Example: =for example $o = $rng->ran_cauchy($pa,10,10); $rng->ran_cauchy($pa,$o); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub ran_cauchy { my ($obj,$pa,@var) = @_; if (ref($var[0]) eq 'PDL') { _ran_cauchy_int($var[0],$pa,$obj); return $var[0]; } else { my $p; $p = zeroes @var; _ran_cauchy_int($p,$pa,$obj); return $p; } } *ran_cauchy = \&PDL::GSL::RNG::ran_cauchy; =head2 ran_cauchy_var =for sig Signature: (pa();[o]output(); gsl_rng *rng) Types: (float double) =for ref Similar to L except that it takes the distribution parameters as an ndarray and returns an ndarray of equal dimensions. Usage: =for usage $ndarray = $rng->ran_cauchy_var($pa_ndarray); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub ran_cauchy_var { my ($obj,@var) = @_; if (scalar(@var) != 1) {barf("Bad number of parameters!");} _ran_cauchy_var_int(@var,my $x=PDL->null,$obj); return $x; } *ran_cauchy_var = \&PDL::GSL::RNG::ran_cauchy_var; =head2 ran_rayleigh =for sig Signature: ([o]output(); double sigma; gsl_rng *rng) Types: (float double) =for ref Fills output ndarray with random variates from the Rayleigh distribution with scale parameter C<$sigma>. Usage: =for usage $ndarray = $rng->ran_rayleigh($sigma,[list of integers = output ndarray dims]); $rng->ran_rayleigh($sigma, $output_ndarray); Example: =for example $o = $rng->ran_rayleigh($sigma,10,10); $rng->ran_rayleigh($sigma,$o); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub ran_rayleigh { my ($obj,$sigma,@var) = @_; if (ref($var[0]) eq 'PDL') { _ran_rayleigh_int($var[0],$sigma,$obj); return $var[0]; } else { my $p; $p = zeroes @var; _ran_rayleigh_int($p,$sigma,$obj); return $p; } } *ran_rayleigh = \&PDL::GSL::RNG::ran_rayleigh; =head2 ran_rayleigh_var =for sig Signature: (sigma();[o]output(); gsl_rng *rng) Types: (float double) =for ref Similar to L except that it takes the distribution parameters as an ndarray and returns an ndarray of equal dimensions. Usage: =for usage $ndarray = $rng->ran_rayleigh_var($sigma_ndarray); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub ran_rayleigh_var { my ($obj,@var) = @_; if (scalar(@var) != 1) {barf("Bad number of parameters!");} _ran_rayleigh_var_int(@var,my $x=PDL->null,$obj); return $x; } *ran_rayleigh_var = \&PDL::GSL::RNG::ran_rayleigh_var; =head2 ran_rayleigh_tail =for sig Signature: ([o]output(); double x; double sigma; gsl_rng *rng) Types: (float double) =for ref Fills output ndarray with random variates from the tail of the Rayleigh distribution with scale parameter C<$sigma> and a lower limit of C<$la>. Usage: =for usage $ndarray = $rng->ran_rayleigh_tail($x, $sigma,[list of integers = output ndarray dims]); $rng->ran_rayleigh_tail($x, $sigma, $output_ndarray); Example: =for example $o = $rng->ran_rayleigh_tail($x, $sigma,10,10); $rng->ran_rayleigh_tail($x, $sigma,$o); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub ran_rayleigh_tail { my ($obj,$x,$sigma,@var) = @_; if (ref($var[0]) eq 'PDL') { _ran_rayleigh_tail_int($var[0],$x,$sigma,$obj); return $var[0]; } else { my $p; $p = zeroes @var; _ran_rayleigh_tail_int($p,$x,$sigma,$obj); return $p; } } *ran_rayleigh_tail = \&PDL::GSL::RNG::ran_rayleigh_tail; =head2 ran_rayleigh_tail_var =for sig Signature: (x();sigma();[o]output(); gsl_rng *rng) Types: (float double) =for ref Similar to L except that it takes the distribution parameters as an ndarray and returns an ndarray of equal dimensions. Usage: =for usage $ndarray = $rng->ran_rayleigh_tail_var($x_ndarray,$sigma_ndarray); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub ran_rayleigh_tail_var { my ($obj,@var) = @_; if (scalar(@var) != 2) {barf("Bad number of parameters!");} _ran_rayleigh_tail_var_int(@var,my $x=PDL->null,$obj); return $x; } *ran_rayleigh_tail_var = \&PDL::GSL::RNG::ran_rayleigh_tail_var; =head2 ran_levy =for sig Signature: ([o]output(); double mu; double x; gsl_rng *rng) Types: (float double) =for ref Fills output ndarray with random variates from the Levy symmetric stable distribution with scale C<$c> and exponent C<$alpha>. Usage: =for usage $ndarray = $rng->ran_levy($mu, $x,[list of integers = output ndarray dims]); $rng->ran_levy($mu, $x, $output_ndarray); Example: =for example $o = $rng->ran_levy($mu, $x,10,10); $rng->ran_levy($mu, $x,$o); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub ran_levy { my ($obj,$mu,$x,@var) = @_; if (ref($var[0]) eq 'PDL') { _ran_levy_int($var[0],$mu,$x,$obj); return $var[0]; } else { my $p; $p = zeroes @var; _ran_levy_int($p,$mu,$x,$obj); return $p; } } *ran_levy = \&PDL::GSL::RNG::ran_levy; =head2 ran_levy_var =for sig Signature: (mu();x();[o]output(); gsl_rng *rng) Types: (float double) =for ref Similar to L except that it takes the distribution parameters as an ndarray and returns an ndarray of equal dimensions. Usage: =for usage $ndarray = $rng->ran_levy_var($mu_ndarray,$x_ndarray); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub ran_levy_var { my ($obj,@var) = @_; if (scalar(@var) != 2) {barf("Bad number of parameters!");} _ran_levy_var_int(@var,my $x=PDL->null,$obj); return $x; } *ran_levy_var = \&PDL::GSL::RNG::ran_levy_var; =head2 ran_gamma =for sig Signature: ([o]output(); double pa; double pb; gsl_rng *rng) Types: (float double) =for ref Fills output ndarray with random variates from the gamma distribution. Usage: =for usage $ndarray = $rng->ran_gamma($pa, $pb,[list of integers = output ndarray dims]); $rng->ran_gamma($pa, $pb, $output_ndarray); Example: =for example $o = $rng->ran_gamma($pa, $pb,10,10); $rng->ran_gamma($pa, $pb,$o); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub ran_gamma { my ($obj,$pa,$pb,@var) = @_; if (ref($var[0]) eq 'PDL') { _ran_gamma_int($var[0],$pa,$pb,$obj); return $var[0]; } else { my $p; $p = zeroes @var; _ran_gamma_int($p,$pa,$pb,$obj); return $p; } } *ran_gamma = \&PDL::GSL::RNG::ran_gamma; =head2 ran_gamma_var =for sig Signature: (pa();pb();[o]output(); gsl_rng *rng) Types: (float double) =for ref Similar to L except that it takes the distribution parameters as an ndarray and returns an ndarray of equal dimensions. Usage: =for usage $ndarray = $rng->ran_gamma_var($pa_ndarray,$pb_ndarray); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub ran_gamma_var { my ($obj,@var) = @_; if (scalar(@var) != 2) {barf("Bad number of parameters!");} _ran_gamma_var_int(@var,my $x=PDL->null,$obj); return $x; } *ran_gamma_var = \&PDL::GSL::RNG::ran_gamma_var; =head2 ran_flat =for sig Signature: ([o]output(); double la; double lb; gsl_rng *rng) Types: (float double) =for ref Fills output ndarray with random variates from the flat (uniform) distribution from C<$la> to C<$lb>. Usage: =for usage $ndarray = $rng->ran_flat($la, $lb,[list of integers = output ndarray dims]); $rng->ran_flat($la, $lb, $output_ndarray); Example: =for example $o = $rng->ran_flat($la, $lb,10,10); $rng->ran_flat($la, $lb,$o); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub ran_flat { my ($obj,$la,$lb,@var) = @_; if (ref($var[0]) eq 'PDL') { _ran_flat_int($var[0],$la,$lb,$obj); return $var[0]; } else { my $p; $p = zeroes @var; _ran_flat_int($p,$la,$lb,$obj); return $p; } } *ran_flat = \&PDL::GSL::RNG::ran_flat; =head2 ran_flat_var =for sig Signature: (la();lb();[o]output(); gsl_rng *rng) Types: (float double) =for ref Similar to L except that it takes the distribution parameters as an ndarray and returns an ndarray of equal dimensions. Usage: =for usage $ndarray = $rng->ran_flat_var($la_ndarray,$lb_ndarray); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub ran_flat_var { my ($obj,@var) = @_; if (scalar(@var) != 2) {barf("Bad number of parameters!");} _ran_flat_var_int(@var,my $x=PDL->null,$obj); return $x; } *ran_flat_var = \&PDL::GSL::RNG::ran_flat_var; =head2 ran_lognormal =for sig Signature: ([o]output(); double mu; double sigma; gsl_rng *rng) Types: (float double) =for ref Fills output ndarray with random variates from the lognormal distribution with parameters C<$mu> (location) and C<$sigma> (scale). Usage: =for usage $ndarray = $rng->ran_lognormal($mu, $sigma,[list of integers = output ndarray dims]); $rng->ran_lognormal($mu, $sigma, $output_ndarray); Example: =for example $o = $rng->ran_lognormal($mu, $sigma,10,10); $rng->ran_lognormal($mu, $sigma,$o); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub ran_lognormal { my ($obj,$mu,$sigma,@var) = @_; if (ref($var[0]) eq 'PDL') { _ran_lognormal_int($var[0],$mu,$sigma,$obj); return $var[0]; } else { my $p; $p = zeroes @var; _ran_lognormal_int($p,$mu,$sigma,$obj); return $p; } } *ran_lognormal = \&PDL::GSL::RNG::ran_lognormal; =head2 ran_lognormal_var =for sig Signature: (mu();sigma();[o]output(); gsl_rng *rng) Types: (float double) =for ref Similar to L except that it takes the distribution parameters as an ndarray and returns an ndarray of equal dimensions. Usage: =for usage $ndarray = $rng->ran_lognormal_var($mu_ndarray,$sigma_ndarray); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub ran_lognormal_var { my ($obj,@var) = @_; if (scalar(@var) != 2) {barf("Bad number of parameters!");} _ran_lognormal_var_int(@var,my $x=PDL->null,$obj); return $x; } *ran_lognormal_var = \&PDL::GSL::RNG::ran_lognormal_var; =head2 ran_chisq =for sig Signature: ([o]output(); double nu; gsl_rng *rng) Types: (float double) =for ref Fills output ndarray with random variates from the chi-squared distribution with C<$nu> degrees of freedom. Usage: =for usage $ndarray = $rng->ran_chisq($nu,[list of integers = output ndarray dims]); $rng->ran_chisq($nu, $output_ndarray); Example: =for example $o = $rng->ran_chisq($nu,10,10); $rng->ran_chisq($nu,$o); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub ran_chisq { my ($obj,$nu,@var) = @_; if (ref($var[0]) eq 'PDL') { _ran_chisq_int($var[0],$nu,$obj); return $var[0]; } else { my $p; $p = zeroes @var; _ran_chisq_int($p,$nu,$obj); return $p; } } *ran_chisq = \&PDL::GSL::RNG::ran_chisq; =head2 ran_chisq_var =for sig Signature: (nu();[o]output(); gsl_rng *rng) Types: (float double) =for ref Similar to L except that it takes the distribution parameters as an ndarray and returns an ndarray of equal dimensions. Usage: =for usage $ndarray = $rng->ran_chisq_var($nu_ndarray); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub ran_chisq_var { my ($obj,@var) = @_; if (scalar(@var) != 1) {barf("Bad number of parameters!");} _ran_chisq_var_int(@var,my $x=PDL->null,$obj); return $x; } *ran_chisq_var = \&PDL::GSL::RNG::ran_chisq_var; =head2 ran_fdist =for sig Signature: ([o]output(); double nu1; double nu2; gsl_rng *rng) Types: (float double) =for ref Fills output ndarray with random variates from the F-distribution with degrees of freedom C<$nu1> and C<$nu2>. Usage: =for usage $ndarray = $rng->ran_fdist($nu1, $nu2,[list of integers = output ndarray dims]); $rng->ran_fdist($nu1, $nu2, $output_ndarray); Example: =for example $o = $rng->ran_fdist($nu1, $nu2,10,10); $rng->ran_fdist($nu1, $nu2,$o); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub ran_fdist { my ($obj,$nu1,$nu2,@var) = @_; if (ref($var[0]) eq 'PDL') { _ran_fdist_int($var[0],$nu1,$nu2,$obj); return $var[0]; } else { my $p; $p = zeroes @var; _ran_fdist_int($p,$nu1,$nu2,$obj); return $p; } } *ran_fdist = \&PDL::GSL::RNG::ran_fdist; =head2 ran_fdist_var =for sig Signature: (nu1();nu2();[o]output(); gsl_rng *rng) Types: (float double) =for ref Similar to L except that it takes the distribution parameters as an ndarray and returns an ndarray of equal dimensions. Usage: =for usage $ndarray = $rng->ran_fdist_var($nu1_ndarray,$nu2_ndarray); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub ran_fdist_var { my ($obj,@var) = @_; if (scalar(@var) != 2) {barf("Bad number of parameters!");} _ran_fdist_var_int(@var,my $x=PDL->null,$obj); return $x; } *ran_fdist_var = \&PDL::GSL::RNG::ran_fdist_var; =head2 ran_tdist =for sig Signature: ([o]output(); double nu; gsl_rng *rng) Types: (float double) =for ref Fills output ndarray with random variates from the t-distribution (AKA Student's t-distribution) with C<$nu> degrees of freedom. Usage: =for usage $ndarray = $rng->ran_tdist($nu,[list of integers = output ndarray dims]); $rng->ran_tdist($nu, $output_ndarray); Example: =for example $o = $rng->ran_tdist($nu,10,10); $rng->ran_tdist($nu,$o); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub ran_tdist { my ($obj,$nu,@var) = @_; if (ref($var[0]) eq 'PDL') { _ran_tdist_int($var[0],$nu,$obj); return $var[0]; } else { my $p; $p = zeroes @var; _ran_tdist_int($p,$nu,$obj); return $p; } } *ran_tdist = \&PDL::GSL::RNG::ran_tdist; =head2 ran_tdist_var =for sig Signature: (nu();[o]output(); gsl_rng *rng) Types: (float double) =for ref Similar to L except that it takes the distribution parameters as an ndarray and returns an ndarray of equal dimensions. Usage: =for usage $ndarray = $rng->ran_tdist_var($nu_ndarray); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub ran_tdist_var { my ($obj,@var) = @_; if (scalar(@var) != 1) {barf("Bad number of parameters!");} _ran_tdist_var_int(@var,my $x=PDL->null,$obj); return $x; } *ran_tdist_var = \&PDL::GSL::RNG::ran_tdist_var; =head2 ran_beta =for sig Signature: ([o]output(); double pa; double pb; gsl_rng *rng) Types: (float double) =for ref Fills output ndarray with random variates from the beta distribution with parameters C<$pa> and C<$pb>. Usage: =for usage $ndarray = $rng->ran_beta($pa, $pb,[list of integers = output ndarray dims]); $rng->ran_beta($pa, $pb, $output_ndarray); Example: =for example $o = $rng->ran_beta($pa, $pb,10,10); $rng->ran_beta($pa, $pb,$o); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub ran_beta { my ($obj,$pa,$pb,@var) = @_; if (ref($var[0]) eq 'PDL') { _ran_beta_int($var[0],$pa,$pb,$obj); return $var[0]; } else { my $p; $p = zeroes @var; _ran_beta_int($p,$pa,$pb,$obj); return $p; } } *ran_beta = \&PDL::GSL::RNG::ran_beta; =head2 ran_beta_var =for sig Signature: (pa();pb();[o]output(); gsl_rng *rng) Types: (float double) =for ref Similar to L except that it takes the distribution parameters as an ndarray and returns an ndarray of equal dimensions. Usage: =for usage $ndarray = $rng->ran_beta_var($pa_ndarray,$pb_ndarray); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub ran_beta_var { my ($obj,@var) = @_; if (scalar(@var) != 2) {barf("Bad number of parameters!");} _ran_beta_var_int(@var,my $x=PDL->null,$obj); return $x; } *ran_beta_var = \&PDL::GSL::RNG::ran_beta_var; =head2 ran_logistic =for sig Signature: ([o]output(); double m; gsl_rng *rng) Types: (float double) =for ref Fills output ndarray with random random variates from the logistic distribution. Usage: =for usage $ndarray = $rng->ran_logistic($m,[list of integers = output ndarray dims]); $rng->ran_logistic($m, $output_ndarray); Example: =for example $o = $rng->ran_logistic($m,10,10); $rng->ran_logistic($m,$o); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub ran_logistic { my ($obj,$m,@var) = @_; if (ref($var[0]) eq 'PDL') { _ran_logistic_int($var[0],$m,$obj); return $var[0]; } else { my $p; $p = zeroes @var; _ran_logistic_int($p,$m,$obj); return $p; } } *ran_logistic = \&PDL::GSL::RNG::ran_logistic; =head2 ran_logistic_var =for sig Signature: (m();[o]output(); gsl_rng *rng) Types: (float double) =for ref Similar to L except that it takes the distribution parameters as an ndarray and returns an ndarray of equal dimensions. Usage: =for usage $ndarray = $rng->ran_logistic_var($m_ndarray); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub ran_logistic_var { my ($obj,@var) = @_; if (scalar(@var) != 1) {barf("Bad number of parameters!");} _ran_logistic_var_int(@var,my $x=PDL->null,$obj); return $x; } *ran_logistic_var = \&PDL::GSL::RNG::ran_logistic_var; =head2 ran_pareto =for sig Signature: ([o]output(); double pa; double lb; gsl_rng *rng) Types: (float double) =for ref Fills output ndarray with random variates from the Pareto distribution of order C<$pa> and scale C<$lb>. Usage: =for usage $ndarray = $rng->ran_pareto($pa, $lb,[list of integers = output ndarray dims]); $rng->ran_pareto($pa, $lb, $output_ndarray); Example: =for example $o = $rng->ran_pareto($pa, $lb,10,10); $rng->ran_pareto($pa, $lb,$o); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub ran_pareto { my ($obj,$pa,$lb,@var) = @_; if (ref($var[0]) eq 'PDL') { _ran_pareto_int($var[0],$pa,$lb,$obj); return $var[0]; } else { my $p; $p = zeroes @var; _ran_pareto_int($p,$pa,$lb,$obj); return $p; } } *ran_pareto = \&PDL::GSL::RNG::ran_pareto; =head2 ran_pareto_var =for sig Signature: (pa();lb();[o]output(); gsl_rng *rng) Types: (float double) =for ref Similar to L except that it takes the distribution parameters as an ndarray and returns an ndarray of equal dimensions. Usage: =for usage $ndarray = $rng->ran_pareto_var($pa_ndarray,$lb_ndarray); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub ran_pareto_var { my ($obj,@var) = @_; if (scalar(@var) != 2) {barf("Bad number of parameters!");} _ran_pareto_var_int(@var,my $x=PDL->null,$obj); return $x; } *ran_pareto_var = \&PDL::GSL::RNG::ran_pareto_var; =head2 ran_weibull =for sig Signature: ([o]output(); double pa; double pb; gsl_rng *rng) Types: (float double) =for ref Fills output ndarray with random variates from the Weibull distribution with scale C<$pa> and exponent C<$pb>. (Some literature uses C for C<$pa> and C for C<$pb>.) Usage: =for usage $ndarray = $rng->ran_weibull($pa, $pb,[list of integers = output ndarray dims]); $rng->ran_weibull($pa, $pb, $output_ndarray); Example: =for example $o = $rng->ran_weibull($pa, $pb,10,10); $rng->ran_weibull($pa, $pb,$o); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub ran_weibull { my ($obj,$pa,$pb,@var) = @_; if (ref($var[0]) eq 'PDL') { _ran_weibull_int($var[0],$pa,$pb,$obj); return $var[0]; } else { my $p; $p = zeroes @var; _ran_weibull_int($p,$pa,$pb,$obj); return $p; } } *ran_weibull = \&PDL::GSL::RNG::ran_weibull; =head2 ran_weibull_var =for sig Signature: (pa();pb();[o]output(); gsl_rng *rng) Types: (float double) =for ref Similar to L except that it takes the distribution parameters as an ndarray and returns an ndarray of equal dimensions. Usage: =for usage $ndarray = $rng->ran_weibull_var($pa_ndarray,$pb_ndarray); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub ran_weibull_var { my ($obj,@var) = @_; if (scalar(@var) != 2) {barf("Bad number of parameters!");} _ran_weibull_var_int(@var,my $x=PDL->null,$obj); return $x; } *ran_weibull_var = \&PDL::GSL::RNG::ran_weibull_var; =head2 ran_gumbel1 =for sig Signature: ([o]output(); double pa; double pb; gsl_rng *rng) Types: (float double) =for ref Fills output ndarray with random variates from the Type-1 Gumbel distribution. Usage: =for usage $ndarray = $rng->ran_gumbel1($pa, $pb,[list of integers = output ndarray dims]); $rng->ran_gumbel1($pa, $pb, $output_ndarray); Example: =for example $o = $rng->ran_gumbel1($pa, $pb,10,10); $rng->ran_gumbel1($pa, $pb,$o); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub ran_gumbel1 { my ($obj,$pa,$pb,@var) = @_; if (ref($var[0]) eq 'PDL') { _ran_gumbel1_int($var[0],$pa,$pb,$obj); return $var[0]; } else { my $p; $p = zeroes @var; _ran_gumbel1_int($p,$pa,$pb,$obj); return $p; } } *ran_gumbel1 = \&PDL::GSL::RNG::ran_gumbel1; =head2 ran_gumbel1_var =for sig Signature: (pa();pb();[o]output(); gsl_rng *rng) Types: (float double) =for ref Similar to L except that it takes the distribution parameters as an ndarray and returns an ndarray of equal dimensions. Usage: =for usage $ndarray = $rng->ran_gumbel1_var($pa_ndarray,$pb_ndarray); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub ran_gumbel1_var { my ($obj,@var) = @_; if (scalar(@var) != 2) {barf("Bad number of parameters!");} _ran_gumbel1_var_int(@var,my $x=PDL->null,$obj); return $x; } *ran_gumbel1_var = \&PDL::GSL::RNG::ran_gumbel1_var; =head2 ran_gumbel2 =for sig Signature: ([o]output(); double pa; double pb; gsl_rng *rng) Types: (float double) =for ref Fills output ndarray with random variates from the Type-2 Gumbel distribution. Usage: =for usage $ndarray = $rng->ran_gumbel2($pa, $pb,[list of integers = output ndarray dims]); $rng->ran_gumbel2($pa, $pb, $output_ndarray); Example: =for example $o = $rng->ran_gumbel2($pa, $pb,10,10); $rng->ran_gumbel2($pa, $pb,$o); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub ran_gumbel2 { my ($obj,$pa,$pb,@var) = @_; if (ref($var[0]) eq 'PDL') { _ran_gumbel2_int($var[0],$pa,$pb,$obj); return $var[0]; } else { my $p; $p = zeroes @var; _ran_gumbel2_int($p,$pa,$pb,$obj); return $p; } } *ran_gumbel2 = \&PDL::GSL::RNG::ran_gumbel2; =head2 ran_gumbel2_var =for sig Signature: (pa();pb();[o]output(); gsl_rng *rng) Types: (float double) =for ref Similar to L except that it takes the distribution parameters as an ndarray and returns an ndarray of equal dimensions. Usage: =for usage $ndarray = $rng->ran_gumbel2_var($pa_ndarray,$pb_ndarray); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub ran_gumbel2_var { my ($obj,@var) = @_; if (scalar(@var) != 2) {barf("Bad number of parameters!");} _ran_gumbel2_var_int(@var,my $x=PDL->null,$obj); return $x; } *ran_gumbel2_var = \&PDL::GSL::RNG::ran_gumbel2_var; =head2 ran_poisson =for sig Signature: ([o]output(); double mu; gsl_rng *rng) Types: (float double) =for ref Fills output ndarray with random integer values from the Poisson distribution with mean C<$mu>. Usage: =for usage $ndarray = $rng->ran_poisson($mu,[list of integers = output ndarray dims]); $rng->ran_poisson($mu, $output_ndarray); Example: =for example $o = $rng->ran_poisson($mu,10,10); $rng->ran_poisson($mu,$o); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub ran_poisson { my ($obj,$mu,@var) = @_; if (ref($var[0]) eq 'PDL') { _ran_poisson_int($var[0],$mu,$obj); return $var[0]; } else { my $p; $p = zeroes @var; _ran_poisson_int($p,$mu,$obj); return $p; } } *ran_poisson = \&PDL::GSL::RNG::ran_poisson; =head2 ran_poisson_var =for sig Signature: (mu();[o]output(); gsl_rng *rng) Types: (float double) =for ref Similar to L except that it takes the distribution parameters as an ndarray and returns an ndarray of equal dimensions. Usage: =for usage $ndarray = $rng->ran_poisson_var($mu_ndarray); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub ran_poisson_var { my ($obj,@var) = @_; if (scalar(@var) != 1) {barf("Bad number of parameters!");} _ran_poisson_var_int(@var,my $x=PDL->null,$obj); return $x; } *ran_poisson_var = \&PDL::GSL::RNG::ran_poisson_var; =head2 ran_bernoulli =for sig Signature: ([o]output(); double p; gsl_rng *rng) Types: (float double) =for ref Fills output ndarray with random values 0 or 1, the result of a Bernoulli trial with probability C<$p>. Usage: =for usage $ndarray = $rng->ran_bernoulli($p,[list of integers = output ndarray dims]); $rng->ran_bernoulli($p, $output_ndarray); Example: =for example $o = $rng->ran_bernoulli($p,10,10); $rng->ran_bernoulli($p,$o); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub ran_bernoulli { my ($obj,$p,@var) = @_; if (ref($var[0]) eq 'PDL') { _ran_bernoulli_int($var[0],$p,$obj); return $var[0]; } else { my $p; $p = zeroes @var; _ran_bernoulli_int($p,$p,$obj); return $p; } } *ran_bernoulli = \&PDL::GSL::RNG::ran_bernoulli; =head2 ran_bernoulli_var =for sig Signature: (p();[o]output(); gsl_rng *rng) Types: (float double) =for ref Similar to L except that it takes the distribution parameters as an ndarray and returns an ndarray of equal dimensions. Usage: =for usage $ndarray = $rng->ran_bernoulli_var($p_ndarray); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub ran_bernoulli_var { my ($obj,@var) = @_; if (scalar(@var) != 1) {barf("Bad number of parameters!");} _ran_bernoulli_var_int(@var,my $x=PDL->null,$obj); return $x; } *ran_bernoulli_var = \&PDL::GSL::RNG::ran_bernoulli_var; =head2 ran_binomial =for sig Signature: ([o]output(); double p; double n; gsl_rng *rng) Types: (float double) =for ref Fills output ndarray with random integer values from the binomial distribution, the number of successes in C<$n> independent trials with probability C<$p>. Usage: =for usage $ndarray = $rng->ran_binomial($p, $n,[list of integers = output ndarray dims]); $rng->ran_binomial($p, $n, $output_ndarray); Example: =for example $o = $rng->ran_binomial($p, $n,10,10); $rng->ran_binomial($p, $n,$o); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub ran_binomial { my ($obj,$p,$n,@var) = @_; if (ref($var[0]) eq 'PDL') { _ran_binomial_int($var[0],$p,$n,$obj); return $var[0]; } else { my $p; $p = zeroes @var; _ran_binomial_int($p,$p,$n,$obj); return $p; } } *ran_binomial = \&PDL::GSL::RNG::ran_binomial; =head2 ran_binomial_var =for sig Signature: (p();n();[o]output(); gsl_rng *rng) Types: (float double) =for ref Similar to L except that it takes the distribution parameters as an ndarray and returns an ndarray of equal dimensions. Usage: =for usage $ndarray = $rng->ran_binomial_var($p_ndarray,$n_ndarray); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub ran_binomial_var { my ($obj,@var) = @_; if (scalar(@var) != 2) {barf("Bad number of parameters!");} _ran_binomial_var_int(@var,my $x=PDL->null,$obj); return $x; } *ran_binomial_var = \&PDL::GSL::RNG::ran_binomial_var; =head2 ran_negative_binomial =for sig Signature: ([o]output(); double p; double n; gsl_rng *rng) Types: (float double) =for ref Fills output ndarray with random integer values from the negative binomial distribution, the number of failures occurring before C<$n> successes in independent trials with probability C<$p> of success. Note that C<$n> is not required to be an integer. Usage: =for usage $ndarray = $rng->ran_negative_binomial($p, $n,[list of integers = output ndarray dims]); $rng->ran_negative_binomial($p, $n, $output_ndarray); Example: =for example $o = $rng->ran_negative_binomial($p, $n,10,10); $rng->ran_negative_binomial($p, $n,$o); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub ran_negative_binomial { my ($obj,$p,$n,@var) = @_; if (ref($var[0]) eq 'PDL') { _ran_negative_binomial_int($var[0],$p,$n,$obj); return $var[0]; } else { my $p; $p = zeroes @var; _ran_negative_binomial_int($p,$p,$n,$obj); return $p; } } *ran_negative_binomial = \&PDL::GSL::RNG::ran_negative_binomial; =head2 ran_negative_binomial_var =for sig Signature: (p();n();[o]output(); gsl_rng *rng) Types: (float double) =for ref Similar to L except that it takes the distribution parameters as an ndarray and returns an ndarray of equal dimensions. Usage: =for usage $ndarray = $rng->ran_negative_binomial_var($p_ndarray,$n_ndarray); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub ran_negative_binomial_var { my ($obj,@var) = @_; if (scalar(@var) != 2) {barf("Bad number of parameters!");} _ran_negative_binomial_var_int(@var,my $x=PDL->null,$obj); return $x; } *ran_negative_binomial_var = \&PDL::GSL::RNG::ran_negative_binomial_var; =head2 ran_pascal =for sig Signature: ([o]output(); double p; double n; gsl_rng *rng) Types: (float double) =for ref Fills output ndarray with random integer values from the Pascal distribution. The Pascal distribution is simply a negative binomial distribution (see L) with an integer value of C<$n>. Usage: =for usage $ndarray = $rng->ran_pascal($p, $n,[list of integers = output ndarray dims]); $rng->ran_pascal($p, $n, $output_ndarray); Example: =for example $o = $rng->ran_pascal($p, $n,10,10); $rng->ran_pascal($p, $n,$o); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub ran_pascal { my ($obj,$p,$n,@var) = @_; if (ref($var[0]) eq 'PDL') { _ran_pascal_int($var[0],$p,$n,$obj); return $var[0]; } else { my $p; $p = zeroes @var; _ran_pascal_int($p,$p,$n,$obj); return $p; } } *ran_pascal = \&PDL::GSL::RNG::ran_pascal; =head2 ran_pascal_var =for sig Signature: (p();n();[o]output(); gsl_rng *rng) Types: (float double) =for ref Similar to L except that it takes the distribution parameters as an ndarray and returns an ndarray of equal dimensions. Usage: =for usage $ndarray = $rng->ran_pascal_var($p_ndarray,$n_ndarray); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub ran_pascal_var { my ($obj,@var) = @_; if (scalar(@var) != 2) {barf("Bad number of parameters!");} _ran_pascal_var_int(@var,my $x=PDL->null,$obj); return $x; } *ran_pascal_var = \&PDL::GSL::RNG::ran_pascal_var; =head2 ran_geometric =for sig Signature: ([o]output(); double p; gsl_rng *rng) Types: (float double) =for ref Fills output ndarray with random integer values from the geometric distribution, the number of independent trials with probability C<$p> until the first success. Usage: =for usage $ndarray = $rng->ran_geometric($p,[list of integers = output ndarray dims]); $rng->ran_geometric($p, $output_ndarray); Example: =for example $o = $rng->ran_geometric($p,10,10); $rng->ran_geometric($p,$o); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub ran_geometric { my ($obj,$p,@var) = @_; if (ref($var[0]) eq 'PDL') { _ran_geometric_int($var[0],$p,$obj); return $var[0]; } else { my $p; $p = zeroes @var; _ran_geometric_int($p,$p,$obj); return $p; } } *ran_geometric = \&PDL::GSL::RNG::ran_geometric; =head2 ran_geometric_var =for sig Signature: (p();[o]output(); gsl_rng *rng) Types: (float double) =for ref Similar to L except that it takes the distribution parameters as an ndarray and returns an ndarray of equal dimensions. Usage: =for usage $ndarray = $rng->ran_geometric_var($p_ndarray); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub ran_geometric_var { my ($obj,@var) = @_; if (scalar(@var) != 1) {barf("Bad number of parameters!");} _ran_geometric_var_int(@var,my $x=PDL->null,$obj); return $x; } *ran_geometric_var = \&PDL::GSL::RNG::ran_geometric_var; =head2 ran_hypergeometric =for sig Signature: ([o]output(); double n1; double n2; double t; gsl_rng *rng) Types: (float double) =for ref Fills output ndarray with random integer values from the hypergeometric distribution. If a population contains C<$n1> elements of type 1 and C<$n2> elements of type 2 then the hypergeometric distribution gives the probability of obtaining C<$x> elements of type 1 in C<$t> samples from the population without replacement. Usage: =for usage $ndarray = $rng->ran_hypergeometric($n1, $n2, $t,[list of integers = output ndarray dims]); $rng->ran_hypergeometric($n1, $n2, $t, $output_ndarray); Example: =for example $o = $rng->ran_hypergeometric($n1, $n2, $t,10,10); $rng->ran_hypergeometric($n1, $n2, $t,$o); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub ran_hypergeometric { my ($obj,$n1,$n2,$t,@var) = @_; if (ref($var[0]) eq 'PDL') { _ran_hypergeometric_int($var[0],$n1,$n2,$t,$obj); return $var[0]; } else { my $p; $p = zeroes @var; _ran_hypergeometric_int($p,$n1,$n2,$t,$obj); return $p; } } *ran_hypergeometric = \&PDL::GSL::RNG::ran_hypergeometric; =head2 ran_hypergeometric_var =for sig Signature: (n1();n2();t();[o]output(); gsl_rng *rng) Types: (float double) =for ref Similar to L except that it takes the distribution parameters as an ndarray and returns an ndarray of equal dimensions. Usage: =for usage $ndarray = $rng->ran_hypergeometric_var($n1_ndarray,$n2_ndarray,$t_ndarray); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub ran_hypergeometric_var { my ($obj,@var) = @_; if (scalar(@var) != 3) {barf("Bad number of parameters!");} _ran_hypergeometric_var_int(@var,my $x=PDL->null,$obj); return $x; } *ran_hypergeometric_var = \&PDL::GSL::RNG::ran_hypergeometric_var; =head2 ran_logarithmic =for sig Signature: ([o]output(); double p; gsl_rng *rng) Types: (float double) =for ref Fills output ndarray with random integer values from the logarithmic distribution. Usage: =for usage $ndarray = $rng->ran_logarithmic($p,[list of integers = output ndarray dims]); $rng->ran_logarithmic($p, $output_ndarray); Example: =for example $o = $rng->ran_logarithmic($p,10,10); $rng->ran_logarithmic($p,$o); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub ran_logarithmic { my ($obj,$p,@var) = @_; if (ref($var[0]) eq 'PDL') { _ran_logarithmic_int($var[0],$p,$obj); return $var[0]; } else { my $p; $p = zeroes @var; _ran_logarithmic_int($p,$p,$obj); return $p; } } *ran_logarithmic = \&PDL::GSL::RNG::ran_logarithmic; =head2 ran_logarithmic_var =for sig Signature: (p();[o]output(); gsl_rng *rng) Types: (float double) =for ref Similar to L except that it takes the distribution parameters as an ndarray and returns an ndarray of equal dimensions. Usage: =for usage $ndarray = $rng->ran_logarithmic_var($p_ndarray); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub ran_logarithmic_var { my ($obj,@var) = @_; if (scalar(@var) != 1) {barf("Bad number of parameters!");} _ran_logarithmic_var_int(@var,my $x=PDL->null,$obj); return $x; } *ran_logarithmic_var = \&PDL::GSL::RNG::ran_logarithmic_var; =head2 ran_additive_gaussian =for sig Signature: ([o]x(); double sigma; gsl_rng *rng) Types: (float double) =for ref Add Gaussian noise of given sigma to an ndarray. Usage: =for usage $rng->ran_additive_gaussian($sigma,$ndarray); Example: =for example $rng->ran_additive_gaussian(1,$image); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub ran_additive_gaussian { my ($obj,$sigma,$var) = @_; barf("In additive gaussian mode you must specify an ndarray!") if ref($var) ne 'PDL'; _ran_additive_gaussian_int($var,$sigma,$obj); return $var; } *ran_additive_gaussian = \&PDL::GSL::RNG::ran_additive_gaussian; =head2 ran_additive_poisson =for sig Signature: ([o]x(); double sigma; gsl_rng *rng) Types: (float double) =for ref Add Poisson noise of given C<$mu> to a C<$ndarray>. Usage: =for usage $rng->ran_additive_poisson($mu,$ndarray); Example: =for example $rng->ran_additive_poisson(1,$image); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub ran_additive_poisson { my ($obj,$sigma,$var) = @_; barf("In additive poisson mode you must specify an ndarray!") if ref($var) ne 'PDL'; _ran_additive_poisson_int($var,$sigma,$obj); return $var; } *ran_additive_poisson = \&PDL::GSL::RNG::ran_additive_poisson; =head2 ran_feed_poisson =for sig Signature: ([o]x(); gsl_rng *rng) Types: (float double) =for ref This method simulates shot noise, taking the values of ndarray as values for C<$mu> to be fed in the poissonian RNG. Usage: =for usage $rng->ran_feed_poisson($ndarray); Example: =for example $rng->ran_feed_poisson($image); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub ran_feed_poisson { my ($obj,$var) = @_; barf("In poisson mode you must specify an ndarray!") if ref($var) ne 'PDL'; _ran_feed_poisson_int($var,$obj); return $var; } *ran_feed_poisson = \&PDL::GSL::RNG::ran_feed_poisson; =head2 ran_bivariate_gaussian =for sig Signature: ([o]x(n); double sigma_x; double sigma_y; double rho; gsl_rng *rng) Types: (float double) =for ref Generates C<$n> bivariate gaussian random deviates. Usage: =for usage $ndarray = $rng->ran_bivariate_gaussian($sigma_x,$sigma_y,$rho,$n); Example: =for example $o = $rng->ran_bivariate_gaussian(1,2,0.5,1000); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub ran_bivariate_gaussian { my ($obj,$sigma_x,$sigma_y,$rho,$n) = @_; barf("Not enough parameters for gaussian bivariate!") if $n<=0; my $p = zeroes(2,$n); _ran_bivariate_gaussian_int($p,$sigma_x,$sigma_y,$rho,$obj); return $p; } *ran_bivariate_gaussian = \&PDL::GSL::RNG::ran_bivariate_gaussian; *ran_dir_2d = \&PDL::GSL::RNG::ran_dir_2d; *ran_dir_3d = \&PDL::GSL::RNG::ran_dir_3d; *ran_dir_nd = \&PDL::GSL::RNG::ran_dir_nd; #line 968 "lib/PDL/GSL/RNG.pd" sub ran_dir { my ($obj,$ndim,$n) = @_; barf("Not enough parameters for random vectors!") if $n<=0; my $p = zeroes($ndim,$n); if ($ndim==2) { ran_dir_2d($p,$obj); } elsif ($ndim==3) { ran_dir_3d($p,$obj); } elsif ($ndim>=4 && $ndim<=100) { ran_dir_nd($p,$ndim,$obj); } else { barf("Bad number of dimensions!"); } return $p; } #line 5501 "lib/PDL/GSL/RNG.pm" =head2 ran_discrete =for sig Signature: ([o]x(); gsl_ran_discrete_t *rng_discrete; gsl_rng *rng) Types: (float double) =for ref Is used to get the desired samples once a proper handle has been enstablished (see ran_discrete_preproc()). Usage: =for usage $ndarray = $rng->ran_discrete($discrete_dist_handle,$num); Example: =for example $prob = pdl [0.1,0.3,0.6]; $ddh = $rng->ran_discrete_preproc($prob); $o = $rng->ran_discrete($discrete_dist_handle,100); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub ran_discrete { my ($obj, $rdt, @var) = @_; if (ref($var[0]) eq 'PDL') { _ran_discrete_int($var[0], $rdt, $obj); return $var[0]; } else { my $p; $p = zeroes @var; _ran_discrete_int($p, $rdt, $obj); return $p; } } *ran_discrete = \&PDL::GSL::RNG::ran_discrete; #line 1024 "lib/PDL/GSL/RNG.pd" sub ran_shuffle_vec { my ($obj,@in) = @_; $obj->ran_shuffle(my $p = PDL->sequence(PDL::indx(), 0+@in)); @in[$p->list]; } #line 1032 "lib/PDL/GSL/RNG.pd" sub ran_choose_vec { my ($obj,$nout,@in) = @_; $obj->ran_choose(PDL->sequence(PDL::indx(), 0+@in),my $pout = PDL->zeroes(PDL::indx(), $nout)); @in[$pout->list]; } #line 5581 "lib/PDL/GSL/RNG.pm" =head2 ran_ver =for sig Signature: ([o]x(n); double x0; double r;IV ns => n; gsl_rng *rng) Types: (float double) =for ref Returns an ndarray with C<$n> values generated by the Verhulst map from C<$x0> and parameter C<$r>. Usage: =for usage $rng->ran_ver($x0, $r, $n); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub ran_ver { my ($obj,$x0,$r,$n) = @_; barf("Not enough parameters for ran_ver!") if $n<=0; my $p = zeroes($n); _ran_ver_int($p,$x0,$r,$n,$obj); return $p; } *ran_ver = \&PDL::GSL::RNG::ran_ver; =head2 ran_caos =for sig Signature: ([o]x(n); double m; IV ns => n; gsl_rng *rng) Types: (float double) =for ref Returns values from Verhuls map with C<$r=4.0> and randomly chosen C<$x0>. The values are scaled by C<$m>. Usage: =for usage $rng->ran_caos($m,$n); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub ran_caos { my ($obj,$m,$n) = @_; barf("Not enough parameters for ran_caos!") if $n<=0; my $p = zeroes($n); _ran_caos_int($p,$m,$n,$obj); return $p; } *ran_caos = \&PDL::GSL::RNG::ran_caos; #line 369 "lib/PDL/GSL/RNG.pd" =head1 BUGS Feedback is welcome. Log bugs in the PDL bug database (the database is always linked from L). =head1 SEE ALSO L The GSL documentation for random number distributions is online at L =head1 AUTHOR This file copyright (C) 1999 Christian Pellegrin Docs mangled by C. Soeller. All rights reserved. There is no warranty. You are allowed to redistribute this software / documentation under certain conditions. For details, see the file COPYING in the PDL distribution. If this file is separated from the PDL distribution, the copyright notice should be included in the file. The GSL RNG and randist modules were written by James Theiler. =cut #line 5711 "lib/PDL/GSL/RNG.pm" # Exit with OK status 1; PDL-GSL-2.103/GENERATED/PDL/GSL/INTEG.pm0000644000175000017500000006301215160062237016261 0ustar osboxesosboxes# # GENERATED WITH PDL::PP from lib/PDL/GSL/INTEG.pd! Don't modify! # package PDL::GSL::INTEG; our @EXPORT_OK = qw(gslinteg_qng gslinteg_qag gslinteg_qags gslinteg_qagp gslinteg_qagi gslinteg_qagiu gslinteg_qagil gslinteg_qawc gslinteg_qaws gslinteg_qawo gslinteg_qawf ); our %EXPORT_TAGS = (Func=>\@EXPORT_OK); use PDL::Core; use PDL::Exporter; use DynaLoader; our @ISA = ( 'PDL::Exporter','DynaLoader' ); push @PDL::Core::PP, __PACKAGE__; bootstrap PDL::GSL::INTEG ; #line 10 "lib/PDL/GSL/INTEG.pd" use strict; use warnings; =head1 NAME PDL::GSL::INTEG - PDL interface to numerical integration routines in GSL =head1 DESCRIPTION This is an interface to the numerical integration package present in the GNU Scientific Library, which is an implementation of QUADPACK. Functions are named B where {algorithm} is the QUADPACK naming convention. The available functions are: =over 3 =item gslinteg_qng: Non-adaptive Gauss-Kronrod integration =item gslinteg_qag: Adaptive integration =item gslinteg_qags: Adaptive integration with singularities =item gslinteg_qagp: Adaptive integration with known singular points =item gslinteg_qagi: Adaptive integration on infinite interval of the form (-\infty,\infty) =item gslinteg_qagiu: Adaptive integration on infinite interval of the form (la,\infty) =item gslinteg_qagil: Adaptive integration on infinite interval of the form (-\infty,lb) =item gslinteg_qawc: Adaptive integration for Cauchy principal values =item gslinteg_qaws: Adaptive integration for singular functions =item gslinteg_qawo: Adaptive integration for oscillatory functions =item gslinteg_qawf: Adaptive integration for Fourier integrals =back Each algorithm computes an approximation to the integral, I, of the function f(x)w(x), where w(x) is a weight function (for general integrands w(x)=1). The user provides absolute and relative error bounds (epsabs,epsrel) which specify the following accuracy requirement: |RESULT - I| <= max(epsabs, epsrel |I|) The routines will fail to converge if the error bounds are too stringent, but always return the best approximation obtained up to that stage All functions return the result, and estimate of the absolute error and an error flag (which is zero if there were no problems). You are responsible for checking for any errors, no warnings are issued unless the option {Warn => 'y'} is specified in which case the reason of failure will be printed. You can nest integrals up to 20 levels. If you find yourself in the unlikely situation that you need more, you can change the value of 'max_nested_integrals' in the first line of the file 'FUNC.c' and recompile. =head1 NOMENCLATURE Throughout this documentation we strive to use the same variables that are present in the original GSL documentation (see L). Oftentimes those variables are called C and C. Since good Perl coding practices discourage the use of Perl variables C<$a> and C<$b>, here we refer to Parameters C and C as C<$pa> and C<$pb>, respectively, and Limits (of domain or integration) as C<$la> and C<$lb>. =head1 SYNOPSIS use PDL; use PDL::GSL::INTEG; my $la = 1.2; my $lb = 3.7; my $epsrel = 0; my $epsabs = 1e-6; # Non adaptive integration my ($res,$abserr,$ierr,$neval) = gslinteg_qng(\&myf,$la,$lb,$epsrel,$epsabs); # Warnings on my ($res,$abserr,$ierr,$neval) = gslinteg_qng(\&myf,$la,$lb,$epsrel,$epsabs,{Warn=>'y'}); # Adaptive integration with warnings on my $limit = 1000; my $key = 5; my ($res,$abserr,$ierr) = gslinteg_qag(\&myf,$la,$lb,$epsrel, $epsabs,$limit,$key,{Warn=>'y'}); sub myf{ my ($x) = @_; return exp(-$x**2); } #line 128 "lib/PDL/GSL/INTEG.pm" =head1 FUNCTIONS =cut =head2 gslinteg_qng =for sig Signature: (a(); b(); epsabs(); epsrel(); int gslwarn(); [o] result(); [o] abserr(); int [o] neval(); int [o] ierr();; SV* function) Types: (double) =for ref Non-adaptive Gauss-Kronrod integration This function applies the Gauss-Kronrod 10-point, 21-point, 43-point and 87-point integration rules in succession until an estimate of the integral of f over ($la,$lb) is achieved within the desired absolute and relative error limits, $epsabs and $epsrel. It is meant for fast integration of smooth functions. It returns an array with the result, an estimate of the absolute error, an error flag and the number of function evaluations performed. =for usage Usage: ($res,$abserr,$ierr,$neval) = gslinteg_qng($function_ref,$la,$lb, $epsrel,$epsabs,[{Warn => $warn}]); =for example Example: my ($res,$abserr,$ierr,$neval) = gslinteg_qng(\&f,0,1,0,1e-9); # with warnings on my ($res,$abserr,$ierr,$neval) = gslinteg_qng(\&f,0,1,0,1e-9,{Warn => 'y'}); sub f{ my ($x) = @_; return ($x**2.6)*log(1.0/$x); } =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub gslinteg_qng{ my $opt = ref($_[-1]) eq 'HASH' ? pop @_ : {Warn => 'n'}; barf 'Usage: gslinteg_qng($function_ref,$la,$lb,$epsabs,$epsrel,[opt])' unless (@_ == 5); my $warn = $$opt{Warn}=~/y/i ? 1 : 0; my ($f,$la,$lb,$epsabs,$epsrel) = @_; $_=PDL->null for my ($res,$abserr,$neval,$ierr); _gslinteg_qng_int($la,$lb,$epsabs,$epsrel,$warn,$res,$abserr,$neval,$ierr,$f); return ($res,$abserr,$ierr,$neval); } *gslinteg_qng = \&PDL::GSL::INTEG::gslinteg_qng; =head2 gslinteg_qag =for sig Signature: (a(); b(); epsabs();epsrel(); int limit(); int key(); int n(); int gslwarn(); [o] result(); [o] abserr(); int [o] ierr();; SV* function) Types: (double) =for ref Adaptive integration This function applies an integration rule adaptively until an estimate of the integral of f over ($la,$lb) is achieved within the desired absolute and relative error limits, $epsabs and $epsrel. On each iteration the adaptive integration strategy bisects the interval with the largest error estimate; the maximum number of allowed subdivisions is given by the parameter $limit. The integration rule is determined by the value of $key, which has to be one of (1,2,3,4,5,6) and correspond to the 15, 21, 31, 41, 51 and 61 point Gauss-Kronrod rules respectively. It returns an array with the result, an estimate of the absolute error and an error flag. =for usage Usage: ($res,$abserr,$ierr) = gslinteg_qag($function_ref,$la,$lb,$epsrel, $epsabs,$limit,$key,[{Warn => $warn}]); =for example Example: my ($res,$abserr,$ierr) = gslinteg_qag(\&f,0,1,0,1e-10,1000,1); # with warnings on my ($res,$abserr,$ierr) = gslinteg_qag(\&f,0,1,0,1e-10,1000,1,{Warn => 'y'}); sub f{ my ($x) = @_; return ($x**2.6)*log(1.0/$x); } =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub gslinteg_qag { my $opt = ref($_[-1]) eq 'HASH' ? pop @_ : {Warn => 'n'}; my $warn = $$opt{Warn}=~/y/i ? 1 : 0; my ($f,$la,$lb,$epsabs,$epsrel,$limit,$key) = @_; barf 'Usage: gslinteg_qag($function_ref,$la,$lb,$epsabs,$epsrel,$limit,$key,[opt]) ' unless ($#_ == 6); $_ = PDL->null for my ($res,$abserr,$ierr); _gslinteg_qag_int($la,$lb,$epsabs,$epsrel,$limit,$key,$limit,$warn,$res,$abserr,$ierr,$f); return ($res,$abserr,$ierr); } *gslinteg_qag = \&PDL::GSL::INTEG::gslinteg_qag; =head2 gslinteg_qags =for sig Signature: (a(); b(); epsabs(); epsrel(); int limit(); int n(); int gslwarn(); [o] result(); [o] abserr(); int [o] ierr();; SV* function) Types: (double) =for ref Adaptive integration with singularities This function applies the Gauss-Kronrod 21-point integration rule adaptively until an estimate of the integral of f over ($la,$lb) is achieved within the desired absolute and relative error limits, $epsabs and $epsrel. The algorithm is such that it accelerates the convergence of the integral in the presence of discontinuities and integrable singularities. The maximum number of allowed subdivisions done by the adaptive algorithm must be supplied in the parameter $limit. =for usage Usage: ($res,$abserr,$ierr) = gslinteg_qags($function_ref,$la,$lb,$epsrel, $epsabs,$limit,[{Warn => $warn}]); =for example Example: my ($res,$abserr,$ierr) = gslinteg_qags(\&f,0,1,0,1e-10,1000); # with warnings on ($res,$abserr,$ierr) = gslinteg_qags(\&f,0,1,0,1e-10,1000,{Warn => 'y'}); sub f{ my ($x) = @_; return ($x)*log(1.0/$x); } =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub gslinteg_qags{ my $opt = ref($_[-1]) eq 'HASH' ? pop @_ : {Warn => 'n'}; my $warn = $$opt{Warn}=~/y/i ? 1 : 0; my ($f,$la,$lb,$epsabs,$epsrel,$limit) = @_; barf 'Usage: gslinteg_qags($function_ref,$la,$lb,$epsabs,$epsrel,$limit,[opt]) ' unless ($#_ == 5); $_ = PDL->null for my ($res,$abserr,$ierr); _gslinteg_qags_int($la,$lb,$epsabs,$epsrel,$limit,$limit,$warn,$res,$abserr,$ierr,$f); return ($res,$abserr,$ierr); } *gslinteg_qags = \&PDL::GSL::INTEG::gslinteg_qags; =head2 gslinteg_qagp =for sig Signature: (pts(l); epsabs(); epsrel();int limit();int n();int gslwarn(); [o] result(); [o] abserr();int [o] ierr();; SV* function) Types: (double) =for ref Adaptive integration with known singular points This function applies the adaptive integration algorithm used by gslinteg_qags taking into account the location of singular points until an estimate of the integral of f over ($la,$lb) is achieved within the desired absolute and relative error limits, $epsabs and $epsrel. Singular points are supplied in the ndarray $points, whose endpoints determine the integration range. So, for example, if the function has singular points at x_1 and x_2 and the integral is desired from a to b (a < x_1 < x_2 < b), $points = pdl(a,x_1,x_2,b). The maximum number of allowed subdivisions done by the adaptive algorithm must be supplied in the parameter $limit. =for usage Usage: ($res,$abserr,$ierr) = gslinteg_qagp($function_ref,$points,$epsabs, $epsrel,$limit,[{Warn => $warn}]) =for example Example: my $points = pdl(0,1,sqrt(2),3); my ($res,$abserr,$ierr) = gslinteg_qagp(\&f,$points,0,1e-3,1000); # with warnings on ($res,$abserr,$ierr) = gslinteg_qagp(\&f,$points,0,1e-3,1000,{Warn => 'y'}); sub f{ my ($x) = @_; my $x2 = $x**2; my $x3 = $x**3; return $x3 * log(abs(($x2-1.0)*($x2-2.0))); } =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub gslinteg_qagp{ my $opt = ref($_[-1]) eq 'HASH' ? pop @_ : {Warn => 'n'}; my $warn = $$opt{Warn}=~/y/i ? 1 : 0; my ($f,$points,$epsabs,$epsrel,$limit) = @_; barf 'Usage: gslinteg_qagp($function_ref,$points,$epsabs,$epsrel,$limit,[opt]) ' unless ($#_ == 4); $_ = PDL->null for my ($res,$abserr,$ierr); _gslinteg_qagp_int($points,$epsabs,$epsrel,$limit,$limit,$warn,$res,$abserr,$ierr,$f); return ($res,$abserr,$ierr); } *gslinteg_qagp = \&PDL::GSL::INTEG::gslinteg_qagp; =head2 gslinteg_qagi =for sig Signature: (epsabs(); epsrel(); int limit(); int n();int gslwarn(); [o] result(); [o] abserr(); int [o] ierr();; SV* function) Types: (double) =for ref Adaptive integration on infinite interval This function estimates the integral of the function f over the infinite interval (-\infty,+\infty) within the desired absolute and relative error limits, $epsabs and $epsrel. After a transformation, the algorithm of gslinteg_qags with a 15-point Gauss-Kronrod rule is used. The maximum number of allowed subdivisions done by the adaptive algorithm must be supplied in the parameter $limit. =for usage Usage: ($res,$abserr,$ierr) = gslinteg_qagi($function_ref,$epsabs, $epsrel,$limit,[{Warn => $warn}]); =for example Example: my ($res,$abserr,$ierr) = gslinteg_qagi(\&myfn,1e-7,0,1000); # with warnings on ($res,$abserr,$ierr) = gslinteg_qagi(\&myfn,1e-7,0,1000,{Warn => 'y'}); sub myfn{ my ($x) = @_; return exp(-$x - $x*$x) ; } =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub gslinteg_qagi { my $opt = ref($_[-1]) eq 'HASH' ? pop @_ : {Warn => 'n'}; my $warn = $$opt{Warn}=~/y/i ? 1 : 0; my ($f,$epsabs,$epsrel,$limit) = @_; barf 'Usage: gslinteg_qagi($function_ref,$epsabs,$epsrel,$limit,[opt])' unless ($#_ == 3); $_ = PDL->null for my ($res,$abserr,$ierr); _gslinteg_qagi_int($epsabs,$epsrel,$limit,$limit,$warn,$res,$abserr,$ierr,$f); return ($res,$abserr,$ierr); } *gslinteg_qagi = \&PDL::GSL::INTEG::gslinteg_qagi; =head2 gslinteg_qagiu =for sig Signature: (a(); epsabs(); epsrel();int limit();int n();int gslwarn(); [o] result(); [o] abserr();int [o] ierr();; SV* function) Types: (double) =for ref Adaptive integration on infinite interval This function estimates the integral of the function f over the infinite interval (la,+\infty) within the desired absolute and relative error limits, $epsabs and $epsrel. After a transformation, the algorithm of gslinteg_qags with a 15-point Gauss-Kronrod rule is used. The maximum number of allowed subdivisions done by the adaptive algorithm must be supplied in the parameter $limit. =for usage Usage: ($res,$abserr,$ierr) = gslinteg_qagiu($function_ref,$la,$epsabs, $epsrel,$limit,[{Warn => $warn}]); =for example Example: my $alfa = 1; my ($res,$abserr,$ierr) = gslinteg_qagiu(\&f,99.9,1e-7,0,1000); # with warnings on ($res,$abserr,$ierr) = gslinteg_qagiu(\&f,99.9,1e-7,0,1000,{Warn => 'y'}); sub f{ my ($x) = @_; if (($x==0) && ($alfa == 1)) {return 1;} if (($x==0) && ($alfa > 1)) {return 0;} return ($x**($alfa-1))/((1+10*$x)**2); } =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub gslinteg_qagiu{ my $opt = ref($_[-1]) eq 'HASH' ? pop @_ : {Warn => 'n'}; my $warn = $$opt{Warn}=~/y/i ? 1 : 0; my ($f,$la,$epsabs,$epsrel,$limit) = @_; barf 'Usage: gslinteg_qagiu($function_ref,$la,$epsabs,$epsrel,$limit,[opt])' unless ($#_ == 4); $_ = PDL->null for my ($res,$abserr,$ierr); _gslinteg_qagiu_int($la,$epsabs,$epsrel,$limit,$limit,$warn,$res,$abserr,$ierr,$f); return ($res,$abserr,$ierr); } *gslinteg_qagiu = \&PDL::GSL::INTEG::gslinteg_qagiu; =head2 gslinteg_qagil =for sig Signature: (b(); epsabs(); epsrel();int limit();int n();int gslwarn(); [o] result(); [o] abserr();int [o] ierr();; SV* function) Types: (double) =for ref Adaptive integration on infinite interval This function estimates the integral of the function f over the infinite interval (-\infty,lb) within the desired absolute and relative error limits, $epsabs and $epsrel. After a transformation, the algorithm of gslinteg_qags with a 15-point Gauss-Kronrod rule is used. The maximum number of allowed subdivisions done by the adaptive algorithm must be supplied in the parameter $limit. =for usage Usage: ($res,$abserr,$ierr) = gslinteg_qagl($function_ref,$lb,$epsabs, $epsrel,$limit,[{Warn => $warn}]); =for example Example: my ($res,$abserr,$ierr) = gslinteg_qagil(\&myfn,1.0,1e-7,0,1000); # with warnings on ($res,$abserr,$ierr) = gslinteg_qagil(\&myfn,1.0,1e-7,0,1000,{Warn => 'y'}); sub myfn{ my ($x) = @_; return exp($x); } =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub gslinteg_qagil{ my $opt = ref($_[-1]) eq 'HASH' ? pop @_ : {Warn => 'n'}; my $warn = $$opt{Warn}=~/y/i ? 1 : 0; my ($f,$lb,$epsabs,$epsrel,$limit) = @_; barf 'Usage: gslinteg_qagil($function_ref,$lb,$epsabs,$epsrel,$limit,[opt])' unless ($#_ == 4); $_ = PDL->null for my ($res,$abserr,$ierr); _gslinteg_qagil_int($lb,$epsabs,$epsrel,$limit,$limit,$warn,$res,$abserr,$ierr,$f); return ($res,$abserr,$ierr); } *gslinteg_qagil = \&PDL::GSL::INTEG::gslinteg_qagil; =head2 gslinteg_qawc =for sig Signature: (a(); b(); c(); epsabs(); epsrel();int limit();int n();int gslwarn(); [o] result(); [o] abserr();int [o] ierr();; SV* function) Types: (double) =for ref Adaptive integration for Cauchy principal values This function computes the Cauchy principal value of the integral of f over (la,lb), with a singularity at c, I = \int_{la}^{lb} dx f(x)/(x - c). The integral is estimated within the desired absolute and relative error limits, $epsabs and $epsrel. The maximum number of allowed subdivisions done by the adaptive algorithm must be supplied in the parameter $limit. =for usage Usage: ($res,$abserr,$ierr) = gslinteg_qawc($function_ref,$la,$lb,$c,$epsabs,$epsrel,$limit) =for example Example: my ($res,$abserr,$ierr) = gslinteg_qawc(\&f,-1,5,0,0,1e-3,1000); # with warnings on ($res,$abserr,$ierr) = gslinteg_qawc(\&f,-1,5,0,0,1e-3,1000,{Warn => 'y'}); sub f{ my ($x) = @_; return 1.0 / (5.0 * $x * $x * $x + 6.0) ; } =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub gslinteg_qawc{ my $opt = ref($_[-1]) eq 'HASH' ? pop @_ : {Warn => 'n'}; my $warn = $$opt{Warn}=~/y/i ? 1 : 0; my ($f,$la,$lb,$c,$epsabs,$epsrel,$limit) = @_; barf 'Usage: gslinteg_qawc($function_ref,$la,$lb,$c,$epsabs,$epsrel,$limit,[opt])' unless ($#_ == 6); $_ = PDL->null for my ($res,$abserr,$ierr); _gslinteg_qawc_int($la,$lb,$c,$epsabs,$epsrel,$limit,$limit,$warn,$res,$abserr,$ierr,$f); return ($res,$abserr,$ierr); } *gslinteg_qawc = \&PDL::GSL::INTEG::gslinteg_qawc; =head2 gslinteg_qaws =for sig Signature: (a(); b(); epsabs(); epsrel();int limit(); int n(); alpha(); beta(); int mu(); int nu(); int gslwarn(); [o] result(); [o] abserr(); int [o] ierr();; SV* function) Types: (double) =for ref Adaptive integration for singular functions The algorithm in gslinteg_qaws is designed for integrands with algebraic-logarithmic singularities at the end-points of an integration region. Specifically, this function computes the integral given by I = \int_{la}^{lb} dx f(x) (x-la)^alpha (lb-x)^beta log^mu (x-la) log^nu (lb-x). The integral is estimated within the desired absolute and relative error limits, $epsabs and $epsrel. The maximum number of allowed subdivisions done by the adaptive algorithm must be supplied in the parameter $limit. =for usage Usage: ($res,$abserr,$ierr) = gslinteg_qaws($function_ref,$alpha,$beta,$mu,$nu,$la,$lb, $epsabs,$epsrel,$limit,[{Warn => $warn}]); =for example Example: my ($res,$abserr,$ierr) = gslinteg_qaws(\&f,0,0,1,0,0,1,0,1e-7,1000); # with warnings on ($res,$abserr,$ierr) = gslinteg_qaws(\&f,0,0,1,0,0,1,0,1e-7,1000,{Warn => 'y'}); sub f{ my ($x) = @_; if($x==0){return 0;} else{ my $u = log($x); my $v = 1 + $u*$u; return 1.0/($v*$v); } } =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub gslinteg_qaws{ my $opt = ref($_[-1]) eq 'HASH' ? pop @_ : {Warn => 'n'}; my $warn = $$opt{Warn}=~/y/i ? 1 : 0; my ($f,$alpha,$beta,$mu,$nu,$la,$lb,$epsabs,$epsrel,$limit) = @_; barf 'Usage: gslinteg_qaws($function_ref,$alpha,$beta,$mu,$nu,$la,$lb,$epsabs,$epsrel,$limit,[opt])' unless ($#_ == 9); $_ = PDL->null for my ($res,$abserr,$ierr); _gslinteg_qaws_int($la,$lb,$epsabs,$epsrel,$limit,$limit,$alpha,$beta,$mu,$nu,$warn,$res,$abserr,$ierr,$f); return ($res,$abserr,$ierr); } *gslinteg_qaws = \&PDL::GSL::INTEG::gslinteg_qaws; =head2 gslinteg_qawo =for sig Signature: (a(); b(); epsabs(); epsrel();int limit();int n(); int sincosopt(); omega(); L(); int nlevels();int gslwarn(); [o] result(); [o] abserr();int [o] ierr();; SV* function) Types: (double) =for ref Adaptive integration for oscillatory functions This function uses an adaptive algorithm to compute the integral of f over (la,lb) with the weight function sin(omega*x) or cos(omega*x) -- which of sine or cosine is used is determined by the parameter $opt ('cos' or 'sin'). The integral is estimated within the desired absolute and relative error limits, $epsabs and $epsrel. The maximum number of allowed subdivisions done by the adaptive algorithm must be supplied in the parameter $limit. =for usage Usage: ($res,$abserr,$ierr) = gslinteg_qawo($function_ref,$omega,$sin_or_cos, $la,$lb,$epsabs,$epsrel,$limit,[opt]) =for example Example: my $PI = 3.14159265358979323846264338328; my ($res,$abserr,$ierr) = PDL::GSL::INTEG::gslinteg_qawo(\&f,10*$PI,'sin',0,1,0,1e-7,1000); # with warnings on ($res,$abserr,$ierr) = PDL::GSL::INTEG::gslinteg_qawo(\&f,10*$PI,'sin',0,1,0,1e-7,1000,{Warn => 'y'}); sub f{ my ($x) = @_; if($x==0){return 0;} else{ return log($x);} } =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub gslinteg_qawo{ my $opt = ref($_[-1]) eq 'HASH' ? pop @_ : {Warn => 'n'}; my $warn = $$opt{Warn}=~/y/i ? 1 : 0; my ($f,$omega,$sincosopt,$la,$lb,$epsabs,$epsrel,$limit) = @_; barf 'Usage: gslinteg_qawo($function_ref,$omega,$sin_or_cos,$la,$lb,$epsabs,$epsrel,$limit,[opt])' unless ($#_ == 7); my $OPTION_SIN_COS; if($sincosopt=~/cos/i){ $OPTION_SIN_COS = 0;} elsif($sincosopt=~/sin/i){ $OPTION_SIN_COS = 1;} else { barf("Error in argument 3 of function gslinteg_qawo: specify 'cos' or 'sin'\n");} my $L = $lb - $la; my $nlevels = $limit; $_ = PDL->null for my ($res,$abserr,$ierr); _gslinteg_qawo_int($la,$lb,$epsabs,$epsrel,$limit,$limit,$OPTION_SIN_COS,$omega,$L,$nlevels,$warn,$res,$abserr,$ierr,$f); return ($res,$abserr,$ierr); } *gslinteg_qawo = \&PDL::GSL::INTEG::gslinteg_qawo; =head2 gslinteg_qawf =for sig Signature: (a(); epsabs();int limit();int n(); int sincosopt(); omega(); int nlevels();int gslwarn(); [o] result(); [o] abserr();int [o] ierr();; SV* function) Types: (double) =for ref Adaptive integration for Fourier integrals This function attempts to compute a Fourier integral of the function f over the semi-infinite interval [la,+\infty). Specifically, it attempts tp compute I = \int_{la}^{+\infty} dx f(x)w(x), where w(x) is sin(omega*x) or cos(omega*x) -- which of sine or cosine is used is determined by the parameter $opt ('cos' or 'sin'). The integral is estimated within the desired absolute error limit $epsabs. The maximum number of allowed subdivisions done by the adaptive algorithm must be supplied in the parameter $limit. =for usage Usage: gslinteg_qawf($function_ref,$omega,$sin_or_cos,$la,$epsabs,$limit,[opt]) =for example Example: my ($res,$abserr,$ierr) = gslinteg_qawf(\&f,$PI/2.0,'cos',0,1e-7,1000); # with warnings on ($res,$abserr,$ierr) = gslinteg_qawf(\&f,$PI/2.0,'cos',0,1e-7,1000,{Warn => 'y'}); sub f{ my ($x) = @_; if ($x == 0){return 0;} return 1.0/sqrt($x) } =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub gslinteg_qawf{ my $opt = ref($_[-1]) eq 'HASH' ? pop @_ : {Warn => 'n'}; my $warn = $$opt{Warn}=~/y/i ? 1 : 0; my ($f,$omega,$sincosopt,$la,$epsabs,$limit) = @_; barf 'Usage: gslinteg_qawf($function_ref,$omega,$sin_or_cos,$la,$epsabs,$limit,[opt])' unless ($#_ == 5); my $OPTION_SIN_COS; if($sincosopt=~/cos/i){ $OPTION_SIN_COS = 0;} elsif($sincosopt=~/sin/i){ $OPTION_SIN_COS = 1;} else { barf("Error in argument 3 of function gslinteg_qawf: specify 'cos' or 'sin'\n");} my $nlevels = $limit; $_ = PDL->null for my ($res,$abserr,$ierr); _gslinteg_qawf_int($la,$epsabs,$limit,$limit,$OPTION_SIN_COS,$omega,$nlevels,$warn,$res,$abserr,$ierr,$f); return ($res,$abserr,$ierr); } *gslinteg_qawf = \&PDL::GSL::INTEG::gslinteg_qawf; #line 114 "lib/PDL/GSL/INTEG.pd" =head1 BUGS Feedback is welcome. Log bugs in the PDL bug database (the database is always linked from L). =head1 SEE ALSO L The GSL documentation for numerical integration is online at L =head1 AUTHOR This file copyright (C) 2003,2005 Andres Jordan All rights reserved. There is no warranty. You are allowed to redistribute this software documentation under certain conditions. For details, see the file COPYING in the PDL distribution. If this file is separated from the PDL distribution, the copyright notice should be included in the file. The GSL integration routines were written by Brian Gough. QUADPACK was written by Piessens, Doncker-Kapenga, Uberhuber and Kahaner. =cut #line 1020 "lib/PDL/GSL/INTEG.pm" # Exit with OK status 1; PDL-GSL-2.103/GENERATED/PDL/GSL/MROOT.pm0000644000175000017500000000766015160062237016322 0ustar osboxesosboxes# # GENERATED WITH PDL::PP from lib/PDL/GSL/MROOT.pd! Don't modify! # package PDL::GSL::MROOT; our @EXPORT_OK = qw(gslmroot_fsolver gslmroot_fsolver ); our %EXPORT_TAGS = (Func=>\@EXPORT_OK); use PDL::Core; use PDL::Exporter; use DynaLoader; our @ISA = ( 'PDL::Exporter','DynaLoader' ); push @PDL::Core::PP, __PACKAGE__; bootstrap PDL::GSL::MROOT ; #line 72 "lib/PDL/GSL/MROOT.pd" use strict; use warnings; =head1 NAME PDL::GSL::MROOT - PDL interface to multidimensional root-finding routines in GSL =head1 DESCRIPTION This is an interface to the multidimensional root-finding package present in the GNU Scientific Library. At the moment there is a single function B which provides an interface to the algorithms in the GSL library that do not use derivatives. =head1 SYNOPSIS use PDL; use PDL::GSL::MROOT; my $init = pdl (-10.00, -5.0); my $epsabs = 1e-7; $res = gslmroot_fsolver($init, \&rosenbrock, {Method => 0, EpsAbs => $epsabs}); sub rosenbrock{ my ($x) = @_; my $c = 1; my $d = 10; my $y = zeroes($x); my $y0 = $y->slice(0); $y0 .= $c * (1 - $x->slice(0)); my $y1 = $y->slice(1); $y1 .= $d * ($x->slice(1) - $x->slice(0)**2); return $y; } #line 69 "lib/PDL/GSL/MROOT.pm" =head1 FUNCTIONS =cut =head2 gslmroot_fsolver =for sig Signature: (double [io]xfree(n); double epsabs(); int method(); SV* function1) Types: (sbyte byte short ushort long ulong indx ulonglong longlong float double ldouble) =for ref Multidimensional root finder without using derivatives This function provides an interface to the multidimensional root finding algorithms in the GSL library. It takes a minimum of two arguments: an ndarray $init with an initial guess for the roots of the system and a reference to a function. The latter function must return an ndarray whose i-th element is the i-th equation evaluated at the vector x (an ndarray which is the sole input to this function). See the example in the Synopsis above for an illustration. The function returns an ndarray with the roots for the system of equations. Two optional arguments can be specified as shown below. One is B, which can take the values 0,1,2,3. They correspond to the 'hybrids', 'hybrid', 'dnewton' and 'broyden' algorithms respectively (see GSL documentation for details). The other optional argument is B, which sets the absolute accuracy to which the roots of the system of equations are required. The default value for Method is 0 ('hybrids' algorithm) and the default for Epsabs is 1e-3. =for usage $res = gslmroot_fsolver($init, $function_ref, [{Method => $method, Epsabs => $epsabs}]); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub gslmroot_fsolver { my ($x, $f_vect) = @_; my $opt = ref($_[-1]) eq 'HASH' ? pop @_ : {Method => 0, EpsAbs => 1e-3}; if( (ref($x) ne 'PDL')){ barf("Have to pass ndarray as first argument to fsolver\n"); } my $res = $x->copy; _gslmroot_fsolver_int($res, $$opt{'EpsAbs'}, $$opt{'Method'}, $f_vect); return $res; } *gslmroot_fsolver = \&PDL::GSL::MROOT::gslmroot_fsolver; #line 118 "lib/PDL/GSL/MROOT.pd" =head1 SEE ALSO L The GSL documentation is online at http://www.gnu.org/software/gsl/manual/ =head1 AUTHOR This file copyright (C) 2006 Andres Jordan and Simon Casassus All rights reserved. There is no warranty. You are allowed to redistribute this software/documentation under certain conditions. For details, see the file COPYING in the PDL distribution. If this file is separated from the PDL distribution, the copyright notice should be included in the file. =cut #line 168 "lib/PDL/GSL/MROOT.pm" # Exit with OK status 1; PDL-GSL-2.103/GENERATED/PDL/GSL/DIFF.pm0000644000175000017500000000744015160062237016126 0ustar osboxesosboxes# # GENERATED WITH PDL::PP from lib/PDL/GSL/DIFF.pd! Don't modify! # package PDL::GSL::DIFF; our @EXPORT_OK = qw(gsldiff diff_central diff_backward diff_forward ); our %EXPORT_TAGS = (Func=>\@EXPORT_OK); use PDL::Core; use PDL::Exporter; use DynaLoader; our @ISA = ( 'PDL::Exporter','DynaLoader' ); push @PDL::Core::PP, __PACKAGE__; bootstrap PDL::GSL::DIFF ; #line 8 "lib/PDL/GSL/DIFF.pd" use strict; use warnings; =head1 NAME PDL::GSL::DIFF - PDL interface to numerical differentiation routines in GSL =head1 DESCRIPTION This is an interface to the numerical differentiation package present in the GNU Scientific Library. =head1 SYNOPSIS use PDL; use PDL::GSL::DIFF; my $x0 = 3.3; my @res = gsldiff(\&myfunction,$x0); # same as above: @res = gsldiff(\&myfunction,$x0,{Method => 'central'}); # use only values greater than $x0 to get the derivative @res = gsldiff(\&myfunction,$x0,{Method => 'forward'}); # use only values smaller than $x0 to get the derivative @res = gsldiff(\&myfunction,$x0,{Method => 'backward'}); sub myfunction{ my ($x) = @_; return $x**2; } =cut #line 125 "lib/PDL/GSL/DIFF.pd" sub gsldiff{ my $opt; if (ref($_[$#_]) eq 'HASH'){ $opt = pop @_; } else{ $opt = {Method => 'central'}; } die 'Usage: gsldiff(function_ref, x, {Options} )' if $#_<1 || $#_>2; my ($f,$x) = @_; my ($res,$abserr); if($$opt{Method}=~/cent/i){ ($res,$abserr) = PDL::GSL::DIFF::diff_central($x,$f); } elsif($$opt{Method}=~/back/i){ ($res,$abserr) = PDL::GSL::DIFF::diff_backward($x,$f); } elsif($$opt{Method}=~/forw/i){ ($res,$abserr) = PDL::GSL::DIFF::diff_forward($x,$f); } else{ barf("Unknown differentiation method $$opt{Method} in gsldiff\n"); } return ($res,$abserr); } #line 88 "lib/PDL/GSL/DIFF.pm" *diff_central = \&PDL::diff_central; *diff_backward = \&PDL::diff_backward; *diff_forward = \&PDL::diff_forward; #line 47 "lib/PDL/GSL/DIFF.pd" =head2 gsldiff =for ref This functions serves as an interface to the three differentiation functions present in GSL: gsl_diff_central, gsl_diff_backward and gsl_diff_forward. To compute the derivative, the central method uses values greater and smaller than the point at which the derivative is to be evaluated, while backward and forward use only values smaller and greater respectively. gsldiff() returns both the derivative and an absolute error estimate. The default method is 'central', others can be specified by passing an option. Please check the GSL documentation for more information. =for usage Usage: ($d,$abserr) = gsldiff($function_ref,$x,{Method => $method}); =for example Example: #derivative using default method ('central') ($d,$abserr) = gsldiff(\&myf,3.3); #same as above with method set explicitly ($d,$abserr) = gsldiff(\&myf,3.3,{Method => 'central'}); #using backward & forward methods ($d,$abserr) = gsldiff(\&myf,3.3,{Method => 'backward'}); ($d,$abserr) = gsldiff(\&myf,3.3,{Method => 'forward'}); sub myf{ my ($x) = @_; return exp($x); } =head1 BUGS Feedback is welcome. Log bugs in the PDL bug database (the database is always linked from L). =head1 SEE ALSO L The GSL documentation is online at http://www.gnu.org/software/gsl/manual/ =head1 AUTHOR This file copyright (C) 2003 Andres Jordan All rights reserved. There is no warranty. You are allowed to redistribute this software documentation under certain conditions. For details, see the file COPYING in the PDL distribution. If this file is separated from the PDL distribution, the copyright notice should be included in the file. The GSL differentiation routines were written by David Morrison. =cut #line 174 "lib/PDL/GSL/DIFF.pm" # Exit with OK status 1; PDL-GSL-2.103/GENERATED/PDL/GSL/SF.pm0000644000175000017500000033030415160062241015717 0ustar osboxesosboxes# # GENERATED WITH PDL::PP from lib/PDL/GSL/SF.pd! Don't modify! # package PDL::GSL::SF; our @EXPORT_OK = qw(gsl_sf_airy_Ai gsl_sf_airy_Bi gsl_sf_airy_Ai_scaled gsl_sf_airy_Bi_scaled gsl_sf_airy_Ai_deriv gsl_sf_airy_Bi_deriv gsl_sf_airy_Ai_deriv_scaled gsl_sf_airy_Bi_deriv_scaled gsl_sf_bessel_Jn gsl_sf_bessel_Jn_array gsl_sf_bessel_Yn gsl_sf_bessel_Yn_array gsl_sf_bessel_In gsl_sf_bessel_I_array gsl_sf_bessel_In_scaled gsl_sf_bessel_In_scaled_array gsl_sf_bessel_Kn gsl_sf_bessel_K_array gsl_sf_bessel_Kn_scaled gsl_sf_bessel_Kn_scaled_array gsl_sf_bessel_jl gsl_sf_bessel_jl_array gsl_sf_bessel_yl gsl_sf_bessel_yl_array gsl_sf_bessel_il_scaled gsl_sf_bessel_il_scaled_array gsl_sf_bessel_kl_scaled gsl_sf_bessel_kl_scaled_array gsl_sf_bessel_Jnu gsl_sf_bessel_Ynu gsl_sf_bessel_Inu_scaled gsl_sf_bessel_Inu gsl_sf_bessel_Knu_scaled gsl_sf_bessel_Knu gsl_sf_bessel_lnKnu gsl_sf_clausen gsl_sf_hydrogenicR gsl_sf_coulomb_wave_FGp_array gsl_sf_coulomb_wave_sphF_array gsl_sf_coulomb_CL_e gsl_sf_coupling_3j gsl_sf_coupling_6j gsl_sf_coupling_9j gsl_sf_dawson gsl_sf_debye_1 gsl_sf_debye_2 gsl_sf_debye_3 gsl_sf_debye_4 gsl_sf_dilog gsl_sf_complex_dilog gsl_sf_multiply gsl_sf_multiply_err gsl_sf_ellint_Kcomp gsl_sf_ellint_Ecomp gsl_sf_ellint_F gsl_sf_ellint_E gsl_sf_ellint_P gsl_sf_ellint_D gsl_sf_ellint_RC gsl_sf_ellint_RD gsl_sf_ellint_RF gsl_sf_ellint_RJ gsl_sf_elljac gsl_sf_erfc gsl_sf_log_erfc gsl_sf_erf gsl_sf_erf_Z gsl_sf_erf_Q gsl_sf_exp gsl_sf_exprel_n gsl_sf_exp_err gsl_sf_expint_E1 gsl_sf_expint_E2 gsl_sf_expint_Ei gsl_sf_Shi gsl_sf_Chi gsl_sf_expint_3 gsl_sf_Si gsl_sf_Ci gsl_sf_atanint gsl_sf_fermi_dirac_int gsl_sf_fermi_dirac_mhalf gsl_sf_fermi_dirac_half gsl_sf_fermi_dirac_3half gsl_sf_fermi_dirac_inc_0 gsl_sf_lngamma gsl_sf_gamma gsl_sf_gammastar gsl_sf_gammainv gsl_sf_lngamma_complex gsl_sf_taylorcoeff gsl_sf_fact gsl_sf_doublefact gsl_sf_lnfact gsl_sf_lndoublefact gsl_sf_lnchoose gsl_sf_choose gsl_sf_lnpoch gsl_sf_poch gsl_sf_pochrel gsl_sf_gamma_inc_Q gsl_sf_gamma_inc_P gsl_sf_lnbeta gsl_sf_beta gsl_sf_gegenpoly_n gsl_sf_gegenpoly_array gsl_sf_hyperg_0F1 gsl_sf_hyperg_1F1 gsl_sf_hyperg_U gsl_sf_hyperg_2F1 gsl_sf_hyperg_2F1_conj gsl_sf_hyperg_2F1_renorm gsl_sf_hyperg_2F1_conj_renorm gsl_sf_hyperg_2F0 gsl_sf_laguerre_n gsl_sf_legendre_Pl gsl_sf_legendre_Pl_array gsl_sf_legendre_Ql gsl_sf_legendre_Plm gsl_sf_legendre_array gsl_sf_legendre_array_index gsl_sf_legendre_sphPlm gsl_sf_conicalP_half gsl_sf_conicalP_mhalf gsl_sf_conicalP_0 gsl_sf_conicalP_1 gsl_sf_conicalP_sph_reg gsl_sf_conicalP_cyl_reg_e gsl_sf_legendre_H3d gsl_sf_legendre_H3d_array gsl_sf_log gsl_sf_complex_log gsl_poly_eval gsl_sf_pow_int gsl_sf_psi gsl_sf_psi_1piy gsl_sf_psi_n gsl_sf_synchrotron_1 gsl_sf_synchrotron_2 gsl_sf_transport_2 gsl_sf_transport_3 gsl_sf_transport_4 gsl_sf_transport_5 gsl_sf_sin gsl_sf_cos gsl_sf_hypot gsl_sf_complex_sin gsl_sf_complex_cos gsl_sf_complex_logsin gsl_sf_lnsinh gsl_sf_lncosh gsl_sf_polar_to_rect gsl_sf_rect_to_polar gsl_sf_angle_restrict_symm gsl_sf_angle_restrict_pos gsl_sf_sin_err gsl_sf_cos_err gsl_sf_zeta gsl_sf_hzeta gsl_sf_eta ); our %EXPORT_TAGS = (Func=>\@EXPORT_OK); use PDL::Core; use PDL::Exporter; use DynaLoader; our @ISA = ( 'PDL::Exporter','DynaLoader' ); push @PDL::Core::PP, __PACKAGE__; bootstrap PDL::GSL::SF ; #line 4 "lib/PDL/GSL/SF.pd" use strict; use warnings; =head1 NAME PDL::GSL::SF - PDL interface to GSL Special Functions =head1 DESCRIPTION This is an interface to the Special Function package present in the GNU Scientific Library. =cut #line 41 "lib/PDL/GSL/SF.pm" =head1 FUNCTIONS =cut =head2 gsl_sf_airy_Ai =for sig Signature: (double x(); double [o]y(); double [o]e()) Types: (double) =for usage ($y, $e) = gsl_sf_airy_Ai($x); gsl_sf_airy_Ai($x, $y, $e); # all arguments given ($y, $e) = $x->gsl_sf_airy_Ai; # method call $x->gsl_sf_airy_Ai($y, $e); =for ref Airy Function Ai(x). =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_airy_Ai = \&PDL::gsl_sf_airy_Ai; =head2 gsl_sf_airy_Bi =for sig Signature: (double x(); double [o]y(); double [o]e()) Types: (double) =for usage ($y, $e) = gsl_sf_airy_Bi($x); gsl_sf_airy_Bi($x, $y, $e); # all arguments given ($y, $e) = $x->gsl_sf_airy_Bi; # method call $x->gsl_sf_airy_Bi($y, $e); =for ref Airy Function Bi(x). =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_airy_Bi = \&PDL::gsl_sf_airy_Bi; =head2 gsl_sf_airy_Ai_scaled =for sig Signature: (double x(); double [o]y(); double [o]e()) Types: (double) =for usage ($y, $e) = gsl_sf_airy_Ai_scaled($x); gsl_sf_airy_Ai_scaled($x, $y, $e); # all arguments given ($y, $e) = $x->gsl_sf_airy_Ai_scaled; # method call $x->gsl_sf_airy_Ai_scaled($y, $e); =for ref Scaled Airy Function Ai(x). Ai(x) for x < 0 and exp(+2/3 x^{3/2}) Ai(x) for x > 0. =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_airy_Ai_scaled = \&PDL::gsl_sf_airy_Ai_scaled; =head2 gsl_sf_airy_Bi_scaled =for sig Signature: (double x(); double [o]y(); double [o]e()) Types: (double) =for usage ($y, $e) = gsl_sf_airy_Bi_scaled($x); gsl_sf_airy_Bi_scaled($x, $y, $e); # all arguments given ($y, $e) = $x->gsl_sf_airy_Bi_scaled; # method call $x->gsl_sf_airy_Bi_scaled($y, $e); =for ref Scaled Airy Function Bi(x). Bi(x) for x < 0 and exp(+2/3 x^{3/2}) Bi(x) for x > 0. =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_airy_Bi_scaled = \&PDL::gsl_sf_airy_Bi_scaled; =head2 gsl_sf_airy_Ai_deriv =for sig Signature: (double x(); double [o]y(); double [o]e()) Types: (double) =for usage ($y, $e) = gsl_sf_airy_Ai_deriv($x); gsl_sf_airy_Ai_deriv($x, $y, $e); # all arguments given ($y, $e) = $x->gsl_sf_airy_Ai_deriv; # method call $x->gsl_sf_airy_Ai_deriv($y, $e); =for ref Derivative Airy Function Ai`(x). =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_airy_Ai_deriv = \&PDL::gsl_sf_airy_Ai_deriv; =head2 gsl_sf_airy_Bi_deriv =for sig Signature: (double x(); double [o]y(); double [o]e()) Types: (double) =for usage ($y, $e) = gsl_sf_airy_Bi_deriv($x); gsl_sf_airy_Bi_deriv($x, $y, $e); # all arguments given ($y, $e) = $x->gsl_sf_airy_Bi_deriv; # method call $x->gsl_sf_airy_Bi_deriv($y, $e); =for ref Derivative Airy Function Bi`(x). =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_airy_Bi_deriv = \&PDL::gsl_sf_airy_Bi_deriv; =head2 gsl_sf_airy_Ai_deriv_scaled =for sig Signature: (double x(); double [o]y(); double [o]e()) Types: (double) =for usage ($y, $e) = gsl_sf_airy_Ai_deriv_scaled($x); gsl_sf_airy_Ai_deriv_scaled($x, $y, $e); # all arguments given ($y, $e) = $x->gsl_sf_airy_Ai_deriv_scaled; # method call $x->gsl_sf_airy_Ai_deriv_scaled($y, $e); =for ref Derivative Scaled Airy Function Ai(x). Ai`(x) for x < 0 and exp(+2/3 x^{3/2}) Ai`(x) for x > 0. =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_airy_Ai_deriv_scaled = \&PDL::gsl_sf_airy_Ai_deriv_scaled; =head2 gsl_sf_airy_Bi_deriv_scaled =for sig Signature: (double x(); double [o]y(); double [o]e()) Types: (double) =for usage ($y, $e) = gsl_sf_airy_Bi_deriv_scaled($x); gsl_sf_airy_Bi_deriv_scaled($x, $y, $e); # all arguments given ($y, $e) = $x->gsl_sf_airy_Bi_deriv_scaled; # method call $x->gsl_sf_airy_Bi_deriv_scaled($y, $e); =for ref Derivative Scaled Airy Function Bi(x). Bi`(x) for x < 0 and exp(+2/3 x^{3/2}) Bi`(x) for x > 0. =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_airy_Bi_deriv_scaled = \&PDL::gsl_sf_airy_Bi_deriv_scaled; =head2 gsl_sf_bessel_Jn =for sig Signature: (double x(); double [o]y(); double [o]e(); int n) Types: (double) =for usage ($y, $e) = gsl_sf_bessel_Jn($x, $n); gsl_sf_bessel_Jn($x, $y, $e, $n); # all arguments given ($y, $e) = $x->gsl_sf_bessel_Jn($n); # method call $x->gsl_sf_bessel_Jn($y, $e, $n); =for ref Regular Bessel Function J_n(x). =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_bessel_Jn = \&PDL::gsl_sf_bessel_Jn; =head2 gsl_sf_bessel_Jn_array =for sig Signature: (double x(); double [o]y(num); int s; IV n=>num) Types: (double) =for usage $y = gsl_sf_bessel_Jn_array($x, $s, $n); gsl_sf_bessel_Jn_array($x, $y, $s, $n); # all arguments given $y = $x->gsl_sf_bessel_Jn_array($s, $n); # method call $x->gsl_sf_bessel_Jn_array($y, $s, $n); =for ref Array of Regular Bessel Functions J_{s}(x) to J_{s+n-1}(x). =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_bessel_Jn_array = \&PDL::gsl_sf_bessel_Jn_array; =head2 gsl_sf_bessel_Yn =for sig Signature: (double x(); double [o]y(); double [o]e(); int n) Types: (double) =for usage ($y, $e) = gsl_sf_bessel_Yn($x, $n); gsl_sf_bessel_Yn($x, $y, $e, $n); # all arguments given ($y, $e) = $x->gsl_sf_bessel_Yn($n); # method call $x->gsl_sf_bessel_Yn($y, $e, $n); =for ref IrRegular Bessel Function Y_n(x). =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_bessel_Yn = \&PDL::gsl_sf_bessel_Yn; =head2 gsl_sf_bessel_Yn_array =for sig Signature: (double x(); double [o]y(num); int s; IV n=>num) Types: (double) =for usage $y = gsl_sf_bessel_Yn_array($x, $s, $n); gsl_sf_bessel_Yn_array($x, $y, $s, $n); # all arguments given $y = $x->gsl_sf_bessel_Yn_array($s, $n); # method call $x->gsl_sf_bessel_Yn_array($y, $s, $n); =for ref Array of Regular Bessel Functions Y_{s}(x) to Y_{s+n-1}(x). =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_bessel_Yn_array = \&PDL::gsl_sf_bessel_Yn_array; =head2 gsl_sf_bessel_In =for sig Signature: (double x(); double [o]y(); double [o]e(); int n) Types: (double) =for usage ($y, $e) = gsl_sf_bessel_In($x, $n); gsl_sf_bessel_In($x, $y, $e, $n); # all arguments given ($y, $e) = $x->gsl_sf_bessel_In($n); # method call $x->gsl_sf_bessel_In($y, $e, $n); =for ref Regular Modified Bessel Function I_n(x). =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_bessel_In = \&PDL::gsl_sf_bessel_In; =head2 gsl_sf_bessel_I_array =for sig Signature: (double x(); double [o]y(num); int s; IV n=>num) Types: (double) =for usage $y = gsl_sf_bessel_I_array($x, $s, $n); gsl_sf_bessel_I_array($x, $y, $s, $n); # all arguments given $y = $x->gsl_sf_bessel_I_array($s, $n); # method call $x->gsl_sf_bessel_I_array($y, $s, $n); =for ref Array of Regular Modified Bessel Functions I_{s}(x) to I_{s+n-1}(x). =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_bessel_I_array = \&PDL::gsl_sf_bessel_I_array; =head2 gsl_sf_bessel_In_scaled =for sig Signature: (double x(); double [o]y(); double [o]e(); int n) Types: (double) =for usage ($y, $e) = gsl_sf_bessel_In_scaled($x, $n); gsl_sf_bessel_In_scaled($x, $y, $e, $n); # all arguments given ($y, $e) = $x->gsl_sf_bessel_In_scaled($n); # method call $x->gsl_sf_bessel_In_scaled($y, $e, $n); =for ref Scaled Regular Modified Bessel Function exp(-|x|) I_n(x). =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_bessel_In_scaled = \&PDL::gsl_sf_bessel_In_scaled; =head2 gsl_sf_bessel_In_scaled_array =for sig Signature: (double x(); double [o]y(num); int s; IV n=>num) Types: (double) =for usage $y = gsl_sf_bessel_In_scaled_array($x, $s, $n); gsl_sf_bessel_In_scaled_array($x, $y, $s, $n); # all arguments given $y = $x->gsl_sf_bessel_In_scaled_array($s, $n); # method call $x->gsl_sf_bessel_In_scaled_array($y, $s, $n); =for ref Array of Scaled Regular Modified Bessel Functions exp(-|x|) I_{s}(x) to exp(-|x|) I_{s+n-1}(x). =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_bessel_In_scaled_array = \&PDL::gsl_sf_bessel_In_scaled_array; =head2 gsl_sf_bessel_Kn =for sig Signature: (double x(); double [o]y(); double [o]e(); int n) Types: (double) =for usage ($y, $e) = gsl_sf_bessel_Kn($x, $n); gsl_sf_bessel_Kn($x, $y, $e, $n); # all arguments given ($y, $e) = $x->gsl_sf_bessel_Kn($n); # method call $x->gsl_sf_bessel_Kn($y, $e, $n); =for ref IrRegular Modified Bessel Function K_n(x). =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_bessel_Kn = \&PDL::gsl_sf_bessel_Kn; =head2 gsl_sf_bessel_K_array =for sig Signature: (double x(); double [o]y(num); int s; IV n=>num) Types: (double) =for usage $y = gsl_sf_bessel_K_array($x, $s, $n); gsl_sf_bessel_K_array($x, $y, $s, $n); # all arguments given $y = $x->gsl_sf_bessel_K_array($s, $n); # method call $x->gsl_sf_bessel_K_array($y, $s, $n); =for ref Array of IrRegular Modified Bessel Functions K_{s}(x) to K_{s+n-1}(x). =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_bessel_K_array = \&PDL::gsl_sf_bessel_K_array; =head2 gsl_sf_bessel_Kn_scaled =for sig Signature: (double x(); double [o]y(); double [o]e(); int n) Types: (double) =for usage ($y, $e) = gsl_sf_bessel_Kn_scaled($x, $n); gsl_sf_bessel_Kn_scaled($x, $y, $e, $n); # all arguments given ($y, $e) = $x->gsl_sf_bessel_Kn_scaled($n); # method call $x->gsl_sf_bessel_Kn_scaled($y, $e, $n); =for ref Scaled IrRegular Modified Bessel Function exp(-|x|) K_n(x). =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_bessel_Kn_scaled = \&PDL::gsl_sf_bessel_Kn_scaled; =head2 gsl_sf_bessel_Kn_scaled_array =for sig Signature: (double x(); double [o]y(num); int s; IV n=>num) Types: (double) =for usage $y = gsl_sf_bessel_Kn_scaled_array($x, $s, $n); gsl_sf_bessel_Kn_scaled_array($x, $y, $s, $n); # all arguments given $y = $x->gsl_sf_bessel_Kn_scaled_array($s, $n); # method call $x->gsl_sf_bessel_Kn_scaled_array($y, $s, $n); =for ref Array of Scaled IrRegular Modified Bessel Functions exp(-|x|) K_{s}(x) to exp(-|x|) K_{s+n-1}(x). =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_bessel_Kn_scaled_array = \&PDL::gsl_sf_bessel_Kn_scaled_array; =head2 gsl_sf_bessel_jl =for sig Signature: (double x(); double [o]y(); double [o]e(); int n) Types: (double) =for usage ($y, $e) = gsl_sf_bessel_jl($x, $n); gsl_sf_bessel_jl($x, $y, $e, $n); # all arguments given ($y, $e) = $x->gsl_sf_bessel_jl($n); # method call $x->gsl_sf_bessel_jl($y, $e, $n); =for ref Regular Sphericl Bessel Function J_n(x). =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_bessel_jl = \&PDL::gsl_sf_bessel_jl; =head2 gsl_sf_bessel_jl_array =for sig Signature: (double x(); double [o]y(num); int n=>num) Types: (double) =for usage $y = gsl_sf_bessel_jl_array($x, $n); gsl_sf_bessel_jl_array($x, $y, $n); # all arguments given $y = $x->gsl_sf_bessel_jl_array($n); # method call $x->gsl_sf_bessel_jl_array($y, $n); =for ref Array of Spherical Regular Bessel Functions J_{0}(x) to J_{n-1}(x). =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_bessel_jl_array = \&PDL::gsl_sf_bessel_jl_array; =head2 gsl_sf_bessel_yl =for sig Signature: (double x(); double [o]y(); double [o]e(); int n) Types: (double) =for usage ($y, $e) = gsl_sf_bessel_yl($x, $n); gsl_sf_bessel_yl($x, $y, $e, $n); # all arguments given ($y, $e) = $x->gsl_sf_bessel_yl($n); # method call $x->gsl_sf_bessel_yl($y, $e, $n); =for ref IrRegular Spherical Bessel Function y_n(x). =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_bessel_yl = \&PDL::gsl_sf_bessel_yl; =head2 gsl_sf_bessel_yl_array =for sig Signature: (double x(); double [o]y(num); int n=>num) Types: (double) =for usage $y = gsl_sf_bessel_yl_array($x, $n); gsl_sf_bessel_yl_array($x, $y, $n); # all arguments given $y = $x->gsl_sf_bessel_yl_array($n); # method call $x->gsl_sf_bessel_yl_array($y, $n); =for ref Array of Regular Spherical Bessel Functions y_{0}(x) to y_{n-1}(x). =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_bessel_yl_array = \&PDL::gsl_sf_bessel_yl_array; =head2 gsl_sf_bessel_il_scaled =for sig Signature: (double x(); double [o]y(); double [o]e(); int n) Types: (double) =for usage ($y, $e) = gsl_sf_bessel_il_scaled($x, $n); gsl_sf_bessel_il_scaled($x, $y, $e, $n); # all arguments given ($y, $e) = $x->gsl_sf_bessel_il_scaled($n); # method call $x->gsl_sf_bessel_il_scaled($y, $e, $n); =for ref Scaled Regular Modified Spherical Bessel Function exp(-|x|) i_n(x). =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_bessel_il_scaled = \&PDL::gsl_sf_bessel_il_scaled; =head2 gsl_sf_bessel_il_scaled_array =for sig Signature: (double x(); double [o]y(num); int n=>num) Types: (double) =for usage $y = gsl_sf_bessel_il_scaled_array($x, $n); gsl_sf_bessel_il_scaled_array($x, $y, $n); # all arguments given $y = $x->gsl_sf_bessel_il_scaled_array($n); # method call $x->gsl_sf_bessel_il_scaled_array($y, $n); =for ref Array of Scaled Regular Modified Spherical Bessel Functions exp(-|x|) i_{0}(x) to exp(-|x|) i_{n-1}(x). =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_bessel_il_scaled_array = \&PDL::gsl_sf_bessel_il_scaled_array; =head2 gsl_sf_bessel_kl_scaled =for sig Signature: (double x(); double [o]y(); double [o]e(); int n) Types: (double) =for usage ($y, $e) = gsl_sf_bessel_kl_scaled($x, $n); gsl_sf_bessel_kl_scaled($x, $y, $e, $n); # all arguments given ($y, $e) = $x->gsl_sf_bessel_kl_scaled($n); # method call $x->gsl_sf_bessel_kl_scaled($y, $e, $n); =for ref Scaled IrRegular Modified Spherical Bessel Function exp(-|x|) k_n(x). =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_bessel_kl_scaled = \&PDL::gsl_sf_bessel_kl_scaled; =head2 gsl_sf_bessel_kl_scaled_array =for sig Signature: (double x(); double [o]y(num); int n=>num) Types: (double) =for usage $y = gsl_sf_bessel_kl_scaled_array($x, $n); gsl_sf_bessel_kl_scaled_array($x, $y, $n); # all arguments given $y = $x->gsl_sf_bessel_kl_scaled_array($n); # method call $x->gsl_sf_bessel_kl_scaled_array($y, $n); =for ref Array of Scaled IrRegular Modified Spherical Bessel Functions exp(-|x|) k_{s}(x) to exp(-|x|) k_{s+n-1}(x). =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_bessel_kl_scaled_array = \&PDL::gsl_sf_bessel_kl_scaled_array; =head2 gsl_sf_bessel_Jnu =for sig Signature: (double x(); double [o]y(); double [o]e(); double n) Types: (double) =for usage ($y, $e) = gsl_sf_bessel_Jnu($x, $n); gsl_sf_bessel_Jnu($x, $y, $e, $n); # all arguments given ($y, $e) = $x->gsl_sf_bessel_Jnu($n); # method call $x->gsl_sf_bessel_Jnu($y, $e, $n); =for ref Regular Cylindrical Bessel Function J_nu(x). =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_bessel_Jnu = \&PDL::gsl_sf_bessel_Jnu; =head2 gsl_sf_bessel_Ynu =for sig Signature: (double x(); double [o]y(); double [o]e(); double n) Types: (double) =for usage ($y, $e) = gsl_sf_bessel_Ynu($x, $n); gsl_sf_bessel_Ynu($x, $y, $e, $n); # all arguments given ($y, $e) = $x->gsl_sf_bessel_Ynu($n); # method call $x->gsl_sf_bessel_Ynu($y, $e, $n); =for ref IrRegular Cylindrical Bessel Function J_nu(x). =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_bessel_Ynu = \&PDL::gsl_sf_bessel_Ynu; =head2 gsl_sf_bessel_Inu_scaled =for sig Signature: (double x(); double [o]y(); double [o]e(); double n) Types: (double) =for usage ($y, $e) = gsl_sf_bessel_Inu_scaled($x, $n); gsl_sf_bessel_Inu_scaled($x, $y, $e, $n); # all arguments given ($y, $e) = $x->gsl_sf_bessel_Inu_scaled($n); # method call $x->gsl_sf_bessel_Inu_scaled($y, $e, $n); =for ref Scaled Modified Cylindrical Bessel Function exp(-|x|) I_nu(x). =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_bessel_Inu_scaled = \&PDL::gsl_sf_bessel_Inu_scaled; =head2 gsl_sf_bessel_Inu =for sig Signature: (double x(); double [o]y(); double [o]e(); double n) Types: (double) =for usage ($y, $e) = gsl_sf_bessel_Inu($x, $n); gsl_sf_bessel_Inu($x, $y, $e, $n); # all arguments given ($y, $e) = $x->gsl_sf_bessel_Inu($n); # method call $x->gsl_sf_bessel_Inu($y, $e, $n); =for ref Modified Cylindrical Bessel Function I_nu(x). =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_bessel_Inu = \&PDL::gsl_sf_bessel_Inu; =head2 gsl_sf_bessel_Knu_scaled =for sig Signature: (double x(); double [o]y(); double [o]e(); double n) Types: (double) =for usage ($y, $e) = gsl_sf_bessel_Knu_scaled($x, $n); gsl_sf_bessel_Knu_scaled($x, $y, $e, $n); # all arguments given ($y, $e) = $x->gsl_sf_bessel_Knu_scaled($n); # method call $x->gsl_sf_bessel_Knu_scaled($y, $e, $n); =for ref Scaled Modified Cylindrical Bessel Function exp(-|x|) K_nu(x). =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_bessel_Knu_scaled = \&PDL::gsl_sf_bessel_Knu_scaled; =head2 gsl_sf_bessel_Knu =for sig Signature: (double x(); double [o]y(); double [o]e(); double n) Types: (double) =for usage ($y, $e) = gsl_sf_bessel_Knu($x, $n); gsl_sf_bessel_Knu($x, $y, $e, $n); # all arguments given ($y, $e) = $x->gsl_sf_bessel_Knu($n); # method call $x->gsl_sf_bessel_Knu($y, $e, $n); =for ref Modified Cylindrical Bessel Function K_nu(x). =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_bessel_Knu = \&PDL::gsl_sf_bessel_Knu; =head2 gsl_sf_bessel_lnKnu =for sig Signature: (double x(); double [o]y(); double [o]e(); double n) Types: (double) =for usage ($y, $e) = gsl_sf_bessel_lnKnu($x, $n); gsl_sf_bessel_lnKnu($x, $y, $e, $n); # all arguments given ($y, $e) = $x->gsl_sf_bessel_lnKnu($n); # method call $x->gsl_sf_bessel_lnKnu($y, $e, $n); =for ref Logarithm of Modified Cylindrical Bessel Function K_nu(x). =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_bessel_lnKnu = \&PDL::gsl_sf_bessel_lnKnu; =head2 gsl_sf_clausen =for sig Signature: (double x(); double [o]y(); double [o]e()) Types: (double) =for usage ($y, $e) = gsl_sf_clausen($x); gsl_sf_clausen($x, $y, $e); # all arguments given ($y, $e) = $x->gsl_sf_clausen; # method call $x->gsl_sf_clausen($y, $e); =for ref Clausen Integral. Cl_2(x) := Integrate[-Log[2 Sin[t/2]], {t,0,x}] =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_clausen = \&PDL::gsl_sf_clausen; =head2 gsl_sf_hydrogenicR =for sig Signature: (double x(); double [o]y(); double [o]e(); int n; int l; double z) Types: (double) =for usage ($y, $e) = gsl_sf_hydrogenicR($x, $n, $l, $z); gsl_sf_hydrogenicR($x, $y, $e, $n, $l, $z); # all arguments given ($y, $e) = $x->gsl_sf_hydrogenicR($n, $l, $z); # method call $x->gsl_sf_hydrogenicR($y, $e, $n, $l, $z); =for ref Normalized Hydrogenic bound states. Radial dipendence. =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_hydrogenicR = \&PDL::gsl_sf_hydrogenicR; =head2 gsl_sf_coulomb_wave_FGp_array =for sig Signature: (double x(); double [o]fc(n); double [o]fcp(n); double [o]gc(n); double [o]gcp(n); int [o]ovfw(); double [o]fe(n); double [o]ge(n); double lam_min; IV kmax=>n; double eta) Types: (double) =for usage ($fc, $fcp, $gc, $gcp, $ovfw, $fe, $ge) = gsl_sf_coulomb_wave_FGp_array($x, $lam_min, $kmax, $eta); gsl_sf_coulomb_wave_FGp_array($x, $fc, $fcp, $gc, $gcp, $ovfw, $fe, $ge, $lam_min, $kmax, $eta); # all arguments given ($fc, $fcp, $gc, $gcp, $ovfw, $fe, $ge) = $x->gsl_sf_coulomb_wave_FGp_array($lam_min, $kmax, $eta); # method call $x->gsl_sf_coulomb_wave_FGp_array($fc, $fcp, $gc, $gcp, $ovfw, $fe, $ge, $lam_min, $kmax, $eta); =for ref Coulomb wave functions F_{lam_F}(eta,x), G_{lam_G}(eta,x) and their derivatives; lam_G := lam_F - k_lam_G. if ovfw is signaled then F_L(eta,x) = fc[k_L] * exp(fe) and similar. =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_coulomb_wave_FGp_array = \&PDL::gsl_sf_coulomb_wave_FGp_array; =head2 gsl_sf_coulomb_wave_sphF_array =for sig Signature: (double x(); double [o]fc(n); int [o]ovfw(); double [o]fe(n); double lam_min; IV kmax=>n; double eta) Types: (double) =for usage ($fc, $ovfw, $fe) = gsl_sf_coulomb_wave_sphF_array($x, $lam_min, $kmax, $eta); gsl_sf_coulomb_wave_sphF_array($x, $fc, $ovfw, $fe, $lam_min, $kmax, $eta); # all arguments given ($fc, $ovfw, $fe) = $x->gsl_sf_coulomb_wave_sphF_array($lam_min, $kmax, $eta); # method call $x->gsl_sf_coulomb_wave_sphF_array($fc, $ovfw, $fe, $lam_min, $kmax, $eta); =for ref Coulomb wave function divided by the argument, F(xi, eta)/xi. This is the function which reduces to spherical Bessel functions in the limit eta->0. =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_coulomb_wave_sphF_array = \&PDL::gsl_sf_coulomb_wave_sphF_array; =head2 gsl_sf_coulomb_CL_e =for sig Signature: (double L(); double eta(); double [o]y(); double [o]e()) Types: (double) =for usage ($y, $e) = gsl_sf_coulomb_CL_e($L, $eta); gsl_sf_coulomb_CL_e($L, $eta, $y, $e); # all arguments given ($y, $e) = $L->gsl_sf_coulomb_CL_e($eta); # method call $L->gsl_sf_coulomb_CL_e($eta, $y, $e); =for ref Coulomb wave function normalization constant. [Abramowitz+Stegun 14.1.8, 14.1.9]. =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_coulomb_CL_e = \&PDL::gsl_sf_coulomb_CL_e; =head2 gsl_sf_coupling_3j =for sig Signature: (ja(); jb(); jc(); ma(); mb(); mc(); double [o]y(); double [o]e()) Types: (long) =for usage ($y, $e) = gsl_sf_coupling_3j($ja, $jb, $jc, $ma, $mb, $mc); gsl_sf_coupling_3j($ja, $jb, $jc, $ma, $mb, $mc, $y, $e); # all arguments given ($y, $e) = $ja->gsl_sf_coupling_3j($jb, $jc, $ma, $mb, $mc); # method call $ja->gsl_sf_coupling_3j($jb, $jc, $ma, $mb, $mc, $y, $e); =for ref 3j Symbols: (ja jb jc) over (ma mb mc). =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_coupling_3j = \&PDL::gsl_sf_coupling_3j; =head2 gsl_sf_coupling_6j =for sig Signature: (ja(); jb(); jc(); jd(); je(); jf(); double [o]y(); double [o]e()) Types: (long) =for usage ($y, $e) = gsl_sf_coupling_6j($ja, $jb, $jc, $jd, $je, $jf); gsl_sf_coupling_6j($ja, $jb, $jc, $jd, $je, $jf, $y, $e); # all arguments given ($y, $e) = $ja->gsl_sf_coupling_6j($jb, $jc, $jd, $je, $jf); # method call $ja->gsl_sf_coupling_6j($jb, $jc, $jd, $je, $jf, $y, $e); =for ref 6j Symbols: (ja jb jc) over (jd je jf). =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_coupling_6j = \&PDL::gsl_sf_coupling_6j; =head2 gsl_sf_coupling_9j =for sig Signature: (ja(); jb(); jc(); jd(); je(); jf(); jg(); jh(); ji(); double [o]y(); double [o]e()) Types: (long) =for usage ($y, $e) = gsl_sf_coupling_9j($ja, $jb, $jc, $jd, $je, $jf, $jg, $jh, $ji); gsl_sf_coupling_9j($ja, $jb, $jc, $jd, $je, $jf, $jg, $jh, $ji, $y, $e); # all arguments given ($y, $e) = $ja->gsl_sf_coupling_9j($jb, $jc, $jd, $je, $jf, $jg, $jh, $ji); # method call $ja->gsl_sf_coupling_9j($jb, $jc, $jd, $je, $jf, $jg, $jh, $ji, $y, $e); =for ref 9j Symbols: (ja jb jc) over (jd je jf) over (jg jh ji). =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_coupling_9j = \&PDL::gsl_sf_coupling_9j; =head2 gsl_sf_dawson =for sig Signature: (double x(); double [o]y(); double [o]e()) Types: (double) =for usage ($y, $e) = gsl_sf_dawson($x); gsl_sf_dawson($x, $y, $e); # all arguments given ($y, $e) = $x->gsl_sf_dawson; # method call $x->gsl_sf_dawson($y, $e); =for ref Dawsons integral: Exp[-x^2] Integral[ Exp[t^2], {t,0,x}] =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_dawson = \&PDL::gsl_sf_dawson; =head2 gsl_sf_debye_1 =for sig Signature: (double x(); double [o]y(); double [o]e()) Types: (double) =for usage ($y, $e) = gsl_sf_debye_1($x); gsl_sf_debye_1($x, $y, $e); # all arguments given ($y, $e) = $x->gsl_sf_debye_1; # method call $x->gsl_sf_debye_1($y, $e); =for ref D_n(x) := n/x^n Integrate[t^n/(e^t - 1), {t,0,x}] =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_debye_1 = \&PDL::gsl_sf_debye_1; =head2 gsl_sf_debye_2 =for sig Signature: (double x(); double [o]y(); double [o]e()) Types: (double) =for usage ($y, $e) = gsl_sf_debye_2($x); gsl_sf_debye_2($x, $y, $e); # all arguments given ($y, $e) = $x->gsl_sf_debye_2; # method call $x->gsl_sf_debye_2($y, $e); =for ref D_n(x) := n/x^n Integrate[t^n/(e^t - 1), {t,0,x}] =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_debye_2 = \&PDL::gsl_sf_debye_2; =head2 gsl_sf_debye_3 =for sig Signature: (double x(); double [o]y(); double [o]e()) Types: (double) =for usage ($y, $e) = gsl_sf_debye_3($x); gsl_sf_debye_3($x, $y, $e); # all arguments given ($y, $e) = $x->gsl_sf_debye_3; # method call $x->gsl_sf_debye_3($y, $e); =for ref D_n(x) := n/x^n Integrate[t^n/(e^t - 1), {t,0,x}] =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_debye_3 = \&PDL::gsl_sf_debye_3; =head2 gsl_sf_debye_4 =for sig Signature: (double x(); double [o]y(); double [o]e()) Types: (double) =for usage ($y, $e) = gsl_sf_debye_4($x); gsl_sf_debye_4($x, $y, $e); # all arguments given ($y, $e) = $x->gsl_sf_debye_4; # method call $x->gsl_sf_debye_4($y, $e); =for ref D_n(x) := n/x^n Integrate[t^n/(e^t - 1), {t,0,x}] =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_debye_4 = \&PDL::gsl_sf_debye_4; =head2 gsl_sf_dilog =for sig Signature: (double x(); double [o]y(); double [o]e()) Types: (double) =for usage ($y, $e) = gsl_sf_dilog($x); gsl_sf_dilog($x, $y, $e); # all arguments given ($y, $e) = $x->gsl_sf_dilog; # method call $x->gsl_sf_dilog($y, $e); =for ref /* Real part of DiLogarithm(x), for real argument. In Lewins notation, this is Li_2(x). Li_2(x) = - Re[ Integrate[ Log[1-s] / s, {s, 0, x}] ] =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_dilog = \&PDL::gsl_sf_dilog; =head2 gsl_sf_complex_dilog =for sig Signature: (double r(); double t(); double [o]re(); double [o]im(); double [o]ere(); double [o]eim()) Types: (double) =for usage ($re, $im, $ere, $eim) = gsl_sf_complex_dilog($r, $t); gsl_sf_complex_dilog($r, $t, $re, $im, $ere, $eim); # all arguments given ($re, $im, $ere, $eim) = $r->gsl_sf_complex_dilog($t); # method call $r->gsl_sf_complex_dilog($t, $re, $im, $ere, $eim); =for ref DiLogarithm(z), for complex argument z = r Exp[i theta]. =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_complex_dilog = \&PDL::gsl_sf_complex_dilog; =head2 gsl_sf_multiply =for sig Signature: (double x(); double xx(); double [o]y(); double [o]e()) Types: (double) =for usage ($y, $e) = gsl_sf_multiply($x, $xx); gsl_sf_multiply($x, $xx, $y, $e); # all arguments given ($y, $e) = $x->gsl_sf_multiply($xx); # method call $x->gsl_sf_multiply($xx, $y, $e); =for ref Multiplication. =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_multiply = \&PDL::gsl_sf_multiply; =head2 gsl_sf_multiply_err =for sig Signature: (double x(); double xe(); double xx(); double xxe(); double [o]y(); double [o]e()) Types: (double) =for usage ($y, $e) = gsl_sf_multiply_err($x, $xe, $xx, $xxe); gsl_sf_multiply_err($x, $xe, $xx, $xxe, $y, $e); # all arguments given ($y, $e) = $x->gsl_sf_multiply_err($xe, $xx, $xxe); # method call $x->gsl_sf_multiply_err($xe, $xx, $xxe, $y, $e); =for ref Multiplication with associated errors. =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_multiply_err = \&PDL::gsl_sf_multiply_err; =head2 gsl_sf_ellint_Kcomp =for sig Signature: (double k(); double [o]y(); double [o]e()) Types: (double) =for usage ($y, $e) = gsl_sf_ellint_Kcomp($k); gsl_sf_ellint_Kcomp($k, $y, $e); # all arguments given ($y, $e) = $k->gsl_sf_ellint_Kcomp; # method call $k->gsl_sf_ellint_Kcomp($y, $e); =for ref Legendre form of complete elliptic integrals K(k) = Integral[1/Sqrt[1 - k^2 Sin[t]^2], {t, 0, Pi/2}]. =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_ellint_Kcomp = \&PDL::gsl_sf_ellint_Kcomp; =head2 gsl_sf_ellint_Ecomp =for sig Signature: (double k(); double [o]y(); double [o]e()) Types: (double) =for usage ($y, $e) = gsl_sf_ellint_Ecomp($k); gsl_sf_ellint_Ecomp($k, $y, $e); # all arguments given ($y, $e) = $k->gsl_sf_ellint_Ecomp; # method call $k->gsl_sf_ellint_Ecomp($y, $e); =for ref Legendre form of complete elliptic integrals E(k) = Integral[ Sqrt[1 - k^2 Sin[t]^2], {t, 0, Pi/2}] =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_ellint_Ecomp = \&PDL::gsl_sf_ellint_Ecomp; =head2 gsl_sf_ellint_F =for sig Signature: (double phi(); double k(); double [o]y(); double [o]e()) Types: (double) =for usage ($y, $e) = gsl_sf_ellint_F($phi, $k); gsl_sf_ellint_F($phi, $k, $y, $e); # all arguments given ($y, $e) = $phi->gsl_sf_ellint_F($k); # method call $phi->gsl_sf_ellint_F($k, $y, $e); =for ref Legendre form of incomplete elliptic integrals F(phi,k) = Integral[1/Sqrt[1 - k^2 Sin[t]^2], {t, 0, phi}] =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_ellint_F = \&PDL::gsl_sf_ellint_F; =head2 gsl_sf_ellint_E =for sig Signature: (double phi(); double k(); double [o]y(); double [o]e()) Types: (double) =for usage ($y, $e) = gsl_sf_ellint_E($phi, $k); gsl_sf_ellint_E($phi, $k, $y, $e); # all arguments given ($y, $e) = $phi->gsl_sf_ellint_E($k); # method call $phi->gsl_sf_ellint_E($k, $y, $e); =for ref Legendre form of incomplete elliptic integrals E(phi,k) = Integral[ Sqrt[1 - k^2 Sin[t]^2], {t, 0, phi}] =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_ellint_E = \&PDL::gsl_sf_ellint_E; =head2 gsl_sf_ellint_P =for sig Signature: (double phi(); double k(); double n(); double [o]y(); double [o]e()) Types: (double) =for usage ($y, $e) = gsl_sf_ellint_P($phi, $k, $n); gsl_sf_ellint_P($phi, $k, $n, $y, $e); # all arguments given ($y, $e) = $phi->gsl_sf_ellint_P($k, $n); # method call $phi->gsl_sf_ellint_P($k, $n, $y, $e); =for ref Legendre form of incomplete elliptic integrals P(phi,k,n) = Integral[(1 + n Sin[t]^2)^(-1)/Sqrt[1 - k^2 Sin[t]^2], {t, 0, phi}] =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_ellint_P = \&PDL::gsl_sf_ellint_P; =head2 gsl_sf_ellint_D =for sig Signature: (double phi(); double k(); double [o]y(); double [o]e()) Types: (double) =for usage ($y, $e) = gsl_sf_ellint_D($phi, $k); gsl_sf_ellint_D($phi, $k, $y, $e); # all arguments given ($y, $e) = $phi->gsl_sf_ellint_D($k); # method call $phi->gsl_sf_ellint_D($k, $y, $e); =for ref Legendre form of incomplete elliptic integrals D(phi,k) =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_ellint_D = \&PDL::gsl_sf_ellint_D; =head2 gsl_sf_ellint_RC =for sig Signature: (double x(); double yy(); double [o]y(); double [o]e()) Types: (double) =for usage ($y, $e) = gsl_sf_ellint_RC($x, $yy); gsl_sf_ellint_RC($x, $yy, $y, $e); # all arguments given ($y, $e) = $x->gsl_sf_ellint_RC($yy); # method call $x->gsl_sf_ellint_RC($yy, $y, $e); =for ref Carlsons symmetric basis of functions RC(x,y) = 1/2 Integral[(t+x)^(-1/2) (t+y)^(-1)], {t,0,Inf} =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_ellint_RC = \&PDL::gsl_sf_ellint_RC; =head2 gsl_sf_ellint_RD =for sig Signature: (double x(); double yy(); double z(); double [o]y(); double [o]e()) Types: (double) =for usage ($y, $e) = gsl_sf_ellint_RD($x, $yy, $z); gsl_sf_ellint_RD($x, $yy, $z, $y, $e); # all arguments given ($y, $e) = $x->gsl_sf_ellint_RD($yy, $z); # method call $x->gsl_sf_ellint_RD($yy, $z, $y, $e); =for ref Carlsons symmetric basis of functions RD(x,y,z) = 3/2 Integral[(t+x)^(-1/2) (t+y)^(-1/2) (t+z)^(-3/2), {t,0,Inf}] =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_ellint_RD = \&PDL::gsl_sf_ellint_RD; =head2 gsl_sf_ellint_RF =for sig Signature: (double x(); double yy(); double z(); double [o]y(); double [o]e()) Types: (double) =for usage ($y, $e) = gsl_sf_ellint_RF($x, $yy, $z); gsl_sf_ellint_RF($x, $yy, $z, $y, $e); # all arguments given ($y, $e) = $x->gsl_sf_ellint_RF($yy, $z); # method call $x->gsl_sf_ellint_RF($yy, $z, $y, $e); =for ref Carlsons symmetric basis of functions RF(x,y,z) = 1/2 Integral[(t+x)^(-1/2) (t+y)^(-1/2) (t+z)^(-1/2), {t,0,Inf}] =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_ellint_RF = \&PDL::gsl_sf_ellint_RF; =head2 gsl_sf_ellint_RJ =for sig Signature: (double x(); double yy(); double z(); double p(); double [o]y(); double [o]e()) Types: (double) =for usage ($y, $e) = gsl_sf_ellint_RJ($x, $yy, $z, $p); gsl_sf_ellint_RJ($x, $yy, $z, $p, $y, $e); # all arguments given ($y, $e) = $x->gsl_sf_ellint_RJ($yy, $z, $p); # method call $x->gsl_sf_ellint_RJ($yy, $z, $p, $y, $e); =for ref Carlsons symmetric basis of functions RJ(x,y,z,p) = 3/2 Integral[(t+x)^(-1/2) (t+y)^(-1/2) (t+z)^(-1/2) (t+p)^(-1), {t,0,Inf}] =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_ellint_RJ = \&PDL::gsl_sf_ellint_RJ; =head2 gsl_sf_elljac =for sig Signature: (double u(); double m(); double [o]sn(); double [o]cn(); double [o]dn()) Types: (double) =for usage ($sn, $cn, $dn) = gsl_sf_elljac($u, $m); gsl_sf_elljac($u, $m, $sn, $cn, $dn); # all arguments given ($sn, $cn, $dn) = $u->gsl_sf_elljac($m); # method call $u->gsl_sf_elljac($m, $sn, $cn, $dn); =for ref Jacobian elliptic functions sn, dn, cn by descending Landen transformations =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_elljac = \&PDL::gsl_sf_elljac; =head2 gsl_sf_erfc =for sig Signature: (double x(); double [o]y(); double [o]e()) Types: (double) =for usage ($y, $e) = gsl_sf_erfc($x); gsl_sf_erfc($x, $y, $e); # all arguments given ($y, $e) = $x->gsl_sf_erfc; # method call $x->gsl_sf_erfc($y, $e); =for ref Complementary Error Function erfc(x) := 2/Sqrt[Pi] Integrate[Exp[-t^2], {t,x,Infinity}] =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_erfc = \&PDL::gsl_sf_erfc; =head2 gsl_sf_log_erfc =for sig Signature: (double x(); double [o]y(); double [o]e()) Types: (double) =for usage ($y, $e) = gsl_sf_log_erfc($x); gsl_sf_log_erfc($x, $y, $e); # all arguments given ($y, $e) = $x->gsl_sf_log_erfc; # method call $x->gsl_sf_log_erfc($y, $e); =for ref Log Complementary Error Function =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_log_erfc = \&PDL::gsl_sf_log_erfc; =head2 gsl_sf_erf =for sig Signature: (double x(); double [o]y(); double [o]e()) Types: (double) =for usage ($y, $e) = gsl_sf_erf($x); gsl_sf_erf($x, $y, $e); # all arguments given ($y, $e) = $x->gsl_sf_erf; # method call $x->gsl_sf_erf($y, $e); =for ref Error Function erf(x) := 2/Sqrt[Pi] Integrate[Exp[-t^2], {t,0,x}] =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_erf = \&PDL::gsl_sf_erf; =head2 gsl_sf_erf_Z =for sig Signature: (double x(); double [o]y(); double [o]e()) Types: (double) =for usage ($y, $e) = gsl_sf_erf_Z($x); gsl_sf_erf_Z($x, $y, $e); # all arguments given ($y, $e) = $x->gsl_sf_erf_Z; # method call $x->gsl_sf_erf_Z($y, $e); =for ref Z(x) : Abramowitz+Stegun 26.2.1 =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_erf_Z = \&PDL::gsl_sf_erf_Z; =head2 gsl_sf_erf_Q =for sig Signature: (double x(); double [o]y(); double [o]e()) Types: (double) =for usage ($y, $e) = gsl_sf_erf_Q($x); gsl_sf_erf_Q($x, $y, $e); # all arguments given ($y, $e) = $x->gsl_sf_erf_Q; # method call $x->gsl_sf_erf_Q($y, $e); =for ref Q(x) : Abramowitz+Stegun 26.2.1 =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_erf_Q = \&PDL::gsl_sf_erf_Q; =head2 gsl_sf_exp =for sig Signature: (double x(); double [o]y(); double [o]e()) Types: (double) =for usage ($y, $e) = gsl_sf_exp($x); gsl_sf_exp($x, $y, $e); # all arguments given ($y, $e) = $x->gsl_sf_exp; # method call $x->gsl_sf_exp($y, $e); =for ref Exponential =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_exp = \&PDL::gsl_sf_exp; =head2 gsl_sf_exprel_n =for sig Signature: (double x(); double [o]y(); double [o]e(); int n) Types: (double) =for usage ($y, $e) = gsl_sf_exprel_n($x, $n); gsl_sf_exprel_n($x, $y, $e, $n); # all arguments given ($y, $e) = $x->gsl_sf_exprel_n($n); # method call $x->gsl_sf_exprel_n($y, $e, $n); =for ref N-relative Exponential. exprel_N(x) = N!/x^N (exp(x) - Sum[x^k/k!, {k,0,N-1}]) = 1 + x/(N+1) + x^2/((N+1)(N+2)) + ... = 1F1(1,1+N,x) =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_exprel_n = \&PDL::gsl_sf_exprel_n; =head2 gsl_sf_exp_err =for sig Signature: (double x(); double dx(); double [o]y(); double [o]e()) Types: (double) =for usage ($y, $e) = gsl_sf_exp_err($x, $dx); gsl_sf_exp_err($x, $dx, $y, $e); # all arguments given ($y, $e) = $x->gsl_sf_exp_err($dx); # method call $x->gsl_sf_exp_err($dx, $y, $e); =for ref Exponential of a quantity with given error. =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_exp_err = \&PDL::gsl_sf_exp_err; =head2 gsl_sf_expint_E1 =for sig Signature: (double x(); double [o]y(); double [o]e()) Types: (double) =for usage ($y, $e) = gsl_sf_expint_E1($x); gsl_sf_expint_E1($x, $y, $e); # all arguments given ($y, $e) = $x->gsl_sf_expint_E1; # method call $x->gsl_sf_expint_E1($y, $e); =for ref E_1(x) := Re[ Integrate[ Exp[-xt]/t, {t,1,Infinity}] ] =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_expint_E1 = \&PDL::gsl_sf_expint_E1; =head2 gsl_sf_expint_E2 =for sig Signature: (double x(); double [o]y(); double [o]e()) Types: (double) =for usage ($y, $e) = gsl_sf_expint_E2($x); gsl_sf_expint_E2($x, $y, $e); # all arguments given ($y, $e) = $x->gsl_sf_expint_E2; # method call $x->gsl_sf_expint_E2($y, $e); =for ref E_2(x) := Re[ Integrate[ Exp[-xt]/t^2, {t,1,Infity}] ] =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_expint_E2 = \&PDL::gsl_sf_expint_E2; =head2 gsl_sf_expint_Ei =for sig Signature: (double x(); double [o]y(); double [o]e()) Types: (double) =for usage ($y, $e) = gsl_sf_expint_Ei($x); gsl_sf_expint_Ei($x, $y, $e); # all arguments given ($y, $e) = $x->gsl_sf_expint_Ei; # method call $x->gsl_sf_expint_Ei($y, $e); =for ref Ei(x) := PV Integrate[ Exp[-t]/t, {t,-x,Infinity}] =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_expint_Ei = \&PDL::gsl_sf_expint_Ei; =head2 gsl_sf_Shi =for sig Signature: (double x(); double [o]y(); double [o]e()) Types: (double) =for usage ($y, $e) = gsl_sf_Shi($x); gsl_sf_Shi($x, $y, $e); # all arguments given ($y, $e) = $x->gsl_sf_Shi; # method call $x->gsl_sf_Shi($y, $e); =for ref Shi(x) := Integrate[ Sinh[t]/t, {t,0,x}] =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_Shi = \&PDL::gsl_sf_Shi; =head2 gsl_sf_Chi =for sig Signature: (double x(); double [o]y(); double [o]e()) Types: (double) =for usage ($y, $e) = gsl_sf_Chi($x); gsl_sf_Chi($x, $y, $e); # all arguments given ($y, $e) = $x->gsl_sf_Chi; # method call $x->gsl_sf_Chi($y, $e); =for ref Chi(x) := Re[ M_EULER + log(x) + Integrate[(Cosh[t]-1)/t, {t,0,x}] ] =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_Chi = \&PDL::gsl_sf_Chi; =head2 gsl_sf_expint_3 =for sig Signature: (double x(); double [o]y(); double [o]e()) Types: (double) =for usage ($y, $e) = gsl_sf_expint_3($x); gsl_sf_expint_3($x, $y, $e); # all arguments given ($y, $e) = $x->gsl_sf_expint_3; # method call $x->gsl_sf_expint_3($y, $e); =for ref Ei_3(x) := Integral[ Exp[-t^3], {t,0,x}] =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_expint_3 = \&PDL::gsl_sf_expint_3; =head2 gsl_sf_Si =for sig Signature: (double x(); double [o]y(); double [o]e()) Types: (double) =for usage ($y, $e) = gsl_sf_Si($x); gsl_sf_Si($x, $y, $e); # all arguments given ($y, $e) = $x->gsl_sf_Si; # method call $x->gsl_sf_Si($y, $e); =for ref Si(x) := Integrate[ Sin[t]/t, {t,0,x}] =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_Si = \&PDL::gsl_sf_Si; =head2 gsl_sf_Ci =for sig Signature: (double x(); double [o]y(); double [o]e()) Types: (double) =for usage ($y, $e) = gsl_sf_Ci($x); gsl_sf_Ci($x, $y, $e); # all arguments given ($y, $e) = $x->gsl_sf_Ci; # method call $x->gsl_sf_Ci($y, $e); =for ref Ci(x) := -Integrate[ Cos[t]/t, {t,x,Infinity}] =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_Ci = \&PDL::gsl_sf_Ci; =head2 gsl_sf_atanint =for sig Signature: (double x(); double [o]y(); double [o]e()) Types: (double) =for usage ($y, $e) = gsl_sf_atanint($x); gsl_sf_atanint($x, $y, $e); # all arguments given ($y, $e) = $x->gsl_sf_atanint; # method call $x->gsl_sf_atanint($y, $e); =for ref AtanInt(x) := Integral[ Arctan[t]/t, {t,0,x}] =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_atanint = \&PDL::gsl_sf_atanint; =head2 gsl_sf_fermi_dirac_int =for sig Signature: (double x(); double [o]y(); double [o]e(); int j) Types: (double) =for usage ($y, $e) = gsl_sf_fermi_dirac_int($x, $j); gsl_sf_fermi_dirac_int($x, $y, $e, $j); # all arguments given ($y, $e) = $x->gsl_sf_fermi_dirac_int($j); # method call $x->gsl_sf_fermi_dirac_int($y, $e, $j); =for ref Complete integral F_j(x) for integer j =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_fermi_dirac_int = \&PDL::gsl_sf_fermi_dirac_int; =head2 gsl_sf_fermi_dirac_mhalf =for sig Signature: (double x(); double [o]y(); double [o]e()) Types: (double) =for usage ($y, $e) = gsl_sf_fermi_dirac_mhalf($x); gsl_sf_fermi_dirac_mhalf($x, $y, $e); # all arguments given ($y, $e) = $x->gsl_sf_fermi_dirac_mhalf; # method call $x->gsl_sf_fermi_dirac_mhalf($y, $e); =for ref Complete integral F_{-1/2}(x) =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_fermi_dirac_mhalf = \&PDL::gsl_sf_fermi_dirac_mhalf; =head2 gsl_sf_fermi_dirac_half =for sig Signature: (double x(); double [o]y(); double [o]e()) Types: (double) =for usage ($y, $e) = gsl_sf_fermi_dirac_half($x); gsl_sf_fermi_dirac_half($x, $y, $e); # all arguments given ($y, $e) = $x->gsl_sf_fermi_dirac_half; # method call $x->gsl_sf_fermi_dirac_half($y, $e); =for ref Complete integral F_{1/2}(x) =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_fermi_dirac_half = \&PDL::gsl_sf_fermi_dirac_half; =head2 gsl_sf_fermi_dirac_3half =for sig Signature: (double x(); double [o]y(); double [o]e()) Types: (double) =for usage ($y, $e) = gsl_sf_fermi_dirac_3half($x); gsl_sf_fermi_dirac_3half($x, $y, $e); # all arguments given ($y, $e) = $x->gsl_sf_fermi_dirac_3half; # method call $x->gsl_sf_fermi_dirac_3half($y, $e); =for ref Complete integral F_{3/2}(x) =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_fermi_dirac_3half = \&PDL::gsl_sf_fermi_dirac_3half; =head2 gsl_sf_fermi_dirac_inc_0 =for sig Signature: (double x(); double [o]y(); double [o]e(); double b) Types: (double) =for usage ($y, $e) = gsl_sf_fermi_dirac_inc_0($x, $b); gsl_sf_fermi_dirac_inc_0($x, $y, $e, $b); # all arguments given ($y, $e) = $x->gsl_sf_fermi_dirac_inc_0($b); # method call $x->gsl_sf_fermi_dirac_inc_0($y, $e, $b); =for ref Incomplete integral F_0(x,b) = ln(1 + e^(b-x)) - (b-x) =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_fermi_dirac_inc_0 = \&PDL::gsl_sf_fermi_dirac_inc_0; =head2 gsl_sf_lngamma =for sig Signature: (double x(); double [o]y(); double [o]s(); double [o]e()) Types: (double) =for usage ($y, $s, $e) = gsl_sf_lngamma($x); gsl_sf_lngamma($x, $y, $s, $e); # all arguments given ($y, $s, $e) = $x->gsl_sf_lngamma; # method call $x->gsl_sf_lngamma($y, $s, $e); =for ref Log[Gamma(x)], x not a negative integer Uses real Lanczos method. Determines the sign of Gamma[x] as well as Log[|Gamma[x]|] for x < 0. So Gamma[x] = sgn * Exp[result_lg]. =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_lngamma = \&PDL::gsl_sf_lngamma; =head2 gsl_sf_gamma =for sig Signature: (double x(); double [o]y(); double [o]e()) Types: (double) =for usage ($y, $e) = gsl_sf_gamma($x); gsl_sf_gamma($x, $y, $e); # all arguments given ($y, $e) = $x->gsl_sf_gamma; # method call $x->gsl_sf_gamma($y, $e); =for ref Gamma(x), x not a negative integer =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_gamma = \&PDL::gsl_sf_gamma; =head2 gsl_sf_gammastar =for sig Signature: (double x(); double [o]y(); double [o]e()) Types: (double) =for usage ($y, $e) = gsl_sf_gammastar($x); gsl_sf_gammastar($x, $y, $e); # all arguments given ($y, $e) = $x->gsl_sf_gammastar; # method call $x->gsl_sf_gammastar($y, $e); =for ref Regulated Gamma Function, x > 0 Gamma^*(x) = Gamma(x)/(Sqrt[2Pi] x^(x-1/2) exp(-x)) = (1 + 1/(12x) + ...), x->Inf =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_gammastar = \&PDL::gsl_sf_gammastar; =head2 gsl_sf_gammainv =for sig Signature: (double x(); double [o]y(); double [o]e()) Types: (double) =for usage ($y, $e) = gsl_sf_gammainv($x); gsl_sf_gammainv($x, $y, $e); # all arguments given ($y, $e) = $x->gsl_sf_gammainv; # method call $x->gsl_sf_gammainv($y, $e); =for ref 1/Gamma(x) =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_gammainv = \&PDL::gsl_sf_gammainv; =head2 gsl_sf_lngamma_complex =for sig Signature: (double zr(); double zi(); double [o]x(); double [o]y(); double [o]xe(); double [o]ye()) Types: (double) =for usage ($x, $y, $xe, $ye) = gsl_sf_lngamma_complex($zr, $zi); gsl_sf_lngamma_complex($zr, $zi, $x, $y, $xe, $ye); # all arguments given ($x, $y, $xe, $ye) = $zr->gsl_sf_lngamma_complex($zi); # method call $zr->gsl_sf_lngamma_complex($zi, $x, $y, $xe, $ye); =for ref Log[Gamma(z)] for z complex, z not a negative integer. Calculates: lnr = log|Gamma(z)|, arg = arg(Gamma(z)) in (-Pi, Pi] =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_lngamma_complex = \&PDL::gsl_sf_lngamma_complex; =head2 gsl_sf_taylorcoeff =for sig Signature: (double x(); double [o]y(); double [o]e(); int n) Types: (double) =for usage ($y, $e) = gsl_sf_taylorcoeff($x, $n); gsl_sf_taylorcoeff($x, $y, $e, $n); # all arguments given ($y, $e) = $x->gsl_sf_taylorcoeff($n); # method call $x->gsl_sf_taylorcoeff($y, $e, $n); =for ref x^n / n! =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_taylorcoeff = \&PDL::gsl_sf_taylorcoeff; =head2 gsl_sf_fact =for sig Signature: (x(); double [o]y(); double [o]e()) Types: (long) =for usage ($y, $e) = gsl_sf_fact($x); gsl_sf_fact($x, $y, $e); # all arguments given ($y, $e) = $x->gsl_sf_fact; # method call $x->gsl_sf_fact($y, $e); =for ref n! =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_fact = \&PDL::gsl_sf_fact; =head2 gsl_sf_doublefact =for sig Signature: (x(); double [o]y(); double [o]e()) Types: (long) =for usage ($y, $e) = gsl_sf_doublefact($x); gsl_sf_doublefact($x, $y, $e); # all arguments given ($y, $e) = $x->gsl_sf_doublefact; # method call $x->gsl_sf_doublefact($y, $e); =for ref n!! = n(n-2)(n-4) =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_doublefact = \&PDL::gsl_sf_doublefact; =head2 gsl_sf_lnfact =for sig Signature: (x(); double [o]y(); double [o]e()) Types: (long) =for usage ($y, $e) = gsl_sf_lnfact($x); gsl_sf_lnfact($x, $y, $e); # all arguments given ($y, $e) = $x->gsl_sf_lnfact; # method call $x->gsl_sf_lnfact($y, $e); =for ref ln n! =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_lnfact = \&PDL::gsl_sf_lnfact; =head2 gsl_sf_lndoublefact =for sig Signature: (x(); double [o]y(); double [o]e()) Types: (long) =for usage ($y, $e) = gsl_sf_lndoublefact($x); gsl_sf_lndoublefact($x, $y, $e); # all arguments given ($y, $e) = $x->gsl_sf_lndoublefact; # method call $x->gsl_sf_lndoublefact($y, $e); =for ref ln n!! =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_lndoublefact = \&PDL::gsl_sf_lndoublefact; =head2 gsl_sf_lnchoose =for sig Signature: (n(); m(); double [o]y(); double [o]e()) Types: (long) =for usage ($y, $e) = gsl_sf_lnchoose($n, $m); gsl_sf_lnchoose($n, $m, $y, $e); # all arguments given ($y, $e) = $n->gsl_sf_lnchoose($m); # method call $n->gsl_sf_lnchoose($m, $y, $e); =for ref log(n choose m) =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_lnchoose = \&PDL::gsl_sf_lnchoose; =head2 gsl_sf_choose =for sig Signature: (n(); m(); double [o]y(); double [o]e()) Types: (long) =for usage ($y, $e) = gsl_sf_choose($n, $m); gsl_sf_choose($n, $m, $y, $e); # all arguments given ($y, $e) = $n->gsl_sf_choose($m); # method call $n->gsl_sf_choose($m, $y, $e); =for ref n choose m =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_choose = \&PDL::gsl_sf_choose; =head2 gsl_sf_lnpoch =for sig Signature: (double x(); double [o]y(); double [o]s(); double [o]e(); double a) Types: (double) =for usage ($y, $s, $e) = gsl_sf_lnpoch($x, $a); gsl_sf_lnpoch($x, $y, $s, $e, $a); # all arguments given ($y, $s, $e) = $x->gsl_sf_lnpoch($a); # method call $x->gsl_sf_lnpoch($y, $s, $e, $a); =for ref Logarithm of Pochammer (Apell) symbol, with sign information. result = log( |(a)_x| ), sgn = sgn( (a)_x ) where (a)_x := Gamma[a + x]/Gamma[a] =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_lnpoch = \&PDL::gsl_sf_lnpoch; =head2 gsl_sf_poch =for sig Signature: (double x(); double [o]y(); double [o]e(); double a) Types: (double) =for usage ($y, $e) = gsl_sf_poch($x, $a); gsl_sf_poch($x, $y, $e, $a); # all arguments given ($y, $e) = $x->gsl_sf_poch($a); # method call $x->gsl_sf_poch($y, $e, $a); =for ref Pochammer (Apell) symbol (a)_x := Gamma[a + x]/Gamma[x] =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_poch = \&PDL::gsl_sf_poch; =head2 gsl_sf_pochrel =for sig Signature: (double x(); double [o]y(); double [o]e(); double a) Types: (double) =for usage ($y, $e) = gsl_sf_pochrel($x, $a); gsl_sf_pochrel($x, $y, $e, $a); # all arguments given ($y, $e) = $x->gsl_sf_pochrel($a); # method call $x->gsl_sf_pochrel($y, $e, $a); =for ref Relative Pochammer (Apell) symbol ((a,x) - 1)/x where (a,x) = (a)_x := Gamma[a + x]/Gamma[a] =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_pochrel = \&PDL::gsl_sf_pochrel; =head2 gsl_sf_gamma_inc_Q =for sig Signature: (double x(); double [o]y(); double [o]e(); double a) Types: (double) =for usage ($y, $e) = gsl_sf_gamma_inc_Q($x, $a); gsl_sf_gamma_inc_Q($x, $y, $e, $a); # all arguments given ($y, $e) = $x->gsl_sf_gamma_inc_Q($a); # method call $x->gsl_sf_gamma_inc_Q($y, $e, $a); =for ref Normalized Incomplete Gamma Function Q(a,x) = 1/Gamma(a) Integral[ t^(a-1) e^(-t), {t,x,Infinity} ] =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_gamma_inc_Q = \&PDL::gsl_sf_gamma_inc_Q; =head2 gsl_sf_gamma_inc_P =for sig Signature: (double x(); double [o]y(); double [o]e(); double a) Types: (double) =for usage ($y, $e) = gsl_sf_gamma_inc_P($x, $a); gsl_sf_gamma_inc_P($x, $y, $e, $a); # all arguments given ($y, $e) = $x->gsl_sf_gamma_inc_P($a); # method call $x->gsl_sf_gamma_inc_P($y, $e, $a); =for ref Complementary Normalized Incomplete Gamma Function P(a,x) = 1/Gamma(a) Integral[ t^(a-1) e^(-t), {t,0,x} ] =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_gamma_inc_P = \&PDL::gsl_sf_gamma_inc_P; =head2 gsl_sf_lnbeta =for sig Signature: (double a(); double b(); double [o]y(); double [o]e()) Types: (double) =for usage ($y, $e) = gsl_sf_lnbeta($a, $b); gsl_sf_lnbeta($a, $b, $y, $e); # all arguments given ($y, $e) = $a->gsl_sf_lnbeta($b); # method call $a->gsl_sf_lnbeta($b, $y, $e); =for ref Logarithm of Beta Function Log[B(a,b)] =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_lnbeta = \&PDL::gsl_sf_lnbeta; =head2 gsl_sf_beta =for sig Signature: (double a(); double b();double [o]y(); double [o]e()) Types: (double) =for usage ($y, $e) = gsl_sf_beta($a, $b); gsl_sf_beta($a, $b, $y, $e); # all arguments given ($y, $e) = $a->gsl_sf_beta($b); # method call $a->gsl_sf_beta($b, $y, $e); =for ref Beta Function B(a,b) =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_beta = \&PDL::gsl_sf_beta; =head2 gsl_sf_gegenpoly_n =for sig Signature: (double x(); double [o]y(); double [o]e(); int n; double lambda) Types: (double) =for usage ($y, $e) = gsl_sf_gegenpoly_n($x, $n, $lambda); gsl_sf_gegenpoly_n($x, $y, $e, $n, $lambda); # all arguments given ($y, $e) = $x->gsl_sf_gegenpoly_n($n, $lambda); # method call $x->gsl_sf_gegenpoly_n($y, $e, $n, $lambda); =for ref Evaluate Gegenbauer polynomials. =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_gegenpoly_n = \&PDL::gsl_sf_gegenpoly_n; =head2 gsl_sf_gegenpoly_array =for sig Signature: (double x(); double [o]y(num); int n=>num; double lambda) Types: (double) =for usage $y = gsl_sf_gegenpoly_array($x, $n, $lambda); gsl_sf_gegenpoly_array($x, $y, $n, $lambda); # all arguments given $y = $x->gsl_sf_gegenpoly_array($n, $lambda); # method call $x->gsl_sf_gegenpoly_array($y, $n, $lambda); =for ref Calculate array of Gegenbauer polynomials from 0 to n-1. =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_gegenpoly_array = \&PDL::gsl_sf_gegenpoly_array; =head2 gsl_sf_hyperg_0F1 =for sig Signature: (double x(); double [o]y(); double [o]e(); double c) Types: (double) =for usage ($y, $e) = gsl_sf_hyperg_0F1($x, $c); gsl_sf_hyperg_0F1($x, $y, $e, $c); # all arguments given ($y, $e) = $x->gsl_sf_hyperg_0F1($c); # method call $x->gsl_sf_hyperg_0F1($y, $e, $c); =for ref /* Hypergeometric function related to Bessel functions 0F1[c,x] = Gamma[c] x^(1/2(1-c)) I_{c-1}(2 Sqrt[x]) Gamma[c] (-x)^(1/2(1-c)) J_{c-1}(2 Sqrt[-x]) =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_hyperg_0F1 = \&PDL::gsl_sf_hyperg_0F1; =head2 gsl_sf_hyperg_1F1 =for sig Signature: (double x(); double [o]y(); double [o]e(); double a; double b) Types: (double) =for usage ($y, $e) = gsl_sf_hyperg_1F1($x, $a, $b); gsl_sf_hyperg_1F1($x, $y, $e, $a, $b); # all arguments given ($y, $e) = $x->gsl_sf_hyperg_1F1($a, $b); # method call $x->gsl_sf_hyperg_1F1($y, $e, $a, $b); =for ref Confluent hypergeometric function for integer parameters. 1F1[a,b,x] = M(a,b,x) =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_hyperg_1F1 = \&PDL::gsl_sf_hyperg_1F1; =head2 gsl_sf_hyperg_U =for sig Signature: (double x(); double [o]y(); double [o]e(); double a; double b) Types: (double) =for usage ($y, $e) = gsl_sf_hyperg_U($x, $a, $b); gsl_sf_hyperg_U($x, $y, $e, $a, $b); # all arguments given ($y, $e) = $x->gsl_sf_hyperg_U($a, $b); # method call $x->gsl_sf_hyperg_U($y, $e, $a, $b); =for ref Confluent hypergeometric function for integer parameters. U(a,b,x) =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_hyperg_U = \&PDL::gsl_sf_hyperg_U; =head2 gsl_sf_hyperg_2F1 =for sig Signature: (double x(); double [o]y(); double [o]e(); double a; double b; double c) Types: (double) =for usage ($y, $e) = gsl_sf_hyperg_2F1($x, $a, $b, $c); gsl_sf_hyperg_2F1($x, $y, $e, $a, $b, $c); # all arguments given ($y, $e) = $x->gsl_sf_hyperg_2F1($a, $b, $c); # method call $x->gsl_sf_hyperg_2F1($y, $e, $a, $b, $c); =for ref Confluent hypergeometric function for integer parameters. 2F1[a,b,c,x] =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_hyperg_2F1 = \&PDL::gsl_sf_hyperg_2F1; =head2 gsl_sf_hyperg_2F1_conj =for sig Signature: (double x(); double [o]y(); double [o]e(); double a; double b; double c) Types: (double) =for usage ($y, $e) = gsl_sf_hyperg_2F1_conj($x, $a, $b, $c); gsl_sf_hyperg_2F1_conj($x, $y, $e, $a, $b, $c); # all arguments given ($y, $e) = $x->gsl_sf_hyperg_2F1_conj($a, $b, $c); # method call $x->gsl_sf_hyperg_2F1_conj($y, $e, $a, $b, $c); =for ref Gauss hypergeometric function 2F1[aR + I aI, aR - I aI, c, x] =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_hyperg_2F1_conj = \&PDL::gsl_sf_hyperg_2F1_conj; =head2 gsl_sf_hyperg_2F1_renorm =for sig Signature: (double x(); double [o]y(); double [o]e(); double a; double b; double c) Types: (double) =for usage ($y, $e) = gsl_sf_hyperg_2F1_renorm($x, $a, $b, $c); gsl_sf_hyperg_2F1_renorm($x, $y, $e, $a, $b, $c); # all arguments given ($y, $e) = $x->gsl_sf_hyperg_2F1_renorm($a, $b, $c); # method call $x->gsl_sf_hyperg_2F1_renorm($y, $e, $a, $b, $c); =for ref Renormalized Gauss hypergeometric function 2F1[a,b,c,x] / Gamma[c] =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_hyperg_2F1_renorm = \&PDL::gsl_sf_hyperg_2F1_renorm; =head2 gsl_sf_hyperg_2F1_conj_renorm =for sig Signature: (double x(); double [o]y(); double [o]e(); double a; double b; double c) Types: (double) =for usage ($y, $e) = gsl_sf_hyperg_2F1_conj_renorm($x, $a, $b, $c); gsl_sf_hyperg_2F1_conj_renorm($x, $y, $e, $a, $b, $c); # all arguments given ($y, $e) = $x->gsl_sf_hyperg_2F1_conj_renorm($a, $b, $c); # method call $x->gsl_sf_hyperg_2F1_conj_renorm($y, $e, $a, $b, $c); =for ref Renormalized Gauss hypergeometric function 2F1[aR + I aI, aR - I aI, c, x] / Gamma[c] =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_hyperg_2F1_conj_renorm = \&PDL::gsl_sf_hyperg_2F1_conj_renorm; =head2 gsl_sf_hyperg_2F0 =for sig Signature: (double x(); double [o]y(); double [o]e(); double a; double b) Types: (double) =for usage ($y, $e) = gsl_sf_hyperg_2F0($x, $a, $b); gsl_sf_hyperg_2F0($x, $y, $e, $a, $b); # all arguments given ($y, $e) = $x->gsl_sf_hyperg_2F0($a, $b); # method call $x->gsl_sf_hyperg_2F0($y, $e, $a, $b); =for ref Mysterious hypergeometric function. The series representation is a divergent hypergeometric series. However, for x < 0 we have 2F0(a,b,x) = (-1/x)^a U(a,1+a-b,-1/x) =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_hyperg_2F0 = \&PDL::gsl_sf_hyperg_2F0; =head2 gsl_sf_laguerre_n =for sig Signature: (double x(); double [o]y(); double [o]e(); int n; double a) Types: (double) =for usage ($y, $e) = gsl_sf_laguerre_n($x, $n, $a); gsl_sf_laguerre_n($x, $y, $e, $n, $a); # all arguments given ($y, $e) = $x->gsl_sf_laguerre_n($n, $a); # method call $x->gsl_sf_laguerre_n($y, $e, $n, $a); =for ref Evaluate generalized Laguerre polynomials. =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_laguerre_n = \&PDL::gsl_sf_laguerre_n; =head2 gsl_sf_legendre_Pl =for sig Signature: (double x(); double [o]y(); double [o]e(); int l) Types: (double) =for usage ($y, $e) = gsl_sf_legendre_Pl($x, $l); gsl_sf_legendre_Pl($x, $y, $e, $l); # all arguments given ($y, $e) = $x->gsl_sf_legendre_Pl($l); # method call $x->gsl_sf_legendre_Pl($y, $e, $l); =for ref P_l(x) =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_legendre_Pl = \&PDL::gsl_sf_legendre_Pl; =head2 gsl_sf_legendre_Pl_array =for sig Signature: (double x(); double [o]y(num); int l=>num) Types: (double) =for usage $y = gsl_sf_legendre_Pl_array($x, $l); gsl_sf_legendre_Pl_array($x, $y, $l); # all arguments given $y = $x->gsl_sf_legendre_Pl_array($l); # method call $x->gsl_sf_legendre_Pl_array($y, $l); =for ref P_l(x) from 0 to n-1. =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_legendre_Pl_array = \&PDL::gsl_sf_legendre_Pl_array; =head2 gsl_sf_legendre_Ql =for sig Signature: (double x(); double [o]y(); double [o]e(); int l) Types: (double) =for usage ($y, $e) = gsl_sf_legendre_Ql($x, $l); gsl_sf_legendre_Ql($x, $y, $e, $l); # all arguments given ($y, $e) = $x->gsl_sf_legendre_Ql($l); # method call $x->gsl_sf_legendre_Ql($y, $e, $l); =for ref Q_l(x) =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_legendre_Ql = \&PDL::gsl_sf_legendre_Ql; =head2 gsl_sf_legendre_Plm =for sig Signature: (double x(); double [o]y(); double [o]e(); int l; int m) Types: (double) =for usage ($y, $e) = gsl_sf_legendre_Plm($x, $l, $m); gsl_sf_legendre_Plm($x, $y, $e, $l, $m); # all arguments given ($y, $e) = $x->gsl_sf_legendre_Plm($l, $m); # method call $x->gsl_sf_legendre_Plm($y, $e, $l, $m); =for ref P_lm(x) =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_legendre_Plm = \&PDL::gsl_sf_legendre_Plm; =head2 gsl_sf_legendre_array =for sig Signature: (double x(); double [o]y(n=CALC($COMP(lmax)*($COMP(lmax)+1)/2+$COMP(lmax)+1)); double [t]work(wn=CALC(gsl_sf_legendre_array_n($COMP(lmax)))); char norm; int lmax; int csphase) Types: (double) =for ref Calculate all normalized associated Legendre polynomials. =for usage $Plm = gsl_sf_legendre_array($x,'P',4,-1); The calculation is done for degree 0 <= l <= lmax and order 0 <= m <= l on the range abs(x)<=1. The parameter norm should be: =over 3 =item 'S' for Schmidt semi-normalized associated Legendre polynomials S_l^m(x), =item 'Y' for spherical harmonic associated Legendre polynomials Y_l^m(x), or =item 'N' for fully normalized associated Legendre polynomials N_l^m(x). =item 'P' (or any other) for unnormalized associated Legendre polynomials P_l^m(x), =back lmax is the maximum degree l. csphase should be (-1) to INCLUDE the Condon-Shortley phase factor (-1)^m, or (+1) to EXCLUDE it. See L to get the value of C and C in the returned vector. =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_legendre_array = \&PDL::gsl_sf_legendre_array; =head2 gsl_sf_legendre_array_index =for sig Signature: (int [o]l(n=CALC($COMP(lmax)*($COMP(lmax)+1)/2+$COMP(lmax)+1)); int [o]m(n); int lmax) Types: (sbyte byte short ushort long ulong indx ulonglong longlong float double ldouble) =for ref Calculate the relation between gsl_sf_legendre_arrays index and l and m values. =for usage ($l,$m) = gsl_sf_legendre_array_index($lmax); Note that this function is called differently than the corresponding GSL function, to make it more useful for PDL: here you just input the maximum l (lmax) that was used in C and it calculates all l and m values. =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_legendre_array_index = \&PDL::gsl_sf_legendre_array_index; =head2 gsl_sf_legendre_sphPlm =for sig Signature: (double x(); double [o]y(); double [o]e(); int l; int m) Types: (double) =for usage ($y, $e) = gsl_sf_legendre_sphPlm($x, $l, $m); gsl_sf_legendre_sphPlm($x, $y, $e, $l, $m); # all arguments given ($y, $e) = $x->gsl_sf_legendre_sphPlm($l, $m); # method call $x->gsl_sf_legendre_sphPlm($y, $e, $l, $m); =for ref P_lm(x), normalized properly for use in spherical harmonics =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_legendre_sphPlm = \&PDL::gsl_sf_legendre_sphPlm; =head2 gsl_sf_conicalP_half =for sig Signature: (double x(); double [o]y(); double [o]e(); double lambda) Types: (double) =for usage ($y, $e) = gsl_sf_conicalP_half($x, $lambda); gsl_sf_conicalP_half($x, $y, $e, $lambda); # all arguments given ($y, $e) = $x->gsl_sf_conicalP_half($lambda); # method call $x->gsl_sf_conicalP_half($y, $e, $lambda); =for ref Irregular Spherical Conical Function P^{1/2}_{-1/2 + I lambda}(x) =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_conicalP_half = \&PDL::gsl_sf_conicalP_half; =head2 gsl_sf_conicalP_mhalf =for sig Signature: (double x(); double [o]y(); double [o]e(); double lambda) Types: (double) =for usage ($y, $e) = gsl_sf_conicalP_mhalf($x, $lambda); gsl_sf_conicalP_mhalf($x, $y, $e, $lambda); # all arguments given ($y, $e) = $x->gsl_sf_conicalP_mhalf($lambda); # method call $x->gsl_sf_conicalP_mhalf($y, $e, $lambda); =for ref Regular Spherical Conical Function P^{-1/2}_{-1/2 + I lambda}(x) =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_conicalP_mhalf = \&PDL::gsl_sf_conicalP_mhalf; =head2 gsl_sf_conicalP_0 =for sig Signature: (double x(); double [o]y(); double [o]e(); double lambda) Types: (double) =for usage ($y, $e) = gsl_sf_conicalP_0($x, $lambda); gsl_sf_conicalP_0($x, $y, $e, $lambda); # all arguments given ($y, $e) = $x->gsl_sf_conicalP_0($lambda); # method call $x->gsl_sf_conicalP_0($y, $e, $lambda); =for ref Conical Function P^{0}_{-1/2 + I lambda}(x) =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_conicalP_0 = \&PDL::gsl_sf_conicalP_0; =head2 gsl_sf_conicalP_1 =for sig Signature: (double x(); double [o]y(); double [o]e(); double lambda) Types: (double) =for usage ($y, $e) = gsl_sf_conicalP_1($x, $lambda); gsl_sf_conicalP_1($x, $y, $e, $lambda); # all arguments given ($y, $e) = $x->gsl_sf_conicalP_1($lambda); # method call $x->gsl_sf_conicalP_1($y, $e, $lambda); =for ref Conical Function P^{1}_{-1/2 + I lambda}(x) =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_conicalP_1 = \&PDL::gsl_sf_conicalP_1; =head2 gsl_sf_conicalP_sph_reg =for sig Signature: (double x(); double [o]y(); double [o]e(); int l; double lambda) Types: (double) =for usage ($y, $e) = gsl_sf_conicalP_sph_reg($x, $l, $lambda); gsl_sf_conicalP_sph_reg($x, $y, $e, $l, $lambda); # all arguments given ($y, $e) = $x->gsl_sf_conicalP_sph_reg($l, $lambda); # method call $x->gsl_sf_conicalP_sph_reg($y, $e, $l, $lambda); =for ref Regular Spherical Conical Function P^{-1/2-l}_{-1/2 + I lambda}(x) =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_conicalP_sph_reg = \&PDL::gsl_sf_conicalP_sph_reg; =head2 gsl_sf_conicalP_cyl_reg_e =for sig Signature: (double x(); double [o]y(); double [o]e(); int m; double lambda) Types: (double) =for usage ($y, $e) = gsl_sf_conicalP_cyl_reg_e($x, $m, $lambda); gsl_sf_conicalP_cyl_reg_e($x, $y, $e, $m, $lambda); # all arguments given ($y, $e) = $x->gsl_sf_conicalP_cyl_reg_e($m, $lambda); # method call $x->gsl_sf_conicalP_cyl_reg_e($y, $e, $m, $lambda); =for ref Regular Cylindrical Conical Function P^{-m}_{-1/2 + I lambda}(x) =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_conicalP_cyl_reg_e = \&PDL::gsl_sf_conicalP_cyl_reg_e; =head2 gsl_sf_legendre_H3d =for sig Signature: (double [o]y(); double [o]e(); int l; double lambda; double eta) Types: (double) =for usage ($y, $e) = gsl_sf_legendre_H3d($l, $lambda, $eta); gsl_sf_legendre_H3d($y, $e, $l, $lambda, $eta); # all arguments given ($y, $e) = $l->gsl_sf_legendre_H3d($lambda, $eta); # method call $y->gsl_sf_legendre_H3d($e, $l, $lambda, $eta); =for ref lth radial eigenfunction of the Laplacian on the 3-dimensional hyperbolic space. =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_legendre_H3d = \&PDL::gsl_sf_legendre_H3d; =head2 gsl_sf_legendre_H3d_array =for sig Signature: (double [o]y(num); int l=>num; double lambda; double eta) Types: (double) =for usage $y = gsl_sf_legendre_H3d_array($l, $lambda, $eta); gsl_sf_legendre_H3d_array($y, $l, $lambda, $eta); # all arguments given $y = $l->gsl_sf_legendre_H3d_array($lambda, $eta); # method call $y->gsl_sf_legendre_H3d_array($l, $lambda, $eta); =for ref Array of H3d(ell), for l from 0 to n-1. =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_legendre_H3d_array = \&PDL::gsl_sf_legendre_H3d_array; =head2 gsl_sf_log =for sig Signature: (double x(); double [o]y(); double [o]e()) Types: (double) =for usage ($y, $e) = gsl_sf_log($x); gsl_sf_log($x, $y, $e); # all arguments given ($y, $e) = $x->gsl_sf_log; # method call $x->gsl_sf_log($y, $e); =for ref Provide a logarithm function with GSL semantics. =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_log = \&PDL::gsl_sf_log; =head2 gsl_sf_complex_log =for sig Signature: (double zr(); double zi(); double [o]x(); double [o]y(); double [o]xe(); double [o]ye()) Types: (double) =for usage ($x, $y, $xe, $ye) = gsl_sf_complex_log($zr, $zi); gsl_sf_complex_log($zr, $zi, $x, $y, $xe, $ye); # all arguments given ($x, $y, $xe, $ye) = $zr->gsl_sf_complex_log($zi); # method call $zr->gsl_sf_complex_log($zi, $x, $y, $xe, $ye); =for ref Complex Logarithm exp(lnr + I theta) = zr + I zi Returns argument in [-pi,pi]. =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_complex_log = \&PDL::gsl_sf_complex_log; =head2 gsl_poly_eval =for sig Signature: (double x(); double c(m); double [o]y()) Types: (double) =for usage $y = gsl_poly_eval($x, $c); gsl_poly_eval($x, $c, $y); # all arguments given $y = $x->gsl_poly_eval($c); # method call $x->gsl_poly_eval($c, $y); =for ref c[0] + c[1] x + c[2] x^2 + ... + c[m-1] x^(m-1) =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_poly_eval = \&PDL::gsl_poly_eval; =head2 gsl_sf_pow_int =for sig Signature: (double x(); double [o]y(); double [o]e(); int n) Types: (double) =for usage ($y, $e) = gsl_sf_pow_int($x, $n); gsl_sf_pow_int($x, $y, $e, $n); # all arguments given ($y, $e) = $x->gsl_sf_pow_int($n); # method call $x->gsl_sf_pow_int($y, $e, $n); =for ref Calculate x^n. =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_pow_int = \&PDL::gsl_sf_pow_int; =head2 gsl_sf_psi =for sig Signature: (double x(); double [o]y(); double [o]e()) Types: (double) =for usage ($y, $e) = gsl_sf_psi($x); gsl_sf_psi($x, $y, $e); # all arguments given ($y, $e) = $x->gsl_sf_psi; # method call $x->gsl_sf_psi($y, $e); =for ref Di-Gamma Function psi(x). =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_psi = \&PDL::gsl_sf_psi; =head2 gsl_sf_psi_1piy =for sig Signature: (double x(); double [o]y(); double [o]e()) Types: (double) =for usage ($y, $e) = gsl_sf_psi_1piy($x); gsl_sf_psi_1piy($x, $y, $e); # all arguments given ($y, $e) = $x->gsl_sf_psi_1piy; # method call $x->gsl_sf_psi_1piy($y, $e); =for ref Di-Gamma Function Re[psi(1 + I y)] =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_psi_1piy = \&PDL::gsl_sf_psi_1piy; =head2 gsl_sf_psi_n =for sig Signature: (double x(); double [o]y(); double [o]e(); int n) Types: (double) =for usage ($y, $e) = gsl_sf_psi_n($x, $n); gsl_sf_psi_n($x, $y, $e, $n); # all arguments given ($y, $e) = $x->gsl_sf_psi_n($n); # method call $x->gsl_sf_psi_n($y, $e, $n); =for ref Poly-Gamma Function psi^(n)(x) =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_psi_n = \&PDL::gsl_sf_psi_n; =head2 gsl_sf_synchrotron_1 =for sig Signature: (double x(); double [o]y(); double [o]e()) Types: (double) =for usage ($y, $e) = gsl_sf_synchrotron_1($x); gsl_sf_synchrotron_1($x, $y, $e); # all arguments given ($y, $e) = $x->gsl_sf_synchrotron_1; # method call $x->gsl_sf_synchrotron_1($y, $e); =for ref First synchrotron function: synchrotron_1(x) = x Integral[ K_{5/3}(t), {t, x, Infinity}] =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_synchrotron_1 = \&PDL::gsl_sf_synchrotron_1; =head2 gsl_sf_synchrotron_2 =for sig Signature: (double x(); double [o]y(); double [o]e()) Types: (double) =for usage ($y, $e) = gsl_sf_synchrotron_2($x); gsl_sf_synchrotron_2($x, $y, $e); # all arguments given ($y, $e) = $x->gsl_sf_synchrotron_2; # method call $x->gsl_sf_synchrotron_2($y, $e); =for ref Second synchroton function: synchrotron_2(x) = x * K_{2/3}(x) =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_synchrotron_2 = \&PDL::gsl_sf_synchrotron_2; =head2 gsl_sf_transport_2 =for sig Signature: (double x(); double [o]y(); double [o]e()) Types: (double) =for usage ($y, $e) = gsl_sf_transport_2($x); gsl_sf_transport_2($x, $y, $e); # all arguments given ($y, $e) = $x->gsl_sf_transport_2; # method call $x->gsl_sf_transport_2($y, $e); =for ref J(2,x) =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_transport_2 = \&PDL::gsl_sf_transport_2; =head2 gsl_sf_transport_3 =for sig Signature: (double x(); double [o]y(); double [o]e()) Types: (double) =for usage ($y, $e) = gsl_sf_transport_3($x); gsl_sf_transport_3($x, $y, $e); # all arguments given ($y, $e) = $x->gsl_sf_transport_3; # method call $x->gsl_sf_transport_3($y, $e); =for ref J(3,x) =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_transport_3 = \&PDL::gsl_sf_transport_3; =head2 gsl_sf_transport_4 =for sig Signature: (double x(); double [o]y(); double [o]e()) Types: (double) =for usage ($y, $e) = gsl_sf_transport_4($x); gsl_sf_transport_4($x, $y, $e); # all arguments given ($y, $e) = $x->gsl_sf_transport_4; # method call $x->gsl_sf_transport_4($y, $e); =for ref J(4,x) =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_transport_4 = \&PDL::gsl_sf_transport_4; =head2 gsl_sf_transport_5 =for sig Signature: (double x(); double [o]y(); double [o]e()) Types: (double) =for usage ($y, $e) = gsl_sf_transport_5($x); gsl_sf_transport_5($x, $y, $e); # all arguments given ($y, $e) = $x->gsl_sf_transport_5; # method call $x->gsl_sf_transport_5($y, $e); =for ref J(5,x) =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_transport_5 = \&PDL::gsl_sf_transport_5; =head2 gsl_sf_sin =for sig Signature: (double x(); double [o]y(); double [o]e()) Types: (double) =for usage ($y, $e) = gsl_sf_sin($x); gsl_sf_sin($x, $y, $e); # all arguments given ($y, $e) = $x->gsl_sf_sin; # method call $x->gsl_sf_sin($y, $e); =for ref Sin(x) with GSL semantics. =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_sin = \&PDL::gsl_sf_sin; =head2 gsl_sf_cos =for sig Signature: (double x(); double [o]y(); double [o]e()) Types: (double) =for usage ($y, $e) = gsl_sf_cos($x); gsl_sf_cos($x, $y, $e); # all arguments given ($y, $e) = $x->gsl_sf_cos; # method call $x->gsl_sf_cos($y, $e); =for ref Cos(x) with GSL semantics. =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_cos = \&PDL::gsl_sf_cos; =head2 gsl_sf_hypot =for sig Signature: (double x(); double xx(); double [o]y(); double [o]e()) Types: (double) =for usage ($y, $e) = gsl_sf_hypot($x, $xx); gsl_sf_hypot($x, $xx, $y, $e); # all arguments given ($y, $e) = $x->gsl_sf_hypot($xx); # method call $x->gsl_sf_hypot($xx, $y, $e); =for ref Hypot(x,xx) with GSL semantics. =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_hypot = \&PDL::gsl_sf_hypot; =head2 gsl_sf_complex_sin =for sig Signature: (double zr(); double zi(); double [o]x(); double [o]y(); double [o]xe(); double [o]ye()) Types: (double) =for usage ($x, $y, $xe, $ye) = gsl_sf_complex_sin($zr, $zi); gsl_sf_complex_sin($zr, $zi, $x, $y, $xe, $ye); # all arguments given ($x, $y, $xe, $ye) = $zr->gsl_sf_complex_sin($zi); # method call $zr->gsl_sf_complex_sin($zi, $x, $y, $xe, $ye); =for ref Sin(z) for complex z =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_complex_sin = \&PDL::gsl_sf_complex_sin; =head2 gsl_sf_complex_cos =for sig Signature: (double zr(); double zi(); double [o]x(); double [o]y(); double [o]xe(); double [o]ye()) Types: (double) =for usage ($x, $y, $xe, $ye) = gsl_sf_complex_cos($zr, $zi); gsl_sf_complex_cos($zr, $zi, $x, $y, $xe, $ye); # all arguments given ($x, $y, $xe, $ye) = $zr->gsl_sf_complex_cos($zi); # method call $zr->gsl_sf_complex_cos($zi, $x, $y, $xe, $ye); =for ref Cos(z) for complex z =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_complex_cos = \&PDL::gsl_sf_complex_cos; =head2 gsl_sf_complex_logsin =for sig Signature: (double zr(); double zi(); double [o]x(); double [o]y(); double [o]xe(); double [o]ye()) Types: (double) =for usage ($x, $y, $xe, $ye) = gsl_sf_complex_logsin($zr, $zi); gsl_sf_complex_logsin($zr, $zi, $x, $y, $xe, $ye); # all arguments given ($x, $y, $xe, $ye) = $zr->gsl_sf_complex_logsin($zi); # method call $zr->gsl_sf_complex_logsin($zi, $x, $y, $xe, $ye); =for ref Log(Sin(z)) for complex z =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_complex_logsin = \&PDL::gsl_sf_complex_logsin; =head2 gsl_sf_lnsinh =for sig Signature: (double x(); double [o]y(); double [o]e()) Types: (double) =for usage ($y, $e) = gsl_sf_lnsinh($x); gsl_sf_lnsinh($x, $y, $e); # all arguments given ($y, $e) = $x->gsl_sf_lnsinh; # method call $x->gsl_sf_lnsinh($y, $e); =for ref Log(Sinh(x)) with GSL semantics. =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_lnsinh = \&PDL::gsl_sf_lnsinh; =head2 gsl_sf_lncosh =for sig Signature: (double x(); double [o]y(); double [o]e()) Types: (double) =for usage ($y, $e) = gsl_sf_lncosh($x); gsl_sf_lncosh($x, $y, $e); # all arguments given ($y, $e) = $x->gsl_sf_lncosh; # method call $x->gsl_sf_lncosh($y, $e); =for ref Log(Cos(x)) with GSL semantics. =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_lncosh = \&PDL::gsl_sf_lncosh; =head2 gsl_sf_polar_to_rect =for sig Signature: (double r(); double t(); double [o]x(); double [o]y(); double [o]xe(); double [o]ye()) Types: (double) =for usage ($x, $y, $xe, $ye) = gsl_sf_polar_to_rect($r, $t); gsl_sf_polar_to_rect($r, $t, $x, $y, $xe, $ye); # all arguments given ($x, $y, $xe, $ye) = $r->gsl_sf_polar_to_rect($t); # method call $r->gsl_sf_polar_to_rect($t, $x, $y, $xe, $ye); =for ref Convert polar to rectlinear coordinates. =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_polar_to_rect = \&PDL::gsl_sf_polar_to_rect; =head2 gsl_sf_rect_to_polar =for sig Signature: (double x(); double y(); double [o]r(); double [o]t(); double [o]re(); double [o]te()) Types: (double) =for usage ($r, $t, $re, $te) = gsl_sf_rect_to_polar($x, $y); gsl_sf_rect_to_polar($x, $y, $r, $t, $re, $te); # all arguments given ($r, $t, $re, $te) = $x->gsl_sf_rect_to_polar($y); # method call $x->gsl_sf_rect_to_polar($y, $r, $t, $re, $te); =for ref Convert rectlinear to polar coordinates. return argument in range [-pi, pi]. =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_rect_to_polar = \&PDL::gsl_sf_rect_to_polar; =head2 gsl_sf_angle_restrict_symm =for sig Signature: (double [o]y()) Types: (double) =for usage $y = gsl_sf_angle_restrict_symm(); gsl_sf_angle_restrict_symm($y); # all arguments given $y->gsl_sf_angle_restrict_symm; =for ref Force an angle to lie in the range (-pi,pi]. =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_angle_restrict_symm = \&PDL::gsl_sf_angle_restrict_symm; =head2 gsl_sf_angle_restrict_pos =for sig Signature: (double [o]y()) Types: (double) =for usage $y = gsl_sf_angle_restrict_pos(); gsl_sf_angle_restrict_pos($y); # all arguments given $y->gsl_sf_angle_restrict_pos; =for ref Force an angle to lie in the range [0,2 pi). =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_angle_restrict_pos = \&PDL::gsl_sf_angle_restrict_pos; =head2 gsl_sf_sin_err =for sig Signature: (double x(); double dx(); double [o]y(); double [o]e()) Types: (double) =for usage ($y, $e) = gsl_sf_sin_err($x, $dx); gsl_sf_sin_err($x, $dx, $y, $e); # all arguments given ($y, $e) = $x->gsl_sf_sin_err($dx); # method call $x->gsl_sf_sin_err($dx, $y, $e); =for ref Sin(x) for quantity with an associated error. =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_sin_err = \&PDL::gsl_sf_sin_err; =head2 gsl_sf_cos_err =for sig Signature: (double x(); double dx(); double [o]y(); double [o]e()) Types: (double) =for usage ($y, $e) = gsl_sf_cos_err($x, $dx); gsl_sf_cos_err($x, $dx, $y, $e); # all arguments given ($y, $e) = $x->gsl_sf_cos_err($dx); # method call $x->gsl_sf_cos_err($dx, $y, $e); =for ref Cos(x) for quantity with an associated error. =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_cos_err = \&PDL::gsl_sf_cos_err; =head2 gsl_sf_zeta =for sig Signature: (double x(); double [o]y(); double [o]e()) Types: (double) =for usage ($y, $e) = gsl_sf_zeta($x); gsl_sf_zeta($x, $y, $e); # all arguments given ($y, $e) = $x->gsl_sf_zeta; # method call $x->gsl_sf_zeta($y, $e); =for ref Riemann Zeta Function zeta(x) = Sum[ k^(-s), {k,1,Infinity} ], s != 1.0 =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_zeta = \&PDL::gsl_sf_zeta; =head2 gsl_sf_hzeta =for sig Signature: (double s(); double [o]y(); double [o]e(); double q) Types: (double) =for usage ($y, $e) = gsl_sf_hzeta($s, $q); gsl_sf_hzeta($s, $y, $e, $q); # all arguments given ($y, $e) = $s->gsl_sf_hzeta($q); # method call $s->gsl_sf_hzeta($y, $e, $q); =for ref Hurwicz Zeta Function zeta(s,q) = Sum[ (k+q)^(-s), {k,0,Infinity} ] =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_hzeta = \&PDL::gsl_sf_hzeta; =head2 gsl_sf_eta =for sig Signature: (double x(); double [o]y(); double [o]e()) Types: (double) =for usage ($y, $e) = gsl_sf_eta($x); gsl_sf_eta($x, $y, $e); # all arguments given ($y, $e) = $x->gsl_sf_eta; # method call $x->gsl_sf_eta($y, $e); =for ref Eta Function eta(s) = (1-2^(1-s)) zeta(s) =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_sf_eta = \&PDL::gsl_sf_eta; #line 64 "lib/PDL/GSL/SF.pd" =head1 AUTHOR This file copyright (C) 1999 Christian Pellegrin All rights reserved. There is no warranty. You are allowed to redistribute this software / documentation under certain conditions. For details, see the file COPYING in the PDL distribution. If this file is separated from the PDL distribution, the copyright notice should be included in the file. The GSL SF modules were written by G. Jungman. =cut #line 6325 "lib/PDL/GSL/SF.pm" # Exit with OK status 1; PDL-GSL-2.103/GENERATED/PDL/GSL/INTERP.pm0000644000175000017500000001671015160062237016417 0ustar osboxesosboxes# # GENERATED WITH PDL::PP from lib/PDL/GSL/INTERP.pd! Don't modify! # package PDL::GSL::INTERP; our @EXPORT_OK = qw( ); our %EXPORT_TAGS = (Func=>\@EXPORT_OK); use PDL::Core; use PDL::Exporter; use DynaLoader; our @ISA = ( 'PDL::Exporter','DynaLoader' ); push @PDL::Core::PP, __PACKAGE__; bootstrap PDL::GSL::INTERP ; #line 6 "lib/PDL/GSL/INTERP.pd" use strict; use warnings; =head1 NAME PDL::GSL::INTERP - PDL interface to Interpolation routines in GSL =head1 DESCRIPTION This is an interface to the interpolation package present in the GNU Scientific Library. =head1 SYNOPSIS use PDL; use PDL::GSL::INTERP; my $x = sequence(10); my $y = exp($x); my $spl = PDL::GSL::INTERP->init('cspline',$x,$y); my $res = $spl->eval(4.35); $res = $spl->deriv(4.35); $res = $spl->deriv2(4.35); $res = $spl->integ(2.1,7.4); =head1 NOMENCLATURE Throughout this documentation we strive to use the same variables that are present in the original GSL documentation (see L). Oftentimes those variables are called C and C. Since good Perl coding practices discourage the use of Perl variables C<$a> and C<$b>, here we refer to Parameters C and C as C<$pa> and C<$pb>, respectively, and Limits (of domain or integration) as C<$la> and C<$lb>. #line 65 "lib/PDL/GSL/INTERP.pm" =head1 FUNCTIONS =cut =head2 init =for sig Signature: (double x(n); double y(n); gsl_spline *spl) Types: (sbyte byte short ushort long ulong indx ulonglong longlong float double ldouble) =for ref The init method initializes a new instance of INTERP. It needs as input an interpolation type and two ndarrays holding the x and y values to be interpolated. The GSL routines require that x be monotonically increasing and a quicksort is performed by default to ensure that. You can skip the quicksort by passing the option {Sort => 0}. The available interpolation types are : =over 2 =item linear =item polynomial =item cspline (natural cubic spline) =item cspline_periodic (periodic cubic spline) =item akima (natural akima spline) =item akima_periodic (periodic akima spline) =back Please check the GSL documentation for more information. =for usage Usage: $blessed_ref = PDL::GSL::INTERP->init($interp_method,$x,$y,$opt); =for example Example: $x = sequence(10); $y = exp($x); $spl = PDL::GSL::INTERP->init('cspline',$x,$y) $spl = PDL::GSL::INTERP->init('cspline',$x,$y,{Sort => 1}) #same as above # no sorting done on x, user is certain that x is monotonically increasing $spl = PDL::GSL::INTERP->init('cspline',$x,$y,{Sort => 0}); =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub init { my $opt; if (ref($_[$#_]) eq 'HASH'){ $opt = pop @_; } else{ $opt = {Sort => 1}; } my ($class,$type,$x,$y) = @_; if( (ref($x) ne 'PDL') || (ref($y) ne 'PDL') ){ barf("Have to pass ndarrays as arguments to init method\n"); } if($$opt{Sort} != 0){ my $idx = PDL::Ufunc::qsorti($x); $x = $x->index($idx); $y = $y->index($idx); } my $ene = nelem($x); my $obj1 = new_spline($type,$ene); my $obj2 = new_accel(); _init_int($x,$y,$$obj1); my @ret_a = ($obj1,$obj2); return bless(\@ret_a, $class); } *init = \&PDL::GSL::INTERP::init; =head2 eval =for sig Signature: (double x(); double [o] out(); gsl_spline *spl;gsl_interp_accel *acc) Types: (sbyte byte short ushort long ulong indx ulonglong longlong float double ldouble) =for ref The function eval returns the interpolating function at a given point. It will barf with an "input domain error" if you try to extrapolate. =for usage Usage: $result = $spl->eval($points); =for example Example: my $res = $spl->eval($x) =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub eval { my $opt; my ($obj,$x) = @_; my $s_obj = $$obj[0]; my $a_obj = $$obj[1]; _eval_int($x,my $o=PDL->null,$$s_obj,$$a_obj); $o; } *eval = \&PDL::GSL::INTERP::eval; =head2 deriv =for sig Signature: (double x(); double [o] out(); gsl_spline *spl;gsl_interp_accel *acc) Types: (sbyte byte short ushort long ulong indx ulonglong longlong float double ldouble) =for ref The deriv function returns the derivative of the interpolating function at a given point. It will barf with an "input domain error" if you try to extrapolate. =for usage Usage: $result = $spl->deriv($points); =for example Example: my $res = $spl->deriv($x) =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub deriv { my ($obj,$x) = @_; my $s_obj = $$obj[0]; my $a_obj = $$obj[1]; _deriv_int($x,my $o=PDL->null,$$s_obj,$$a_obj); $o; } *deriv = \&PDL::GSL::INTERP::deriv; =head2 deriv2 =for sig Signature: (double x(); double [o] out(); gsl_spline *spl;gsl_interp_accel *acc) Types: (sbyte byte short ushort long ulong indx ulonglong longlong float double ldouble) =for ref The deriv2 function returns the second derivative of the interpolating function at a given point. It will barf with an "input domain error" if you try to extrapolate. =for usage Usage: $result = $spl->deriv2($points); =for example Example: my $res = $spl->deriv2($x) =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub deriv2 { my ($obj,$x) = @_; my $s_obj = $$obj[0]; my $a_obj = $$obj[1]; _deriv2_int($x,my $o=PDL->null,$$s_obj,$$a_obj); $o; } *deriv2 = \&PDL::GSL::INTERP::deriv2; =head2 integ =for sig Signature: (double a(); double b(); double [o] out(); gsl_spline *spl;gsl_interp_accel *acc) Types: (sbyte byte short ushort long ulong indx ulonglong longlong float double ldouble) =for ref The integ function returns the integral of the interpolating function between two points. It will barf with an "input domain error" if you try to extrapolate. =for usage Usage: $result = $spl->integ($la,$lb); =for example Example: my $res = $spl->integ($la,$lb) =pod Broadcasts over its inputs. =for bad C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut sub integ { my ($obj,$la,$lb) = @_; my $s_obj = $$obj[0]; my $a_obj = $$obj[1]; _integ_int($la,$lb,my $o=PDL->null,$$s_obj,$$a_obj); $o; } *integ = \&PDL::GSL::INTERP::integ; #line 45 "lib/PDL/GSL/INTERP.pd" =head1 BUGS Feedback is welcome. =head1 SEE ALSO L The GSL documentation for interpolation is online at L =head1 AUTHOR This file copyright (C) 2003 Andres Jordan All rights reserved. There is no warranty. You are allowed to redistribute this software/documentation under certain conditions. For details, see the file COPYING in the PDL distribution. If this file is separated from the PDL distribution, the copyright notice should be included in the file. The GSL interpolation module was written by Gerard Jungman. =cut #line 430 "lib/PDL/GSL/INTERP.pm" # Exit with OK status 1; PDL-GSL-2.103/GENERATED/PDL/GSL/LINALG.pm0000644000175000017500000001045515160062237016364 0ustar osboxesosboxes# # GENERATED WITH PDL::PP from lib/PDL/GSL/LINALG.pd! Don't modify! # package PDL::GSL::LINALG; our @EXPORT_OK = qw(LU_decomp LU_solve LU_det solve_tridiag ); our %EXPORT_TAGS = (Func=>\@EXPORT_OK); use PDL::Core; use PDL::Exporter; use DynaLoader; our @ISA = ( 'PDL::Exporter','DynaLoader' ); push @PDL::Core::PP, __PACKAGE__; bootstrap PDL::GSL::LINALG ; #line 4 "lib/PDL/GSL/LINALG.pd" use strict; use warnings; =head1 NAME PDL::GSL::LINALG - PDL interface to linear algebra routines in GSL =head1 SYNOPSIS use PDL::LiteF; use PDL::MatrixOps; # for 'x' use PDL::GSL::LINALG; my $A = pdl [ [0.18, 0.60, 0.57, 0.96], [0.41, 0.24, 0.99, 0.58], [0.14, 0.30, 0.97, 0.66], [0.51, 0.13, 0.19, 0.85], ]; my $B = sequence(2,4); # column vectors LU_decomp(my $lu=$A->copy, my $p=null, my $signum=null); # transpose so first dim means is vector, higher dims broadcast LU_solve($lu, $p, $B->transpose, my $x=null); $x = $x->inplace->transpose; # now can be matrix-multiplied =head1 DESCRIPTION This is an interface to the linear algebra package present in the GNU Scientific Library. Functions are named as in GSL, but with the initial C removed. They are provided in both real and complex double precision. Currently only LU decomposition interfaces here. Pull requests welcome! #line 61 "lib/PDL/GSL/LINALG.pm" =head1 FUNCTIONS =cut =head2 LU_decomp =for sig Signature: ([io,phys]A(n,m); indx [o,phys]ipiv(p=CALC($PDL(A)->ndims > 1 ? PDLMIN($PDL(A)->dims[0], $PDL(A)->dims[1]) : 1)); int [o,phys]signum()) Types: (cdouble double) =for usage ($ipiv, $signum) = LU_decomp($A); LU_decomp($A, $ipiv, $signum); # all arguments given ($ipiv, $signum) = $A->LU_decomp; # method call $A->LU_decomp($ipiv, $signum); =for ref LU decomposition of the given (real or complex) matrix. =pod Broadcasts over its inputs. =for bad C ignores the bad-value flag of the input ndarrays. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *LU_decomp = \&PDL::LU_decomp; =head2 LU_solve =for sig Signature: ([phys]LU(n,m); indx [phys]ipiv(p); [phys]B(n); [o,phys]x(n)) Types: (cdouble double) =for usage $x = LU_solve($LU, $ipiv, $B); LU_solve($LU, $ipiv, $B, $x); # all arguments given $x = $LU->LU_solve($ipiv, $B); # method call $LU->LU_solve($ipiv, $B, $x); =for ref Solve C using the LU and permutation from L, real or complex. =pod Broadcasts over its inputs. =for bad C ignores the bad-value flag of the input ndarrays. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *LU_solve = \&PDL::LU_solve; =head2 LU_det =for sig Signature: ([phys]LU(n,m); int [phys]signum(); [o]det()) Types: (cdouble double) =for usage $det = LU_det($LU, $signum); LU_det($LU, $signum, $det); # all arguments given $det = $LU->LU_det($signum); # method call $LU->LU_det($signum, $det); =for ref Find the determinant from the LU decomp. =pod Broadcasts over its inputs. =for bad C ignores the bad-value flag of the input ndarrays. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *LU_det = \&PDL::LU_det; =head2 solve_tridiag =for sig Signature: ([phys]diag(n); [phys]superdiag(n); [phys]subdiag(n); [phys]B(n); [o,phys]x(n)) Types: (double) =for usage $x = solve_tridiag($diag, $superdiag, $subdiag, $B); solve_tridiag($diag, $superdiag, $subdiag, $B, $x); # all arguments given $x = $diag->solve_tridiag($superdiag, $subdiag, $B); # method call $diag->solve_tridiag($superdiag, $subdiag, $B, $x); =for ref Solve C where A is a tridiagonal system. Real only, because GSL does not have a complex function. =pod Broadcasts over its inputs. =for bad C ignores the bad-value flag of the input ndarrays. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *solve_tridiag = \&PDL::solve_tridiag; #line 40 "lib/PDL/GSL/LINALG.pd" =head1 SEE ALSO L The GSL documentation for linear algebra is online at L =cut #line 242 "lib/PDL/GSL/LINALG.pm" # Exit with OK status 1; PDL-GSL-2.103/GENERATED/PDL/GSL/CDF.pm0000644000175000017500000016531115160062236016013 0ustar osboxesosboxes# # GENERATED WITH PDL::PP from lib/PDL/GSL/CDF.pd! Don't modify! # package PDL::GSL::CDF; our @EXPORT_OK = qw(gsl_cdf_beta_P gsl_cdf_beta_Pinv gsl_cdf_beta_Q gsl_cdf_beta_Qinv gsl_cdf_binomial_P gsl_cdf_binomial_Q gsl_cdf_cauchy_P gsl_cdf_cauchy_Pinv gsl_cdf_cauchy_Q gsl_cdf_cauchy_Qinv gsl_cdf_chisq_P gsl_cdf_chisq_Pinv gsl_cdf_chisq_Q gsl_cdf_chisq_Qinv gsl_cdf_exponential_P gsl_cdf_exponential_Pinv gsl_cdf_exponential_Q gsl_cdf_exponential_Qinv gsl_cdf_exppow_P gsl_cdf_exppow_Q gsl_cdf_fdist_P gsl_cdf_fdist_Pinv gsl_cdf_fdist_Q gsl_cdf_fdist_Qinv gsl_cdf_flat_P gsl_cdf_flat_Pinv gsl_cdf_flat_Q gsl_cdf_flat_Qinv gsl_cdf_gamma_P gsl_cdf_gamma_Pinv gsl_cdf_gamma_Q gsl_cdf_gamma_Qinv gsl_cdf_gaussian_P gsl_cdf_gaussian_Pinv gsl_cdf_gaussian_Q gsl_cdf_gaussian_Qinv gsl_cdf_geometric_P gsl_cdf_geometric_Q gsl_cdf_gumbel1_P gsl_cdf_gumbel1_Pinv gsl_cdf_gumbel1_Q gsl_cdf_gumbel1_Qinv gsl_cdf_gumbel2_P gsl_cdf_gumbel2_Pinv gsl_cdf_gumbel2_Q gsl_cdf_gumbel2_Qinv gsl_cdf_hypergeometric_P gsl_cdf_hypergeometric_Q gsl_cdf_laplace_P gsl_cdf_laplace_Pinv gsl_cdf_laplace_Q gsl_cdf_laplace_Qinv gsl_cdf_logistic_P gsl_cdf_logistic_Pinv gsl_cdf_logistic_Q gsl_cdf_logistic_Qinv gsl_cdf_lognormal_P gsl_cdf_lognormal_Pinv gsl_cdf_lognormal_Q gsl_cdf_lognormal_Qinv gsl_cdf_negative_binomial_P gsl_cdf_negative_binomial_Q gsl_cdf_pareto_P gsl_cdf_pareto_Pinv gsl_cdf_pareto_Q gsl_cdf_pareto_Qinv gsl_cdf_pascal_P gsl_cdf_pascal_Q gsl_cdf_poisson_P gsl_cdf_poisson_Q gsl_cdf_rayleigh_P gsl_cdf_rayleigh_Pinv gsl_cdf_rayleigh_Q gsl_cdf_rayleigh_Qinv gsl_cdf_tdist_P gsl_cdf_tdist_Pinv gsl_cdf_tdist_Q gsl_cdf_tdist_Qinv gsl_cdf_ugaussian_P gsl_cdf_ugaussian_Pinv gsl_cdf_ugaussian_Q gsl_cdf_ugaussian_Qinv gsl_cdf_weibull_P gsl_cdf_weibull_Pinv gsl_cdf_weibull_Q gsl_cdf_weibull_Qinv ); our %EXPORT_TAGS = (Func=>\@EXPORT_OK); use PDL::Core; use PDL::Exporter; use DynaLoader; our @ISA = ( 'PDL::Exporter','DynaLoader' ); push @PDL::Core::PP, __PACKAGE__; bootstrap PDL::GSL::CDF ; #line 6 "lib/PDL/GSL/CDF.pd" use strict; use warnings; =head1 NAME PDL::GSL::CDF - PDL interface to GSL Cumulative Distribution Functions =head1 DESCRIPTION This is an interface to the Cumulative Distribution Function package present in the GNU Scientific Library. Let us have a continuous random number distributions are defined by a probability density function C. The cumulative distribution function for the lower tail C is defined by the integral of C, and gives the probability of a variate taking a value less than C. These functions are named B. The cumulative distribution function for the upper tail C is defined by the integral of C, and gives the probability of a variate taking a value greater than C. These functions are named B. The upper and lower cumulative distribution functions are related by C and satisfy C<0 E= P(x) E= 1> and C<0 E= Q(x) E= 1>. The inverse cumulative distributions, C and C give the values of C which correspond to a specific value of C

or C. They can be used to find confidence limits from probability values. These functions are named B and B. For discrete distributions the probability of sampling the integer value C is given by C, where C. The cumulative distribution for the lower tail C of a discrete distribution is defined as, where the sum is over the allowed range of the distribution less than or equal to C. The cumulative distribution for the upper tail of a discrete distribution C is defined as giving the sum of probabilities for all values greater than C. These two definitions satisfy the identity C. If the range of the distribution is C<1> to C inclusive then C, C while C, C. =head1 SYNOPSIS use PDL; use PDL::GSL::CDF; my $p = gsl_cdf_tdist_P( $t, $df ); my $t = gsl_cdf_tdist_Pinv( $p, $df ); =cut #line 75 "lib/PDL/GSL/CDF.pm" =head1 FUNCTIONS =cut #line 138 "lib/PDL/GSL/CDF.pd" =head2 The Beta Distribution (gsl_cdf_beta_*) These functions compute the cumulative distribution functions P(x), Q(x) and their inverses for the beta distribution with parameters I and I. =cut #line 93 "lib/PDL/GSL/CDF.pm" =head2 gsl_cdf_beta_P =for sig Signature: (x(); a(); b(); [o]out()) Types: (double) =for usage $out = gsl_cdf_beta_P($x, $a, $b); gsl_cdf_beta_P($x, $a, $b, $out); # all arguments given $out = $x->gsl_cdf_beta_P($a, $b); # method call $x->gsl_cdf_beta_P($a, $b, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_beta_P = \&PDL::gsl_cdf_beta_P; =head2 gsl_cdf_beta_Pinv =for sig Signature: (p(); a(); b(); [o]out()) Types: (double) =for usage $out = gsl_cdf_beta_Pinv($p, $a, $b); gsl_cdf_beta_Pinv($p, $a, $b, $out); # all arguments given $out = $p->gsl_cdf_beta_Pinv($a, $b); # method call $p->gsl_cdf_beta_Pinv($a, $b, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_beta_Pinv = \&PDL::gsl_cdf_beta_Pinv; =head2 gsl_cdf_beta_Q =for sig Signature: (x(); a(); b(); [o]out()) Types: (double) =for usage $out = gsl_cdf_beta_Q($x, $a, $b); gsl_cdf_beta_Q($x, $a, $b, $out); # all arguments given $out = $x->gsl_cdf_beta_Q($a, $b); # method call $x->gsl_cdf_beta_Q($a, $b, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_beta_Q = \&PDL::gsl_cdf_beta_Q; =head2 gsl_cdf_beta_Qinv =for sig Signature: (q(); a(); b(); [o]out()) Types: (double) =for usage $out = gsl_cdf_beta_Qinv($q, $a, $b); gsl_cdf_beta_Qinv($q, $a, $b, $out); # all arguments given $out = $q->gsl_cdf_beta_Qinv($a, $b); # method call $q->gsl_cdf_beta_Qinv($a, $b, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_beta_Qinv = \&PDL::gsl_cdf_beta_Qinv; #line 138 "lib/PDL/GSL/CDF.pd" =head2 The Binomial Distribution (gsl_cdf_binomial_*) These functions compute the cumulative distribution functions P(k), Q(k) for the binomial distribution with parameters I

and I. =cut #line 250 "lib/PDL/GSL/CDF.pm" =head2 gsl_cdf_binomial_P =for sig Signature: (ulonglong k(); p(); ulonglong n(); [o]out()) Types: (double) =for usage $out = gsl_cdf_binomial_P($k, $p, $n); gsl_cdf_binomial_P($k, $p, $n, $out); # all arguments given $out = $k->gsl_cdf_binomial_P($p, $n); # method call $k->gsl_cdf_binomial_P($p, $n, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_binomial_P = \&PDL::gsl_cdf_binomial_P; =head2 gsl_cdf_binomial_Q =for sig Signature: (ulonglong k(); p(); ulonglong n(); [o]out()) Types: (double) =for usage $out = gsl_cdf_binomial_Q($k, $p, $n); gsl_cdf_binomial_Q($k, $p, $n, $out); # all arguments given $out = $k->gsl_cdf_binomial_Q($p, $n); # method call $k->gsl_cdf_binomial_Q($p, $n, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_binomial_Q = \&PDL::gsl_cdf_binomial_Q; #line 138 "lib/PDL/GSL/CDF.pd" =head2 The Cauchy Distribution (gsl_cdf_cauchy_*) These functions compute the cumulative distribution functions P(x), Q(x) and their inverses for the Cauchy distribution with scale parameter I. =cut #line 333 "lib/PDL/GSL/CDF.pm" =head2 gsl_cdf_cauchy_P =for sig Signature: (x(); a(); [o]out()) Types: (double) =for usage $out = gsl_cdf_cauchy_P($x, $a); gsl_cdf_cauchy_P($x, $a, $out); # all arguments given $out = $x->gsl_cdf_cauchy_P($a); # method call $x->gsl_cdf_cauchy_P($a, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_cauchy_P = \&PDL::gsl_cdf_cauchy_P; =head2 gsl_cdf_cauchy_Pinv =for sig Signature: (p(); a(); [o]out()) Types: (double) =for usage $out = gsl_cdf_cauchy_Pinv($p, $a); gsl_cdf_cauchy_Pinv($p, $a, $out); # all arguments given $out = $p->gsl_cdf_cauchy_Pinv($a); # method call $p->gsl_cdf_cauchy_Pinv($a, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_cauchy_Pinv = \&PDL::gsl_cdf_cauchy_Pinv; =head2 gsl_cdf_cauchy_Q =for sig Signature: (x(); a(); [o]out()) Types: (double) =for usage $out = gsl_cdf_cauchy_Q($x, $a); gsl_cdf_cauchy_Q($x, $a, $out); # all arguments given $out = $x->gsl_cdf_cauchy_Q($a); # method call $x->gsl_cdf_cauchy_Q($a, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_cauchy_Q = \&PDL::gsl_cdf_cauchy_Q; =head2 gsl_cdf_cauchy_Qinv =for sig Signature: (q(); a(); [o]out()) Types: (double) =for usage $out = gsl_cdf_cauchy_Qinv($q, $a); gsl_cdf_cauchy_Qinv($q, $a, $out); # all arguments given $out = $q->gsl_cdf_cauchy_Qinv($a); # method call $q->gsl_cdf_cauchy_Qinv($a, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_cauchy_Qinv = \&PDL::gsl_cdf_cauchy_Qinv; #line 138 "lib/PDL/GSL/CDF.pd" =head2 The Chi-squared Distribution (gsl_cdf_chisq_*) These functions compute the cumulative distribution functions P(x), Q(x) and their inverses for the chi-squared distribution with I degrees of freedom. =cut #line 490 "lib/PDL/GSL/CDF.pm" =head2 gsl_cdf_chisq_P =for sig Signature: (x(); nu(); [o]out()) Types: (double) =for usage $out = gsl_cdf_chisq_P($x, $nu); gsl_cdf_chisq_P($x, $nu, $out); # all arguments given $out = $x->gsl_cdf_chisq_P($nu); # method call $x->gsl_cdf_chisq_P($nu, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_chisq_P = \&PDL::gsl_cdf_chisq_P; =head2 gsl_cdf_chisq_Pinv =for sig Signature: (p(); nu(); [o]out()) Types: (double) =for usage $out = gsl_cdf_chisq_Pinv($p, $nu); gsl_cdf_chisq_Pinv($p, $nu, $out); # all arguments given $out = $p->gsl_cdf_chisq_Pinv($nu); # method call $p->gsl_cdf_chisq_Pinv($nu, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_chisq_Pinv = \&PDL::gsl_cdf_chisq_Pinv; =head2 gsl_cdf_chisq_Q =for sig Signature: (x(); nu(); [o]out()) Types: (double) =for usage $out = gsl_cdf_chisq_Q($x, $nu); gsl_cdf_chisq_Q($x, $nu, $out); # all arguments given $out = $x->gsl_cdf_chisq_Q($nu); # method call $x->gsl_cdf_chisq_Q($nu, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_chisq_Q = \&PDL::gsl_cdf_chisq_Q; =head2 gsl_cdf_chisq_Qinv =for sig Signature: (q(); nu(); [o]out()) Types: (double) =for usage $out = gsl_cdf_chisq_Qinv($q, $nu); gsl_cdf_chisq_Qinv($q, $nu, $out); # all arguments given $out = $q->gsl_cdf_chisq_Qinv($nu); # method call $q->gsl_cdf_chisq_Qinv($nu, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_chisq_Qinv = \&PDL::gsl_cdf_chisq_Qinv; #line 138 "lib/PDL/GSL/CDF.pd" =head2 The Exponential Distribution (gsl_cdf_exponential_*) These functions compute the cumulative distribution functions P(x), Q(x) and their inverses for the exponential distribution with mean I. =cut #line 647 "lib/PDL/GSL/CDF.pm" =head2 gsl_cdf_exponential_P =for sig Signature: (x(); mu(); [o]out()) Types: (double) =for usage $out = gsl_cdf_exponential_P($x, $mu); gsl_cdf_exponential_P($x, $mu, $out); # all arguments given $out = $x->gsl_cdf_exponential_P($mu); # method call $x->gsl_cdf_exponential_P($mu, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_exponential_P = \&PDL::gsl_cdf_exponential_P; =head2 gsl_cdf_exponential_Pinv =for sig Signature: (p(); mu(); [o]out()) Types: (double) =for usage $out = gsl_cdf_exponential_Pinv($p, $mu); gsl_cdf_exponential_Pinv($p, $mu, $out); # all arguments given $out = $p->gsl_cdf_exponential_Pinv($mu); # method call $p->gsl_cdf_exponential_Pinv($mu, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_exponential_Pinv = \&PDL::gsl_cdf_exponential_Pinv; =head2 gsl_cdf_exponential_Q =for sig Signature: (x(); mu(); [o]out()) Types: (double) =for usage $out = gsl_cdf_exponential_Q($x, $mu); gsl_cdf_exponential_Q($x, $mu, $out); # all arguments given $out = $x->gsl_cdf_exponential_Q($mu); # method call $x->gsl_cdf_exponential_Q($mu, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_exponential_Q = \&PDL::gsl_cdf_exponential_Q; =head2 gsl_cdf_exponential_Qinv =for sig Signature: (q(); mu(); [o]out()) Types: (double) =for usage $out = gsl_cdf_exponential_Qinv($q, $mu); gsl_cdf_exponential_Qinv($q, $mu, $out); # all arguments given $out = $q->gsl_cdf_exponential_Qinv($mu); # method call $q->gsl_cdf_exponential_Qinv($mu, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_exponential_Qinv = \&PDL::gsl_cdf_exponential_Qinv; #line 138 "lib/PDL/GSL/CDF.pd" =head2 The Exponential Power Distribution (gsl_cdf_exppow_*) These functions compute the cumulative distribution functions P(x), Q(x) for the exponential power distribution with parameters I and I. =cut #line 804 "lib/PDL/GSL/CDF.pm" =head2 gsl_cdf_exppow_P =for sig Signature: (x(); a(); b(); [o]out()) Types: (double) =for usage $out = gsl_cdf_exppow_P($x, $a, $b); gsl_cdf_exppow_P($x, $a, $b, $out); # all arguments given $out = $x->gsl_cdf_exppow_P($a, $b); # method call $x->gsl_cdf_exppow_P($a, $b, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_exppow_P = \&PDL::gsl_cdf_exppow_P; =head2 gsl_cdf_exppow_Q =for sig Signature: (x(); a(); b(); [o]out()) Types: (double) =for usage $out = gsl_cdf_exppow_Q($x, $a, $b); gsl_cdf_exppow_Q($x, $a, $b, $out); # all arguments given $out = $x->gsl_cdf_exppow_Q($a, $b); # method call $x->gsl_cdf_exppow_Q($a, $b, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_exppow_Q = \&PDL::gsl_cdf_exppow_Q; #line 138 "lib/PDL/GSL/CDF.pd" =head2 The F-distribution (gsl_cdf_fdist_*) These functions compute the cumulative distribution functions P(x), Q(x) and their inverses for the F-distribution with I and I degrees of freedom. =cut #line 887 "lib/PDL/GSL/CDF.pm" =head2 gsl_cdf_fdist_P =for sig Signature: (x(); nu1(); nu2(); [o]out()) Types: (double) =for usage $out = gsl_cdf_fdist_P($x, $nu1, $nu2); gsl_cdf_fdist_P($x, $nu1, $nu2, $out); # all arguments given $out = $x->gsl_cdf_fdist_P($nu1, $nu2); # method call $x->gsl_cdf_fdist_P($nu1, $nu2, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_fdist_P = \&PDL::gsl_cdf_fdist_P; =head2 gsl_cdf_fdist_Pinv =for sig Signature: (p(); nu1(); nu2(); [o]out()) Types: (double) =for usage $out = gsl_cdf_fdist_Pinv($p, $nu1, $nu2); gsl_cdf_fdist_Pinv($p, $nu1, $nu2, $out); # all arguments given $out = $p->gsl_cdf_fdist_Pinv($nu1, $nu2); # method call $p->gsl_cdf_fdist_Pinv($nu1, $nu2, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_fdist_Pinv = \&PDL::gsl_cdf_fdist_Pinv; =head2 gsl_cdf_fdist_Q =for sig Signature: (x(); nu1(); nu2(); [o]out()) Types: (double) =for usage $out = gsl_cdf_fdist_Q($x, $nu1, $nu2); gsl_cdf_fdist_Q($x, $nu1, $nu2, $out); # all arguments given $out = $x->gsl_cdf_fdist_Q($nu1, $nu2); # method call $x->gsl_cdf_fdist_Q($nu1, $nu2, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_fdist_Q = \&PDL::gsl_cdf_fdist_Q; =head2 gsl_cdf_fdist_Qinv =for sig Signature: (q(); nu1(); nu2(); [o]out()) Types: (double) =for usage $out = gsl_cdf_fdist_Qinv($q, $nu1, $nu2); gsl_cdf_fdist_Qinv($q, $nu1, $nu2, $out); # all arguments given $out = $q->gsl_cdf_fdist_Qinv($nu1, $nu2); # method call $q->gsl_cdf_fdist_Qinv($nu1, $nu2, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_fdist_Qinv = \&PDL::gsl_cdf_fdist_Qinv; #line 138 "lib/PDL/GSL/CDF.pd" =head2 The Flat (Uniform) Distribution (gsl_cdf_flat_*) These functions compute the cumulative distribution functions P(x), Q(x) and their inverses for a uniform distribution from I to I. =cut #line 1044 "lib/PDL/GSL/CDF.pm" =head2 gsl_cdf_flat_P =for sig Signature: (x(); a(); b(); [o]out()) Types: (double) =for usage $out = gsl_cdf_flat_P($x, $a, $b); gsl_cdf_flat_P($x, $a, $b, $out); # all arguments given $out = $x->gsl_cdf_flat_P($a, $b); # method call $x->gsl_cdf_flat_P($a, $b, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_flat_P = \&PDL::gsl_cdf_flat_P; =head2 gsl_cdf_flat_Pinv =for sig Signature: (p(); a(); b(); [o]out()) Types: (double) =for usage $out = gsl_cdf_flat_Pinv($p, $a, $b); gsl_cdf_flat_Pinv($p, $a, $b, $out); # all arguments given $out = $p->gsl_cdf_flat_Pinv($a, $b); # method call $p->gsl_cdf_flat_Pinv($a, $b, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_flat_Pinv = \&PDL::gsl_cdf_flat_Pinv; =head2 gsl_cdf_flat_Q =for sig Signature: (x(); a(); b(); [o]out()) Types: (double) =for usage $out = gsl_cdf_flat_Q($x, $a, $b); gsl_cdf_flat_Q($x, $a, $b, $out); # all arguments given $out = $x->gsl_cdf_flat_Q($a, $b); # method call $x->gsl_cdf_flat_Q($a, $b, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_flat_Q = \&PDL::gsl_cdf_flat_Q; =head2 gsl_cdf_flat_Qinv =for sig Signature: (q(); a(); b(); [o]out()) Types: (double) =for usage $out = gsl_cdf_flat_Qinv($q, $a, $b); gsl_cdf_flat_Qinv($q, $a, $b, $out); # all arguments given $out = $q->gsl_cdf_flat_Qinv($a, $b); # method call $q->gsl_cdf_flat_Qinv($a, $b, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_flat_Qinv = \&PDL::gsl_cdf_flat_Qinv; #line 138 "lib/PDL/GSL/CDF.pd" =head2 The Gamma Distribution (gsl_cdf_gamma_*) These functions compute the cumulative distribution functions P(x), Q(x) and their inverses for the gamma distribution with parameters I and I. =cut #line 1201 "lib/PDL/GSL/CDF.pm" =head2 gsl_cdf_gamma_P =for sig Signature: (x(); a(); b(); [o]out()) Types: (double) =for usage $out = gsl_cdf_gamma_P($x, $a, $b); gsl_cdf_gamma_P($x, $a, $b, $out); # all arguments given $out = $x->gsl_cdf_gamma_P($a, $b); # method call $x->gsl_cdf_gamma_P($a, $b, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_gamma_P = \&PDL::gsl_cdf_gamma_P; =head2 gsl_cdf_gamma_Pinv =for sig Signature: (p(); a(); b(); [o]out()) Types: (double) =for usage $out = gsl_cdf_gamma_Pinv($p, $a, $b); gsl_cdf_gamma_Pinv($p, $a, $b, $out); # all arguments given $out = $p->gsl_cdf_gamma_Pinv($a, $b); # method call $p->gsl_cdf_gamma_Pinv($a, $b, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_gamma_Pinv = \&PDL::gsl_cdf_gamma_Pinv; =head2 gsl_cdf_gamma_Q =for sig Signature: (x(); a(); b(); [o]out()) Types: (double) =for usage $out = gsl_cdf_gamma_Q($x, $a, $b); gsl_cdf_gamma_Q($x, $a, $b, $out); # all arguments given $out = $x->gsl_cdf_gamma_Q($a, $b); # method call $x->gsl_cdf_gamma_Q($a, $b, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_gamma_Q = \&PDL::gsl_cdf_gamma_Q; =head2 gsl_cdf_gamma_Qinv =for sig Signature: (q(); a(); b(); [o]out()) Types: (double) =for usage $out = gsl_cdf_gamma_Qinv($q, $a, $b); gsl_cdf_gamma_Qinv($q, $a, $b, $out); # all arguments given $out = $q->gsl_cdf_gamma_Qinv($a, $b); # method call $q->gsl_cdf_gamma_Qinv($a, $b, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_gamma_Qinv = \&PDL::gsl_cdf_gamma_Qinv; #line 138 "lib/PDL/GSL/CDF.pd" =head2 The Gaussian Distribution (gsl_cdf_gaussian_*) These functions compute the cumulative distribution functions P(x), Q(x) and their inverses for the Gaussian distribution with standard deviation I. =cut #line 1358 "lib/PDL/GSL/CDF.pm" =head2 gsl_cdf_gaussian_P =for sig Signature: (x(); sigma(); [o]out()) Types: (double) =for usage $out = gsl_cdf_gaussian_P($x, $sigma); gsl_cdf_gaussian_P($x, $sigma, $out); # all arguments given $out = $x->gsl_cdf_gaussian_P($sigma); # method call $x->gsl_cdf_gaussian_P($sigma, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_gaussian_P = \&PDL::gsl_cdf_gaussian_P; =head2 gsl_cdf_gaussian_Pinv =for sig Signature: (p(); sigma(); [o]out()) Types: (double) =for usage $out = gsl_cdf_gaussian_Pinv($p, $sigma); gsl_cdf_gaussian_Pinv($p, $sigma, $out); # all arguments given $out = $p->gsl_cdf_gaussian_Pinv($sigma); # method call $p->gsl_cdf_gaussian_Pinv($sigma, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_gaussian_Pinv = \&PDL::gsl_cdf_gaussian_Pinv; =head2 gsl_cdf_gaussian_Q =for sig Signature: (x(); sigma(); [o]out()) Types: (double) =for usage $out = gsl_cdf_gaussian_Q($x, $sigma); gsl_cdf_gaussian_Q($x, $sigma, $out); # all arguments given $out = $x->gsl_cdf_gaussian_Q($sigma); # method call $x->gsl_cdf_gaussian_Q($sigma, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_gaussian_Q = \&PDL::gsl_cdf_gaussian_Q; =head2 gsl_cdf_gaussian_Qinv =for sig Signature: (q(); sigma(); [o]out()) Types: (double) =for usage $out = gsl_cdf_gaussian_Qinv($q, $sigma); gsl_cdf_gaussian_Qinv($q, $sigma, $out); # all arguments given $out = $q->gsl_cdf_gaussian_Qinv($sigma); # method call $q->gsl_cdf_gaussian_Qinv($sigma, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_gaussian_Qinv = \&PDL::gsl_cdf_gaussian_Qinv; #line 138 "lib/PDL/GSL/CDF.pd" =head2 The Geometric Distribution (gsl_cdf_geometric_*) These functions compute the cumulative distribution functions P(k), Q(k) for the geometric distribution with parameter I

. =cut #line 1515 "lib/PDL/GSL/CDF.pm" =head2 gsl_cdf_geometric_P =for sig Signature: (ulonglong k(); p(); [o]out()) Types: (double) =for usage $out = gsl_cdf_geometric_P($k, $p); gsl_cdf_geometric_P($k, $p, $out); # all arguments given $out = $k->gsl_cdf_geometric_P($p); # method call $k->gsl_cdf_geometric_P($p, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_geometric_P = \&PDL::gsl_cdf_geometric_P; =head2 gsl_cdf_geometric_Q =for sig Signature: (ulonglong k(); p(); [o]out()) Types: (double) =for usage $out = gsl_cdf_geometric_Q($k, $p); gsl_cdf_geometric_Q($k, $p, $out); # all arguments given $out = $k->gsl_cdf_geometric_Q($p); # method call $k->gsl_cdf_geometric_Q($p, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_geometric_Q = \&PDL::gsl_cdf_geometric_Q; #line 138 "lib/PDL/GSL/CDF.pd" =head2 The Type-1 Gumbel Distribution (gsl_cdf_gumbel1_*) These functions compute the cumulative distribution functions P(x), Q(x) and their inverses for the Type-1 Gumbel distribution with parameters I and I. =cut #line 1598 "lib/PDL/GSL/CDF.pm" =head2 gsl_cdf_gumbel1_P =for sig Signature: (x(); a(); b(); [o]out()) Types: (double) =for usage $out = gsl_cdf_gumbel1_P($x, $a, $b); gsl_cdf_gumbel1_P($x, $a, $b, $out); # all arguments given $out = $x->gsl_cdf_gumbel1_P($a, $b); # method call $x->gsl_cdf_gumbel1_P($a, $b, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_gumbel1_P = \&PDL::gsl_cdf_gumbel1_P; =head2 gsl_cdf_gumbel1_Pinv =for sig Signature: (p(); a(); b(); [o]out()) Types: (double) =for usage $out = gsl_cdf_gumbel1_Pinv($p, $a, $b); gsl_cdf_gumbel1_Pinv($p, $a, $b, $out); # all arguments given $out = $p->gsl_cdf_gumbel1_Pinv($a, $b); # method call $p->gsl_cdf_gumbel1_Pinv($a, $b, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_gumbel1_Pinv = \&PDL::gsl_cdf_gumbel1_Pinv; =head2 gsl_cdf_gumbel1_Q =for sig Signature: (x(); a(); b(); [o]out()) Types: (double) =for usage $out = gsl_cdf_gumbel1_Q($x, $a, $b); gsl_cdf_gumbel1_Q($x, $a, $b, $out); # all arguments given $out = $x->gsl_cdf_gumbel1_Q($a, $b); # method call $x->gsl_cdf_gumbel1_Q($a, $b, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_gumbel1_Q = \&PDL::gsl_cdf_gumbel1_Q; =head2 gsl_cdf_gumbel1_Qinv =for sig Signature: (q(); a(); b(); [o]out()) Types: (double) =for usage $out = gsl_cdf_gumbel1_Qinv($q, $a, $b); gsl_cdf_gumbel1_Qinv($q, $a, $b, $out); # all arguments given $out = $q->gsl_cdf_gumbel1_Qinv($a, $b); # method call $q->gsl_cdf_gumbel1_Qinv($a, $b, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_gumbel1_Qinv = \&PDL::gsl_cdf_gumbel1_Qinv; #line 138 "lib/PDL/GSL/CDF.pd" =head2 The Type-2 Gumbel Distribution (gsl_cdf_gumbel2_*) These functions compute the cumulative distribution functions P(x), Q(x) and their inverses for the Type-2 Gumbel distribution with parameters I and I. =cut #line 1755 "lib/PDL/GSL/CDF.pm" =head2 gsl_cdf_gumbel2_P =for sig Signature: (x(); a(); b(); [o]out()) Types: (double) =for usage $out = gsl_cdf_gumbel2_P($x, $a, $b); gsl_cdf_gumbel2_P($x, $a, $b, $out); # all arguments given $out = $x->gsl_cdf_gumbel2_P($a, $b); # method call $x->gsl_cdf_gumbel2_P($a, $b, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_gumbel2_P = \&PDL::gsl_cdf_gumbel2_P; =head2 gsl_cdf_gumbel2_Pinv =for sig Signature: (p(); a(); b(); [o]out()) Types: (double) =for usage $out = gsl_cdf_gumbel2_Pinv($p, $a, $b); gsl_cdf_gumbel2_Pinv($p, $a, $b, $out); # all arguments given $out = $p->gsl_cdf_gumbel2_Pinv($a, $b); # method call $p->gsl_cdf_gumbel2_Pinv($a, $b, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_gumbel2_Pinv = \&PDL::gsl_cdf_gumbel2_Pinv; =head2 gsl_cdf_gumbel2_Q =for sig Signature: (x(); a(); b(); [o]out()) Types: (double) =for usage $out = gsl_cdf_gumbel2_Q($x, $a, $b); gsl_cdf_gumbel2_Q($x, $a, $b, $out); # all arguments given $out = $x->gsl_cdf_gumbel2_Q($a, $b); # method call $x->gsl_cdf_gumbel2_Q($a, $b, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_gumbel2_Q = \&PDL::gsl_cdf_gumbel2_Q; =head2 gsl_cdf_gumbel2_Qinv =for sig Signature: (q(); a(); b(); [o]out()) Types: (double) =for usage $out = gsl_cdf_gumbel2_Qinv($q, $a, $b); gsl_cdf_gumbel2_Qinv($q, $a, $b, $out); # all arguments given $out = $q->gsl_cdf_gumbel2_Qinv($a, $b); # method call $q->gsl_cdf_gumbel2_Qinv($a, $b, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_gumbel2_Qinv = \&PDL::gsl_cdf_gumbel2_Qinv; #line 138 "lib/PDL/GSL/CDF.pd" =head2 The Hypergeometric Distribution (gsl_cdf_hypergeometric_*) These functions compute the cumulative distribution functions P(k), Q(k) for the hypergeometric distribution with parameters I, I and I. =cut #line 1912 "lib/PDL/GSL/CDF.pm" =head2 gsl_cdf_hypergeometric_P =for sig Signature: (ulonglong k(); ulonglong n1(); ulonglong n2(); ulonglong t(); [o]out()) Types: (double) =for usage $out = gsl_cdf_hypergeometric_P($k, $n1, $n2, $t); gsl_cdf_hypergeometric_P($k, $n1, $n2, $t, $out); # all arguments given $out = $k->gsl_cdf_hypergeometric_P($n1, $n2, $t); # method call $k->gsl_cdf_hypergeometric_P($n1, $n2, $t, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_hypergeometric_P = \&PDL::gsl_cdf_hypergeometric_P; =head2 gsl_cdf_hypergeometric_Q =for sig Signature: (ulonglong k(); ulonglong n1(); ulonglong n2(); ulonglong t(); [o]out()) Types: (double) =for usage $out = gsl_cdf_hypergeometric_Q($k, $n1, $n2, $t); gsl_cdf_hypergeometric_Q($k, $n1, $n2, $t, $out); # all arguments given $out = $k->gsl_cdf_hypergeometric_Q($n1, $n2, $t); # method call $k->gsl_cdf_hypergeometric_Q($n1, $n2, $t, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_hypergeometric_Q = \&PDL::gsl_cdf_hypergeometric_Q; #line 138 "lib/PDL/GSL/CDF.pd" =head2 The Laplace Distribution (gsl_cdf_laplace_*) These functions compute the cumulative distribution functions P(x), Q(x) and their inverses for the Laplace distribution with width I. =cut #line 1995 "lib/PDL/GSL/CDF.pm" =head2 gsl_cdf_laplace_P =for sig Signature: (x(); a(); [o]out()) Types: (double) =for usage $out = gsl_cdf_laplace_P($x, $a); gsl_cdf_laplace_P($x, $a, $out); # all arguments given $out = $x->gsl_cdf_laplace_P($a); # method call $x->gsl_cdf_laplace_P($a, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_laplace_P = \&PDL::gsl_cdf_laplace_P; =head2 gsl_cdf_laplace_Pinv =for sig Signature: (p(); a(); [o]out()) Types: (double) =for usage $out = gsl_cdf_laplace_Pinv($p, $a); gsl_cdf_laplace_Pinv($p, $a, $out); # all arguments given $out = $p->gsl_cdf_laplace_Pinv($a); # method call $p->gsl_cdf_laplace_Pinv($a, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_laplace_Pinv = \&PDL::gsl_cdf_laplace_Pinv; =head2 gsl_cdf_laplace_Q =for sig Signature: (x(); a(); [o]out()) Types: (double) =for usage $out = gsl_cdf_laplace_Q($x, $a); gsl_cdf_laplace_Q($x, $a, $out); # all arguments given $out = $x->gsl_cdf_laplace_Q($a); # method call $x->gsl_cdf_laplace_Q($a, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_laplace_Q = \&PDL::gsl_cdf_laplace_Q; =head2 gsl_cdf_laplace_Qinv =for sig Signature: (q(); a(); [o]out()) Types: (double) =for usage $out = gsl_cdf_laplace_Qinv($q, $a); gsl_cdf_laplace_Qinv($q, $a, $out); # all arguments given $out = $q->gsl_cdf_laplace_Qinv($a); # method call $q->gsl_cdf_laplace_Qinv($a, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_laplace_Qinv = \&PDL::gsl_cdf_laplace_Qinv; #line 138 "lib/PDL/GSL/CDF.pd" =head2 The Logistic Distribution (gsl_cdf_logistic_*) These functions compute the cumulative distribution functions P(x), Q(x) and their inverses for the logistic distribution with scale parameter I. =cut #line 2152 "lib/PDL/GSL/CDF.pm" =head2 gsl_cdf_logistic_P =for sig Signature: (x(); a(); [o]out()) Types: (double) =for usage $out = gsl_cdf_logistic_P($x, $a); gsl_cdf_logistic_P($x, $a, $out); # all arguments given $out = $x->gsl_cdf_logistic_P($a); # method call $x->gsl_cdf_logistic_P($a, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_logistic_P = \&PDL::gsl_cdf_logistic_P; =head2 gsl_cdf_logistic_Pinv =for sig Signature: (p(); a(); [o]out()) Types: (double) =for usage $out = gsl_cdf_logistic_Pinv($p, $a); gsl_cdf_logistic_Pinv($p, $a, $out); # all arguments given $out = $p->gsl_cdf_logistic_Pinv($a); # method call $p->gsl_cdf_logistic_Pinv($a, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_logistic_Pinv = \&PDL::gsl_cdf_logistic_Pinv; =head2 gsl_cdf_logistic_Q =for sig Signature: (x(); a(); [o]out()) Types: (double) =for usage $out = gsl_cdf_logistic_Q($x, $a); gsl_cdf_logistic_Q($x, $a, $out); # all arguments given $out = $x->gsl_cdf_logistic_Q($a); # method call $x->gsl_cdf_logistic_Q($a, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_logistic_Q = \&PDL::gsl_cdf_logistic_Q; =head2 gsl_cdf_logistic_Qinv =for sig Signature: (q(); a(); [o]out()) Types: (double) =for usage $out = gsl_cdf_logistic_Qinv($q, $a); gsl_cdf_logistic_Qinv($q, $a, $out); # all arguments given $out = $q->gsl_cdf_logistic_Qinv($a); # method call $q->gsl_cdf_logistic_Qinv($a, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_logistic_Qinv = \&PDL::gsl_cdf_logistic_Qinv; #line 138 "lib/PDL/GSL/CDF.pd" =head2 The Lognormal Distribution (gsl_cdf_lognormal_*) These functions compute the cumulative distribution functions P(x), Q(x) and their inverses for the lognormal distribution with parameters I and I. =cut #line 2309 "lib/PDL/GSL/CDF.pm" =head2 gsl_cdf_lognormal_P =for sig Signature: (x(); zeta(); sigma(); [o]out()) Types: (double) =for usage $out = gsl_cdf_lognormal_P($x, $zeta, $sigma); gsl_cdf_lognormal_P($x, $zeta, $sigma, $out); # all arguments given $out = $x->gsl_cdf_lognormal_P($zeta, $sigma); # method call $x->gsl_cdf_lognormal_P($zeta, $sigma, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_lognormal_P = \&PDL::gsl_cdf_lognormal_P; =head2 gsl_cdf_lognormal_Pinv =for sig Signature: (p(); zeta(); sigma(); [o]out()) Types: (double) =for usage $out = gsl_cdf_lognormal_Pinv($p, $zeta, $sigma); gsl_cdf_lognormal_Pinv($p, $zeta, $sigma, $out); # all arguments given $out = $p->gsl_cdf_lognormal_Pinv($zeta, $sigma); # method call $p->gsl_cdf_lognormal_Pinv($zeta, $sigma, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_lognormal_Pinv = \&PDL::gsl_cdf_lognormal_Pinv; =head2 gsl_cdf_lognormal_Q =for sig Signature: (x(); zeta(); sigma(); [o]out()) Types: (double) =for usage $out = gsl_cdf_lognormal_Q($x, $zeta, $sigma); gsl_cdf_lognormal_Q($x, $zeta, $sigma, $out); # all arguments given $out = $x->gsl_cdf_lognormal_Q($zeta, $sigma); # method call $x->gsl_cdf_lognormal_Q($zeta, $sigma, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_lognormal_Q = \&PDL::gsl_cdf_lognormal_Q; =head2 gsl_cdf_lognormal_Qinv =for sig Signature: (q(); zeta(); sigma(); [o]out()) Types: (double) =for usage $out = gsl_cdf_lognormal_Qinv($q, $zeta, $sigma); gsl_cdf_lognormal_Qinv($q, $zeta, $sigma, $out); # all arguments given $out = $q->gsl_cdf_lognormal_Qinv($zeta, $sigma); # method call $q->gsl_cdf_lognormal_Qinv($zeta, $sigma, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_lognormal_Qinv = \&PDL::gsl_cdf_lognormal_Qinv; =head2 gsl_cdf_negative_binomial_P =for sig Signature: (ulonglong k(); p(); n(); [o]out()) Types: (double) =for usage $out = gsl_cdf_negative_binomial_P($k, $p, $n); gsl_cdf_negative_binomial_P($k, $p, $n, $out); # all arguments given $out = $k->gsl_cdf_negative_binomial_P($p, $n); # method call $k->gsl_cdf_negative_binomial_P($p, $n, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_negative_binomial_P = \&PDL::gsl_cdf_negative_binomial_P; =head2 gsl_cdf_negative_binomial_Q =for sig Signature: (ulonglong k(); p(); n(); [o]out()) Types: (double) =for usage $out = gsl_cdf_negative_binomial_Q($k, $p, $n); gsl_cdf_negative_binomial_Q($k, $p, $n, $out); # all arguments given $out = $k->gsl_cdf_negative_binomial_Q($p, $n); # method call $k->gsl_cdf_negative_binomial_Q($p, $n, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_negative_binomial_Q = \&PDL::gsl_cdf_negative_binomial_Q; #line 138 "lib/PDL/GSL/CDF.pd" =head2 The Pareto Distribution (gsl_cdf_pareto_*) These functions compute the cumulative distribution functions P(x), Q(x) and their inverses for the Pareto distribution with exponent I and scale I. =cut #line 2540 "lib/PDL/GSL/CDF.pm" =head2 gsl_cdf_pareto_P =for sig Signature: (x(); a(); b(); [o]out()) Types: (double) =for usage $out = gsl_cdf_pareto_P($x, $a, $b); gsl_cdf_pareto_P($x, $a, $b, $out); # all arguments given $out = $x->gsl_cdf_pareto_P($a, $b); # method call $x->gsl_cdf_pareto_P($a, $b, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_pareto_P = \&PDL::gsl_cdf_pareto_P; =head2 gsl_cdf_pareto_Pinv =for sig Signature: (p(); a(); b(); [o]out()) Types: (double) =for usage $out = gsl_cdf_pareto_Pinv($p, $a, $b); gsl_cdf_pareto_Pinv($p, $a, $b, $out); # all arguments given $out = $p->gsl_cdf_pareto_Pinv($a, $b); # method call $p->gsl_cdf_pareto_Pinv($a, $b, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_pareto_Pinv = \&PDL::gsl_cdf_pareto_Pinv; =head2 gsl_cdf_pareto_Q =for sig Signature: (x(); a(); b(); [o]out()) Types: (double) =for usage $out = gsl_cdf_pareto_Q($x, $a, $b); gsl_cdf_pareto_Q($x, $a, $b, $out); # all arguments given $out = $x->gsl_cdf_pareto_Q($a, $b); # method call $x->gsl_cdf_pareto_Q($a, $b, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_pareto_Q = \&PDL::gsl_cdf_pareto_Q; =head2 gsl_cdf_pareto_Qinv =for sig Signature: (q(); a(); b(); [o]out()) Types: (double) =for usage $out = gsl_cdf_pareto_Qinv($q, $a, $b); gsl_cdf_pareto_Qinv($q, $a, $b, $out); # all arguments given $out = $q->gsl_cdf_pareto_Qinv($a, $b); # method call $q->gsl_cdf_pareto_Qinv($a, $b, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_pareto_Qinv = \&PDL::gsl_cdf_pareto_Qinv; #line 138 "lib/PDL/GSL/CDF.pd" =head2 The Pascal Distribution (gsl_cdf_pascal_*) These functions compute the cumulative distribution functions P(k), Q(k) for the Pascal distribution with parameters I

and I. =cut #line 2697 "lib/PDL/GSL/CDF.pm" =head2 gsl_cdf_pascal_P =for sig Signature: (ulonglong k(); p(); ulonglong n(); [o]out()) Types: (double) =for usage $out = gsl_cdf_pascal_P($k, $p, $n); gsl_cdf_pascal_P($k, $p, $n, $out); # all arguments given $out = $k->gsl_cdf_pascal_P($p, $n); # method call $k->gsl_cdf_pascal_P($p, $n, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_pascal_P = \&PDL::gsl_cdf_pascal_P; =head2 gsl_cdf_pascal_Q =for sig Signature: (ulonglong k(); p(); ulonglong n(); [o]out()) Types: (double) =for usage $out = gsl_cdf_pascal_Q($k, $p, $n); gsl_cdf_pascal_Q($k, $p, $n, $out); # all arguments given $out = $k->gsl_cdf_pascal_Q($p, $n); # method call $k->gsl_cdf_pascal_Q($p, $n, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_pascal_Q = \&PDL::gsl_cdf_pascal_Q; #line 138 "lib/PDL/GSL/CDF.pd" =head2 The Poisson Distribution (gsl_cdf_poisson_*) These functions compute the cumulative distribution functions P(k), Q(k) for the Poisson distribution with parameter I. =cut #line 2780 "lib/PDL/GSL/CDF.pm" =head2 gsl_cdf_poisson_P =for sig Signature: (ulonglong k(); mu(); [o]out()) Types: (double) =for usage $out = gsl_cdf_poisson_P($k, $mu); gsl_cdf_poisson_P($k, $mu, $out); # all arguments given $out = $k->gsl_cdf_poisson_P($mu); # method call $k->gsl_cdf_poisson_P($mu, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_poisson_P = \&PDL::gsl_cdf_poisson_P; =head2 gsl_cdf_poisson_Q =for sig Signature: (ulonglong k(); mu(); [o]out()) Types: (double) =for usage $out = gsl_cdf_poisson_Q($k, $mu); gsl_cdf_poisson_Q($k, $mu, $out); # all arguments given $out = $k->gsl_cdf_poisson_Q($mu); # method call $k->gsl_cdf_poisson_Q($mu, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_poisson_Q = \&PDL::gsl_cdf_poisson_Q; #line 138 "lib/PDL/GSL/CDF.pd" =head2 The Rayleigh Distribution (gsl_cdf_rayleigh_*) These functions compute the cumulative distribution functions P(x), Q(x) and their inverses for the Rayleigh distribution with scale parameter I. =cut #line 2863 "lib/PDL/GSL/CDF.pm" =head2 gsl_cdf_rayleigh_P =for sig Signature: (x(); sigma(); [o]out()) Types: (double) =for usage $out = gsl_cdf_rayleigh_P($x, $sigma); gsl_cdf_rayleigh_P($x, $sigma, $out); # all arguments given $out = $x->gsl_cdf_rayleigh_P($sigma); # method call $x->gsl_cdf_rayleigh_P($sigma, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_rayleigh_P = \&PDL::gsl_cdf_rayleigh_P; =head2 gsl_cdf_rayleigh_Pinv =for sig Signature: (p(); sigma(); [o]out()) Types: (double) =for usage $out = gsl_cdf_rayleigh_Pinv($p, $sigma); gsl_cdf_rayleigh_Pinv($p, $sigma, $out); # all arguments given $out = $p->gsl_cdf_rayleigh_Pinv($sigma); # method call $p->gsl_cdf_rayleigh_Pinv($sigma, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_rayleigh_Pinv = \&PDL::gsl_cdf_rayleigh_Pinv; =head2 gsl_cdf_rayleigh_Q =for sig Signature: (x(); sigma(); [o]out()) Types: (double) =for usage $out = gsl_cdf_rayleigh_Q($x, $sigma); gsl_cdf_rayleigh_Q($x, $sigma, $out); # all arguments given $out = $x->gsl_cdf_rayleigh_Q($sigma); # method call $x->gsl_cdf_rayleigh_Q($sigma, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_rayleigh_Q = \&PDL::gsl_cdf_rayleigh_Q; =head2 gsl_cdf_rayleigh_Qinv =for sig Signature: (q(); sigma(); [o]out()) Types: (double) =for usage $out = gsl_cdf_rayleigh_Qinv($q, $sigma); gsl_cdf_rayleigh_Qinv($q, $sigma, $out); # all arguments given $out = $q->gsl_cdf_rayleigh_Qinv($sigma); # method call $q->gsl_cdf_rayleigh_Qinv($sigma, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_rayleigh_Qinv = \&PDL::gsl_cdf_rayleigh_Qinv; #line 138 "lib/PDL/GSL/CDF.pd" =head2 The t-distribution (gsl_cdf_tdist_*) These functions compute the cumulative distribution functions P(x), Q(x) and their inverses for the t-distribution with I degrees of freedom. =cut #line 3020 "lib/PDL/GSL/CDF.pm" =head2 gsl_cdf_tdist_P =for sig Signature: (x(); nu(); [o]out()) Types: (double) =for usage $out = gsl_cdf_tdist_P($x, $nu); gsl_cdf_tdist_P($x, $nu, $out); # all arguments given $out = $x->gsl_cdf_tdist_P($nu); # method call $x->gsl_cdf_tdist_P($nu, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_tdist_P = \&PDL::gsl_cdf_tdist_P; =head2 gsl_cdf_tdist_Pinv =for sig Signature: (p(); nu(); [o]out()) Types: (double) =for usage $out = gsl_cdf_tdist_Pinv($p, $nu); gsl_cdf_tdist_Pinv($p, $nu, $out); # all arguments given $out = $p->gsl_cdf_tdist_Pinv($nu); # method call $p->gsl_cdf_tdist_Pinv($nu, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_tdist_Pinv = \&PDL::gsl_cdf_tdist_Pinv; =head2 gsl_cdf_tdist_Q =for sig Signature: (x(); nu(); [o]out()) Types: (double) =for usage $out = gsl_cdf_tdist_Q($x, $nu); gsl_cdf_tdist_Q($x, $nu, $out); # all arguments given $out = $x->gsl_cdf_tdist_Q($nu); # method call $x->gsl_cdf_tdist_Q($nu, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_tdist_Q = \&PDL::gsl_cdf_tdist_Q; =head2 gsl_cdf_tdist_Qinv =for sig Signature: (q(); nu(); [o]out()) Types: (double) =for usage $out = gsl_cdf_tdist_Qinv($q, $nu); gsl_cdf_tdist_Qinv($q, $nu, $out); # all arguments given $out = $q->gsl_cdf_tdist_Qinv($nu); # method call $q->gsl_cdf_tdist_Qinv($nu, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_tdist_Qinv = \&PDL::gsl_cdf_tdist_Qinv; #line 138 "lib/PDL/GSL/CDF.pd" =head2 The Unit Gaussian Distribution (gsl_cdf_ugaussian_*) These functions compute the cumulative distribution functions P(x), Q(x) and their inverses for the unit Gaussian distribution. =cut #line 3177 "lib/PDL/GSL/CDF.pm" =head2 gsl_cdf_ugaussian_P =for sig Signature: (x(); [o]out()) Types: (double) =for usage $out = gsl_cdf_ugaussian_P($x); gsl_cdf_ugaussian_P($x, $out); # all arguments given $out = $x->gsl_cdf_ugaussian_P; # method call $x->gsl_cdf_ugaussian_P($out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_ugaussian_P = \&PDL::gsl_cdf_ugaussian_P; =head2 gsl_cdf_ugaussian_Pinv =for sig Signature: (p(); [o]out()) Types: (double) =for usage $out = gsl_cdf_ugaussian_Pinv($p); gsl_cdf_ugaussian_Pinv($p, $out); # all arguments given $out = $p->gsl_cdf_ugaussian_Pinv; # method call $p->gsl_cdf_ugaussian_Pinv($out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_ugaussian_Pinv = \&PDL::gsl_cdf_ugaussian_Pinv; =head2 gsl_cdf_ugaussian_Q =for sig Signature: (x(); [o]out()) Types: (double) =for usage $out = gsl_cdf_ugaussian_Q($x); gsl_cdf_ugaussian_Q($x, $out); # all arguments given $out = $x->gsl_cdf_ugaussian_Q; # method call $x->gsl_cdf_ugaussian_Q($out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_ugaussian_Q = \&PDL::gsl_cdf_ugaussian_Q; =head2 gsl_cdf_ugaussian_Qinv =for sig Signature: (q(); [o]out()) Types: (double) =for usage $out = gsl_cdf_ugaussian_Qinv($q); gsl_cdf_ugaussian_Qinv($q, $out); # all arguments given $out = $q->gsl_cdf_ugaussian_Qinv; # method call $q->gsl_cdf_ugaussian_Qinv($out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_ugaussian_Qinv = \&PDL::gsl_cdf_ugaussian_Qinv; #line 138 "lib/PDL/GSL/CDF.pd" =head2 The Weibull Distribution (gsl_cdf_weibull_*) These functions compute the cumulative distribution functions P(x), Q(x) and their inverses for the Weibull distribution with scale I and exponent I. =cut #line 3334 "lib/PDL/GSL/CDF.pm" =head2 gsl_cdf_weibull_P =for sig Signature: (x(); a(); b(); [o]out()) Types: (double) =for usage $out = gsl_cdf_weibull_P($x, $a, $b); gsl_cdf_weibull_P($x, $a, $b, $out); # all arguments given $out = $x->gsl_cdf_weibull_P($a, $b); # method call $x->gsl_cdf_weibull_P($a, $b, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_weibull_P = \&PDL::gsl_cdf_weibull_P; =head2 gsl_cdf_weibull_Pinv =for sig Signature: (p(); a(); b(); [o]out()) Types: (double) =for usage $out = gsl_cdf_weibull_Pinv($p, $a, $b); gsl_cdf_weibull_Pinv($p, $a, $b, $out); # all arguments given $out = $p->gsl_cdf_weibull_Pinv($a, $b); # method call $p->gsl_cdf_weibull_Pinv($a, $b, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_weibull_Pinv = \&PDL::gsl_cdf_weibull_Pinv; =head2 gsl_cdf_weibull_Q =for sig Signature: (x(); a(); b(); [o]out()) Types: (double) =for usage $out = gsl_cdf_weibull_Q($x, $a, $b); gsl_cdf_weibull_Q($x, $a, $b, $out); # all arguments given $out = $x->gsl_cdf_weibull_Q($a, $b); # method call $x->gsl_cdf_weibull_Q($a, $b, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_weibull_Q = \&PDL::gsl_cdf_weibull_Q; =head2 gsl_cdf_weibull_Qinv =for sig Signature: (q(); a(); b(); [o]out()) Types: (double) =for usage $out = gsl_cdf_weibull_Qinv($q, $a, $b); gsl_cdf_weibull_Qinv($q, $a, $b, $out); # all arguments given $out = $q->gsl_cdf_weibull_Qinv($a, $b); # method call $q->gsl_cdf_weibull_Qinv($a, $b, $out); =for ref =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *gsl_cdf_weibull_Qinv = \&PDL::gsl_cdf_weibull_Qinv; #line 166 "lib/PDL/GSL/CDF.pd" =head1 AUTHOR Copyright (C) 2009 Maggie J. Xiong The GSL CDF module was written by J. Stover. All rights reserved. There is no warranty. You are allowed to redistribute this software / documentation as described in the file COPYING in the PDL distribution. =cut #line 3497 "lib/PDL/GSL/CDF.pm" # Exit with OK status 1; PDL-GSL-2.103/GENERATED/PDL/Stats/0000755000175000017500000000000015160062241015517 5ustar osboxesosboxesPDL-GSL-2.103/GENERATED/PDL/Stats/Distr.pm0000644000175000017500000004664515160062241017161 0ustar osboxesosboxes# # GENERATED WITH PDL::PP from lib/PDL/Stats/Distr.pd! Don't modify! # package PDL::Stats::Distr; our @EXPORT_OK = qw(mme_beta pdf_beta mme_binomial pmf_binomial mle_exp pdf_exp mme_gamma pdf_gamma mle_gaussian pdf_gaussian mle_geo pmf_geo mle_geosh pmf_geosh mle_lognormal mme_lognormal pdf_lognormal mme_nbd pmf_nbd mme_pareto pdf_pareto mle_poisson pmf_poisson pmf_poisson_stirling pmf_poisson_factorial ); our %EXPORT_TAGS = (Func=>\@EXPORT_OK); use PDL::Core; use PDL::Exporter; use DynaLoader; our @ISA = ( 'PDL::Exporter','DynaLoader' ); push @PDL::Core::PP, __PACKAGE__; bootstrap PDL::Stats::Distr ; #line 7 "lib/PDL/Stats/Distr.pd" use strict; use warnings; use Carp; use PDL::LiteF; =head1 NAME PDL::Stats::Distr -- parameter estimations and probability density functions for distributions. =head1 DESCRIPTION Parameter estimate is maximum likelihood estimate when there is closed form estimate, otherwise it is method of moments estimate. =head1 SYNOPSIS use PDL::LiteF; use PDL::Stats::Distr; # do a frequency (probability) plot with fitted normal curve my $data = grandom(100)->abs; my ($xvals, $hist) = $data->hist; # turn frequency into probability $hist /= $data->nelem; # get maximum likelihood estimates of normal curve parameters my ($m, $v) = $data->mle_gaussian(); # fitted normal curve probabilities my $p = $xvals->pdf_gaussian($m, $v); use PDL::Graphics::Simple; my $win = pgswin(); $win->plot( with=>'bins', $hist, with=>'lines', style => 2, $p ); undef $win; # to close Or, play with different distributions with B :) $data->plot_distr( 'gaussian', 'lognormal' ); =cut #line 71 "lib/PDL/Stats/Distr.pm" =head1 FUNCTIONS =cut =head2 mme_beta =for sig Signature: (a(n); float+ [o]alpha(); float+ [o]beta()) Types: (float double ldouble) =for usage my ($a, $b) = $data->mme_beta(); =for ref beta distribution. pdf: f(x; a,b) = 1/B(a,b) x^(a-1) (1-x)^(b-1) =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *mme_beta = \&PDL::mme_beta; =head2 pdf_beta =for sig Signature: (x(); a(); b(); float+ [o]p()) Types: (float double ldouble) =for usage $p = pdf_beta($x, $a, $b); pdf_beta($x, $a, $b, $p); # all arguments given $p = $x->pdf_beta($a, $b); # method call $x->pdf_beta($a, $b, $p); =for ref probability density function for beta distribution. x defined on [0,1]. =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *pdf_beta = \&PDL::pdf_beta; =head2 mme_binomial =for sig Signature: (a(n); int [o]n_(); float+ [o]p()) Types: (float double ldouble) =for usage my ($n, $p) = $data->mme_binomial; =for ref binomial distribution. pmf: f(k; n,p) = (n k) p^k (1-p)^(n-k) for k = 0,1,2..n =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *mme_binomial = \&PDL::mme_binomial; =head2 pmf_binomial =for sig Signature: (ushort x(); ushort n(); p(); float+ [o]out()) Types: (float double ldouble) =for usage $out = pmf_binomial($x, $n, $p); pmf_binomial($x, $n, $p, $out); # all arguments given $out = $x->pmf_binomial($n, $p); # method call $x->pmf_binomial($n, $p, $out); =for ref probability mass function for binomial distribution. =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *pmf_binomial = \&PDL::pmf_binomial; =head2 mle_exp =for sig Signature: (a(n); float+ [o]l()) Types: (float double ldouble) =for usage my $lamda = $data->mle_exp; =for ref exponential distribution. mle same as method of moments estimate. =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *mle_exp = \&PDL::mle_exp; =head2 pdf_exp =for sig Signature: (x(); l(); float+ [o]p()) Types: (float double ldouble) =for usage $p = pdf_exp($x, $l); pdf_exp($x, $l, $p); # all arguments given $p = $x->pdf_exp($l); # method call $x->pdf_exp($l, $p); =for ref probability density function for exponential distribution. =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *pdf_exp = \&PDL::pdf_exp; =head2 mme_gamma =for sig Signature: (a(n); float+ [o]shape(); float+ [o]scale()) Types: (float double ldouble) =for usage my ($shape, $scale) = $data->mme_gamma(); =for ref two-parameter gamma distribution =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *mme_gamma = \&PDL::mme_gamma; =head2 pdf_gamma =for sig Signature: (x(); a(); t(); float+ [o]p()) Types: (float double ldouble) =for usage $p = pdf_gamma($x, $a, $t); pdf_gamma($x, $a, $t, $p); # all arguments given $p = $x->pdf_gamma($a, $t); # method call $x->pdf_gamma($a, $t, $p); =for ref probability density function for two-parameter gamma distribution. =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *pdf_gamma = \&PDL::pdf_gamma; =head2 mle_gaussian =for sig Signature: (a(n); float+ [o]m(); float+ [o]v()) Types: (float double ldouble) =for usage my ($m, $v) = $data->mle_gaussian(); =for ref gaussian aka normal distribution. same results as $data->average and $data->var. mle same as method of moments estimate. =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *mle_gaussian = \&PDL::mle_gaussian; =head2 pdf_gaussian =for sig Signature: (x(); m(); v(); float+ [o]p()) Types: (float double ldouble) =for usage $p = pdf_gaussian($x, $m, $v); pdf_gaussian($x, $m, $v, $p); # all arguments given $p = $x->pdf_gaussian($m, $v); # method call $x->pdf_gaussian($m, $v, $p); =for ref probability density function for gaussian distribution. =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *pdf_gaussian = \&PDL::pdf_gaussian; =head2 mle_geo =for sig Signature: (a(n); float+ [o]p()) Types: (float double ldouble) =for usage $p = mle_geo($a); mle_geo($a, $p); # all arguments given $p = $a->mle_geo; # method call $a->mle_geo($p); =for ref geometric distribution. mle same as method of moments estimate. =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *mle_geo = \&PDL::mle_geo; =head2 pmf_geo =for sig Signature: (ushort x(); p(); float+ [o]out()) Types: (float double ldouble) =for usage $out = pmf_geo($x, $p); pmf_geo($x, $p, $out); # all arguments given $out = $x->pmf_geo($p); # method call $x->pmf_geo($p, $out); =for ref probability mass function for geometric distribution. x >= 0. =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *pmf_geo = \&PDL::pmf_geo; =head2 mle_geosh =for sig Signature: (a(n); float+ [o]p()) Types: (float double ldouble) =for usage $p = mle_geosh($a); mle_geosh($a, $p); # all arguments given $p = $a->mle_geosh; # method call $a->mle_geosh($p); =for ref shifted geometric distribution. mle same as method of moments estimate. =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *mle_geosh = \&PDL::mle_geosh; =head2 pmf_geosh =for sig Signature: (ushort x(); p(); float+ [o]out()) Types: (float double ldouble) =for usage $out = pmf_geosh($x, $p); pmf_geosh($x, $p, $out); # all arguments given $out = $x->pmf_geosh($p); # method call $x->pmf_geosh($p, $out); =for ref probability mass function for shifted geometric distribution. x >= 1. =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *pmf_geosh = \&PDL::pmf_geosh; =head2 mle_lognormal =for sig Signature: (a(n); float+ [o]m(); float+ [o]v()) Types: (float double ldouble) =for usage my ($m, $v) = $data->mle_lognormal(); =for ref lognormal distribution. maximum likelihood estimation. =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *mle_lognormal = \&PDL::mle_lognormal; =head2 mme_lognormal =for sig Signature: (a(n); float+ [o]m(); float+ [o]v()) Types: (float double ldouble) =for usage my ($m, $v) = $data->mme_lognormal(); =for ref lognormal distribution. method of moments estimation. =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *mme_lognormal = \&PDL::mme_lognormal; =head2 pdf_lognormal =for sig Signature: (x(); m(); v(); float+ [o]p()) Types: (float double ldouble) =for usage $p = pdf_lognormal($x, $m, $v); pdf_lognormal($x, $m, $v, $p); # all arguments given $p = $x->pdf_lognormal($m, $v); # method call $x->pdf_lognormal($m, $v, $p); =for ref probability density function for lognormal distribution. x > 0. v > 0. =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *pdf_lognormal = \&PDL::pdf_lognormal; =head2 mme_nbd =for sig Signature: (a(n); float+ [o]r(); float+ [o]p()) Types: (float double ldouble) =for usage my ($r, $p) = $data->mme_nbd(); =for ref negative binomial distribution. pmf: f(x; r,p) = (x+r-1 r-1) p^r (1-p)^x for x=0,1,2... =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *mme_nbd = \&PDL::mme_nbd; =head2 pmf_nbd =for sig Signature: (ushort x(); r(); p(); float+ [o]out()) Types: (float double ldouble) =for usage $out = pmf_nbd($x, $r, $p); pmf_nbd($x, $r, $p, $out); # all arguments given $out = $x->pmf_nbd($r, $p); # method call $x->pmf_nbd($r, $p, $out); =for ref probability mass function for negative binomial distribution. =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *pmf_nbd = \&PDL::pmf_nbd; =head2 mme_pareto =for sig Signature: (a(n); float+ [o]k(); float+ [o]xm()) Types: (float double ldouble) =for usage my ($k, $xm) = $data->mme_pareto(); =for ref pareto distribution. pdf: f(x; k,xm) = k xm^k / x^(k+1) for x >= xm > 0. =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *mme_pareto = \&PDL::mme_pareto; =head2 pdf_pareto =for sig Signature: (x(); k(); xm(); float+ [o]p()) Types: (float double ldouble) =for usage $p = pdf_pareto($x, $k, $xm); pdf_pareto($x, $k, $xm, $p); # all arguments given $p = $x->pdf_pareto($k, $xm); # method call $x->pdf_pareto($k, $xm, $p); =for ref probability density function for pareto distribution. x >= xm > 0. =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *pdf_pareto = \&PDL::pdf_pareto; =head2 mle_poisson =for sig Signature: (a(n); float+ [o]l()) Types: (float double ldouble) =for usage my $lamda = $data->mle_poisson(); =for ref poisson distribution. pmf: f(x;l) = e^(-l) * l^x / x! =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *mle_poisson = \&PDL::mle_poisson; =head2 pmf_poisson =for sig Signature: (x(); l(); float+ [o]p()) Types: (float double ldouble) =for usage $p = pmf_poisson($x, $l); pmf_poisson($x, $l, $p); # all arguments given $p = $x->pmf_poisson($l); # method call $x->pmf_poisson($l, $p); =for ref Probability mass function for poisson distribution. Uses Stirling's formula for x > 85. =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *pmf_poisson = \&PDL::pmf_poisson; =head2 pmf_poisson_stirling =for sig Signature: (x(); l(); [o]p()) Types: (float double ldouble) =for usage $p = pmf_poisson_stirling($x, $l); pmf_poisson_stirling($x, $l, $p); # all arguments given $p = $x->pmf_poisson_stirling($l); # method call $x->pmf_poisson_stirling($l, $p); =for ref Probability mass function for poisson distribution. Uses Stirling's formula for all values of the input. See http://en.wikipedia.org/wiki/Stirling's_approximation for more info. =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut *pmf_poisson_stirling = \&PDL::pmf_poisson_stirling; =head2 pmf_poisson_factorial =for sig Signature: (ushort x(); l(); float+ [o]p()) Types: (float double ldouble) =for usage $p = pmf_poisson_factorial($x, $l); pmf_poisson_factorial($x, $l, $p); # all arguments given $p = $x->pmf_poisson_factorial($l); # method call $x->pmf_poisson_factorial($l, $p); =for ref Probability mass function for poisson distribution. Input is limited to x < 170 to avoid gsl_sf_fact() overflow. =pod Broadcasts over its inputs. =for bad C processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. =cut #line 646 "lib/PDL/Stats/Distr.pd" sub PDL::pmf_poisson_factorial { my ($x, $l) = @_; my $pdlx = PDL->topdl($x); croak "Does not support input greater than 170. Please use pmf_poisson or pmf_poisson_stirling instead." if any($pdlx >= 170); PDL::_pmf_poisson_factorial_int($pdlx, $l, my $p = PDL->null); $p; } #line 1031 "lib/PDL/Stats/Distr.pm" *pmf_poisson_factorial = \&PDL::pmf_poisson_factorial; #line 662 "lib/PDL/Stats/Distr.pd" #line 663 "lib/PDL/Stats/Distr.pd" =head2 plot_distr =for ref Plots data distribution. When given specific distribution(s) to fit, returns % ref to sum log likelihood and parameter values under fitted distribution(s). See FUNCTIONS above for available distributions. =for options Default options (case insensitive): MAXBN => 20, # see PDL::Graphics::Simple for next options WIN => undef, # pgswin object. not closed here if passed # allows comparing multiple distr in same plot # set env before passing WIN COLOR => 1, # "style" for data distr =for usage Usage: # yes it threads :) my $data = grandom( 500, 3 )->abs; # ll on plot is sum across 3 data curves my ($ll, $pars) = $data->plot_distr( 'gaussian', 'lognormal' ); # pars are from normalized data (ie data / bin_size) print "$_\t@{$pars->{$_}}\n" for (sort keys %$pars); print "$_\t$ll->{$_}\n" for (sort keys %$ll); =cut *plot_distr = \&PDL::plot_distr; sub PDL::plot_distr { require PDL::Graphics::Simple; my ($self, @distr) = @_; my %opt = ( MAXBN => 20, WIN => undef, # pgswin object. not closed here if passed COLOR => 1, # "style" for data distr ); my $opt = ref($distr[-1]) eq 'HASH' ? pop @distr : undef; $opt and $opt{uc $_} = $opt->{$_} for (keys %$opt); $self = $self->squeeze; # use int range, step etc for int xvals--pmf compatible my $INT = !!grep { /(?:binomial)|(?:geo)|(?:nbd)|(?:poisson)/ } @distr; my ($range, $step, $step_int); $range = $self->max->sclr - $self->min->sclr; $step = $range / $opt{MAXBN}; $step_int = ($range <= $opt{MAXBN})? 1 : PDL::ceil( $range / $opt{MAXBN} ) ; $opt{MAXBN} = PDL::ceil( $range / $step )->min->sclr; my $hist = $self->double->histogram($step, $self->min->sclr, $opt{MAXBN}); # turn fre into prob $hist /= $self->dim(0); my $xvals = $self->min->sclr + sequence( $opt{MAXBN} ) * $step; my $xvals_int = PDL::ceil($self->min->sclr) + sequence( $opt{MAXBN} ) * $step_int; $xvals_int = $xvals_int->where( $xvals_int <= $xvals->max )->sever; my $win = $opt{WIN} || PDL::Graphics::Simple::pgswin(); my $inc = 0; # key only once $win->plot((map +(with=>'lines', style=>$opt{COLOR}, ($inc++?():(key=>"Base")), $xvals, $_), $hist->dog), { xlabel=>'xvals', ylabel=>'probability', legend=>'tc', # top centre }); return if !@distr; my (%ll, %pars); my $c = $opt{COLOR}; # fitted lines start from ++$c for my $distr ( @distr ) { # find mle_ or mme_$distr; my @funcs = grep { /_$distr$/ } (keys %PDL::Stats::Distr::); if (!@funcs) { carp "Do not recognize $distr distribution!"; next; } # might have mle and mme for a distr. sort so mle comes first @funcs = sort @funcs; my ($f_para, $f_prob) = @funcs[0, -1]; my $nrmd = $self / $step; eval { my @paras = $nrmd->$f_para(); $pars{$distr} = \@paras; @paras = map { $_->dummy(0) } @paras; $ll{$distr} = $nrmd->$f_prob( @paras )->log->sumover; my %curve_opts = (style=>++$c, key=>sprintf("$distr LL = %.2f", $ll{$distr}->sum)); my $inc = 0; # curve_opts only once if ($f_prob =~ /^pdf/) { $win->oplot( map +(with=>'lines', ($inc++?():%curve_opts), $xvals, $_), ($xvals/$step)->$f_prob(@paras)->dog ); } else { $win->oplot( with=>'points', %curve_opts, $xvals_int, ($xvals_int/$step_int)->$f_prob(@paras) ); } }; carp $@ if $@; } return (\%ll, \%pars); } =head1 DEPENDENCIES GSL - GNU Scientific Library =head1 SEE ALSO L L =head1 AUTHOR Copyright (C) 2009 Maggie J. Xiong , David Mertens All rights reserved. There is no warranty. You are allowed to redistribute this software / documentation as described in the file COPYING in the PDL distribution. =cut #line 1169 "lib/PDL/Stats/Distr.pm" # Exit with OK status 1; PDL-GSL-2.103/META.yml0000644000175000017500000000137615160062236013770 0ustar osboxesosboxes--- abstract: unknown author: - 'PerlDL Developers ' build_requires: ExtUtils::MakeMaker: '0' configure_requires: ExtUtils::MakeMaker: '0' PDL: '2.096' dynamic_config: 1 generated_by: 'ExtUtils::MakeMaker version 7.72, CPAN::Meta::Converter version 2.150010' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: PDL-GSL no_index: directory: - t - inc requires: PDL: '2.096' perl: '5.016' resources: IRC: irc://irc.perl.org/#pdl bugtracker: https://github.com/PDLPorters/PDL-GSL/issues homepage: http://pdl.perl.org/ repository: git://github.com/PDLPorters/PDL-GSL.git version: '2.103' x_serialization_backend: 'CPAN::Meta::YAML version 0.018' PDL-GSL-2.103/Changes0000644000175000017500000000100415160062174013777 0ustar osboxesosboxes2.103 2026-03-22 - fix bad use of inplace 2.102 2026-03-22 - generate pdldoc entries right - PDL::Stats::Distr switch to using PGS 2.101 2025-01-06 - add licence information 2.100 2025-01-03 - uses PDL 2.096+ lib/*.pd format for quicker builds 2.099 2024-12-09 - separate file for package declaration so PAUSE deigns to index 2.098 2024-12-09 - adjust package declaration so PAUSE deigns to index 2.097 2024-12-09 - add package declaration so PAUSE deigns to index 2.096 2024-12-09 - split out from PDL 2.095 PDL-GSL-2.103/lib/0000755000175000017500000000000015160062236013256 5ustar osboxesosboxesPDL-GSL-2.103/lib/PDL/0000755000175000017500000000000015160062236013675 5ustar osboxesosboxesPDL-GSL-2.103/lib/PDL/GSL.pm0000644000175000017500000000076615160062203014663 0ustar osboxesosboxespackage PDL::GSL; use strict; use warnings; our $VERSION = '2.103'; =head1 NAME PDL::GSL - PDL interface to the GNU Scientific Library =head1 DESCRIPTION This is an interface to the GNU Scientific Library. It contains the following packages: =over =item L =item L =item L =item L =item L =item L =item L =item L =item L =back =cut 1; PDL-GSL-2.103/lib/PDL/GSL/0000755000175000017500000000000015160062236014322 5ustar osboxesosboxesPDL-GSL-2.103/lib/PDL/GSL/DIFF.pd0000644000175000017500000001011114736061645015364 0ustar osboxesosboxesuse strict; use warnings; { no warnings 'once'; # pass info back to Makefile.PL $PDL::Core::Dev::EXTRAS{$::PDLMOD}{OBJECT} .= join '', map " $::PDLBASE-$_\$(OBJ_EXT)", qw(FUNC); } pp_addpm({At=>'Top'},<<'EOD'); use strict; use warnings; =head1 NAME PDL::GSL::DIFF - PDL interface to numerical differentiation routines in GSL =head1 DESCRIPTION This is an interface to the numerical differentiation package present in the GNU Scientific Library. =head1 SYNOPSIS use PDL; use PDL::GSL::DIFF; my $x0 = 3.3; my @res = gsldiff(\&myfunction,$x0); # same as above: @res = gsldiff(\&myfunction,$x0,{Method => 'central'}); # use only values greater than $x0 to get the derivative @res = gsldiff(\&myfunction,$x0,{Method => 'forward'}); # use only values smaller than $x0 to get the derivative @res = gsldiff(\&myfunction,$x0,{Method => 'backward'}); sub myfunction{ my ($x) = @_; return $x**2; } =cut EOD pp_addpm({At=>'Bot'},<<'EOD'); # the rest of FUNCTIONS section =head2 gsldiff =for ref This functions serves as an interface to the three differentiation functions present in GSL: gsl_diff_central, gsl_diff_backward and gsl_diff_forward. To compute the derivative, the central method uses values greater and smaller than the point at which the derivative is to be evaluated, while backward and forward use only values smaller and greater respectively. gsldiff() returns both the derivative and an absolute error estimate. The default method is 'central', others can be specified by passing an option. Please check the GSL documentation for more information. =for usage Usage: ($d,$abserr) = gsldiff($function_ref,$x,{Method => $method}); =for example Example: #derivative using default method ('central') ($d,$abserr) = gsldiff(\&myf,3.3); #same as above with method set explicitly ($d,$abserr) = gsldiff(\&myf,3.3,{Method => 'central'}); #using backward & forward methods ($d,$abserr) = gsldiff(\&myf,3.3,{Method => 'backward'}); ($d,$abserr) = gsldiff(\&myf,3.3,{Method => 'forward'}); sub myf{ my ($x) = @_; return exp($x); } =head1 BUGS Feedback is welcome. Log bugs in the PDL bug database (the database is always linked from L). =head1 SEE ALSO L The GSL documentation is online at http://www.gnu.org/software/gsl/manual/ =head1 AUTHOR This file copyright (C) 2003 Andres Jordan All rights reserved. There is no warranty. You are allowed to redistribute this software documentation under certain conditions. For details, see the file COPYING in the PDL distribution. If this file is separated from the PDL distribution, the copyright notice should be included in the file. The GSL differentiation routines were written by David Morrison. =cut EOD pp_addhdr(' #include #include #include #include double FUNC(double x,void * p); void set_funname(SV *fn); '); pp_addpm(' sub gsldiff{ my $opt; if (ref($_[$#_]) eq \'HASH\'){ $opt = pop @_; } else{ $opt = {Method => \'central\'}; } die \'Usage: gsldiff(function_ref, x, {Options} )\' if $#_<1 || $#_>2; my ($f,$x) = @_; my ($res,$abserr); if($$opt{Method}=~/cent/i){ ($res,$abserr) = PDL::GSL::DIFF::diff_central($x,$f); } elsif($$opt{Method}=~/back/i){ ($res,$abserr) = PDL::GSL::DIFF::diff_backward($x,$f); } elsif($$opt{Method}=~/forw/i){ ($res,$abserr) = PDL::GSL::DIFF::diff_forward($x,$f); } else{ barf("Unknown differentiation method $$opt{Method} in gsldiff\n"); } return ($res,$abserr); } '); pp_add_exported('gsldiff'); sub diff_func { my ($which) = @_; pp_def("diff_$which", Pars => 'double x(); double [o] res(); double [o] abserr();', OtherPars => 'SV* function;', Doc => undef, Code => < #include #include #include #include void set_funname(SV *fn, PDL_Indx n); int my_f (const gsl_vector * v, void * params, gsl_vector * df); int fsolver (double *xfree, int nelem, double epsabs, int method); '); pp_def('gslmroot_fsolver', Pars => 'double [io]xfree(n); double epsabs(); int method();', OtherPars => 'SV* function1;', Doc => <<'EOF', =for ref Multidimensional root finder without using derivatives This function provides an interface to the multidimensional root finding algorithms in the GSL library. It takes a minimum of two arguments: an ndarray $init with an initial guess for the roots of the system and a reference to a function. The latter function must return an ndarray whose i-th element is the i-th equation evaluated at the vector x (an ndarray which is the sole input to this function). See the example in the Synopsis above for an illustration. The function returns an ndarray with the roots for the system of equations. Two optional arguments can be specified as shown below. One is B, which can take the values 0,1,2,3. They correspond to the 'hybrids', 'hybrid', 'dnewton' and 'broyden' algorithms respectively (see GSL documentation for details). The other optional argument is B, which sets the absolute accuracy to which the roots of the system of equations are required. The default value for Method is 0 ('hybrids' algorithm) and the default for Epsabs is 1e-3. =for usage $res = gslmroot_fsolver($init, $function_ref, [{Method => $method, Epsabs => $epsabs}]); EOF Code =>' set_funname($COMP(function1), $SIZE(n)); if (fsolver($P(xfree), $SIZE(n), $epsabs(), $method()) != GSL_SUCCESS) $CROAK("Something is wrong: could not assign fsolver type...\n"); ', PMCode => <<'EOF', sub gslmroot_fsolver { my ($x, $f_vect) = @_; my $opt = ref($_[-1]) eq 'HASH' ? pop @_ : {Method => 0, EpsAbs => 1e-3}; if( (ref($x) ne 'PDL')){ barf("Have to pass ndarray as first argument to fsolver\n"); } my $res = $x->copy; _gslmroot_fsolver_int($res, $$opt{'EpsAbs'}, $$opt{'Method'}, $f_vect); return $res; } EOF ); pp_addpm({At=>'Top'},<<'EOD'); use strict; use warnings; =head1 NAME PDL::GSL::MROOT - PDL interface to multidimensional root-finding routines in GSL =head1 DESCRIPTION This is an interface to the multidimensional root-finding package present in the GNU Scientific Library. At the moment there is a single function B which provides an interface to the algorithms in the GSL library that do not use derivatives. =head1 SYNOPSIS use PDL; use PDL::GSL::MROOT; my $init = pdl (-10.00, -5.0); my $epsabs = 1e-7; $res = gslmroot_fsolver($init, \&rosenbrock, {Method => 0, EpsAbs => $epsabs}); sub rosenbrock{ my ($x) = @_; my $c = 1; my $d = 10; my $y = zeroes($x); my $y0 = $y->slice(0); $y0 .= $c * (1 - $x->slice(0)); my $y1 = $y->slice(1); $y1 .= $d * ($x->slice(1) - $x->slice(0)**2); return $y; } EOD pp_addpm({At=>'Bot'},<<'EOD'); =head1 SEE ALSO L The GSL documentation is online at http://www.gnu.org/software/gsl/manual/ =head1 AUTHOR This file copyright (C) 2006 Andres Jordan and Simon Casassus All rights reserved. There is no warranty. You are allowed to redistribute this software/documentation under certain conditions. For details, see the file COPYING in the PDL distribution. If this file is separated from the PDL distribution, the copyright notice should be included in the file. =cut EOD pp_add_boot('gsl_set_error_handler_off(); '); pp_done(); PDL-GSL-2.103/lib/PDL/GSL/MROOT-FUNC.c0000644000175000017500000000764614736061645016147 0ustar osboxesosboxes// This file copyright (C) 2006 Andres Jordan // and Simon Casassus // All rights reserved. There is no warranty. You are allowed to // redistribute this software/documentation under certain conditions. // For details, see the file COPYING in the PDL distribution. If this file // is separated from the PDL distribution, the copyright notice should be // included in the file. #include #include #include "EXTERN.h" #include "perl.h" #include "pdl.h" #include "pdlcore.h" #define PDL PDL_GSL_MROOT extern Core *PDL; static SV* ext_funname1; static PDL_Indx ene; void set_funname(SV *fn, PDL_Indx n) { ext_funname1 = fn; ene = n; } void DFF(double* xval, double* vector){ //this version tries just to get the output dSP; ENTER; SAVETMPS; pdl* px = PDL->pdlnew(); if (!px) PDL->pdl_barf("Failed to create pdl"); SV* pxsv = sv_newmortal(); PDL->SetSV_PDL(pxsv, px); int ndims = 1; PDL_Indx pdims[] = { (PDL_Indx) ene }; PDL->barf_if_error(PDL->setdims(px,pdims,ndims)); px->datatype = PDL_D; px->data = (void *) xval; px->state |= PDL_ALLOCATED | PDL_DONTTOUCHDATA; /* get function name on the perl side */ PUSHMARK(SP); XPUSHs(pxsv); PUTBACK; int count=call_sv(ext_funname1,G_SCALAR); SPAGAIN; SP -= count ; I32 ax = (SP - PL_stack_base) + 1 ; if (count!=1) croak("error calling perl function\n"); /* recover output value */ pdl* pvector = PDL->SvPDLV(ST(0)); PDL->barf_if_error(PDL->make_physical(pvector)); double *xpass = (double *) pvector->data; PDL_Indx i; for(i=0;idata = NULL; PUTBACK; FREETMPS; LEAVE; } int my_f (const gsl_vector * v, void * params, gsl_vector * df) { double dp = *((double *)params); int nelem = (int) dp; double xfree[nelem], vector[nelem]; int iloop; for (iloop=0;iloop< nelem;iloop++) { xfree[iloop] = gsl_vector_get(v, iloop); vector[iloop] = gsl_vector_get(v, iloop) * gsl_vector_get(v, iloop); } DFF(xfree, vector); for (iloop=0;iloop< nelem;iloop++) { gsl_vector_set(df, iloop, vector[iloop]); } return GSL_SUCCESS; } int print_state (size_t iter, gsl_multiroot_fsolver * s) { printf ("iter = %3zu x = % .3f % .3f " "f(x) = % .3e % .3e\n", iter, gsl_vector_get (s->x, 0), gsl_vector_get (s->x, 1), gsl_vector_get (s->f, 0), gsl_vector_get (s->f, 1)); return 1; } int fsolver (double *xfree, int nelem, double epsabs, int method) { gsl_multiroot_fsolver_type *T; gsl_multiroot_fsolver *s; int status; size_t i, iter = 0; size_t n = nelem; double p[1] = { nelem }; int iloop; // struct func_params p = {1.0, 10.0}; gsl_multiroot_function func = {&my_f, n, p}; gsl_vector *x = gsl_vector_alloc (n); for (iloop=0;iloopf, epsabs); } while (status == GSL_CONTINUE && iter < 1000); if (status) warn ("Final status = %s\n", gsl_strerror (status)); for (iloop=0;iloopx, iloop); } gsl_multiroot_fsolver_free (s); gsl_vector_free (x); return GSL_SUCCESS; } PDL-GSL-2.103/lib/PDL/GSL/CDF.pd0000644000175000017500000002366314736061645015270 0ustar osboxesosboxesuse strict; use warnings; our $VERSION = '2.096'; pp_addpm({At=>'Top'},<<'EOD'); use strict; use warnings; =head1 NAME PDL::GSL::CDF - PDL interface to GSL Cumulative Distribution Functions =head1 DESCRIPTION This is an interface to the Cumulative Distribution Function package present in the GNU Scientific Library. Let us have a continuous random number distributions are defined by a probability density function C. The cumulative distribution function for the lower tail C is defined by the integral of C, and gives the probability of a variate taking a value less than C. These functions are named B. The cumulative distribution function for the upper tail C is defined by the integral of C, and gives the probability of a variate taking a value greater than C. These functions are named B. The upper and lower cumulative distribution functions are related by C and satisfy C<0 E= P(x) E= 1> and C<0 E= Q(x) E= 1>. The inverse cumulative distributions, C and C give the values of C which correspond to a specific value of C

or C. They can be used to find confidence limits from probability values. These functions are named B and B. For discrete distributions the probability of sampling the integer value C is given by C, where C. The cumulative distribution for the lower tail C of a discrete distribution is defined as, where the sum is over the allowed range of the distribution less than or equal to C. The cumulative distribution for the upper tail of a discrete distribution C is defined as giving the sum of probabilities for all values greater than C. These two definitions satisfy the identity C. If the range of the distribution is C<1> to C inclusive then C, C while C, C. =head1 SYNOPSIS use PDL; use PDL::GSL::CDF; my $p = gsl_cdf_tdist_P( $t, $df ); my $t = gsl_cdf_tdist_Pinv( $p, $df ); =cut EOD pp_addhdr(' #include #include static char *funcname; static void cdf_error_handler(const char *reason, const char *file, int line, int status) { char buf[200]; sprintf(buf,"Error in %s: %s", funcname, gsl_strerror(status)); barf(buf); } '); use Text::ParseWords qw(shellwords); chomp(my $header = `gsl-config --cflags`); $header =~ s#\\#/#g; # win32 ($header) = map {s/^-I//;$_} grep /^-I/, shellwords $header; $header .= '/gsl/gsl_cdf.h'; my $h = do { open my $fh, "<", $header or die "$header: $!"; local $/ = undef; <$fh> }; my @functions = $h =~ m/(double\s+gsl_cdf_.+?\)\s*;\s*)\n/xmsg; my @func_defs; my %p_type = ( 'double' => 'double', 'unsigned int' => 'ulonglong', ); my %func_desc = ( gsl_cdf_gaussian => ['The Gaussian Distribution', 'These functions compute the cumulative distribution functions P(x), Q(x) and their inverses for the Gaussian distribution with standard deviation I.'], gsl_cdf_ugaussian => ['The Unit Gaussian Distribution', 'These functions compute the cumulative distribution functions P(x), Q(x) and their inverses for the unit Gaussian distribution.'], gsl_cdf_exponential => ['The Exponential Distribution', 'These functions compute the cumulative distribution functions P(x), Q(x) and their inverses for the exponential distribution with mean I.'], gsl_cdf_laplace => ['The Laplace Distribution', 'These functions compute the cumulative distribution functions P(x), Q(x) and their inverses for the Laplace distribution with width I.'], gsl_cdf_exppow => ['The Exponential Power Distribution', 'These functions compute the cumulative distribution functions P(x), Q(x) for the exponential power distribution with parameters I and I.'], gsl_cdf_cauchy => ['The Cauchy Distribution', 'These functions compute the cumulative distribution functions P(x), Q(x) and their inverses for the Cauchy distribution with scale parameter I.'], gsl_cdf_rayleigh => ['The Rayleigh Distribution', 'These functions compute the cumulative distribution functions P(x), Q(x) and their inverses for the Rayleigh distribution with scale parameter I.'], gsl_cdf_gamma => ['The Gamma Distribution', 'These functions compute the cumulative distribution functions P(x), Q(x) and their inverses for the gamma distribution with parameters I and I.'], gsl_cdf_flat => ['The Flat (Uniform) Distribution', 'These functions compute the cumulative distribution functions P(x), Q(x) and their inverses for a uniform distribution from I to I.'], gsl_cdf_lognormal => ['The Lognormal Distribution', 'These functions compute the cumulative distribution functions P(x), Q(x) and their inverses for the lognormal distribution with parameters I and I.'], gsl_cdf_chisq => ['The Chi-squared Distribution', 'These functions compute the cumulative distribution functions P(x), Q(x) and their inverses for the chi-squared distribution with I degrees of freedom.'], gsl_cdf_fdist => ['The F-distribution', 'These functions compute the cumulative distribution functions P(x), Q(x) and their inverses for the F-distribution with I and I degrees of freedom.'], gsl_cdf_tdist => ['The t-distribution', 'These functions compute the cumulative distribution functions P(x), Q(x) and their inverses for the t-distribution with I degrees of freedom.'], gsl_cdf_beta => ['The Beta Distribution', 'These functions compute the cumulative distribution functions P(x), Q(x) and their inverses for the beta distribution with parameters I and I.'], gsl_cdf_logistic => ['The Logistic Distribution', 'These functions compute the cumulative distribution functions P(x), Q(x) and their inverses for the logistic distribution with scale parameter I.'], gsl_cdf_pareto => ['The Pareto Distribution', 'These functions compute the cumulative distribution functions P(x), Q(x) and their inverses for the Pareto distribution with exponent I and scale I.'], gsl_cdf_weibull => ['The Weibull Distribution', 'These functions compute the cumulative distribution functions P(x), Q(x) and their inverses for the Weibull distribution with scale I and exponent I.'], gsl_cdf_gumbel1 => ['The Type-1 Gumbel Distribution', 'These functions compute the cumulative distribution functions P(x), Q(x) and their inverses for the Type-1 Gumbel distribution with parameters I and I.'], gsl_cdf_gumbel2 => ['The Type-2 Gumbel Distribution', 'These functions compute the cumulative distribution functions P(x), Q(x) and their inverses for the Type-2 Gumbel distribution with parameters I and I.'], gsl_cdf_poisson => ['The Poisson Distribution', 'These functions compute the cumulative distribution functions P(k), Q(k) for the Poisson distribution with parameter I.'], gsl_cdf_binomial => ['The Binomial Distribution', 'These functions compute the cumulative distribution functions P(k), Q(k) for the binomial distribution with parameters I

and I.'], gsl_cdf_negative_binomial => ['The Negative Binomial Distribution', 'These functions compute the cumulative distribution functions P(k), Q(k) for the negative binomial distribution with parameters I

and I.'], gsl_cdf_pascal => ['The Pascal Distribution', 'These functions compute the cumulative distribution functions P(k), Q(k) for the Pascal distribution with parameters I

and I.'], gsl_cdf_geometric => ['The Geometric Distribution', 'These functions compute the cumulative distribution functions P(k), Q(k) for the geometric distribution with parameter I

.'], gsl_cdf_hypergeometric => ['The Hypergeometric Distribution', 'These functions compute the cumulative distribution functions P(k), Q(k) for the hypergeometric distribution with parameters I, I and I.'], ); for (@functions) { s/\n\s+/ /xmsg; s/const //g; if (m/^(\w+)\s+(\w+)\s*\(\s*(.+)\s*\)\s*\;$/s) { my ($out_type, $function, $pars) = ($1, $2, $3); my @pars = split /,/, $pars; for (@pars) { if (m/^(.+)( \w+)$/) { my ($type, $par) = ($1, $2); s/^ | $//g for ($type, $par); $par = lc $par; $_ = [$p_type{$type}, $par]; } } push @func_defs, [ $out_type, $function, \@pars ]; } } @func_defs = sort { $a->[1] cmp $b->[1] } @func_defs; # sort by function name for my $f (@func_defs) { my ($out_type, $function, $pars) = @$f; my $func_short = join '_', (split '_', $function)[0..2]; my ($p, $code) = print_ppdef($out_type, $function, @$pars); my $desc = delete $func_desc{$func_short}; pp_addpm(qq{\n=head2 $desc->[0] (${func_short}_*)\n\n$desc->[1]\n\n=cut\n\n}) if $desc; pp_def($function, HandleBad => 1, GenericTypes => ['D'], Pars => $p, Code => $code, Doc => '', ); } sub print_ppdef { my ($out_type, $function, @pars) = @_; @pars = map $_->[0] eq 'double' ? [$_->[1]] : $_, @pars; my $pars = join ' ', map "@$_();", @pars, ['[o]out']; my $code = pp_line_numbers(__LINE__, <[-1]()", @pars]}); gsl_set_error_handler(current_handler); EOF $code = "PDL_IF_BAD(if ( !(" . join(' && ', map { "\$ISGOOD($_->[-1]())" } @pars ) . ") ) {" . "\$SETBAD(out()); }" . 'else,) {' . $code . "}\n"; return ($pars, $code); } pp_addpm({At=>'Bot'},<<'EOD'); =head1 AUTHOR Copyright (C) 2009 Maggie J. Xiong The GSL CDF module was written by J. Stover. All rights reserved. There is no warranty. You are allowed to redistribute this software / documentation as described in the file COPYING in the PDL distribution. =cut EOD pp_done(); PDL-GSL-2.103/lib/PDL/GSL/RNG.pd0000644000175000017500000006655314736061645015327 0ustar osboxesosboxesuse strict; use warnings; use PDL::Types qw(types ppdefs_all); pp_bless('PDL::GSL::RNG'); # make the functions generated go into our namespace, and # not PDL's namespace pp_addpm({At=>'Top'},<<'EOD'); use strict; use warnings; =head1 NAME PDL::GSL::RNG - PDL interface to RNG and randist routines in GSL =head1 DESCRIPTION This is an interface to the rng and randist packages present in the GNU Scientific Library. =head1 SYNOPSIS use PDL; use PDL::GSL::RNG; $rng = PDL::GSL::RNG->new('taus'); $rng->set_seed(time()); $x=zeroes(5,5,5) $rng->get_uniform($x); # inplace $y=$rng->get_uniform(3,4,5); # creates new pdl =head1 NOMENCLATURE Throughout this documentation we strive to use the same variables that are present in the original GSL documentation (see L). Oftentimes those variables are called C and C. Since good Perl coding practices discourage the use of Perl variables C<$a> and C<$b>, here we refer to Parameters C and C as C<$pa> and C<$pb>, respectively, and Limits (of domain or integration) as C<$la> and C<$lb>. =cut EOD pp_addpm({At=>'Middle'},<<'EOD'); =head2 new =for ref The new method initializes a new instance of the RNG. The available RNGs are: =over =item coveyou =item cmrg =item fishman18 =item fishman20 =item fishman2x =item gfsr4 =item knuthran =item knuthran2 =item knuthran2002 =item lecuyer21 =item minstd =item mrg =item mt19937 =item mt19937_1999 =item mt19937_1998 =item r250 =item ran0 =item ran1 =item ran2 =item ran3 =item rand =item rand48 =item random128_bsd =item random128_glibc2 =item random128_libc5 =item random256_bsd =item random256_glibc2 =item random256_libc5 =item random32_bsd =item random32_glibc2 =item random32_libc5 =item random64_bsd =item random64_glibc2 =item random64_libc5 =item random8_bsd =item random8_glibc2 =item random8_libc5 =item random_bsd =item random_glibc2 =item random_libc5 =item randu =item ranf =item ranlux =item ranlux389 =item ranlxd1 =item ranlxd2 =item ranlxs0 =item ranlxs1 =item ranlxs2 =item ranmar =item slatec =item taus =item taus2 =item taus113 =item transputer =item tt800 =item uni =item uni32 =item vax =item waterman14 =item zuf =item default =back The last one (default) uses the environment variable GSL_RNG_TYPE. Note that only a few of these rngs are recommended for general use. Please check the GSL documentation for more information. =for usage Usage: $blessed_ref = PDL::GSL::RNG->new($RNG_name); Example: =for example $rng = PDL::GSL::RNG->new('taus'); =head2 set_seed =for ref Sets the RNG seed. Usage: =for usage $rng->set_seed($integer); # or $rng = PDL::GSL::RNG->new('taus')->set_seed($integer); Example: =for example $rng->set_seed(666); =head2 min =for ref Return the minimum value generable by this RNG. Usage: =for usage $integer = $rng->min(); Example: =for example $min = $rng->min(); $max = $rng->max(); =head2 max =for ref Return the maximum value generable by the RNG. Usage: =for usage $integer = $rng->max(); Example: =for example $min = $rng->min(); $max = $rng->max(); =head2 name =for ref Returns the name of the RNG. Usage: =for usage $string = $rng->name(); Example: =for example $name = $rng->name(); =head2 ran_shuffle =for ref Shuffles values in ndarray, treating it as flat. Usage: =for usage $rng->ran_shuffle($ndarray); =head2 ran_shuffle_vec =for ref Returns values in Perl list, shuffled. Usage: =for usage @shuffled = $rng->ran_shuffle_vec(@vec); =head2 ran_choose =for ref Chooses values from C<$inndarray> to C<$outndarray>, treating both as flat. Usage: =for usage $rng->ran_choose($inndarray,$outndarray); =head2 ran_choose_vec =for ref Chooses C<$n> values from C<@vec>. Usage: =for usage @chosen = $rng->ran_choose_vec($n,@vec); =head2 ran_dir =for ref Returns C<$n> random vectors in C<$ndim> dimensions. Usage: =for usage $ndarray = $rng->ran_dir($ndim,$n); Example: =for example $o = $rng->ran_dir($ndim,$n); =head2 ran_discrete_preproc =for ref This method returns a handle that must be used when calling L. You specify the probability of the integer number that are returned by L. Usage: =for usage $discrete_dist_handle = $rng->ran_discrete_preproc($double_ndarray_prob); Example: =for example $prob = pdl [0.1,0.3,0.6]; $ddh = $rng->ran_discrete_preproc($prob); $o = $rng->ran_discrete($discrete_dist_handle,100); =cut EOD pp_addpm({At=>'Bot'},<<'EOD'); =head1 BUGS Feedback is welcome. Log bugs in the PDL bug database (the database is always linked from L). =head1 SEE ALSO L The GSL documentation for random number distributions is online at L =head1 AUTHOR This file copyright (C) 1999 Christian Pellegrin Docs mangled by C. Soeller. All rights reserved. There is no warranty. You are allowed to redistribute this software / documentation under certain conditions. For details, see the file COPYING in the PDL distribution. If this file is separated from the PDL distribution, the copyright notice should be included in the file. The GSL RNG and randist modules were written by James Theiler. =cut EOD # PP interface to RNG ############################## # # make_get_sub generates a wrapper PDL subroutine that handles the # fill-a-PDL and create-a-PDL cases for each of the GSL functions. # --CED # sub make_get_sub { my ($fname,$par) =@_; my $s = ' sub ' . $fname . ' { my ($obj,' . $par . '@var) = @_;'; if ($par ne '') { my $ss=$par; $ss =~ s/,//; $s .= 'if (!(' . $ss . '>0)) {barf("first parameter must be an int >0")};'; } $s .= 'if (ref($var[0]) eq \'PDL\') { _' . $fname . '_int($var[0],' . $par . '$obj); return $var[0]; } else { my $p; $p = zeroes @var; _' . $fname . '_int($p,' . $par . '$obj); return $p; } } ' } pp_addhdr(' #include #include "gsl/gsl_rng.h" #include "gsl/gsl_randist.h" '); use Config; my %p_type = ( 'double' => 'double', 'unsigned int' => $Config{intsize} == 4 ? 'uint' : $Config{intsize} == 8 ? 'ulonglong' : die("Unknown intsize, not [48]"), 'size_t' => 'SIZE', ); use Text::ParseWords qw(shellwords); chomp(my $header = `gsl-config --cflags`); $header =~ s#\\#/#g; # win32 ($header) = map {s/^-I//;$_} grep /^-I/, shellwords $header; $header .= '/gsl/gsl_randist.h'; my $h = do { open my $fh, "<", $header or die "$header: $!"; local $/ = undef; <$fh> }; my @defs; DEF: for my $def ($h =~ m/(double\s+gsl_ran_\S*_pdf\s*\(.+?\))/sg) { local $_ = $def; s/\n\s+/ /xmsg; s/const //g; if (m/^(\w+)\s+(\w+)\s*\(\s*(.+)\s*\)/s) { my ($out_type, $function, $pars) = ($1, $2, $3); my @pars = split /,/, $pars; for (@pars) { die "Couldn't parse '$_' in '$def'" if !m/^(.+?)(\w+)\s*(\[\s*\])?\s*$/; my ($type, $par, $vec) = ($1, $2, $3); next DEF if $type =~ /gsl_ran_discrete_t/; s/^ | $//g for ($type, $par); $par = lc $par; # numbers interfere with $ISGOOD in BadCode $par =~ s/1/a/g; $par =~ s/2/b/g; die("unknown type '$type' in '$def'") if !$p_type{$type}; $_ = [$p_type{$type}, $par, $vec ? 1 : ()]; } push @defs, [ $out_type, $function, \@pars ]; } } @defs = sort { $a->[1] cmp $b->[1] } @defs; # sort by function name my @export_names; for my $f (@defs) { my ($out_type, $function, $pars) = @$f; my ($p, $code) = gen_def($out_type, $function, @$pars); (my $pp_name = $function) =~ s/^gsl_//; push @export_names, $pp_name; pp_def($pp_name, HandleBad => 1, GenericTypes => ['D'], Pars => $p, Code => $code, Doc => '', ); } sub gen_def { my ($out_type, $function, @pars) = @_; my $SIZEVAR; my @formal_pars = map { if ($_->[0] eq 'SIZE') { die "$function got second sizevar (@$_) but already got '$SIZEVAR'" if $SIZEVAR; $SIZEVAR = $_->[1]; () } else { my $prefix = $_->[0] eq 'double' ? '' : "$_->[0] "; my $suffix = !$_->[2] ? '()' : $SIZEVAR ? "($SIZEVAR)" : die "$function got vector par (@$_) but no sizevar"; $prefix.$_->[1].$suffix } } @pars; my $pars = join '; ', @formal_pars, '[o]out()'; my @call_pars = map $_->[0] eq 'SIZE' ? "\$SIZE($_->[1])" : $_->[2] ? "\$P($_->[1])" : "\$$_->[1]()", @pars; my $code = join "\n", "PDL_IF_BAD(char anybad=0;,)", (map $_->[2] ? "PDL_IF_BAD(loop ($SIZEVAR) %{ if (\$ISBAD($_->[1]())) { anybad=1; break; } %},)" : "PDL_IF_BAD(if ( \$ISBAD($_->[1]())) anybad=1;,)", grep $_->[0] ne 'SIZE', @pars), "PDL_IF_BAD(if (anybad) { \$SETBAD(out()); continue; },)", "\$out() = $function(@{[join ', ', @call_pars]});\n"; return ($pars, $code); } sub pp_defnd { # hide the docs my ($name, %hash) = @_; pp_def($name,%hash,Doc=>undef); } pp_def('ran_shuffle_1d', Pars => '[io]a(n)', GenericTypes => [ppdefs_all()], OtherPars => 'gsl_rng *rng', Code => ' gsl_ran_shuffle($COMP(rng), $P(a), $SIZE(n), sizeof($GENERIC())); ', PMCode => <<'EOF', sub ran_shuffle_1d { _ran_shuffle_1d_int(@_[1,0]) } EOF Doc => <<'EOF', =for ref Takes n-dimensional ndarray, and shuffles it along its zero-th dimension. Usage: =for usage $vec2d = sequence(10,10); $rng->ran_shuffle_1d($vec2d); EOF ); pp_def('get_uniform', Pars => '[o]a()', GenericTypes => ['F','D'], OtherPars => 'gsl_rng *rng', Code => ' $a() = gsl_rng_uniform($COMP(rng));', PMCode => make_get_sub('get_uniform',''), Doc => <<'EOF', =for ref This function creates an ndarray with given dimensions or accepts an existing ndarray and fills it. get_uniform() returns values 0<=x<1, Usage: =for usage $ndarray = $rng->get_uniform($list_of_integers) $rng->get_uniform($ndarray); Example: =for example $x = zeroes 5,6; $max=100; $o = $rng->get_uniform(10,10); $rng->get_uniform($x); EOF ); pp_def('get_uniform_pos', Pars => '[o]a()', GenericTypes => ['F','D'], OtherPars => 'gsl_rng *rng', Code => ' $a() = gsl_rng_uniform_pos($COMP(rng));', PMCode => make_get_sub('get_uniform_pos',''), Doc => <<'EOF', =for ref This function creates an ndarray with given dimensions or accepts an existing ndarray and fills it. get_uniform_pos() returns values 0get_uniform_pos($list_of_integers) $rng->get_uniform_pos($ndarray); Example: =for example $x = zeroes 5,6; $o = $rng->get_uniform_pos(10,10); $rng->get_uniform_pos($x); EOF ); pp_def('get', Pars => '[o]a()', GenericTypes => ['F','D'], OtherPars => 'gsl_rng *rng', Code => ' $a() = gsl_rng_get($COMP(rng));', PMCode => make_get_sub('get',''), Doc => <<'EOF', =for ref This function creates an ndarray with given dimensions or accepts an existing ndarray and fills it. get() returns integer values between a minimum and a maximum specific to every RNG. Usage: =for usage $ndarray = $rng->get($list_of_integers) $rng->get($ndarray); Example: =for example $x = zeroes 5,6; $o = $rng->get(10,10); $rng->get($x); EOF ); pp_def('get_int', Pars => '[o]a()', GenericTypes => ['F','D'], OtherPars => 'IV n; gsl_rng *rng', Code => ' $a() = gsl_rng_uniform_int($COMP(rng),$COMP(n));', PMCode => make_get_sub('get_int','$n,'), Doc => <<'EOF', =for ref This function creates an ndarray with given dimensions or accepts an existing ndarray and fills it. get_int() returns integer values between 0 and $max. Usage: =for usage $ndarray = $rng->get($max, $list_of_integers) $rng->get($max, $ndarray); Example: =for example $x = zeroes 5,6; $max=100; $o = $rng->get(10,10); $rng->get($x); EOF ); # randist stuff sub add_randist { my ($name,$doc,$params) = @_; my $npar = @$params; my $pars1=join '; ', (map "double $_", @$params), 'gsl_rng *rng'; my $fcall1=join ',', map "\$COMP($_)", @$params; my $arglist=join '', map "\$$_,", @$params; my $pars2=join ';', map "$_()", @$params; my $fcall2=join ',', map "\$$_()", @$params; my $arglist2=join ',', map "\$${_}_ndarray", @$params; pp_def( 'ran_' . $name, Pars => '[o]output()', GenericTypes => ['F','D'], OtherPars => $pars1, Code =>' $output() = gsl_ran_' . $name . '($COMP(rng),' . $fcall1 . ');', PMCode =>' sub ran_' . $name . ' { my ($obj,' . $arglist . '@var) = @_; if (ref($var[0]) eq \'PDL\') { _ran_' . $name . '_int($var[0],' . $arglist . '$obj); return $var[0]; } else { my $p; $p = zeroes @var; _ran_' . $name . '_int($p,' . $arglist . '$obj); return $p; } } ', Doc => <ran_$name(@{[join ', ', map qq{\$$_}, @$params]},[list of integers = output ndarray dims]); \$rng->ran_$name(@{[join ', ', map qq{\$$_}, @$params]}, \$output_ndarray); Example: =for example \$o = \$rng->ran_$name(@{[join ', ', map qq{\$$_}, @$params]},10,10); \$rng->ran_$name(@{[join ', ', map qq{\$$_}, @$params]},\$o); EOF ); pp_def( 'ran_' . $name . '_var', Pars => $pars2 . ';[o]output()', GenericTypes => ['F','D'], OtherPars => 'gsl_rng *rng', Code =>' $output() = gsl_ran_' . $name . '($COMP(rng),' . $fcall2 . ');', PMCode =>' sub ran_' . $name . '_var { my ($obj,@var) = @_; if (scalar(@var) != ' . $npar . ') {barf("Bad number of parameters!");} _ran_' . $name . '_var_int(@var,my $x=PDL->null,$obj); return $x; } ', Doc => < except that it takes the distribution parameters as an ndarray and returns an ndarray of equal dimensions. Usage: =for usage \$ndarray = \$rng->ran_${name}_var($arglist2); EOF ); } add_randist('gaussian','values from Gaussian distribution with mean zero and standard deviation C<$sigma>.',[qw(sigma)]); add_randist('ugaussian_tail', 'variates from the upper tail of a Gaussian distribution with C (AKA unit Gaussian distribution).',[qw(tail)]); add_randist('exponential', 'variates from the exponential distribution with mean C<$mu>.',[qw(mu)]); add_randist('laplace', 'variates from the Laplace distribution with width C<$pa>.',[qw(pa)]); add_randist('exppow', 'variates from the exponential power distribution with scale parameter C<$pa> and exponent C<$pb>.',[qw(pa pb)]); add_randist('cauchy', 'variates from the Cauchy distribution with scale parameter C<$pa>.',[qw(pa)]); add_randist('rayleigh', 'variates from the Rayleigh distribution with scale parameter C<$sigma>.',[qw(sigma)]); add_randist('rayleigh_tail', 'variates from the tail of the Rayleigh distribution with scale parameter C<$sigma> and a lower limit of C<$la>.',[qw(x sigma)]); add_randist('levy', 'variates from the Levy symmetric stable distribution with scale C<$c> and exponent C<$alpha>.',[qw(mu x)]); add_randist('gamma', 'variates from the gamma distribution.',[qw(pa pb)]); add_randist('flat', 'variates from the flat (uniform) distribution from C<$la> to C<$lb>.',[qw(la lb)]); add_randist('lognormal', 'variates from the lognormal distribution with parameters C<$mu> (location) and C<$sigma> (scale).',[qw(mu sigma)]); add_randist('chisq', 'variates from the chi-squared distribution with C<$nu> degrees of freedom.',[qw(nu)]); add_randist('fdist', 'variates from the F-distribution with degrees of freedom C<$nu1> and C<$nu2>.',[qw(nu1 nu2)]); add_randist('tdist', q{variates from the t-distribution (AKA Student's t-distribution) with C<$nu> degrees of freedom.},[qw(nu)]); add_randist('beta', 'variates from the beta distribution with parameters C<$pa> and C<$pb>.',[qw(pa pb)]); add_randist('logistic', 'random variates from the logistic distribution.',[qw(m)]); add_randist('pareto', 'variates from the Pareto distribution of order C<$pa> and scale C<$lb>.',[qw(pa lb)]); add_randist('weibull', 'variates from the Weibull distribution with scale C<$pa> and exponent C<$pb>. (Some literature uses C for C<$pa> and C for C<$pb>.)',[qw(pa pb)]); add_randist('gumbel1', 'variates from the Type-1 Gumbel distribution.',[qw(pa pb)]); add_randist('gumbel2', 'variates from the Type-2 Gumbel distribution.',[qw(pa pb)]); add_randist('poisson','integer values from the Poisson distribution with mean C<$mu>.',[qw(mu)]); add_randist('bernoulli', 'values 0 or 1, the result of a Bernoulli trial with probability C<$p>.',[qw(p)]); add_randist('binomial', 'integer values from the binomial distribution, the number of successes in C<$n> independent trials with probability C<$p>.',[qw(p n)]); add_randist('negative_binomial', 'integer values from the negative binomial distribution, the number of failures occurring before C<$n> successes in independent trials with probability C<$p> of success. Note that C<$n> is not required to be an integer.',[qw(p n)]); add_randist('pascal', 'integer values from the Pascal distribution. The Pascal distribution is simply a negative binomial distribution (see L) with an integer value of C<$n>.',[qw(p n)]); add_randist('geometric', 'integer values from the geometric distribution, the number of independent trials with probability C<$p> until the first success.',[qw(p)]); add_randist('hypergeometric', 'integer values from the hypergeometric distribution. If a population contains C<$n1> elements of type 1 and C<$n2> elements of type 2 then the hypergeometric distribution gives the probability of obtaining C<$x> elements of type 1 in C<$t> samples from the population without replacement.',[qw(n1 n2 t)]); add_randist('logarithmic', 'integer values from the logarithmic distribution.',[qw(p)]); # specific randist pp_def('ran_additive_gaussian', Pars => '[o]x()', GenericTypes => ['F','D'], OtherPars => 'double sigma; gsl_rng *rng', Code =>'$x() += gsl_ran_gaussian($COMP(rng), $COMP(sigma));', PMCode =>' sub ran_additive_gaussian { my ($obj,$sigma,$var) = @_; barf("In additive gaussian mode you must specify an ndarray!") if ref($var) ne \'PDL\'; _ran_additive_gaussian_int($var,$sigma,$obj); return $var; } ', Doc => <<'EOF', =for ref Add Gaussian noise of given sigma to an ndarray. Usage: =for usage $rng->ran_additive_gaussian($sigma,$ndarray); Example: =for example $rng->ran_additive_gaussian(1,$image); EOF ); pp_def('ran_additive_poisson', Pars => '[o]x()', GenericTypes => ['F','D'], OtherPars => 'double sigma; gsl_rng *rng', Code =>'$x() += gsl_ran_poisson($COMP(rng), $COMP(sigma));', PMCode =>' sub ran_additive_poisson { my ($obj,$sigma,$var) = @_; barf("In additive poisson mode you must specify an ndarray!") if ref($var) ne \'PDL\'; _ran_additive_poisson_int($var,$sigma,$obj); return $var; } ', Doc => <<'EOF', =for ref Add Poisson noise of given C<$mu> to a C<$ndarray>. Usage: =for usage $rng->ran_additive_poisson($mu,$ndarray); Example: =for example $rng->ran_additive_poisson(1,$image); EOF ); pp_def('ran_feed_poisson', Pars => '[o]x()', GenericTypes => ['F','D'], OtherPars => 'gsl_rng *rng', Code =>'$x() = gsl_ran_poisson($COMP(rng), $x());', PMCode =>' sub ran_feed_poisson { my ($obj,$var) = @_; barf("In poisson mode you must specify an ndarray!") if ref($var) ne \'PDL\'; _ran_feed_poisson_int($var,$obj); return $var; } ', Doc => <<'EOF', =for ref This method simulates shot noise, taking the values of ndarray as values for C<$mu> to be fed in the poissonian RNG. Usage: =for usage $rng->ran_feed_poisson($ndarray); Example: =for example $rng->ran_feed_poisson($image); EOF ); pp_def('ran_bivariate_gaussian', Pars => '[o]x(n)', GenericTypes => ['F','D'], OtherPars => 'double sigma_x; double sigma_y; double rho; gsl_rng *rng', Code => <<'EOF', double xx,yy; gsl_ran_bivariate_gaussian($COMP(rng), $COMP(sigma_x), $COMP(sigma_y),$COMP(rho), &xx, &yy); $x(n=>0)=xx; $x(n=>1)=yy; EOF PMCode => <<'EOF', sub ran_bivariate_gaussian { my ($obj,$sigma_x,$sigma_y,$rho,$n) = @_; barf("Not enough parameters for gaussian bivariate!") if $n<=0; my $p = zeroes(2,$n); _ran_bivariate_gaussian_int($p,$sigma_x,$sigma_y,$rho,$obj); return $p; } EOF Doc => <<'EOF', =for ref Generates C<$n> bivariate gaussian random deviates. Usage: =for usage $ndarray = $rng->ran_bivariate_gaussian($sigma_x,$sigma_y,$rho,$n); Example: =for example $o = $rng->ran_bivariate_gaussian(1,2,0.5,1000); EOF ); pp_defnd('ran_dir_2d', Pars => '[o]x(n)', GenericTypes => ['F','D'], OtherPars => 'gsl_rng *rng', Code =>' double xx,yy; gsl_ran_dir_2d($COMP(rng), &xx, &yy); $x(n=>0)=xx; $x(n=>1)=yy; '); pp_defnd('ran_dir_3d', Pars => '[o]x(n)', GenericTypes => ['F','D'], OtherPars => 'gsl_rng *rng', Code =>' double xx,yy,zz; gsl_ran_dir_3d($COMP(rng), &xx, &yy, &zz); $x(n=>0)=xx; $x(n=>1)=yy; $x(n=>2)=zz; '); my $MAX_DIMENSIONS = 100; pp_defnd('ran_dir_nd', Pars => '[o]x(n)', GenericTypes => ['F','D'], OtherPars => 'IV ns => n; gsl_rng *rng', Code =>' double xxx[' . $MAX_DIMENSIONS .']; gsl_ran_dir_nd($COMP(rng), $COMP(ns), xxx); loop (n) %{ $x() = xxx[n]; %}'); pp_addpm(' sub ran_dir { my ($obj,$ndim,$n) = @_; barf("Not enough parameters for random vectors!") if $n<=0; my $p = zeroes($ndim,$n); if ($ndim==2) { ran_dir_2d($p,$obj); } elsif ($ndim==3) { ran_dir_3d($p,$obj); } elsif ($ndim>=4 && $ndim<=' . $MAX_DIMENSIONS . ') { ran_dir_nd($p,$ndim,$obj); } else { barf("Bad number of dimensions!"); } return $p; } '); pp_def('ran_discrete', Pars => '[o]x()', GenericTypes => ['F','D'], OtherPars => 'gsl_ran_discrete_t *rng_discrete; gsl_rng *rng', Code =>' $x()=gsl_ran_discrete($COMP(rng), $COMP(rng_discrete)); ', PMCode =>' sub ran_discrete { my ($obj, $rdt, @var) = @_; if (ref($var[0]) eq \'PDL\') { _ran_discrete_int($var[0], $rdt, $obj); return $var[0]; } else { my $p; $p = zeroes @var; _ran_discrete_int($p, $rdt, $obj); return $p; } } ', Doc => <<'EOF', =for ref Is used to get the desired samples once a proper handle has been enstablished (see ran_discrete_preproc()). Usage: =for usage $ndarray = $rng->ran_discrete($discrete_dist_handle,$num); Example: =for example $prob = pdl [0.1,0.3,0.6]; $ddh = $rng->ran_discrete_preproc($prob); $o = $rng->ran_discrete($discrete_dist_handle,100); EOF ); pp_addpm(' sub ran_shuffle_vec { my ($obj,@in) = @_; $obj->ran_shuffle(my $p = PDL->sequence(PDL::indx(), 0+@in)); @in[$p->list]; } '); pp_addpm(' sub ran_choose_vec { my ($obj,$nout,@in) = @_; $obj->ran_choose(PDL->sequence(PDL::indx(), 0+@in),my $pout = PDL->zeroes(PDL::indx(), $nout)); @in[$pout->list]; } '); pp_def('ran_ver', Pars => '[o]x(n)', GenericTypes => ['F','D'], OtherPars => 'double x0; double r;IV ns => n; gsl_rng *rng', Code =>' double xx=$COMP(x0); loop (n) %{ $x() = xx; xx = $COMP(r)*(1-xx)*xx; %}', PMCode =>' sub ran_ver { my ($obj,$x0,$r,$n) = @_; barf("Not enough parameters for ran_ver!") if $n<=0; my $p = zeroes($n); _ran_ver_int($p,$x0,$r,$n,$obj); return $p; } ', Doc => <<'EOF', =for ref Returns an ndarray with C<$n> values generated by the Verhulst map from C<$x0> and parameter C<$r>. Usage: =for usage $rng->ran_ver($x0, $r, $n); EOF ); pp_def('ran_caos', Pars => '[o]x(n)', GenericTypes => ['F','D'], OtherPars => 'double m; IV ns => n; gsl_rng *rng', Code =>' double xx=gsl_ran_gaussian($COMP(rng),0.1)+0.5; loop (n) %{ $x() = (xx-0.5)*$COMP(m); xx = 4.0*(1-xx)*xx; %}', PMCode =>' sub ran_caos { my ($obj,$m,$n) = @_; barf("Not enough parameters for ran_caos!") if $n<=0; my $p = zeroes($n); _ran_caos_int($p,$m,$n,$obj); return $p; } ', Doc => <<'EOF', =for ref Returns values from Verhuls map with C<$r=4.0> and randomly chosen C<$x0>. The values are scaled by C<$m>. Usage: =for usage $rng->ran_caos($m,$n); EOF ); # XS function for the RNG object pp_addxs('',' MODULE = PDL::GSL::RNG PACKAGE = PDL::GSL::RNG #define DEF_RNG(X) if (!strcmp(TYPE,#X)) rng=gsl_rng_alloc( gsl_rng_ ## X ); strcat(rngs,#X ", "); gsl_rng * new (CLASS,TYPE) char *CLASS char *TYPE CODE: gsl_rng * rng = NULL; char rngs[5000]; strcpy(rngs,""); DEF_RNG(borosh13) DEF_RNG(coveyou) DEF_RNG(cmrg) DEF_RNG(fishman18) DEF_RNG(fishman20) DEF_RNG(fishman2x) DEF_RNG(gfsr4) DEF_RNG(knuthran) DEF_RNG(knuthran2) DEF_RNG(knuthran2002) DEF_RNG(lecuyer21) DEF_RNG(minstd) DEF_RNG(mrg) DEF_RNG(mt19937) DEF_RNG(mt19937_1999) DEF_RNG(mt19937_1998) DEF_RNG(r250) DEF_RNG(ran0) DEF_RNG(ran1) DEF_RNG(ran2) DEF_RNG(ran3) DEF_RNG(rand) DEF_RNG(rand48) DEF_RNG(random128_bsd) DEF_RNG(random128_glibc2) DEF_RNG(random128_libc5) DEF_RNG(random256_bsd) DEF_RNG(random256_glibc2) DEF_RNG(random256_libc5) DEF_RNG(random32_bsd) DEF_RNG(random32_glibc2) DEF_RNG(random32_libc5) DEF_RNG(random64_bsd) DEF_RNG(random64_glibc2) DEF_RNG(random64_libc5) DEF_RNG(random8_bsd) DEF_RNG(random8_glibc2) DEF_RNG(random8_libc5) DEF_RNG(random_bsd) DEF_RNG(random_glibc2) DEF_RNG(random_libc5) DEF_RNG(randu) DEF_RNG(ranf) DEF_RNG(ranlux) DEF_RNG(ranlux389) DEF_RNG(ranlxd1) DEF_RNG(ranlxd2) DEF_RNG(ranlxs0) DEF_RNG(ranlxs1) DEF_RNG(ranlxs2) DEF_RNG(ranmar) DEF_RNG(slatec) DEF_RNG(taus) DEF_RNG(taus2) DEF_RNG(taus113) DEF_RNG(transputer) DEF_RNG(tt800) DEF_RNG(uni) DEF_RNG(uni32) DEF_RNG(vax) DEF_RNG(waterman14) DEF_RNG(zuf) DEF_RNG(default) if (rng==NULL) { barf("Unknown RNG, please use one of the following: %s", rngs); } else RETVAL = rng; OUTPUT: RETVAL void set_seed(rng, seed) gsl_rng * rng int seed PPCODE: gsl_rng_set(rng,seed); XPUSHs(ST(0)); /* return self */ unsigned int min(rng) gsl_rng * rng CODE: RETVAL = gsl_rng_min(rng); OUTPUT: RETVAL unsigned int max(rng) gsl_rng * rng CODE: RETVAL = gsl_rng_max(rng); OUTPUT: RETVAL char* name(rng) gsl_rng * rng CODE: RETVAL = (char *) gsl_rng_name(rng); OUTPUT: RETVAL void DESTROY(sv) SV * sv CODE: gsl_rng *rng = INT2PTR(gsl_rng *, SvIV((SV*)SvRV(sv))); gsl_rng_free(rng); gsl_ran_discrete_t * ran_discrete_preproc(rng, p) gsl_rng * rng pdl * p CODE: IV n; if (p->ndims!=1 || p->datatype!=PDL_D) { barf("Bad input to ran_discrete_preproc!"); } PDL->barf_if_error(PDL->make_physical(p)); n = p->dims[0]; RETVAL = gsl_ran_discrete_preproc(n,(double *) p->data); OUTPUT: RETVAL void ran_shuffle(rng, in) gsl_rng * rng pdl * in CODE: IV size, n; PDL->barf_if_error(PDL->make_physical(in)); n = in->nvals; size = PDL->howbig(in->datatype); gsl_ran_shuffle(rng,in->data,n,size); PDL->changed(in, PDL_PARENTDATACHANGED, 0); void ran_choose(rng, in, out) gsl_rng * rng pdl * in pdl * out CODE: IV size, n,m; if (in->datatype != out->datatype) barf("Data Types must match for ran_chooser"); PDL->barf_if_error(PDL->make_physical(in)); PDL->barf_if_error(PDL->make_physical(out)); n = in->nvals; m = out->nvals; size = PDL->howbig(in->datatype); gsl_ran_choose(rng,out->data, m, in->data,n,size); PDL->changed(out, PDL_PARENTDATACHANGED, 0); '); pp_core_importList(' qw/ zeroes long barf /'); # import just a named list to our namespace, so we don't get warning # messages like 'warning 'min' redefined at line ...' pp_export_nothing; # set to not export anything. (This is a OO package, it doesn't need to export any methods.) pp_add_exported(@export_names); # ... except functions suitable for that pp_add_boot('gsl_set_error_handler_off(); '); pp_done(); PDL-GSL-2.103/lib/PDL/GSL/DIFF-FUNC.c0000644000175000017500000000111014736061645015733 0ustar osboxesosboxes#include "EXTERN.h" #include "perl.h" #include "pdlcore.h" #include SV* ext_funname; void set_funname(SV *fn) { ext_funname = fn; } double FUNC(double x,void * p){ double res; int count; dSP; SV* funname = ext_funname; /* get function name on the perl side */ ENTER; SAVETMPS; PUSHMARK(SP); XPUSHs(sv_2mortal(newSVnv(x))); PUTBACK; count=call_sv(funname,G_SCALAR); SPAGAIN; if (count!=1) croak("error calling perl function\n"); /* recover output value */ res = POPn; PUTBACK; FREETMPS; LEAVE; return res; } PDL-GSL-2.103/lib/PDL/GSL/INTERP.pd0000644000175000017500000001750714736061645015675 0ustar osboxesosboxesuse strict; use warnings; pp_bless('PDL::GSL::INTERP'); # make the functions generated go into our namespace pp_addpm({At=>'Top'},<<'EOD'); use strict; use warnings; =head1 NAME PDL::GSL::INTERP - PDL interface to Interpolation routines in GSL =head1 DESCRIPTION This is an interface to the interpolation package present in the GNU Scientific Library. =head1 SYNOPSIS use PDL; use PDL::GSL::INTERP; my $x = sequence(10); my $y = exp($x); my $spl = PDL::GSL::INTERP->init('cspline',$x,$y); my $res = $spl->eval(4.35); $res = $spl->deriv(4.35); $res = $spl->deriv2(4.35); $res = $spl->integ(2.1,7.4); =head1 NOMENCLATURE Throughout this documentation we strive to use the same variables that are present in the original GSL documentation (see L). Oftentimes those variables are called C and C. Since good Perl coding practices discourage the use of Perl variables C<$a> and C<$b>, here we refer to Parameters C and C as C<$pa> and C<$pb>, respectively, and Limits (of domain or integration) as C<$la> and C<$lb>. EOD pp_addpm({At=>'Bot'},<<'EOD'); =head1 BUGS Feedback is welcome. =head1 SEE ALSO L The GSL documentation for interpolation is online at L =head1 AUTHOR This file copyright (C) 2003 Andres Jordan All rights reserved. There is no warranty. You are allowed to redistribute this software/documentation under certain conditions. For details, see the file COPYING in the PDL distribution. If this file is separated from the PDL distribution, the copyright notice should be included in the file. The GSL interpolation module was written by Gerard Jungman. =cut EOD pp_addhdr(' #include #include #include #include #include "gslerr.h" typedef gsl_spline GslSpline; typedef gsl_interp_accel GslAccel; '); pp_def('init', Pars => 'double x(n); double y(n);', OtherPars => 'gsl_spline *spl', Doc => <<'EOF', =for ref The init method initializes a new instance of INTERP. It needs as input an interpolation type and two ndarrays holding the x and y values to be interpolated. The GSL routines require that x be monotonically increasing and a quicksort is performed by default to ensure that. You can skip the quicksort by passing the option {Sort => 0}. The available interpolation types are : =over 2 =item linear =item polynomial =item cspline (natural cubic spline) =item cspline_periodic (periodic cubic spline) =item akima (natural akima spline) =item akima_periodic (periodic akima spline) =back Please check the GSL documentation for more information. =for usage Usage: $blessed_ref = PDL::GSL::INTERP->init($interp_method,$x,$y,$opt); =for example Example: $x = sequence(10); $y = exp($x); $spl = PDL::GSL::INTERP->init('cspline',$x,$y) $spl = PDL::GSL::INTERP->init('cspline',$x,$y,{Sort => 1}) #same as above # no sorting done on x, user is certain that x is monotonically increasing $spl = PDL::GSL::INTERP->init('cspline',$x,$y,{Sort => 0}); =cut EOF Code =>'GSLERR(gsl_spline_init,($COMP(spl),$P(x),$P(y),$SIZE(n)));', PMCode => <<'EOF', sub init { my $opt; if (ref($_[$#_]) eq 'HASH'){ $opt = pop @_; } else{ $opt = {Sort => 1}; } my ($class,$type,$x,$y) = @_; if( (ref($x) ne 'PDL') || (ref($y) ne 'PDL') ){ barf("Have to pass ndarrays as arguments to init method\n"); } if($$opt{Sort} != 0){ my $idx = PDL::Ufunc::qsorti($x); $x = $x->index($idx); $y = $y->index($idx); } my $ene = nelem($x); my $obj1 = new_spline($type,$ene); my $obj2 = new_accel(); _init_int($x,$y,$$obj1); my @ret_a = ($obj1,$obj2); return bless(\@ret_a, $class); } EOF ); pp_def('eval', Pars => 'double x(); double [o] out();', OtherPars => 'gsl_spline *spl;gsl_interp_accel *acc;', Doc => <<'EOF', =for ref The function eval returns the interpolating function at a given point. It will barf with an "input domain error" if you try to extrapolate. =for usage Usage: $result = $spl->eval($points); =for example Example: my $res = $spl->eval($x) =cut EOF PMCode => <<'EOF', sub eval { my $opt; my ($obj,$x) = @_; my $s_obj = $$obj[0]; my $a_obj = $$obj[1]; _eval_int($x,my $o=PDL->null,$$s_obj,$$a_obj); $o; } EOF HandleBad => 1, Code => ' PDL_IF_BAD(if ($ISBAD($x())) { $out() = $x(); } else,) { GSLERR(gsl_spline_eval_e,($COMP(spl), $x(), $COMP(acc), $P(out))); } ', ); pp_def('deriv', Pars => 'double x(); double [o] out();', OtherPars => 'gsl_spline *spl;gsl_interp_accel *acc;', PMCode => <<'EOF', sub deriv { my ($obj,$x) = @_; my $s_obj = $$obj[0]; my $a_obj = $$obj[1]; _deriv_int($x,my $o=PDL->null,$$s_obj,$$a_obj); $o; } EOF Doc => <<'EOF', =for ref The deriv function returns the derivative of the interpolating function at a given point. It will barf with an "input domain error" if you try to extrapolate. =for usage Usage: $result = $spl->deriv($points); =for example Example: my $res = $spl->deriv($x) =cut EOF Code =>' GSLERR(gsl_spline_eval_deriv_e,($COMP(spl), $x(), $COMP(acc), $P(out))); '); pp_def('deriv2', Pars => 'double x(); double [o] out();', OtherPars => 'gsl_spline *spl;gsl_interp_accel *acc;', Doc => <<'EOF', =for ref The deriv2 function returns the second derivative of the interpolating function at a given point. It will barf with an "input domain error" if you try to extrapolate. =for usage Usage: $result = $spl->deriv2($points); =for example Example: my $res = $spl->deriv2($x) =cut EOF PMCode => <<'EOF', sub deriv2 { my ($obj,$x) = @_; my $s_obj = $$obj[0]; my $a_obj = $$obj[1]; _deriv2_int($x,my $o=PDL->null,$$s_obj,$$a_obj); $o; } EOF Code =>' GSLERR(gsl_spline_eval_deriv2_e,($COMP(spl), $x(), $COMP(acc), $P(out))); '); pp_def('integ', Pars => 'double a(); double b(); double [o] out();', OtherPars => 'gsl_spline *spl;gsl_interp_accel *acc;', Doc => <<'EOF', =for ref The integ function returns the integral of the interpolating function between two points. It will barf with an "input domain error" if you try to extrapolate. =for usage Usage: $result = $spl->integ($la,$lb); =for example Example: my $res = $spl->integ($la,$lb) =cut EOF PMCode => <<'EOF', sub integ { my ($obj,$la,$lb) = @_; my $s_obj = $$obj[0]; my $a_obj = $$obj[1]; _integ_int($la,$lb,my $o=PDL->null,$$s_obj,$$a_obj); $o; } EOF Code =>' GSLERR(gsl_spline_eval_integ_e,($COMP(spl), $a(), $b(), $COMP(acc),$P(out))); '); # XS functions for the INTERP objects pp_addxs('',' MODULE = PDL::GSL::INTERP PACKAGE = PDL::GSL::INTERP #define DEF_INTERP(X) if (!strcmp(TYPE,#X)) spline=gsl_spline_alloc( gsl_interp_ ## X , ene); strcat(ula,#X ", "); GslSpline * new_spline (TYPE,ene) char *TYPE int ene CODE: GslSpline * spline = NULL; char ula[100]; strcpy(ula,""); DEF_INTERP(linear); DEF_INTERP(polynomial); DEF_INTERP(cspline); DEF_INTERP(cspline_periodic); DEF_INTERP(akima); DEF_INTERP(akima_periodic); if (spline==NULL) { barf("Unknown interpolation type, please use one of the following: %s", ula); } else RETVAL = spline; OUTPUT: RETVAL GslAccel * new_accel () CODE: GslAccel * accel = NULL; accel = gsl_interp_accel_alloc(); if (accel == NULL){ barf("Problem allocating accelerator object\n"); } RETVAL = accel; OUTPUT: RETVAL MODULE = PDL::GSL::INTERP PACKAGE = GslSplinePtr PREFIX = spl_ void spl_DESTROY(spline) GslSpline * spline CODE: gsl_spline_free(spline); MODULE = PDL::GSL::INTERP PACKAGE = GslAccelPtr PREFIX = acc_ void acc_DESTROY(accel) GslAccel * accel CODE: gsl_interp_accel_free(accel); '); pp_export_nothing; pp_add_boot('gsl_set_error_handler_off(); '); pp_done(); PDL-GSL-2.103/lib/PDL/GSL/INTEG.pd0000644000175000017500000007247014736061645015542 0ustar osboxesosboxesuse strict; use warnings; { no warnings 'once'; # pass info back to Makefile.PL $PDL::Core::Dev::EXTRAS{$::PDLMOD}{OBJECT} .= join '', map " $::PDLBASE-$_\$(OBJ_EXT)", qw(FUNC); } pp_bless('PDL::GSL::INTEG'); pp_addpm({At=>'Top'},<<'EOD'); use strict; use warnings; =head1 NAME PDL::GSL::INTEG - PDL interface to numerical integration routines in GSL =head1 DESCRIPTION This is an interface to the numerical integration package present in the GNU Scientific Library, which is an implementation of QUADPACK. Functions are named B where {algorithm} is the QUADPACK naming convention. The available functions are: =over 3 =item gslinteg_qng: Non-adaptive Gauss-Kronrod integration =item gslinteg_qag: Adaptive integration =item gslinteg_qags: Adaptive integration with singularities =item gslinteg_qagp: Adaptive integration with known singular points =item gslinteg_qagi: Adaptive integration on infinite interval of the form (-\infty,\infty) =item gslinteg_qagiu: Adaptive integration on infinite interval of the form (la,\infty) =item gslinteg_qagil: Adaptive integration on infinite interval of the form (-\infty,lb) =item gslinteg_qawc: Adaptive integration for Cauchy principal values =item gslinteg_qaws: Adaptive integration for singular functions =item gslinteg_qawo: Adaptive integration for oscillatory functions =item gslinteg_qawf: Adaptive integration for Fourier integrals =back Each algorithm computes an approximation to the integral, I, of the function f(x)w(x), where w(x) is a weight function (for general integrands w(x)=1). The user provides absolute and relative error bounds (epsabs,epsrel) which specify the following accuracy requirement: |RESULT - I| <= max(epsabs, epsrel |I|) The routines will fail to converge if the error bounds are too stringent, but always return the best approximation obtained up to that stage All functions return the result, and estimate of the absolute error and an error flag (which is zero if there were no problems). You are responsible for checking for any errors, no warnings are issued unless the option {Warn => 'y'} is specified in which case the reason of failure will be printed. You can nest integrals up to 20 levels. If you find yourself in the unlikely situation that you need more, you can change the value of 'max_nested_integrals' in the first line of the file 'FUNC.c' and recompile. =head1 NOMENCLATURE Throughout this documentation we strive to use the same variables that are present in the original GSL documentation (see L). Oftentimes those variables are called C and C. Since good Perl coding practices discourage the use of Perl variables C<$a> and C<$b>, here we refer to Parameters C and C as C<$pa> and C<$pb>, respectively, and Limits (of domain or integration) as C<$la> and C<$lb>. =head1 SYNOPSIS use PDL; use PDL::GSL::INTEG; my $la = 1.2; my $lb = 3.7; my $epsrel = 0; my $epsabs = 1e-6; # Non adaptive integration my ($res,$abserr,$ierr,$neval) = gslinteg_qng(\&myf,$la,$lb,$epsrel,$epsabs); # Warnings on my ($res,$abserr,$ierr,$neval) = gslinteg_qng(\&myf,$la,$lb,$epsrel,$epsabs,{Warn=>'y'}); # Adaptive integration with warnings on my $limit = 1000; my $key = 5; my ($res,$abserr,$ierr) = gslinteg_qag(\&myf,$la,$lb,$epsrel, $epsabs,$limit,$key,{Warn=>'y'}); sub myf{ my ($x) = @_; return exp(-$x**2); } EOD pp_addpm({At=>'Bot'},<<'EOD'); =head1 BUGS Feedback is welcome. Log bugs in the PDL bug database (the database is always linked from L). =head1 SEE ALSO L The GSL documentation for numerical integration is online at L =head1 AUTHOR This file copyright (C) 2003,2005 Andres Jordan All rights reserved. There is no warranty. You are allowed to redistribute this software documentation under certain conditions. For details, see the file COPYING in the PDL distribution. If this file is separated from the PDL distribution, the copyright notice should be included in the file. The GSL integration routines were written by Brian Gough. QUADPACK was written by Piessens, Doncker-Kapenga, Uberhuber and Kahaner. =cut EOD pp_addhdr(' #include #include #include #include double FUNC(double x,void * p); void set_funname(SV *fn); void dec_func(); void my_handler (const char * reason, const char * file, int line, int gsl_errno); '); pp_def('gslinteg_qng', Pars => 'a(); b(); epsabs(); epsrel(); int gslwarn(); [o] result(); [o] abserr(); int [o] neval(); int [o] ierr();', OtherPars => 'SV* function;', GenericTypes => ['D'], PMCode => <<'EOF', sub gslinteg_qng{ my $opt = ref($_[-1]) eq 'HASH' ? pop @_ : {Warn => 'n'}; barf 'Usage: gslinteg_qng($function_ref,$la,$lb,$epsabs,$epsrel,[opt])' unless (@_ == 5); my $warn = $$opt{Warn}=~/y/i ? 1 : 0; my ($f,$la,$lb,$epsabs,$epsrel) = @_; $_=PDL->null for my ($res,$abserr,$neval,$ierr); _gslinteg_qng_int($la,$lb,$epsabs,$epsrel,$warn,$res,$abserr,$neval,$ierr,$f); return ($res,$abserr,$ierr,$neval); } EOF Code => <<'EOF', gsl_error_handler_t * old_handler; if ($gslwarn() == 1) { old_handler = gsl_set_error_handler(&my_handler); } else { gsl_set_error_handler_off ();} set_funname($COMP(function)); gsl_function F; F.function = &FUNC; F.params = 0; $ierr() = gsl_integration_qng(&F,$a(),$b(),$epsabs(),$epsrel(),$P(result),$P(abserr),(size_t *) $P(neval)); dec_func(); EOF Doc => <<'EOF', =for ref Non-adaptive Gauss-Kronrod integration This function applies the Gauss-Kronrod 10-point, 21-point, 43-point and 87-point integration rules in succession until an estimate of the integral of f over ($la,$lb) is achieved within the desired absolute and relative error limits, $epsabs and $epsrel. It is meant for fast integration of smooth functions. It returns an array with the result, an estimate of the absolute error, an error flag and the number of function evaluations performed. =for usage Usage: ($res,$abserr,$ierr,$neval) = gslinteg_qng($function_ref,$la,$lb, $epsrel,$epsabs,[{Warn => $warn}]); =for example Example: my ($res,$abserr,$ierr,$neval) = gslinteg_qng(\&f,0,1,0,1e-9); # with warnings on my ($res,$abserr,$ierr,$neval) = gslinteg_qng(\&f,0,1,0,1e-9,{Warn => 'y'}); sub f{ my ($x) = @_; return ($x**2.6)*log(1.0/$x); } EOF ); pp_def('gslinteg_qag', Pars => 'a(); b(); epsabs();epsrel(); int limit(); int key(); int n(); int gslwarn(); [o] result(); [o] abserr(); int [o] ierr();', GenericTypes => ['D'], OtherPars => 'SV* function;', Code => <<'EOF', gsl_error_handler_t * old_handler; if ($gslwarn() == 1) { old_handler = gsl_set_error_handler(&my_handler); } else { gsl_set_error_handler_off ();} {gsl_integration_workspace *w; set_funname($COMP(function)); gsl_function F; F.function = &FUNC; F.params = 0; w = gsl_integration_workspace_alloc((size_t) $n()); $ierr() = gsl_integration_qag(&F,$a(),$b(),$epsabs(),$epsrel(),(size_t) $limit(),$key(),w,$P(result),$P(abserr)); gsl_integration_workspace_free(w); dec_func(); } EOF PMCode => <<'EOF', sub gslinteg_qag { my $opt = ref($_[-1]) eq 'HASH' ? pop @_ : {Warn => 'n'}; my $warn = $$opt{Warn}=~/y/i ? 1 : 0; my ($f,$la,$lb,$epsabs,$epsrel,$limit,$key) = @_; barf 'Usage: gslinteg_qag($function_ref,$la,$lb,$epsabs,$epsrel,$limit,$key,[opt]) ' unless ($#_ == 6); $_ = PDL->null for my ($res,$abserr,$ierr); _gslinteg_qag_int($la,$lb,$epsabs,$epsrel,$limit,$key,$limit,$warn,$res,$abserr,$ierr,$f); return ($res,$abserr,$ierr); } EOF Doc => <<'EOF', =for ref Adaptive integration This function applies an integration rule adaptively until an estimate of the integral of f over ($la,$lb) is achieved within the desired absolute and relative error limits, $epsabs and $epsrel. On each iteration the adaptive integration strategy bisects the interval with the largest error estimate; the maximum number of allowed subdivisions is given by the parameter $limit. The integration rule is determined by the value of $key, which has to be one of (1,2,3,4,5,6) and correspond to the 15, 21, 31, 41, 51 and 61 point Gauss-Kronrod rules respectively. It returns an array with the result, an estimate of the absolute error and an error flag. =for usage Usage: ($res,$abserr,$ierr) = gslinteg_qag($function_ref,$la,$lb,$epsrel, $epsabs,$limit,$key,[{Warn => $warn}]); =for example Example: my ($res,$abserr,$ierr) = gslinteg_qag(\&f,0,1,0,1e-10,1000,1); # with warnings on my ($res,$abserr,$ierr) = gslinteg_qag(\&f,0,1,0,1e-10,1000,1,{Warn => 'y'}); sub f{ my ($x) = @_; return ($x**2.6)*log(1.0/$x); } EOF ); pp_def('gslinteg_qags', Pars => 'a(); b(); epsabs(); epsrel(); int limit(); int n(); int gslwarn(); [o] result(); [o] abserr(); int [o] ierr();', GenericTypes => ['D'], OtherPars => 'SV* function;', PMCode => <<'EOF', sub gslinteg_qags{ my $opt = ref($_[-1]) eq 'HASH' ? pop @_ : {Warn => 'n'}; my $warn = $$opt{Warn}=~/y/i ? 1 : 0; my ($f,$la,$lb,$epsabs,$epsrel,$limit) = @_; barf 'Usage: gslinteg_qags($function_ref,$la,$lb,$epsabs,$epsrel,$limit,[opt]) ' unless ($#_ == 5); $_ = PDL->null for my ($res,$abserr,$ierr); _gslinteg_qags_int($la,$lb,$epsabs,$epsrel,$limit,$limit,$warn,$res,$abserr,$ierr,$f); return ($res,$abserr,$ierr); } EOF Code => <<'EOF', gsl_error_handler_t * old_handler; if ($gslwarn() == 1) { old_handler = gsl_set_error_handler(&my_handler); } else { gsl_set_error_handler_off ();} {gsl_integration_workspace *w; set_funname($COMP(function)); gsl_function F; F.function = &FUNC; F.params = 0; w = gsl_integration_workspace_alloc((size_t) $n()); $ierr() = gsl_integration_qags(&F,$a(),$b(),$epsabs(),$epsrel(),(size_t) $limit(),w,$P(result),$P(abserr)); gsl_integration_workspace_free(w); dec_func(); } EOF Doc => <<'EOF', =for ref Adaptive integration with singularities This function applies the Gauss-Kronrod 21-point integration rule adaptively until an estimate of the integral of f over ($la,$lb) is achieved within the desired absolute and relative error limits, $epsabs and $epsrel. The algorithm is such that it accelerates the convergence of the integral in the presence of discontinuities and integrable singularities. The maximum number of allowed subdivisions done by the adaptive algorithm must be supplied in the parameter $limit. =for usage Usage: ($res,$abserr,$ierr) = gslinteg_qags($function_ref,$la,$lb,$epsrel, $epsabs,$limit,[{Warn => $warn}]); =for example Example: my ($res,$abserr,$ierr) = gslinteg_qags(\&f,0,1,0,1e-10,1000); # with warnings on ($res,$abserr,$ierr) = gslinteg_qags(\&f,0,1,0,1e-10,1000,{Warn => 'y'}); sub f{ my ($x) = @_; return ($x)*log(1.0/$x); } EOF ); pp_def('gslinteg_qagp', Pars => 'pts(l); epsabs(); epsrel();int limit();int n();int gslwarn(); [o] result(); [o] abserr();int [o] ierr();', GenericTypes => ['D'], OtherPars => 'SV* function;', Code => <<'EOF', gsl_error_handler_t * old_handler; if ($gslwarn() == 1) { old_handler = gsl_set_error_handler(&my_handler); } else { gsl_set_error_handler_off ();} {gsl_integration_workspace *w; set_funname($COMP(function)); gsl_function F; F.function = &FUNC; F.params = 0; w = gsl_integration_workspace_alloc((size_t) $n()); $ierr() = gsl_integration_qagp(&F,$P(pts),(size_t) $SIZE(l),$epsabs(),$epsrel(),(size_t) $limit(),w,$P(result),$P(abserr)); gsl_integration_workspace_free(w); dec_func(); } EOF PMCode => <<'EOF', sub gslinteg_qagp{ my $opt = ref($_[-1]) eq 'HASH' ? pop @_ : {Warn => 'n'}; my $warn = $$opt{Warn}=~/y/i ? 1 : 0; my ($f,$points,$epsabs,$epsrel,$limit) = @_; barf 'Usage: gslinteg_qagp($function_ref,$points,$epsabs,$epsrel,$limit,[opt]) ' unless ($#_ == 4); $_ = PDL->null for my ($res,$abserr,$ierr); _gslinteg_qagp_int($points,$epsabs,$epsrel,$limit,$limit,$warn,$res,$abserr,$ierr,$f); return ($res,$abserr,$ierr); } EOF Doc => <<'EOF', =for ref Adaptive integration with known singular points This function applies the adaptive integration algorithm used by gslinteg_qags taking into account the location of singular points until an estimate of the integral of f over ($la,$lb) is achieved within the desired absolute and relative error limits, $epsabs and $epsrel. Singular points are supplied in the ndarray $points, whose endpoints determine the integration range. So, for example, if the function has singular points at x_1 and x_2 and the integral is desired from a to b (a < x_1 < x_2 < b), $points = pdl(a,x_1,x_2,b). The maximum number of allowed subdivisions done by the adaptive algorithm must be supplied in the parameter $limit. =for usage Usage: ($res,$abserr,$ierr) = gslinteg_qagp($function_ref,$points,$epsabs, $epsrel,$limit,[{Warn => $warn}]) =for example Example: my $points = pdl(0,1,sqrt(2),3); my ($res,$abserr,$ierr) = gslinteg_qagp(\&f,$points,0,1e-3,1000); # with warnings on ($res,$abserr,$ierr) = gslinteg_qagp(\&f,$points,0,1e-3,1000,{Warn => 'y'}); sub f{ my ($x) = @_; my $x2 = $x**2; my $x3 = $x**3; return $x3 * log(abs(($x2-1.0)*($x2-2.0))); } EOF ); pp_def('gslinteg_qagi', Pars => 'epsabs(); epsrel(); int limit(); int n();int gslwarn(); [o] result(); [o] abserr(); int [o] ierr();', GenericTypes => ['D'], OtherPars => 'SV* function;', Code => <<'EOF', gsl_error_handler_t * old_handler; if ($gslwarn() == 1) { old_handler = gsl_set_error_handler(&my_handler); } else { gsl_set_error_handler_off ();} {gsl_integration_workspace *w; set_funname($COMP(function)); gsl_function F; F.function = &FUNC; F.params = 0; w = gsl_integration_workspace_alloc((size_t) $n()); $ierr() = gsl_integration_qagi(&F,$epsabs(),$epsrel(),(size_t) $limit(),w,$P(result),$P(abserr)); gsl_integration_workspace_free(w); dec_func(); } EOF PMCode => <<'EOF', sub gslinteg_qagi { my $opt = ref($_[-1]) eq 'HASH' ? pop @_ : {Warn => 'n'}; my $warn = $$opt{Warn}=~/y/i ? 1 : 0; my ($f,$epsabs,$epsrel,$limit) = @_; barf 'Usage: gslinteg_qagi($function_ref,$epsabs,$epsrel,$limit,[opt])' unless ($#_ == 3); $_ = PDL->null for my ($res,$abserr,$ierr); _gslinteg_qagi_int($epsabs,$epsrel,$limit,$limit,$warn,$res,$abserr,$ierr,$f); return ($res,$abserr,$ierr); } EOF Doc => <<'EOF', =for ref Adaptive integration on infinite interval This function estimates the integral of the function f over the infinite interval (-\infty,+\infty) within the desired absolute and relative error limits, $epsabs and $epsrel. After a transformation, the algorithm of gslinteg_qags with a 15-point Gauss-Kronrod rule is used. The maximum number of allowed subdivisions done by the adaptive algorithm must be supplied in the parameter $limit. =for usage Usage: ($res,$abserr,$ierr) = gslinteg_qagi($function_ref,$epsabs, $epsrel,$limit,[{Warn => $warn}]); =for example Example: my ($res,$abserr,$ierr) = gslinteg_qagi(\&myfn,1e-7,0,1000); # with warnings on ($res,$abserr,$ierr) = gslinteg_qagi(\&myfn,1e-7,0,1000,{Warn => 'y'}); sub myfn{ my ($x) = @_; return exp(-$x - $x*$x) ; } EOF ); pp_def('gslinteg_qagiu', Pars => 'a(); epsabs(); epsrel();int limit();int n();int gslwarn(); [o] result(); [o] abserr();int [o] ierr();', GenericTypes => ['D'], OtherPars => 'SV* function;', Doc => <<'EOF', =for ref Adaptive integration on infinite interval This function estimates the integral of the function f over the infinite interval (la,+\infty) within the desired absolute and relative error limits, $epsabs and $epsrel. After a transformation, the algorithm of gslinteg_qags with a 15-point Gauss-Kronrod rule is used. The maximum number of allowed subdivisions done by the adaptive algorithm must be supplied in the parameter $limit. =for usage Usage: ($res,$abserr,$ierr) = gslinteg_qagiu($function_ref,$la,$epsabs, $epsrel,$limit,[{Warn => $warn}]); =for example Example: my $alfa = 1; my ($res,$abserr,$ierr) = gslinteg_qagiu(\&f,99.9,1e-7,0,1000); # with warnings on ($res,$abserr,$ierr) = gslinteg_qagiu(\&f,99.9,1e-7,0,1000,{Warn => 'y'}); sub f{ my ($x) = @_; if (($x==0) && ($alfa == 1)) {return 1;} if (($x==0) && ($alfa > 1)) {return 0;} return ($x**($alfa-1))/((1+10*$x)**2); } EOF PMCode => <<'EOF', sub gslinteg_qagiu{ my $opt = ref($_[-1]) eq 'HASH' ? pop @_ : {Warn => 'n'}; my $warn = $$opt{Warn}=~/y/i ? 1 : 0; my ($f,$la,$epsabs,$epsrel,$limit) = @_; barf 'Usage: gslinteg_qagiu($function_ref,$la,$epsabs,$epsrel,$limit,[opt])' unless ($#_ == 4); $_ = PDL->null for my ($res,$abserr,$ierr); _gslinteg_qagiu_int($la,$epsabs,$epsrel,$limit,$limit,$warn,$res,$abserr,$ierr,$f); return ($res,$abserr,$ierr); } EOF Code =>' gsl_error_handler_t * old_handler; if ($gslwarn() == 1) { old_handler = gsl_set_error_handler(&my_handler); } else { gsl_set_error_handler_off ();} {gsl_integration_workspace *w; set_funname($COMP(function)); gsl_function F; F.function = &FUNC; F.params = 0; w = gsl_integration_workspace_alloc((size_t) $n()); $ierr() = gsl_integration_qagiu(&F,$a(),$epsabs(),$epsrel(),(size_t) $limit(),w,$P(result),$P(abserr)); gsl_integration_workspace_free(w); dec_func(); } '); pp_def('gslinteg_qagil', Pars => 'b(); epsabs(); epsrel();int limit();int n();int gslwarn(); [o] result(); [o] abserr();int [o] ierr();', GenericTypes => ['D'], OtherPars => 'SV* function;', Doc => <<'EOF', =for ref Adaptive integration on infinite interval This function estimates the integral of the function f over the infinite interval (-\infty,lb) within the desired absolute and relative error limits, $epsabs and $epsrel. After a transformation, the algorithm of gslinteg_qags with a 15-point Gauss-Kronrod rule is used. The maximum number of allowed subdivisions done by the adaptive algorithm must be supplied in the parameter $limit. =for usage Usage: ($res,$abserr,$ierr) = gslinteg_qagl($function_ref,$lb,$epsabs, $epsrel,$limit,[{Warn => $warn}]); =for example Example: my ($res,$abserr,$ierr) = gslinteg_qagil(\&myfn,1.0,1e-7,0,1000); # with warnings on ($res,$abserr,$ierr) = gslinteg_qagil(\&myfn,1.0,1e-7,0,1000,{Warn => 'y'}); sub myfn{ my ($x) = @_; return exp($x); } EOF PMCode => <<'EOF', sub gslinteg_qagil{ my $opt = ref($_[-1]) eq 'HASH' ? pop @_ : {Warn => 'n'}; my $warn = $$opt{Warn}=~/y/i ? 1 : 0; my ($f,$lb,$epsabs,$epsrel,$limit) = @_; barf 'Usage: gslinteg_qagil($function_ref,$lb,$epsabs,$epsrel,$limit,[opt])' unless ($#_ == 4); $_ = PDL->null for my ($res,$abserr,$ierr); _gslinteg_qagil_int($lb,$epsabs,$epsrel,$limit,$limit,$warn,$res,$abserr,$ierr,$f); return ($res,$abserr,$ierr); } EOF Code =>' gsl_error_handler_t * old_handler; if ($gslwarn() == 1) { old_handler = gsl_set_error_handler(&my_handler); } else { gsl_set_error_handler_off ();} {gsl_integration_workspace *w; set_funname($COMP(function)); gsl_function F; F.function = &FUNC; F.params = 0; w = gsl_integration_workspace_alloc((size_t) $n()); $ierr() = gsl_integration_qagil(&F,$b(),$epsabs(),$epsrel(),(size_t) $limit(),w,$P(result),$P(abserr)); gsl_integration_workspace_free(w); dec_func(); } '); pp_def('gslinteg_qawc', Pars => 'a(); b(); c(); epsabs(); epsrel();int limit();int n();int gslwarn(); [o] result(); [o] abserr();int [o] ierr();', GenericTypes => ['D'], OtherPars => 'SV* function;', PMCode => <<'EOF', sub gslinteg_qawc{ my $opt = ref($_[-1]) eq 'HASH' ? pop @_ : {Warn => 'n'}; my $warn = $$opt{Warn}=~/y/i ? 1 : 0; my ($f,$la,$lb,$c,$epsabs,$epsrel,$limit) = @_; barf 'Usage: gslinteg_qawc($function_ref,$la,$lb,$c,$epsabs,$epsrel,$limit,[opt])' unless ($#_ == 6); $_ = PDL->null for my ($res,$abserr,$ierr); _gslinteg_qawc_int($la,$lb,$c,$epsabs,$epsrel,$limit,$limit,$warn,$res,$abserr,$ierr,$f); return ($res,$abserr,$ierr); } EOF Doc => <<'EOF', =for ref Adaptive integration for Cauchy principal values This function computes the Cauchy principal value of the integral of f over (la,lb), with a singularity at c, I = \int_{la}^{lb} dx f(x)/(x - c). The integral is estimated within the desired absolute and relative error limits, $epsabs and $epsrel. The maximum number of allowed subdivisions done by the adaptive algorithm must be supplied in the parameter $limit. =for usage Usage: ($res,$abserr,$ierr) = gslinteg_qawc($function_ref,$la,$lb,$c,$epsabs,$epsrel,$limit) =for example Example: my ($res,$abserr,$ierr) = gslinteg_qawc(\&f,-1,5,0,0,1e-3,1000); # with warnings on ($res,$abserr,$ierr) = gslinteg_qawc(\&f,-1,5,0,0,1e-3,1000,{Warn => 'y'}); sub f{ my ($x) = @_; return 1.0 / (5.0 * $x * $x * $x + 6.0) ; } EOF Code =>' gsl_error_handler_t * old_handler; if ($gslwarn() == 1) { old_handler = gsl_set_error_handler(&my_handler); } else { gsl_set_error_handler_off ();} {gsl_integration_workspace *w; set_funname($COMP(function)); gsl_function F; F.function = &FUNC; F.params = 0; w = gsl_integration_workspace_alloc((size_t) $n()); $ierr() = gsl_integration_qawc(&F,$a(),$b(),$c(),$epsabs(),$epsrel(),(size_t) $limit(),w,$P(result),$P(abserr)); gsl_integration_workspace_free(w); dec_func(); } '); pp_def('gslinteg_qaws', Pars => 'a(); b(); epsabs(); epsrel();int limit(); int n(); alpha(); beta(); int mu(); int nu(); int gslwarn(); [o] result(); [o] abserr(); int [o] ierr();', GenericTypes => ['D'], OtherPars => 'SV* function;', PMCode => <<'EOF', sub gslinteg_qaws{ my $opt = ref($_[-1]) eq 'HASH' ? pop @_ : {Warn => 'n'}; my $warn = $$opt{Warn}=~/y/i ? 1 : 0; my ($f,$alpha,$beta,$mu,$nu,$la,$lb,$epsabs,$epsrel,$limit) = @_; barf 'Usage: gslinteg_qaws($function_ref,$alpha,$beta,$mu,$nu,$la,$lb,$epsabs,$epsrel,$limit,[opt])' unless ($#_ == 9); $_ = PDL->null for my ($res,$abserr,$ierr); _gslinteg_qaws_int($la,$lb,$epsabs,$epsrel,$limit,$limit,$alpha,$beta,$mu,$nu,$warn,$res,$abserr,$ierr,$f); return ($res,$abserr,$ierr); } EOF Doc => <<'EOF', =for ref Adaptive integration for singular functions The algorithm in gslinteg_qaws is designed for integrands with algebraic-logarithmic singularities at the end-points of an integration region. Specifically, this function computes the integral given by I = \int_{la}^{lb} dx f(x) (x-la)^alpha (lb-x)^beta log^mu (x-la) log^nu (lb-x). The integral is estimated within the desired absolute and relative error limits, $epsabs and $epsrel. The maximum number of allowed subdivisions done by the adaptive algorithm must be supplied in the parameter $limit. =for usage Usage: ($res,$abserr,$ierr) = gslinteg_qaws($function_ref,$alpha,$beta,$mu,$nu,$la,$lb, $epsabs,$epsrel,$limit,[{Warn => $warn}]); =for example Example: my ($res,$abserr,$ierr) = gslinteg_qaws(\&f,0,0,1,0,0,1,0,1e-7,1000); # with warnings on ($res,$abserr,$ierr) = gslinteg_qaws(\&f,0,0,1,0,0,1,0,1e-7,1000,{Warn => 'y'}); sub f{ my ($x) = @_; if($x==0){return 0;} else{ my $u = log($x); my $v = 1 + $u*$u; return 1.0/($v*$v); } } EOF Code => ' gsl_error_handler_t * old_handler; if ($gslwarn() == 1) { old_handler = gsl_set_error_handler(&my_handler); } else { gsl_set_error_handler_off ();} {gsl_integration_qaws_table * qtab; gsl_integration_workspace *w; qtab = gsl_integration_qaws_table_alloc($alpha(),$beta(),$mu(),$nu()); set_funname($COMP(function)); gsl_function F; F.function = &FUNC; F.params = 0; w = gsl_integration_workspace_alloc((size_t) $n()); $ierr() = gsl_integration_qaws(&F,$a(),$b(),qtab,$epsabs(),$epsrel(),(size_t) $limit(),w,$P(result),$P(abserr)); gsl_integration_workspace_free(w); gsl_integration_qaws_table_free(qtab); dec_func(); } '); pp_def('gslinteg_qawo', Pars => 'a(); b(); epsabs(); epsrel();int limit();int n(); int sincosopt(); omega(); L(); int nlevels();int gslwarn(); [o] result(); [o] abserr();int [o] ierr();', GenericTypes => ['D'], OtherPars => 'SV* function;', PMCode => <<'EOF', sub gslinteg_qawo{ my $opt = ref($_[-1]) eq 'HASH' ? pop @_ : {Warn => 'n'}; my $warn = $$opt{Warn}=~/y/i ? 1 : 0; my ($f,$omega,$sincosopt,$la,$lb,$epsabs,$epsrel,$limit) = @_; barf 'Usage: gslinteg_qawo($function_ref,$omega,$sin_or_cos,$la,$lb,$epsabs,$epsrel,$limit,[opt])' unless ($#_ == 7); my $OPTION_SIN_COS; if($sincosopt=~/cos/i){ $OPTION_SIN_COS = 0;} elsif($sincosopt=~/sin/i){ $OPTION_SIN_COS = 1;} else { barf("Error in argument 3 of function gslinteg_qawo: specify 'cos' or 'sin'\n");} my $L = $lb - $la; my $nlevels = $limit; $_ = PDL->null for my ($res,$abserr,$ierr); _gslinteg_qawo_int($la,$lb,$epsabs,$epsrel,$limit,$limit,$OPTION_SIN_COS,$omega,$L,$nlevels,$warn,$res,$abserr,$ierr,$f); return ($res,$abserr,$ierr); } EOF Doc => <<'EOF', =for ref Adaptive integration for oscillatory functions This function uses an adaptive algorithm to compute the integral of f over (la,lb) with the weight function sin(omega*x) or cos(omega*x) -- which of sine or cosine is used is determined by the parameter $opt ('cos' or 'sin'). The integral is estimated within the desired absolute and relative error limits, $epsabs and $epsrel. The maximum number of allowed subdivisions done by the adaptive algorithm must be supplied in the parameter $limit. =for usage Usage: ($res,$abserr,$ierr) = gslinteg_qawo($function_ref,$omega,$sin_or_cos, $la,$lb,$epsabs,$epsrel,$limit,[opt]) =for example Example: my $PI = 3.14159265358979323846264338328; my ($res,$abserr,$ierr) = PDL::GSL::INTEG::gslinteg_qawo(\&f,10*$PI,'sin',0,1,0,1e-7,1000); # with warnings on ($res,$abserr,$ierr) = PDL::GSL::INTEG::gslinteg_qawo(\&f,10*$PI,'sin',0,1,0,1e-7,1000,{Warn => 'y'}); sub f{ my ($x) = @_; if($x==0){return 0;} else{ return log($x);} } EOF Code => ' gsl_error_handler_t * old_handler; if ($gslwarn() == 1) { old_handler = gsl_set_error_handler(&my_handler); } else { gsl_set_error_handler_off ();} {gsl_integration_qawo_table * qtab; gsl_integration_workspace *w; enum gsl_integration_qawo_enum T; T = GSL_INTEG_SINE; if ($sincosopt() == 0){ T = GSL_INTEG_COSINE ;} qtab = gsl_integration_qawo_table_alloc($omega(),$L(),T,(size_t) $nlevels()); set_funname($COMP(function)); gsl_function F; F.function = &FUNC; F.params = 0; w = gsl_integration_workspace_alloc((size_t) $n()); $ierr() = gsl_integration_qawo(&F,$a(),$epsabs(),$epsrel(),(size_t) $limit(),w,qtab,$P(result),$P(abserr)); gsl_integration_workspace_free(w); gsl_integration_qawo_table_free(qtab); dec_func(); } '); pp_def('gslinteg_qawf', Pars => 'a(); epsabs();int limit();int n(); int sincosopt(); omega(); int nlevels();int gslwarn(); [o] result(); [o] abserr();int [o] ierr();', GenericTypes => ['D'], OtherPars => 'SV* function;', PMCode => <<'EOF', sub gslinteg_qawf{ my $opt = ref($_[-1]) eq 'HASH' ? pop @_ : {Warn => 'n'}; my $warn = $$opt{Warn}=~/y/i ? 1 : 0; my ($f,$omega,$sincosopt,$la,$epsabs,$limit) = @_; barf 'Usage: gslinteg_qawf($function_ref,$omega,$sin_or_cos,$la,$epsabs,$limit,[opt])' unless ($#_ == 5); my $OPTION_SIN_COS; if($sincosopt=~/cos/i){ $OPTION_SIN_COS = 0;} elsif($sincosopt=~/sin/i){ $OPTION_SIN_COS = 1;} else { barf("Error in argument 3 of function gslinteg_qawf: specify 'cos' or 'sin'\n");} my $nlevels = $limit; $_ = PDL->null for my ($res,$abserr,$ierr); _gslinteg_qawf_int($la,$epsabs,$limit,$limit,$OPTION_SIN_COS,$omega,$nlevels,$warn,$res,$abserr,$ierr,$f); return ($res,$abserr,$ierr); } EOF Doc => <<'EOF', =for ref Adaptive integration for Fourier integrals This function attempts to compute a Fourier integral of the function f over the semi-infinite interval [la,+\infty). Specifically, it attempts tp compute I = \int_{la}^{+\infty} dx f(x)w(x), where w(x) is sin(omega*x) or cos(omega*x) -- which of sine or cosine is used is determined by the parameter $opt ('cos' or 'sin'). The integral is estimated within the desired absolute error limit $epsabs. The maximum number of allowed subdivisions done by the adaptive algorithm must be supplied in the parameter $limit. =for usage Usage: gslinteg_qawf($function_ref,$omega,$sin_or_cos,$la,$epsabs,$limit,[opt]) =for example Example: my ($res,$abserr,$ierr) = gslinteg_qawf(\&f,$PI/2.0,'cos',0,1e-7,1000); # with warnings on ($res,$abserr,$ierr) = gslinteg_qawf(\&f,$PI/2.0,'cos',0,1e-7,1000,{Warn => 'y'}); sub f{ my ($x) = @_; if ($x == 0){return 0;} return 1.0/sqrt($x) } EOF Code => ' gsl_error_handler_t * old_handler; if ($gslwarn() == 1) { old_handler = gsl_set_error_handler(&my_handler); } else { gsl_set_error_handler_off ();} {gsl_integration_qawo_table * qtab; gsl_integration_workspace *w; gsl_integration_workspace *cw; enum gsl_integration_qawo_enum T; T = GSL_INTEG_SINE; if ($sincosopt() == 0){ T = GSL_INTEG_COSINE ;} qtab = gsl_integration_qawo_table_alloc($omega(),1.,T,(size_t) $nlevels()); set_funname($COMP(function)); gsl_function F; F.function = &FUNC; F.params = 0; w = gsl_integration_workspace_alloc((size_t) $n()); cw = gsl_integration_workspace_alloc((size_t) $n()); $ierr() = gsl_integration_qawf(&F,$a(),$epsabs(),(size_t) $limit(),w,cw,qtab,$P(result),$P(abserr)); gsl_integration_workspace_free(w); gsl_integration_workspace_free(cw); gsl_integration_qawo_table_free(qtab); dec_func(); } '); pp_done(); PDL-GSL-2.103/lib/PDL/GSL/INTEG-FUNC.c0000644000175000017500000000232514736061645016102 0ustar osboxesosboxes#include "EXTERN.h" #include "perl.h" #include "pdlcore.h" #include #define PDL PDL_GSL_INTEG extern Core *PDL; #define max_nested_integrals 20 static SV* ext_funname[max_nested_integrals]; static int current_fun = -1; void set_funname(SV *fn) { current_fun++; if (current_fun > (max_nested_integrals)) barf("Too many nested integrals, sorry!\n"); ext_funname[current_fun] = fn; } void dec_func() { current_fun--; } void my_handler (const char * reason, const char * file, int line, int gsl_errno){ printf("Warning: %s at line %d of GSL file %s\n",reason,line,file); } double FUNC(double x,void * p){ SV* funname; int count; I32 ax ; double res; double* resp; dSP; resp = &res; ENTER; SAVETMPS; /* get function name on the perl side */ funname = ext_funname[current_fun]; PUSHMARK(SP); XPUSHs(sv_2mortal(newSVnv(x))); PUTBACK; count=call_sv(funname,G_SCALAR); SPAGAIN; SP -= count ; ax = (SP - PL_stack_base) + 1 ; if (count!=1) croak("error calling perl function\n"); /* recover output value */ /*res = POPn;*/ *resp = SvNV(ST(0)); PUTBACK; FREETMPS; LEAVE; return res; } PDL-GSL-2.103/lib/PDL/GSL/LINALG.pd0000644000175000017500000001131114736061645015625 0ustar osboxesosboxesuse strict; use warnings; pp_addpm({At=>'Top'},<<'EOD'); use strict; use warnings; =head1 NAME PDL::GSL::LINALG - PDL interface to linear algebra routines in GSL =head1 SYNOPSIS use PDL::LiteF; use PDL::MatrixOps; # for 'x' use PDL::GSL::LINALG; my $A = pdl [ [0.18, 0.60, 0.57, 0.96], [0.41, 0.24, 0.99, 0.58], [0.14, 0.30, 0.97, 0.66], [0.51, 0.13, 0.19, 0.85], ]; my $B = sequence(2,4); # column vectors LU_decomp(my $lu=$A->copy, my $p=null, my $signum=null); # transpose so first dim means is vector, higher dims broadcast LU_solve($lu, $p, $B->transpose, my $x=null); $x = $x->inplace->transpose; # now can be matrix-multiplied =head1 DESCRIPTION This is an interface to the linear algebra package present in the GNU Scientific Library. Functions are named as in GSL, but with the initial C removed. They are provided in both real and complex double precision. Currently only LU decomposition interfaces here. Pull requests welcome! EOD pp_addpm({At=>'Bot'},<<'EOD'); =head1 SEE ALSO L The GSL documentation for linear algebra is online at L =cut EOD pp_addhdr(' #include #include "gslerr.h" #define MATRIX_SETUP(m, rows, cols, lda, datap) \\ m.size1 = rows; \\ m.size2 = cols; \\ m.tda = lda; \\ m.data = (double *)datap; \\ m.owner = 0; /* rely on optimiser for this to produce sensible code */ #define PERM_SETUP(p, psize, datap) \\ gsl_permutation *p ## _local = gsl_permutation_alloc(psize); \\ size_t *p ## _local_data = p ## _local->data; \\ size_t p ## _i_local = 0; \\ for (p ## _i_local = 0; p ## _i_local < (size_t)psize; p ## _i_local++) { \\ p ## _local_data[p ## _i_local] = datap[p ## _i_local]; \\ } \\ p.data = p ## _local_data; \\ p.size = psize; #define PERM_RETURN(p, psize, datap) \\ for (p ## _i_local = 0; p ## _i_local < (size_t)psize; p ## _i_local++) { \\ datap[p ## _i_local] = p ## _local_data[p ## _i_local]; \\ } \\ gsl_permutation_free(p ## _local); #define VECTOR_SETUP(v, vsize, datap) \\ v.size = vsize; \\ v.stride = 1; \\ v.data = (double *)datap; \\ v.owner = 0; '); pp_def('LU_decomp', HandleBad => 0, Pars => '[io,phys]A(n,m); indx [o,phys]ipiv(p=CALC($PDL(A)->ndims > 1 ? PDLMIN($PDL(A)->dims[0], $PDL(A)->dims[1]) : 1)); int [o,phys]signum()', GenericTypes => [qw(C D)], Code => <<'EOF', /* make sure the PDL data types match */ gsl_matrix$TDC(,_complex) m; gsl_permutation p; int s; MATRIX_SETUP(m, $SIZE(m), $SIZE(n), $SIZE(n), $P(A)) PERM_SETUP(p, $SIZE(p), $P(ipiv)) GSLERR(gsl_linalg$TDC(,_complex)_LU_decomp, (&m, &p, &s)) PERM_RETURN(p, $SIZE(p), $P(ipiv)) $signum() = s; EOF Doc => <<'EOF', =for ref LU decomposition of the given (real or complex) matrix. EOF ); pp_def('LU_solve', HandleBad => 0, Pars => '[phys]LU(n,m); indx [phys]ipiv(p); [phys]B(n); [o,phys]x(n)', GenericTypes => [qw(C D)], Code => <<'EOF', gsl_matrix$TDC(,_complex) m; gsl_permutation p; gsl_vector$TDC(,_complex) b, x; int s; MATRIX_SETUP(m, $SIZE(m), $SIZE(n), $SIZE(n), $P(LU)) PERM_SETUP(p, $SIZE(p), $P(ipiv)) VECTOR_SETUP(b, $SIZE(n), $P(B)) VECTOR_SETUP(x, $SIZE(n), $P(x)) GSLERR(gsl_linalg$TDC(,_complex)_LU_solve, (&m, &p, &b, &x)) PERM_RETURN(p, $SIZE(p), $P(ipiv)) EOF Doc => <<'EOF', =for ref Solve C using the LU and permutation from L, real or complex. EOF ); pp_def('LU_det', HandleBad => 0, Pars => '[phys]LU(n,m); int [phys]signum(); [o]det()', GenericTypes => [qw(C D)], Code => <<'EOF', gsl_matrix$TDC(,_complex) m; MATRIX_SETUP(m, $SIZE(m), $SIZE(n), $SIZE(n), $P(LU)) types (D) %{ $det() = gsl_linalg_LU_det(&m, $signum()); %} types (C) %{ gsl_complex z = gsl_linalg_complex_LU_det(&m, $signum()); $det() = GSL_REAL(z) + I*GSL_IMAG(z); %} EOF Doc => <<'EOF', =for ref Find the determinant from the LU decomp. EOF ); pp_def('solve_tridiag', HandleBad => 0, Pars => '[phys]diag(n); [phys]superdiag(n); [phys]subdiag(n); [phys]B(n); [o,phys]x(n)', GenericTypes => [qw(D)], Code => <<'EOF', gsl_vector d, sup, sub, b, x; VECTOR_SETUP(d, $SIZE(n), $P(diag)) VECTOR_SETUP(sup, $SIZE(n)-1, $P(superdiag)) VECTOR_SETUP(sub, $SIZE(n)-1, $P(subdiag)) VECTOR_SETUP(b, $SIZE(n), $P(B)) VECTOR_SETUP(x, $SIZE(n), $P(x)) #define CONST_VEC (const gsl_vector *) GSLERR(gsl_linalg_solve_tridiag, ( CONST_VEC &d, CONST_VEC &sup, CONST_VEC &sub, CONST_VEC &b, &x )) #undef CONST_VEC EOF Doc => <<'EOF', =for ref Solve C where A is a tridiagonal system. Real only, because GSL does not have a complex function. EOF ); pp_add_boot('gsl_set_error_handler_off(); '); pp_done(); PDL-GSL-2.103/lib/PDL/GSL/SF.pd0000644000175000017500000015250414736061645015201 0ustar osboxesosboxesuse strict; use warnings; pp_addpm({At=>'Top'},<<'EOD'); use strict; use warnings; =head1 NAME PDL::GSL::SF - PDL interface to GSL Special Functions =head1 DESCRIPTION This is an interface to the Special Function package present in the GNU Scientific Library. =cut EOD pp_add_boot("gsl_set_error_handler_off();\n"); pp_addhdr(' #include #include #include "gslerr.h" '); sub airy_func { my ($which, $doc) = @_; pp_def($which, Doc => $doc, GenericTypes => ['D'], Pars=>'double x(); double [o]y(); double [o]e()', Code => < 0.' ); airy_func( 'gsl_sf_airy_Bi_scaled', 'Scaled Airy Function Bi(x). Bi(x) for x < 0 and exp(+2/3 x^{3/2}) Bi(x) for x > 0.' ); airy_func('gsl_sf_airy_Ai_deriv', 'Derivative Airy Function Ai`(x).'); airy_func('gsl_sf_airy_Bi_deriv', 'Derivative Airy Function Bi`(x).'); airy_func( 'gsl_sf_airy_Ai_deriv_scaled', 'Derivative Scaled Airy Function Ai(x). Ai`(x) for x < 0 and exp(+2/3 x^{3/2}) Ai`(x) for x > 0.' ); airy_func( 'gsl_sf_airy_Bi_deriv_scaled', 'Derivative Scaled Airy Function Bi(x). Bi`(x) for x < 0 and exp(+2/3 x^{3/2}) Bi`(x) for x > 0.' ); pp_addpm({At=>'Bot'},<<'EOD'); =head1 AUTHOR This file copyright (C) 1999 Christian Pellegrin All rights reserved. There is no warranty. You are allowed to redistribute this software / documentation under certain conditions. For details, see the file COPYING in the PDL distribution. If this file is separated from the PDL distribution, the copyright notice should be included in the file. The GSL SF modules were written by G. Jungman. =cut EOD use strict; use warnings; pp_def('gsl_sf_bessel_Jn', GenericTypes => ['D'], OtherPars =>'int n', Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_bessel_Jn_e,($COMP(n),$x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Regular Bessel Function J_n(x).' ); pp_def('gsl_sf_bessel_Jn_array', GenericTypes => ['D'], OtherPars =>'int s; IV n=>num', Pars=>'double x(); double [o]y(num)', Code =>' GSLERR(gsl_sf_bessel_Jn_array,($COMP(s),$COMP(s)+$COMP(n)-1,$x(),$P(y))) ', Doc =>'Array of Regular Bessel Functions J_{s}(x) to J_{s+n-1}(x).' ); pp_def('gsl_sf_bessel_Yn', GenericTypes => ['D'], OtherPars =>'int n', Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_bessel_Yn_e,($COMP(n),$x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'IrRegular Bessel Function Y_n(x).' ); pp_def('gsl_sf_bessel_Yn_array', GenericTypes => ['D'], OtherPars =>'int s; IV n=>num', Pars=>'double x(); double [o]y(num)', Code =>' GSLERR(gsl_sf_bessel_Yn_array,($COMP(s),$COMP(s)+$COMP(n)-1,$x(),$P(y))) ', Doc =>'Array of Regular Bessel Functions Y_{s}(x) to Y_{s+n-1}(x).' ); pp_def('gsl_sf_bessel_In', GenericTypes => ['D'], OtherPars =>'int n', Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_bessel_In_e,($COMP(n),$x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Regular Modified Bessel Function I_n(x).' ); pp_def('gsl_sf_bessel_I_array', GenericTypes => ['D'], OtherPars =>'int s; IV n=>num', Pars=>'double x(); double [o]y(num)', Code =>' GSLERR(gsl_sf_bessel_In_array,($COMP(s),$COMP(s)+$COMP(n)-1,$x(),$P(y))) ', Doc =>'Array of Regular Modified Bessel Functions I_{s}(x) to I_{s+n-1}(x).' ); pp_def('gsl_sf_bessel_In_scaled', GenericTypes => ['D'], OtherPars =>'int n', Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_bessel_In_scaled_e,($COMP(n),$x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Scaled Regular Modified Bessel Function exp(-|x|) I_n(x).' ); pp_def('gsl_sf_bessel_In_scaled_array', GenericTypes => ['D'], OtherPars =>'int s; IV n=>num', Pars=>'double x(); double [o]y(num)', Code =>' GSLERR(gsl_sf_bessel_In_scaled_array,($COMP(s),$COMP(s)+$COMP(n)-1,$x(),$P(y))) ', Doc =>'Array of Scaled Regular Modified Bessel Functions exp(-|x|) I_{s}(x) to exp(-|x|) I_{s+n-1}(x).' ); pp_def('gsl_sf_bessel_Kn', GenericTypes => ['D'], OtherPars =>'int n', Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_bessel_Kn_e,($COMP(n),$x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'IrRegular Modified Bessel Function K_n(x).' ); pp_def('gsl_sf_bessel_K_array', GenericTypes => ['D'], OtherPars =>'int s; IV n=>num', Pars=>'double x(); double [o]y(num)', Code =>' GSLERR(gsl_sf_bessel_Kn_array,($COMP(s),$COMP(s)+$COMP(n)-1,$x(),$P(y))) ', Doc =>'Array of IrRegular Modified Bessel Functions K_{s}(x) to K_{s+n-1}(x).' ); pp_def('gsl_sf_bessel_Kn_scaled', GenericTypes => ['D'], OtherPars =>'int n', Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_bessel_Kn_scaled_e,($COMP(n),$x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Scaled IrRegular Modified Bessel Function exp(-|x|) K_n(x).' ); pp_def('gsl_sf_bessel_Kn_scaled_array', GenericTypes => ['D'], OtherPars =>'int s; IV n=>num', Pars=>'double x(); double [o]y(num)', Code =>' GSLERR(gsl_sf_bessel_Kn_scaled_array,($COMP(s),$COMP(s)+$COMP(n)-1,$x(),$P(y))) ', Doc =>'Array of Scaled IrRegular Modified Bessel Functions exp(-|x|) K_{s}(x) to exp(-|x|) K_{s+n-1}(x).' ); pp_def('gsl_sf_bessel_jl', GenericTypes => ['D'], OtherPars =>'int n', Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_bessel_jl_e,($COMP(n),$x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Regular Sphericl Bessel Function J_n(x).' ); pp_def('gsl_sf_bessel_jl_array', GenericTypes => ['D'], OtherPars =>'int n=>num', Pars=>'double x(); double [o]y(num)', Code =>' GSLERR(gsl_sf_bessel_jl_array,($COMP(n)-1,$x(),$P(y))) ', Doc =>'Array of Spherical Regular Bessel Functions J_{0}(x) to J_{n-1}(x).' ); pp_def('gsl_sf_bessel_yl', GenericTypes => ['D'], OtherPars =>'int n', Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_bessel_yl_e,($COMP(n),$x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'IrRegular Spherical Bessel Function y_n(x).' ); pp_def('gsl_sf_bessel_yl_array', GenericTypes => ['D'], OtherPars =>'int n=>num', Pars=>'double x(); double [o]y(num)', Code =>' GSLERR(gsl_sf_bessel_yl_array,($COMP(n)-1,$x(),$P(y))) ', Doc =>'Array of Regular Spherical Bessel Functions y_{0}(x) to y_{n-1}(x).' ); pp_def('gsl_sf_bessel_il_scaled', GenericTypes => ['D'], OtherPars =>'int n', Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_bessel_il_scaled_e,($COMP(n),$x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Scaled Regular Modified Spherical Bessel Function exp(-|x|) i_n(x).' ); pp_def('gsl_sf_bessel_il_scaled_array', GenericTypes => ['D'], OtherPars =>'int n=>num', Pars=>'double x(); double [o]y(num)', Code =>' GSLERR(gsl_sf_bessel_il_scaled_array,($COMP(n)-1,$x(),$P(y))) ', Doc =>'Array of Scaled Regular Modified Spherical Bessel Functions exp(-|x|) i_{0}(x) to exp(-|x|) i_{n-1}(x).' ); pp_def('gsl_sf_bessel_kl_scaled', GenericTypes => ['D'], OtherPars =>'int n', Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_bessel_kl_scaled_e,($COMP(n),$x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Scaled IrRegular Modified Spherical Bessel Function exp(-|x|) k_n(x).' ); pp_def('gsl_sf_bessel_kl_scaled_array', GenericTypes => ['D'], OtherPars =>'int n=>num', Pars=>'double x(); double [o]y(num)', Code =>' GSLERR(gsl_sf_bessel_kl_scaled_array,($COMP(n)-1,$x(),$P(y))) ', Doc =>'Array of Scaled IrRegular Modified Spherical Bessel Functions exp(-|x|) k_{s}(x) to exp(-|x|) k_{s+n-1}(x).' ); pp_def('gsl_sf_bessel_Jnu', GenericTypes => ['D'], OtherPars =>'double n', Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_bessel_Jnu_e,($COMP(n),$x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Regular Cylindrical Bessel Function J_nu(x).' ); pp_def('gsl_sf_bessel_Ynu', GenericTypes => ['D'], OtherPars =>'double n', Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_bessel_Ynu_e,($COMP(n),$x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'IrRegular Cylindrical Bessel Function J_nu(x).' ); pp_def('gsl_sf_bessel_Inu_scaled', GenericTypes => ['D'], OtherPars =>'double n', Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_bessel_Inu_scaled_e,($COMP(n),$x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Scaled Modified Cylindrical Bessel Function exp(-|x|) I_nu(x).' ); pp_def('gsl_sf_bessel_Inu', GenericTypes => ['D'], OtherPars =>'double n', Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_bessel_Inu_e,($COMP(n),$x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Modified Cylindrical Bessel Function I_nu(x).' ); pp_def('gsl_sf_bessel_Knu_scaled', GenericTypes => ['D'], OtherPars =>'double n', Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_bessel_Knu_scaled_e,($COMP(n),$x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Scaled Modified Cylindrical Bessel Function exp(-|x|) K_nu(x).' ); pp_def('gsl_sf_bessel_Knu', GenericTypes => ['D'], OtherPars =>'double n', Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_bessel_Knu_e,($COMP(n),$x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Modified Cylindrical Bessel Function K_nu(x).' ); pp_def('gsl_sf_bessel_lnKnu', GenericTypes => ['D'], OtherPars =>'double n', Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_bessel_lnKnu_e,($COMP(n),$x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Logarithm of Modified Cylindrical Bessel Function K_nu(x).' ); pp_def('gsl_sf_clausen', GenericTypes => ['D'], Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_clausen_e,($x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Clausen Integral. Cl_2(x) := Integrate[-Log[2 Sin[t/2]], {t,0,x}]' ); pp_def('gsl_sf_hydrogenicR', GenericTypes => ['D'], OtherPars =>'int n; int l; double z', Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_hydrogenicR_e,($COMP(n),$COMP(l),$COMP(z),$x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Normalized Hydrogenic bound states. Radial dipendence.' ); pp_def('gsl_sf_coulomb_wave_FGp_array', GenericTypes => ['D'], OtherPars =>'double lam_min; IV kmax=>n; double eta', Pars=>'double x(); double [o]fc(n); double [o]fcp(n); double [o]gc(n); double [o]gcp(n); int [o]ovfw(); double [o]fe(n); double [o]ge(n);', Code =>' int s; s = gsl_sf_coulomb_wave_FGp_array($COMP(lam_min),$COMP(kmax),$COMP(eta),$x(),$P(fc),$P(fcp),$P(gc),$P(gcp),$P(fe),$P(ge)); if (s==GSL_EOVRFLW) { $ovfw()=1; } else {if (s) $CROAK("Error in gsl_sf_coulomb_wave_FGp_array: %s",gsl_strerror(s)); else {$ovfw()=0;}} ', Doc =>' Coulomb wave functions F_{lam_F}(eta,x), G_{lam_G}(eta,x) and their derivatives; lam_G := lam_F - k_lam_G. if ovfw is signaled then F_L(eta,x) = fc[k_L] * exp(fe) and similar. ' ); pp_def('gsl_sf_coulomb_wave_sphF_array', GenericTypes => ['D'], OtherPars =>'double lam_min; IV kmax=>n; double eta', Pars=>'double x(); double [o]fc(n); int [o]ovfw(); double [o]fe(n);', Code =>' int s; s = gsl_sf_coulomb_wave_sphF_array($COMP(lam_min),$COMP(kmax),$COMP(eta),$x(),$P(fc),$P(fe)); if (s==GSL_EOVRFLW) { $ovfw()=1; } else {if (s) $CROAK("Error in gsl_sf_coulomb_wave_sphF_array: %s",gsl_strerror(s)); else {$ovfw()=0;}} ', Doc =>' Coulomb wave function divided by the argument, F(xi, eta)/xi. This is the function which reduces to spherical Bessel functions in the limit eta->0. ' ); pp_def('gsl_sf_coulomb_CL_e', GenericTypes => ['D'], Pars=>'double L(); double eta(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_coulomb_CL_e,($L(),$eta(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Coulomb wave function normalization constant. [Abramowitz+Stegun 14.1.8, 14.1.9].' ); pp_def('gsl_sf_coupling_3j', GenericTypes => ['L'], Pars=>'ja(); jb(); jc(); ma(); mb(); mc(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_coupling_3j_e,($ja(),$jb(),$jc(),$ma(),$mb(),$mc(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'3j Symbols: (ja jb jc) over (ma mb mc).' ); pp_def('gsl_sf_coupling_6j', GenericTypes => ['L'], Pars=>'ja(); jb(); jc(); jd(); je(); jf(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_coupling_6j_e,($ja(),$jb(),$jc(),$jd(),$je(),$jf(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'6j Symbols: (ja jb jc) over (jd je jf).' ); pp_def('gsl_sf_coupling_9j', GenericTypes => ['L'], Pars=>'ja(); jb(); jc(); jd(); je(); jf(); jg(); jh(); ji(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_coupling_9j_e,($ja(),$jb(),$jc(),$jd(),$je(),$jf(),$jg(),$jh(),$ji(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'9j Symbols: (ja jb jc) over (jd je jf) over (jg jh ji).' ); pp_def('gsl_sf_dawson', GenericTypes => ['D'], Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_dawson_e,($x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Dawsons integral: Exp[-x^2] Integral[ Exp[t^2], {t,0,x}]' ); pp_def('gsl_sf_debye_1', GenericTypes => ['D'], Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_debye_1_e,($x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'D_n(x) := n/x^n Integrate[t^n/(e^t - 1), {t,0,x}]' ); pp_def('gsl_sf_debye_2', GenericTypes => ['D'], Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_debye_2_e,($x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'D_n(x) := n/x^n Integrate[t^n/(e^t - 1), {t,0,x}]' ); pp_def('gsl_sf_debye_3', GenericTypes => ['D'], Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_debye_3_e,($x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'D_n(x) := n/x^n Integrate[t^n/(e^t - 1), {t,0,x}]' ); pp_def('gsl_sf_debye_4', GenericTypes => ['D'], Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_debye_4_e,($x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'D_n(x) := n/x^n Integrate[t^n/(e^t - 1), {t,0,x}]' ); pp_def('gsl_sf_dilog', GenericTypes => ['D'], Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_dilog_e,($x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'/* Real part of DiLogarithm(x), for real argument. In Lewins notation, this is Li_2(x). Li_2(x) = - Re[ Integrate[ Log[1-s] / s, {s, 0, x}] ]' ); pp_def('gsl_sf_complex_dilog', GenericTypes => ['D'], Pars=>'double r(); double t(); double [o]re(); double [o]im(); double [o]ere(); double [o]eim()', Code =>' gsl_sf_result re; gsl_sf_result im; GSLERR(gsl_sf_complex_dilog_e,($r(),$t(),&re,&im)) $re() = re.val; $ere() = re.err; $im() = im.val; $eim() = im.err; ', Doc =>'DiLogarithm(z), for complex argument z = r Exp[i theta].' ); pp_def('gsl_sf_multiply', GenericTypes => ['D'], Pars=>'double x(); double xx(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_multiply_e,($x(),$xx(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Multiplication.' ); pp_def('gsl_sf_multiply_err', GenericTypes => ['D'], Pars=>'double x(); double xe(); double xx(); double xxe(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_multiply_err_e,($x(),$xe(),$xx(),$xxe(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Multiplication with associated errors.' ); pp_def('gsl_sf_ellint_Kcomp', GenericTypes => ['D'], Pars=>'double k(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_ellint_Kcomp_e,($k(),GSL_PREC_DOUBLE,&r)) $y() = r.val; $e() = r.err; ', Doc =>'Legendre form of complete elliptic integrals K(k) = Integral[1/Sqrt[1 - k^2 Sin[t]^2], {t, 0, Pi/2}].' ); pp_def('gsl_sf_ellint_Ecomp', GenericTypes => ['D'], Pars=>'double k(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_ellint_Ecomp_e,($k(),GSL_PREC_DOUBLE,&r)) $y() = r.val; $e() = r.err; ', Doc =>'Legendre form of complete elliptic integrals E(k) = Integral[ Sqrt[1 - k^2 Sin[t]^2], {t, 0, Pi/2}]' ); pp_def('gsl_sf_ellint_F', GenericTypes => ['D'], Pars=>'double phi(); double k(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_ellint_F_e,($phi(),$k(),GSL_PREC_DOUBLE,&r)) $y() = r.val; $e() = r.err; ', Doc =>'Legendre form of incomplete elliptic integrals F(phi,k) = Integral[1/Sqrt[1 - k^2 Sin[t]^2], {t, 0, phi}]' ); pp_def('gsl_sf_ellint_E', GenericTypes => ['D'], Pars=>'double phi(); double k(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_ellint_E_e,($phi(),$k(),GSL_PREC_DOUBLE,&r)) $y() = r.val; $e() = r.err; ', Doc =>'Legendre form of incomplete elliptic integrals E(phi,k) = Integral[ Sqrt[1 - k^2 Sin[t]^2], {t, 0, phi}]' ); pp_def('gsl_sf_ellint_P', GenericTypes => ['D'], Pars=>'double phi(); double k(); double n(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_ellint_P_e,($phi(),$k(),$n(),GSL_PREC_DOUBLE,&r)) $y() = r.val; $e() = r.err; ', Doc =>'Legendre form of incomplete elliptic integrals P(phi,k,n) = Integral[(1 + n Sin[t]^2)^(-1)/Sqrt[1 - k^2 Sin[t]^2], {t, 0, phi}]' ); pp_def('gsl_sf_ellint_D', GenericTypes => ['D'], Pars=>'double phi(); double k(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_ellint_D_e,($phi(),$k(),GSL_PREC_DOUBLE,&r)) $y() = r.val; $e() = r.err; ', Doc =>'Legendre form of incomplete elliptic integrals D(phi,k)' ); pp_def('gsl_sf_ellint_RC', GenericTypes => ['D'], Pars=>'double x(); double yy(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_ellint_RC_e,($x(),$yy(),GSL_PREC_DOUBLE,&r)) $y() = r.val; $e() = r.err; ', Doc =>'Carlsons symmetric basis of functions RC(x,y) = 1/2 Integral[(t+x)^(-1/2) (t+y)^(-1)], {t,0,Inf}' ); pp_def('gsl_sf_ellint_RD', GenericTypes => ['D'], Pars=>'double x(); double yy(); double z(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_ellint_RD_e,($x(),$yy(),$z(),GSL_PREC_DOUBLE,&r)) $y() = r.val; $e() = r.err; ', Doc =>'Carlsons symmetric basis of functions RD(x,y,z) = 3/2 Integral[(t+x)^(-1/2) (t+y)^(-1/2) (t+z)^(-3/2), {t,0,Inf}]' ); pp_def('gsl_sf_ellint_RF', GenericTypes => ['D'], Pars=>'double x(); double yy(); double z(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_ellint_RF_e,($x(),$yy(),$z(),GSL_PREC_DOUBLE,&r)) $y() = r.val; $e() = r.err; ', Doc =>'Carlsons symmetric basis of functions RF(x,y,z) = 1/2 Integral[(t+x)^(-1/2) (t+y)^(-1/2) (t+z)^(-1/2), {t,0,Inf}]' ); pp_def('gsl_sf_ellint_RJ', GenericTypes => ['D'], Pars=>'double x(); double yy(); double z(); double p(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_ellint_RJ_e,($x(),$yy(),$z(),$p(),GSL_PREC_DOUBLE,&r)) $y() = r.val; $e() = r.err; ', Doc =>'Carlsons symmetric basis of functions RJ(x,y,z,p) = 3/2 Integral[(t+x)^(-1/2) (t+y)^(-1/2) (t+z)^(-1/2) (t+p)^(-1), {t,0,Inf}]' ); pp_def('gsl_sf_elljac', GenericTypes => ['D'], Pars=>'double u(); double m(); double [o]sn(); double [o]cn(); double [o]dn()', Code =>' if (gsl_sf_elljac_e($u(),$m(),$P(sn),$P(cn),$P(dn))) {$CROAK("Error in gsl_sf_elljac");}; ', Doc =>'Jacobian elliptic functions sn, dn, cn by descending Landen transformations' ); pp_def('gsl_sf_erfc', GenericTypes => ['D'], Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_erfc_e,($x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Complementary Error Function erfc(x) := 2/Sqrt[Pi] Integrate[Exp[-t^2], {t,x,Infinity}]' ); pp_def('gsl_sf_log_erfc', GenericTypes => ['D'], Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_log_erfc_e,($x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Log Complementary Error Function' ); pp_def('gsl_sf_erf', GenericTypes => ['D'], Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_erf_e,($x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Error Function erf(x) := 2/Sqrt[Pi] Integrate[Exp[-t^2], {t,0,x}]' ); pp_def('gsl_sf_erf_Z', GenericTypes => ['D'], Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_erf_Z_e,($x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Z(x) : Abramowitz+Stegun 26.2.1' ); pp_def('gsl_sf_erf_Q', GenericTypes => ['D'], Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_erf_Q_e,($x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Q(x) : Abramowitz+Stegun 26.2.1' ); pp_def('gsl_sf_exp', GenericTypes => ['D'], Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_exp_e,($x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Exponential' ); pp_def('gsl_sf_exprel_n', GenericTypes => ['D'], OtherPars => 'int n', Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_exprel_n_e,($COMP(n),$x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'N-relative Exponential. exprel_N(x) = N!/x^N (exp(x) - Sum[x^k/k!, {k,0,N-1}]) = 1 + x/(N+1) + x^2/((N+1)(N+2)) + ... = 1F1(1,1+N,x)' ); pp_def('gsl_sf_exp_err', GenericTypes => ['D'], Pars=>'double x(); double dx(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_exp_err_e,($x(),$dx(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Exponential of a quantity with given error.' ); pp_def('gsl_sf_expint_E1', GenericTypes => ['D'], Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_expint_E1_e,($x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'E_1(x) := Re[ Integrate[ Exp[-xt]/t, {t,1,Infinity}] ]' ); pp_def('gsl_sf_expint_E2', GenericTypes => ['D'], Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_expint_E2_e,($x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'E_2(x) := Re[ Integrate[ Exp[-xt]/t^2, {t,1,Infity}] ]' ); pp_def('gsl_sf_expint_Ei', GenericTypes => ['D'], Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_expint_Ei_e,($x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Ei(x) := PV Integrate[ Exp[-t]/t, {t,-x,Infinity}]' ); pp_def('gsl_sf_Shi', GenericTypes => ['D'], Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_Shi_e,($x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Shi(x) := Integrate[ Sinh[t]/t, {t,0,x}]' ); pp_def('gsl_sf_Chi', GenericTypes => ['D'], Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_Chi_e,($x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Chi(x) := Re[ M_EULER + log(x) + Integrate[(Cosh[t]-1)/t, {t,0,x}] ]' ); pp_def('gsl_sf_expint_3', GenericTypes => ['D'], Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_expint_3_e,($x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Ei_3(x) := Integral[ Exp[-t^3], {t,0,x}]' ); pp_def('gsl_sf_Si', GenericTypes => ['D'], Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_Si_e,($x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Si(x) := Integrate[ Sin[t]/t, {t,0,x}]' ); pp_def('gsl_sf_Ci', GenericTypes => ['D'], Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_Ci_e,($x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Ci(x) := -Integrate[ Cos[t]/t, {t,x,Infinity}]' ); pp_def('gsl_sf_atanint', GenericTypes => ['D'], Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_atanint_e,($x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'AtanInt(x) := Integral[ Arctan[t]/t, {t,0,x}]' ); pp_def('gsl_sf_fermi_dirac_int', GenericTypes => ['D'], OtherPars => 'int j', Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_fermi_dirac_int_e,($COMP(j),$x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Complete integral F_j(x) for integer j' ); pp_def('gsl_sf_fermi_dirac_mhalf', GenericTypes => ['D'], Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_fermi_dirac_mhalf_e,($x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Complete integral F_{-1/2}(x)' ); pp_def('gsl_sf_fermi_dirac_half', GenericTypes => ['D'], Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_fermi_dirac_half_e,($x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Complete integral F_{1/2}(x)' ); pp_def('gsl_sf_fermi_dirac_3half', GenericTypes => ['D'], Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_fermi_dirac_3half_e,($x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Complete integral F_{3/2}(x)' ); pp_def('gsl_sf_fermi_dirac_inc_0', GenericTypes => ['D'], OtherPars => 'double b', Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_fermi_dirac_inc_0_e,($x(),$COMP(b),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Incomplete integral F_0(x,b) = ln(1 + e^(b-x)) - (b-x)' ); pp_def('gsl_sf_lngamma', GenericTypes => ['D'], Pars=>'double x(); double [o]y(); double [o]s(); double [o]e()', Code =>' gsl_sf_result r; double sgn; GSLERR(gsl_sf_lngamma_sgn_e,($x(),&r,&sgn)) $y() = r.val; $e() = r.err; $s() = sgn; ', Doc =>'Log[Gamma(x)], x not a negative integer Uses real Lanczos method. Determines the sign of Gamma[x] as well as Log[|Gamma[x]|] for x < 0. So Gamma[x] = sgn * Exp[result_lg].' ); pp_def('gsl_sf_gamma', GenericTypes => ['D'], Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_gamma_e,($x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Gamma(x), x not a negative integer' ); pp_def('gsl_sf_gammastar', GenericTypes => ['D'], Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_gammastar_e,($x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Regulated Gamma Function, x > 0 Gamma^*(x) = Gamma(x)/(Sqrt[2Pi] x^(x-1/2) exp(-x)) = (1 + 1/(12x) + ...), x->Inf' ); pp_def('gsl_sf_gammainv', GenericTypes => ['D'], Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_gammainv_e,($x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'1/Gamma(x)' ); pp_def('gsl_sf_lngamma_complex', GenericTypes => ['D'], Pars=>'double zr(); double zi(); double [o]x(); double [o]y(); double [o]xe(); double [o]ye()', Code =>' gsl_sf_result r; gsl_sf_result ri; GSLERR(gsl_sf_lngamma_complex_e,($zr(),$zi(),&r,&ri)) $x() = r.val; $xe() = r.err; $y() = ri.val; $ye() = ri.err; ', Doc =>'Log[Gamma(z)] for z complex, z not a negative integer. Calculates: lnr = log|Gamma(z)|, arg = arg(Gamma(z)) in (-Pi, Pi]' ); pp_def('gsl_sf_taylorcoeff', GenericTypes => ['D'], OtherPars => 'int n', Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_taylorcoeff_e,($COMP(n),$x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'x^n / n!' ); pp_def('gsl_sf_fact', GenericTypes => ['L'], Pars=>'x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_fact_e,($x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'n!' ); pp_def('gsl_sf_doublefact', GenericTypes => ['L'], Pars=>'x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_doublefact_e,($x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'n!! = n(n-2)(n-4)' ); pp_def('gsl_sf_lnfact', GenericTypes => ['L'], Pars=>'x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_lnfact_e,($x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'ln n!' ); pp_def('gsl_sf_lndoublefact', GenericTypes => ['L'], Pars=>'x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_lndoublefact_e,($x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'ln n!!' ); pp_def('gsl_sf_lnchoose', GenericTypes => ['L'], Pars=>'n(); m(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_lnchoose_e,($n(), $m(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'log(n choose m)' ); pp_def('gsl_sf_choose', GenericTypes => ['L'], Pars=>'n(); m(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_choose_e,($n(), $m(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'n choose m' ); pp_def('gsl_sf_lnpoch', GenericTypes => ['D'], OtherPars => 'double a', Pars=>'double x(); double [o]y(); double [o]s(); double [o]e()', Code =>' gsl_sf_result r; double sgn; GSLERR(gsl_sf_lnpoch_sgn_e,($COMP(a),$x(),&r,&sgn)) $y() = r.val; $e() = r.err; $s() = sgn; ', Doc =>'Logarithm of Pochammer (Apell) symbol, with sign information. result = log( |(a)_x| ), sgn = sgn( (a)_x ) where (a)_x := Gamma[a + x]/Gamma[a]' ); pp_def('gsl_sf_poch', GenericTypes => ['D'], OtherPars => 'double a', Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_poch_e,($COMP(a),$x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Pochammer (Apell) symbol (a)_x := Gamma[a + x]/Gamma[x]' ); pp_def('gsl_sf_pochrel', GenericTypes => ['D'], OtherPars => 'double a', Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_pochrel_e,($COMP(a),$x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Relative Pochammer (Apell) symbol ((a,x) - 1)/x where (a,x) = (a)_x := Gamma[a + x]/Gamma[a]' ); pp_def('gsl_sf_gamma_inc_Q', GenericTypes => ['D'], OtherPars => 'double a', Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_gamma_inc_Q_e,($COMP(a),$x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Normalized Incomplete Gamma Function Q(a,x) = 1/Gamma(a) Integral[ t^(a-1) e^(-t), {t,x,Infinity} ]' ); pp_def('gsl_sf_gamma_inc_P', GenericTypes => ['D'], OtherPars => 'double a', Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_gamma_inc_P_e,($COMP(a),$x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Complementary Normalized Incomplete Gamma Function P(a,x) = 1/Gamma(a) Integral[ t^(a-1) e^(-t), {t,0,x} ]' ); pp_def('gsl_sf_lnbeta', GenericTypes => ['D'], Pars=>'double a(); double b(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_lnbeta_e,($a(),$b(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Logarithm of Beta Function Log[B(a,b)]' ); pp_def('gsl_sf_beta', GenericTypes => ['D'], OtherPars => '', Pars=>'double a(); double b();double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_beta_e,($a(),$b(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Beta Function B(a,b)' ); pp_def('gsl_sf_gegenpoly_n', GenericTypes => ['D'], OtherPars =>'int n; double lambda', Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_gegenpoly_n_e,($COMP(n),$COMP(lambda), $x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Evaluate Gegenbauer polynomials.' ); pp_def('gsl_sf_gegenpoly_array', GenericTypes => ['D'], OtherPars =>'int n=>num; double lambda', Pars=>'double x(); double [o]y(num)', Code =>' GSLERR(gsl_sf_gegenpoly_array,($COMP(n)-1,$COMP(lambda),$x(),$P(y))) ', Doc =>'Calculate array of Gegenbauer polynomials from 0 to n-1.' ); pp_def('gsl_sf_hyperg_0F1', GenericTypes => ['D'], OtherPars =>'double c', Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_hyperg_0F1_e,($COMP(c), $x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'/* Hypergeometric function related to Bessel functions 0F1[c,x] = Gamma[c] x^(1/2(1-c)) I_{c-1}(2 Sqrt[x]) Gamma[c] (-x)^(1/2(1-c)) J_{c-1}(2 Sqrt[-x])' ); pp_def('gsl_sf_hyperg_1F1', GenericTypes => ['D'], OtherPars =>'double a; double b', Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_hyperg_1F1_e,($COMP(a),$COMP(b), $x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Confluent hypergeometric function for integer parameters. 1F1[a,b,x] = M(a,b,x)' ); pp_def('gsl_sf_hyperg_U', GenericTypes => ['D'], OtherPars =>'double a; double b', Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_hyperg_U_e,($COMP(a),$COMP(b), $x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Confluent hypergeometric function for integer parameters. U(a,b,x)' ); pp_def('gsl_sf_hyperg_2F1', GenericTypes => ['D'], OtherPars =>'double a; double b; double c', Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_hyperg_2F1_e,($COMP(a),$COMP(b), $COMP(c),$x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Confluent hypergeometric function for integer parameters. 2F1[a,b,c,x]' ); pp_def('gsl_sf_hyperg_2F1_conj', GenericTypes => ['D'], OtherPars =>'double a; double b; double c', Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_hyperg_2F1_conj_e,($COMP(a),$COMP(b), $COMP(c),$x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Gauss hypergeometric function 2F1[aR + I aI, aR - I aI, c, x]' ); pp_def('gsl_sf_hyperg_2F1_renorm', GenericTypes => ['D'], OtherPars =>'double a; double b; double c', Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_hyperg_2F1_renorm_e,($COMP(a),$COMP(b), $COMP(c),$x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Renormalized Gauss hypergeometric function 2F1[a,b,c,x] / Gamma[c]' ); pp_def('gsl_sf_hyperg_2F1_conj_renorm', GenericTypes => ['D'], OtherPars =>'double a; double b; double c', Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_hyperg_2F1_conj_renorm_e,($COMP(a),$COMP(b), $COMP(c),$x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Renormalized Gauss hypergeometric function 2F1[aR + I aI, aR - I aI, c, x] / Gamma[c]' ); pp_def('gsl_sf_hyperg_2F0', GenericTypes => ['D'], OtherPars =>'double a; double b', Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_hyperg_2F0_e,($COMP(a),$COMP(b), $x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Mysterious hypergeometric function. The series representation is a divergent hypergeometric series. However, for x < 0 we have 2F0(a,b,x) = (-1/x)^a U(a,1+a-b,-1/x)' ); pp_def('gsl_sf_laguerre_n', GenericTypes => ['D'], OtherPars =>'int n; double a', Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_laguerre_n_e,($COMP(n),$COMP(a), $x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Evaluate generalized Laguerre polynomials.' ); pp_def('gsl_sf_legendre_Pl', GenericTypes => ['D'], OtherPars =>'int l', Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_legendre_Pl_e,($COMP(l),$x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'P_l(x)' ); pp_def('gsl_sf_legendre_Pl_array', GenericTypes => ['D'], OtherPars =>'int l=>num', Pars=>'double x(); double [o]y(num)', Code =>' GSLERR(gsl_sf_legendre_Pl_array,($COMP(l)-1,$x(),$P(y))) ', Doc =>'P_l(x) from 0 to n-1.' ); pp_def('gsl_sf_legendre_Ql', GenericTypes => ['D'], OtherPars =>'int l', Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_legendre_Ql_e,($COMP(l),$x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Q_l(x)' ); pp_def('gsl_sf_legendre_Plm', GenericTypes => ['D'], OtherPars =>'int l; int m', Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_legendre_Plm_e,($COMP(l),$COMP(m),$x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'P_lm(x)' ); pp_def('gsl_sf_legendre_array', GenericTypes => ['D'], OtherPars => 'char norm; int lmax; int csphase', Pars => 'double x(); double [o]y(n=CALC($COMP(lmax)*($COMP(lmax)+1)/2+$COMP(lmax)+1)); double [t]work(wn=CALC(gsl_sf_legendre_array_n($COMP(lmax))))', HandleBad => 1, Code => <<'EOBC', PDL_IF_BAD(if ( $ISBAD( x() ) ) { loop(n) %{ $SETBAD ( y() ); %} } else,) { if($x()<-1||$x()>1) $CROAK("The input to gsl_sf_legendre_array must be abs(x)<=1, and you input %f",$x()); gsl_sf_legendre_t norm; switch ($COMP(norm)) { case 'S': norm = GSL_SF_LEGENDRE_SCHMIDT; break; case 'Y': norm = GSL_SF_LEGENDRE_SPHARM; break; case 'N': norm = GSL_SF_LEGENDRE_FULL; break; default: norm = GSL_SF_LEGENDRE_NONE; break; } GSLERR(gsl_sf_legendre_array_e,(norm, $COMP(lmax), $x(), $COMP(csphase), $P(work))); loop(n) %{ $y() = $work(wn=>n); %} } EOBC Doc => <<'EOD', =for ref Calculate all normalized associated Legendre polynomials. =for usage $Plm = gsl_sf_legendre_array($x,'P',4,-1); The calculation is done for degree 0 <= l <= lmax and order 0 <= m <= l on the range abs(x)<=1. The parameter norm should be: =over 3 =item 'S' for Schmidt semi-normalized associated Legendre polynomials S_l^m(x), =item 'Y' for spherical harmonic associated Legendre polynomials Y_l^m(x), or =item 'N' for fully normalized associated Legendre polynomials N_l^m(x). =item 'P' (or any other) for unnormalized associated Legendre polynomials P_l^m(x), =back lmax is the maximum degree l. csphase should be (-1) to INCLUDE the Condon-Shortley phase factor (-1)^m, or (+1) to EXCLUDE it. See L to get the value of C and C in the returned vector. EOD ); pp_def('gsl_sf_legendre_array_index', OtherPars => 'int lmax', Pars => 'int [o]l(n=CALC($COMP(lmax)*($COMP(lmax)+1)/2+$COMP(lmax)+1)); int [o]m(n)', Code => q/ int ell, em, index; for (ell=0; ell<=$COMP(lmax); ell++){ for (em=0; em<=ell; em++){ index = gsl_sf_legendre_array_index(ell,em); $l(n=>index)=ell; $m(n=>index)=em; } }/, Doc =>'=for ref Calculate the relation between gsl_sf_legendre_arrays index and l and m values. =for usage ($l,$m) = gsl_sf_legendre_array_index($lmax); Note that this function is called differently than the corresponding GSL function, to make it more useful for PDL: here you just input the maximum l (lmax) that was used in C and it calculates all l and m values.' ); pp_def('gsl_sf_legendre_sphPlm', GenericTypes => ['D'], OtherPars =>'int l; int m', Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_legendre_sphPlm_e,($COMP(l),$COMP(m),$x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'P_lm(x), normalized properly for use in spherical harmonics' ); pp_def('gsl_sf_conicalP_half', GenericTypes => ['D'], OtherPars =>'double lambda', Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_conicalP_half_e,($COMP(lambda),$x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Irregular Spherical Conical Function P^{1/2}_{-1/2 + I lambda}(x)' ); pp_def('gsl_sf_conicalP_mhalf', GenericTypes => ['D'], OtherPars =>'double lambda', Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_conicalP_mhalf_e,($COMP(lambda),$x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Regular Spherical Conical Function P^{-1/2}_{-1/2 + I lambda}(x)' ); pp_def('gsl_sf_conicalP_0', GenericTypes => ['D'], OtherPars =>'double lambda', Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_conicalP_0_e,($COMP(lambda),$x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Conical Function P^{0}_{-1/2 + I lambda}(x)' ); pp_def('gsl_sf_conicalP_1', GenericTypes => ['D'], OtherPars =>'double lambda', Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_conicalP_1_e,($COMP(lambda),$x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Conical Function P^{1}_{-1/2 + I lambda}(x)' ); pp_def('gsl_sf_conicalP_sph_reg', GenericTypes => ['D'], OtherPars =>'int l; double lambda', Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_conicalP_sph_reg_e,($COMP(l),$COMP(lambda),$x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Regular Spherical Conical Function P^{-1/2-l}_{-1/2 + I lambda}(x)' ); pp_def('gsl_sf_conicalP_cyl_reg_e', GenericTypes => ['D'], OtherPars =>'int m; double lambda', Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_conicalP_cyl_reg_e,($COMP(m),$COMP(lambda),$x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Regular Cylindrical Conical Function P^{-m}_{-1/2 + I lambda}(x)' ); pp_def('gsl_sf_legendre_H3d', GenericTypes => ['D'], OtherPars =>'int l; double lambda; double eta', Pars=>'double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_legendre_H3d_e,($COMP(l),$COMP(lambda),$COMP(eta),&r)) $y() = r.val; $e() = r.err; ', Doc =>'lth radial eigenfunction of the Laplacian on the 3-dimensional hyperbolic space.' ); pp_def('gsl_sf_legendre_H3d_array', GenericTypes => ['D'], OtherPars =>'int l=>num; double lambda; double eta', Pars=>'double [o]y(num)', Code =>' GSLERR(gsl_sf_legendre_H3d_array,($COMP(l)-1,$COMP(lambda),$COMP(eta),$P(y))) ', Doc =>'Array of H3d(ell), for l from 0 to n-1.' ); pp_def('gsl_sf_log', GenericTypes => ['D'], Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_log_e,($x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Provide a logarithm function with GSL semantics.' ); pp_def('gsl_sf_complex_log', GenericTypes => ['D'], Pars=>'double zr(); double zi(); double [o]x(); double [o]y(); double [o]xe(); double [o]ye()', Code =>' gsl_sf_result r; gsl_sf_result ri; GSLERR(gsl_sf_complex_log_e,($zr(),$zi(),&r,&ri)) $x() = r.val; $xe() = r.err; $y() = ri.val; $ye() = ri.err; ', Doc =>'Complex Logarithm exp(lnr + I theta) = zr + I zi Returns argument in [-pi,pi].' ); pp_def('gsl_poly_eval', GenericTypes => ['D'], Pars=>'double x(); double c(m); double [o]y()', Code =>' $y() = gsl_poly_eval($P(c),$SIZE(m),$x()); ', Doc =>'c[0] + c[1] x + c[2] x^2 + ... + c[m-1] x^(m-1)' ); pp_def('gsl_sf_pow_int', GenericTypes => ['D'], OtherPars => 'int n', Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_pow_int_e,($x(),$COMP(n),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Calculate x^n.' ); pp_def('gsl_sf_psi', GenericTypes => ['D'], Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_psi_e,($x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Di-Gamma Function psi(x).' ); pp_def('gsl_sf_psi_1piy', GenericTypes => ['D'], Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_psi_1piy_e,($x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Di-Gamma Function Re[psi(1 + I y)]' ); pp_def('gsl_sf_psi_n', GenericTypes => ['D'], OtherPars => 'int n', Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_psi_n_e,($COMP(n),$x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Poly-Gamma Function psi^(n)(x)' ); pp_def('gsl_sf_synchrotron_1', GenericTypes => ['D'], Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_synchrotron_1_e,($x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'First synchrotron function: synchrotron_1(x) = x Integral[ K_{5/3}(t), {t, x, Infinity}]' ); pp_def('gsl_sf_synchrotron_2', GenericTypes => ['D'], Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_synchrotron_2_e,($x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Second synchroton function: synchrotron_2(x) = x * K_{2/3}(x)' ); pp_def('gsl_sf_transport_2', GenericTypes => ['D'], Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_transport_2_e,($x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'J(2,x)' ); pp_def('gsl_sf_transport_3', GenericTypes => ['D'], Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_transport_3_e,($x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'J(3,x)' ); pp_def('gsl_sf_transport_4', GenericTypes => ['D'], Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_transport_4_e,($x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'J(4,x)' ); pp_def('gsl_sf_transport_5', GenericTypes => ['D'], Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_transport_5_e,($x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'J(5,x)' ); pp_def('gsl_sf_sin', GenericTypes => ['D'], Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_sin_e,($x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Sin(x) with GSL semantics.' ); pp_def('gsl_sf_cos', GenericTypes => ['D'], Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_cos_e,($x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Cos(x) with GSL semantics.' ); pp_def('gsl_sf_hypot', GenericTypes => ['D'], Pars=>'double x(); double xx(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_hypot_e,($x(),$xx(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Hypot(x,xx) with GSL semantics.' ); pp_def('gsl_sf_complex_sin', GenericTypes => ['D'], Pars=>'double zr(); double zi(); double [o]x(); double [o]y(); double [o]xe(); double [o]ye()', Code =>' gsl_sf_result r; gsl_sf_result ri; GSLERR(gsl_sf_complex_sin_e,($zr(),$zi(),&r,&ri)) $x() = r.val; $xe() = r.err; $y() = ri.val; $ye() = ri.err; ', Doc =>'Sin(z) for complex z' ); pp_def('gsl_sf_complex_cos', GenericTypes => ['D'], Pars=>'double zr(); double zi(); double [o]x(); double [o]y(); double [o]xe(); double [o]ye()', Code =>' gsl_sf_result r; gsl_sf_result ri; GSLERR(gsl_sf_complex_cos_e,($zr(),$zi(),&r,&ri)) $x() = r.val; $xe() = r.err; $y() = ri.val; $ye() = ri.err; ', Doc =>'Cos(z) for complex z' ); pp_def('gsl_sf_complex_logsin', GenericTypes => ['D'], Pars=>'double zr(); double zi(); double [o]x(); double [o]y(); double [o]xe(); double [o]ye()', Code =>' gsl_sf_result r; gsl_sf_result ri; GSLERR(gsl_sf_complex_logsin_e,($zr(),$zi(),&r,&ri)) $x() = r.val; $xe() = r.err; $y() = ri.val; $ye() = ri.err; ', Doc =>'Log(Sin(z)) for complex z' ); pp_def('gsl_sf_lnsinh', GenericTypes => ['D'], Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_lnsinh_e,($x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Log(Sinh(x)) with GSL semantics.' ); pp_def('gsl_sf_lncosh', GenericTypes => ['D'], Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_lncosh_e,($x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Log(Cos(x)) with GSL semantics.' ); pp_def('gsl_sf_polar_to_rect', GenericTypes => ['D'], Pars=>'double r(); double t(); double [o]x(); double [o]y(); double [o]xe(); double [o]ye()', Code =>' gsl_sf_result r; gsl_sf_result ri; GSLERR(gsl_sf_polar_to_rect,($r(),$t(),&r,&ri)) $x() = r.val; $xe() = r.err; $y() = ri.val; $ye() = ri.err; ', Doc =>'Convert polar to rectlinear coordinates.' ); pp_def('gsl_sf_rect_to_polar', GenericTypes => ['D'], Pars=>'double x(); double y(); double [o]r(); double [o]t(); double [o]re(); double [o]te()', Code =>' gsl_sf_result r; gsl_sf_result ri; GSLERR(gsl_sf_rect_to_polar,($x(),$y(),&r,&ri)) $r() = r.val; $re() = r.err; $t() = ri.val; $te() = ri.err; ', Doc =>'Convert rectlinear to polar coordinates. return argument in range [-pi, pi].' ); pp_def('gsl_sf_angle_restrict_symm', GenericTypes => ['D'], Pars=>'double [o]y();', Code =>' GSLERR(gsl_sf_angle_restrict_symm_e,($P(y))) ', Doc =>'Force an angle to lie in the range (-pi,pi].' ); pp_def('gsl_sf_angle_restrict_pos', GenericTypes => ['D'], Pars=>'double [o]y();', Code =>' GSLERR(gsl_sf_angle_restrict_pos_e,($P(y))) ', Doc =>'Force an angle to lie in the range [0,2 pi).' ); pp_def('gsl_sf_sin_err', GenericTypes => ['D'], Pars=>'double x(); double dx(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_sin_err_e,($x(),$dx(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Sin(x) for quantity with an associated error.' ); pp_def('gsl_sf_cos_err', GenericTypes => ['D'], Pars=>'double x(); double dx(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_cos_err_e,($x(),$dx(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Cos(x) for quantity with an associated error.' ); pp_def('gsl_sf_zeta', GenericTypes => ['D'], Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_zeta_e,($x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Riemann Zeta Function zeta(x) = Sum[ k^(-s), {k,1,Infinity} ], s != 1.0' ); pp_def('gsl_sf_hzeta', GenericTypes => ['D'], OtherPars =>'double q', Pars=>'double s(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_hzeta_e,($s(), $COMP(q), &r)) $y() = r.val; $e() = r.err; ', Doc =>'Hurwicz Zeta Function zeta(s,q) = Sum[ (k+q)^(-s), {k,0,Infinity} ]' ); pp_def('gsl_sf_eta', GenericTypes => ['D'], Pars=>'double x(); double [o]y(); double [o]e()', Code =>' gsl_sf_result r; GSLERR(gsl_sf_eta_e,($x(),&r)) $y() = r.val; $e() = r.err; ', Doc =>'Eta Function eta(s) = (1-2^(1-s)) zeta(s)' ); pp_done(); PDL-GSL-2.103/lib/PDL/Stats/0000755000175000017500000000000015160062236014773 5ustar osboxesosboxesPDL-GSL-2.103/lib/PDL/Stats/Distr.pd0000644000175000017500000004574514745744062016440 0ustar osboxesosboxesuse strict; use warnings; use PDL::Types 'types'; my $F = [map $_->ppsym, grep !$_->integer && $_->real, types()]; pp_addpm({At=>'Top'}, <<'EOD'); use strict; use warnings; use Carp; use PDL::LiteF; =head1 NAME PDL::Stats::Distr -- parameter estimations and probability density functions for distributions. =head1 DESCRIPTION Parameter estimate is maximum likelihood estimate when there is closed form estimate, otherwise it is method of moments estimate. =head1 SYNOPSIS use PDL::LiteF; use PDL::Stats::Distr; # do a frequency (probability) plot with fitted normal curve my $data = grandom(100)->abs; my ($xvals, $hist) = $data->hist; # turn frequency into probability $hist /= $data->nelem; # get maximum likelihood estimates of normal curve parameters my ($m, $v) = $data->mle_gaussian(); # fitted normal curve probabilities my $p = $xvals->pdf_gaussian($m, $v); use PDL::Graphics::Simple; my $win = pgswin(); $win->plot( with=>'bins', $hist, with=>'lines', style => 2, $p ); undef $win; # to close Or, play with different distributions with B :) $data->plot_distr( 'gaussian', 'lognormal' ); =cut EOD pp_addhdr(' #include #include #include '); pp_def('mme_beta', Pars => 'a(n); float+ [o]alpha(); float+ [o]beta()', GenericTypes => $F, HandleBad => 1, Code => ' $GENERIC(alpha) sa = 0, a2 = 0; PDL_Indx N = PDL_IF_BAD(0,$SIZE(n)); loop (n) %{ PDL_IF_BAD(if ($ISBAD($a())) continue;,) sa += $a(); a2 += pow($a(), 2); PDL_IF_BAD(N++;,) %} if (N < 1) { $SETBAD(alpha()); $SETBAD(beta()); continue; } $GENERIC(alpha) m = sa / N; $GENERIC(alpha) v = a2 / N - pow(m, 2); $alpha() = m * ( m * (1 - m) / v - 1 ); $beta() = (1 - m) * ( m * (1 - m) / v - 1 ); ', Doc => ' =for usage my ($a, $b) = $data->mme_beta(); =for ref beta distribution. pdf: f(x; a,b) = 1/B(a,b) x^(a-1) (1-x)^(b-1) =cut ', ); pp_def('pdf_beta', Pars => 'x(); a(); b(); float+ [o]p()', GenericTypes => $F, HandleBad => 1, Code => ' PDL_IF_BAD(if ($ISBAD($x()) || $ISBAD($a()) || $ISBAD($b())) { $SETBAD($p()); continue; },) if (!($x()>=0 && $x()<=1)) $CROAK("x out of range [0,1]"); double B_1 = 1 / gsl_sf_beta( $a(), $b() ); $p() = B_1 * pow($x(), $a()-1) * pow(1-$x(), $b()-1); ', Doc => ' =for ref probability density function for beta distribution. x defined on [0,1]. =cut ', ); pp_def('mme_binomial', Pars => 'a(n); int [o]n_(); float+ [o]p()', GenericTypes => $F, HandleBad => 1, Code => ' $GENERIC(p) sa, a2, m, v; sa = 0; a2 = 0; PDL_Indx N = PDL_IF_BAD(0,$SIZE(n)); loop (n) %{ PDL_IF_BAD(if ($ISBAD($a())) continue;,) sa += $a(); a2 += pow($a(), 2); PDL_IF_BAD(N++;,) %} if (N < 1) { $SETBAD(n_()); $SETBAD(p()); continue; } m = sa / N; v = a2 / N - pow(m, 2); $p() = 1 - v/m; $n_() = m / $p() >= 0? (int) (m / $p() + .5) : (int) (m / $p() - .5); $p() = m / $n_(); ', Doc => ' =for usage my ($n, $p) = $data->mme_binomial; =for ref binomial distribution. pmf: f(k; n,p) = (n k) p^k (1-p)^(n-k) for k = 0,1,2..n ', ); pp_def('pmf_binomial', Pars => 'ushort x(); ushort n(); p(); float+ [o]out()', GenericTypes => $F, HandleBad => 1, Code => ' PDL_IF_BAD(if ($ISBAD($x()) || $ISBAD($n()) || $ISBAD($p())) { $SETBAD( $out() ); continue; },) $GENERIC(out) bc = gsl_sf_choose($n(), $x()); $out() = bc * pow($p(), $x()) * pow(1-$p(), $n() - $x()); ', Doc => ' =for ref probability mass function for binomial distribution. ', ); pp_def('mle_exp', Pars => 'a(n); float+ [o]l()', GenericTypes => $F, HandleBad => 1, Code => ' $GENERIC(l) sa = 0; PDL_Indx N = PDL_IF_BAD(0,$SIZE(n)); loop (n) %{ PDL_IF_BAD(if ($ISBAD($a())) continue;,) sa += $a(); PDL_IF_BAD(N++;,) %} PDL_IF_BAD(if (sa <= 0) { $SETBAD(l()); continue; },) $l() = N / sa; ', Doc => ' =for usage my $lamda = $data->mle_exp; =for ref exponential distribution. mle same as method of moments estimate. ', ); pp_def('pdf_exp', Pars => 'x(); l(); float+ [o]p()', GenericTypes => $F, HandleBad => 1, Code => ' PDL_IF_BAD(if ( $ISBAD($x()) || $ISBAD($l()) ) { $SETBAD( $p() ); continue; },) $p() = $l() * exp( -1 * $l() * $x() ); ', Doc => ' =for ref probability density function for exponential distribution. ', ); pp_def('mme_gamma', Pars => 'a(n); float+ [o]shape(); float+ [o]scale()', GenericTypes => $F, HandleBad => 1, Code => ' $GENERIC(shape) sa = 0, a2 = 0; PDL_Indx N = PDL_IF_BAD(0,$SIZE(n)); loop (n) %{ PDL_IF_BAD(if ($ISBAD($a())) continue;,) sa += $a(); a2 += pow($a(), 2); PDL_IF_BAD(N++;,) %} PDL_IF_BAD(if (N < 1) { $SETBAD(shape()); $SETBAD(scale()); continue; },) $GENERIC(shape) m = sa / N; $GENERIC(shape) v = a2 / N - pow(m, 2); $shape() = pow(m, 2) / v; $scale() = v / m; ', Doc => ' =for usage my ($shape, $scale) = $data->mme_gamma(); =for ref two-parameter gamma distribution ', ); pp_def('pdf_gamma', Pars => 'x(); a(); t(); float+ [o]p()', GenericTypes => $F, HandleBad => 1, Code => ' PDL_IF_BAD(if ($ISBAD($x()) || $ISBAD($a()) || $ISBAD($t())) { $SETBAD( $p() ); continue; },) double g = gsl_sf_gamma( $a() ); $p() = pow($x(), $a()-1) * exp(-1*$x() / $t()) / (pow($t(), $a()) * g); ', Doc => ' =for ref probability density function for two-parameter gamma distribution. ', ); pp_def('mle_gaussian', Pars => 'a(n); float+ [o]m(); float+ [o]v()', GenericTypes => $F, HandleBad => 1, Code => ' $GENERIC(m) sa = 0, a2 = 0; PDL_Indx N = PDL_IF_BAD(0,$SIZE(n)); loop (n) %{ PDL_IF_BAD(if ($ISBAD($a())) continue;,) sa += $a(); a2 += pow($a(), 2); PDL_IF_BAD(N++;,) %} if (N < 1) { $SETBAD(m()); $SETBAD(v()); continue; } $m() = sa / N; $v() = a2 / N - pow($m(),2); ', Doc => ' =for usage my ($m, $v) = $data->mle_gaussian(); =for ref gaussian aka normal distribution. same results as $data->average and $data->var. mle same as method of moments estimate. ', ); pp_def('pdf_gaussian', Pars => 'x(); m(); v(); float+ [o]p()', GenericTypes => $F, HandleBad => 1, Code => ' PDL_IF_BAD(if ($ISBAD($x()) || $ISBAD($m()) || $ISBAD($v())) { $SETBAD( $p() ); continue; },) $p() = 1 / sqrt($v() * 2 * M_PI) * exp( -1 * pow($x() - $m(), 2) / (2*$v()) ); ', Doc => ' =for ref probability density function for gaussian distribution. ', ); pp_def('mle_geo', Pars => 'a(n); float+ [o]p();', GenericTypes => $F, HandleBad => 1, Code => ' $GENERIC(p) sa = 0; PDL_Indx N = PDL_IF_BAD(0,$SIZE(n)); loop (n) %{ PDL_IF_BAD(if ($ISBAD($a())) continue;,) sa += $a(); PDL_IF_BAD(N++;,) %} if (N < 1) { $SETBAD(p()); continue; } $p() = 1 / (1 + sa/N); ', Doc => ' =for ref geometric distribution. mle same as method of moments estimate. ', ); pp_def('pmf_geo', Pars => 'ushort x(); p(); float+ [o]out()', GenericTypes => $F, HandleBad => 1, Code => ' PDL_IF_BAD(if ($ISBAD($x()) || $ISBAD($p())) { $SETBAD( $out() ); continue; },) $out() = pow(1-$p(), $x()) * $p(); ', Doc => ' =for ref probability mass function for geometric distribution. x >= 0. ', ); pp_def('mle_geosh', Pars => 'a(n); float+ [o]p();', GenericTypes => $F, HandleBad => 1, Code => ' $GENERIC(p) sa = 0; PDL_Indx N = PDL_IF_BAD(0,$SIZE(n)); loop (n) %{ PDL_IF_BAD(if ($ISBAD($a())) continue;,) sa += $a(); PDL_IF_BAD(N++;,) %} if (sa <= 0) { $SETBAD(p()); continue; } $p() = N / sa; ', Doc => ' =for ref shifted geometric distribution. mle same as method of moments estimate. ', ); pp_def('pmf_geosh', Pars => 'ushort x(); p(); float+ [o]out()', GenericTypes => $F, HandleBad => 1, Code => ' PDL_IF_BAD(if ($ISBAD($x()) || $ISBAD($p())) { $SETBAD( $out() ); continue; },) if ( $x() < 1 ) { $CROAK( "x >= 1 please" ); } $out() = pow(1-$p(), $x()-1) * $p(); ', Doc => ' =for ref probability mass function for shifted geometric distribution. x >= 1. ', ); pp_def('mle_lognormal', Pars => 'a(n); float+ [o]m(); float+ [o]v()', GenericTypes => $F, HandleBad => 1, Code => ' $GENERIC(m) sa = 0, a2 = 0; PDL_Indx N = PDL_IF_BAD(0,$SIZE(n)); loop (n) %{ PDL_IF_BAD(if ($ISBAD($a())) continue;,) sa += log($a()); PDL_IF_BAD(N++;,) %} if (N < 1) { $SETBAD(m()); $SETBAD(v()); continue; } $m() = sa / N; loop (n) %{ PDL_IF_BAD(if ($ISBAD($a())) continue;,) a2 += pow(log($a()) - $m(), 2); %} $v() = a2 / N; ', Doc => ' =for usage my ($m, $v) = $data->mle_lognormal(); =for ref lognormal distribution. maximum likelihood estimation. ', ); pp_def('mme_lognormal', Pars => 'a(n); float+ [o]m(); float+ [o]v()', GenericTypes => $F, HandleBad => 1, Code => ' $GENERIC(m) sa = 0, a2 = 0; PDL_Indx N = PDL_IF_BAD(0,$SIZE(n)); loop (n) %{ PDL_IF_BAD(if ($ISBAD($a())) continue;,) sa += $a(); a2 += pow($a(), 2); PDL_IF_BAD(N++;,) %} if (N < 1) { $SETBAD(m()); $SETBAD(v()); continue; } $m() = 2 * log(sa / N) - 1/2 * log( a2 / N ); $v() = log( a2 / N ) - 2 * log( sa / N ); ', Doc => ' =for usage my ($m, $v) = $data->mme_lognormal(); =for ref lognormal distribution. method of moments estimation. ', ); pp_def('pdf_lognormal', Pars => 'x(); m(); v(); float+ [o]p()', GenericTypes => $F, HandleBad => 1, Code => ' PDL_IF_BAD(if ( $ISBAD($x()) || $ISBAD($m()) || $ISBAD($v()) ) { $SETBAD( $p() ); continue; },) if (!($x() > 0 && $v() > 0)) $CROAK( "x and v > 0 please" ); $p() = 1 / ($x() * sqrt($v() * 2 * M_PI)) * exp( -1 * pow(log($x()) - $m(), 2) / (2*$v()) ); ', Doc => ' =for ref probability density function for lognormal distribution. x > 0. v > 0. ', ); pp_def('mme_nbd', Pars => 'a(n); float+ [o]r(); float+ [o]p()', GenericTypes => $F, HandleBad => 1, Code => ' $GENERIC(p) sa = 0, a2 = 0; PDL_Indx N = PDL_IF_BAD(0,$SIZE(n)); loop (n) %{ PDL_IF_BAD(if ($ISBAD($a())) continue;,) sa += $a(); a2 += pow($a(), 2); PDL_IF_BAD(N++;,) %} PDL_IF_BAD(if (N < 1) { $SETBAD(r()); $SETBAD(p()); continue; },) $GENERIC(p) m = sa / N; $GENERIC(p) v = a2 / N - pow(m, 2); $r() = pow(m, 2) / (v - m); $p() = m / v; ', Doc => ' =for usage my ($r, $p) = $data->mme_nbd(); =for ref negative binomial distribution. pmf: f(x; r,p) = (x+r-1 r-1) p^r (1-p)^x for x=0,1,2... ', ); pp_def('pmf_nbd', Pars => 'ushort x(); r(); p(); float+ [o]out()', GenericTypes => $F, HandleBad => 1, Code => ' PDL_IF_BAD(if ( $ISBAD($x()) || $ISBAD($r()) || $ISBAD($p()) ) { $SETBAD( $out() ); continue; },) $GENERIC(out) nbc = gsl_sf_gamma($x()+$r()) / (gsl_sf_fact($x()) * gsl_sf_gamma($r())); $out() = nbc * pow($p(),$r()) * pow(1-$p(), $x()); ', Doc => ' =for ref probability mass function for negative binomial distribution. ', ); pp_def('mme_pareto', Pars => 'a(n); float+ [o]k(); float+ [o]xm()', GenericTypes => $F, HandleBad => 1, Code => ' $GENERIC(xm) sa = 0, min = $a(n=>0); PDL_Indx N = PDL_IF_BAD(0,$SIZE(n)); loop (n) %{ PDL_IF_BAD(if ($ISBAD($a())) continue;,) sa += $a(); if (min > $a()) min = $a(); PDL_IF_BAD(N++;,) %} if (min <= 0) $CROAK("min <= 0!"); $k() = (sa - min) / ( N*( sa/N - min ) ); $xm() = (N * $k() - 1) * min / ( N * $k() ); ', Doc => ' =for usage my ($k, $xm) = $data->mme_pareto(); =for ref pareto distribution. pdf: f(x; k,xm) = k xm^k / x^(k+1) for x >= xm > 0. ', ); pp_def('pdf_pareto', Pars => 'x(); k(); xm(); float+ [o]p()', GenericTypes => $F, HandleBad => 1, Code => ' PDL_IF_BAD(if ( $ISBAD($x()) || $ISBAD($k()) || $ISBAD($xm()) ) { $SETBAD( $p() ); continue; },) if (!($xm() > 0 && $x() >= $xm() )) $CROAK("x >= xm > 0 please"); $p() = $k() * pow($xm(),$k()) / pow($x(), $k()+1); ', Doc => ' =for ref probability density function for pareto distribution. x >= xm > 0. ', ); pp_def('mle_poisson', Pars => 'a(n); float+ [o]l();', GenericTypes => $F, HandleBad => 1, Code => ' $GENERIC(l) sa = 0; PDL_Indx N = PDL_IF_BAD(0,$SIZE(n)); loop (n) %{ PDL_IF_BAD(if ($ISBAD($a())) continue;,) sa += $a(); PDL_IF_BAD(N++;,) %} if (N < 1) { $SETBAD(l()); continue; } $l() = sa / N; ', Doc => ' =for usage my $lamda = $data->mle_poisson(); =for ref poisson distribution. pmf: f(x;l) = e^(-l) * l^x / x! ', ); pp_def('pmf_poisson', Pars => 'x(); l(); float+ [o]p()', GenericTypes => $F, HandleBad => 1, Code => q{ PDL_IF_BAD(if ($ISBAD($x()) || $ISBAD($l())) { $SETBAD($p()); continue; },) if ($x() < 0) { $p() = 0; } else if ($x() < GSL_SF_FACT_NMAX / 2) { /* Exact formula */ $p() = exp( -1 * $l()) * pow($l(),$x()) / gsl_sf_fact( (unsigned int) $x() ); } else { /* Use Stirling's approximation. See * http://en.wikipedia.org/wiki/Stirling%27s_approximation */ double log_p = $x() - $l() + $x() * log($l() / $x()) - 0.5 * log(2*M_PI * $x()) - 1. / 12. / $x() + 1 / 360. / $x()/$x()/$x() - 1. / 1260. / $x()/$x()/$x()/$x()/$x(); $p() = exp(log_p); } }, Doc => q{ =for ref Probability mass function for poisson distribution. Uses Stirling's formula for x > 85. }, ); pp_def('pmf_poisson_stirling', Pars => 'x(); l(); [o]p()', GenericTypes => $F, HandleBad => 1, Code => q{ PDL_IF_BAD(if ($ISBAD($x()) || $ISBAD($l())) { $SETBAD($p()); continue; },) if ($x() < 0) { $p() = 0; } else if ($x() == 0) { $p() = exp(-$l()); } else { /* Use Stirling's approximation. See * http://en.wikipedia.org/wiki/Stirling%27s_approximation */ double log_p = $x() - $l() + $x() * log($l() / $x()) - 0.5 * log(2*M_PI * $x()) - 1. / 12. / $x() + 1 / 360. / $x()/$x()/$x() - 1. / 1260. / $x()/$x()/$x()/$x()/$x(); $p() = exp(log_p); } }, Doc => q{ =for ref Probability mass function for poisson distribution. Uses Stirling's formula for all values of the input. See http://en.wikipedia.org/wiki/Stirling's_approximation for more info. }, ); pp_def('pmf_poisson_factorial', Pars => 'ushort x(); l(); float+ [o]p()', GenericTypes => $F, HandleBad => 1, Code => q{ PDL_IF_BAD(if ($ISBAD($x()) || $ISBAD($l())) { $SETBAD($p()); continue; },) if ($x() < GSL_SF_FACT_NMAX) { $p() = exp( -1 * $l()) * pow($l(),$x()) / gsl_sf_fact( $x() ); } else { /* bail out */ $p() = 0; } }, PMCode => pp_line_numbers(__LINE__, <<'EOF'), sub PDL::pmf_poisson_factorial { my ($x, $l) = @_; my $pdlx = PDL->topdl($x); croak "Does not support input greater than 170. Please use pmf_poisson or pmf_poisson_stirling instead." if any($pdlx >= 170); PDL::_pmf_poisson_factorial_int($pdlx, $l, my $p = PDL->null); $p; } EOF Doc => <<'EOD', =for ref Probability mass function for poisson distribution. Input is limited to x < 170 to avoid gsl_sf_fact() overflow. EOD ); pp_addpm {At=>'Bot'}, pp_line_numbers(__LINE__, <<'EOD'); =head2 plot_distr =for ref Plots data distribution. When given specific distribution(s) to fit, returns % ref to sum log likelihood and parameter values under fitted distribution(s). See FUNCTIONS above for available distributions. =for options Default options (case insensitive): MAXBN => 20, # see PDL::Graphics::Simple for next options WIN => undef, # pgswin object. not closed here if passed # allows comparing multiple distr in same plot # set env before passing WIN COLOR => 1, # "style" for data distr =for usage Usage: # yes it threads :) my $data = grandom( 500, 3 )->abs; # ll on plot is sum across 3 data curves my ($ll, $pars) = $data->plot_distr( 'gaussian', 'lognormal' ); # pars are from normalized data (ie data / bin_size) print "$_\t@{$pars->{$_}}\n" for (sort keys %$pars); print "$_\t$ll->{$_}\n" for (sort keys %$ll); =cut *plot_distr = \&PDL::plot_distr; sub PDL::plot_distr { require PDL::Graphics::Simple; my ($self, @distr) = @_; my %opt = ( MAXBN => 20, WIN => undef, # pgswin object. not closed here if passed COLOR => 1, # "style" for data distr ); my $opt = ref($distr[-1]) eq 'HASH' ? pop @distr : undef; $opt and $opt{uc $_} = $opt->{$_} for (keys %$opt); $self = $self->squeeze; # use int range, step etc for int xvals--pmf compatible my $INT = !!grep { /(?:binomial)|(?:geo)|(?:nbd)|(?:poisson)/ } @distr; my ($range, $step, $step_int); $range = $self->max->sclr - $self->min->sclr; $step = $range / $opt{MAXBN}; $step_int = ($range <= $opt{MAXBN})? 1 : PDL::ceil( $range / $opt{MAXBN} ) ; $opt{MAXBN} = PDL::ceil( $range / $step )->min->sclr; my $hist = $self->double->histogram($step, $self->min->sclr, $opt{MAXBN}); # turn fre into prob $hist /= $self->dim(0); my $xvals = $self->min->sclr + sequence( $opt{MAXBN} ) * $step; my $xvals_int = PDL::ceil($self->min->sclr) + sequence( $opt{MAXBN} ) * $step_int; $xvals_int = $xvals_int->where( $xvals_int <= $xvals->max )->sever; my $win = $opt{WIN} || PDL::Graphics::Simple::pgswin(); my $inc = 0; # key only once $win->plot((map +(with=>'lines', style=>$opt{COLOR}, ($inc++?():(key=>"Base")), $xvals, $_), $hist->dog), { xlabel=>'xvals', ylabel=>'probability', legend=>'tc', # top centre }); return if !@distr; my (%ll, %pars); my $c = $opt{COLOR}; # fitted lines start from ++$c for my $distr ( @distr ) { # find mle_ or mme_$distr; my @funcs = grep { /_$distr$/ } (keys %PDL::Stats::Distr::); if (!@funcs) { carp "Do not recognize $distr distribution!"; next; } # might have mle and mme for a distr. sort so mle comes first @funcs = sort @funcs; my ($f_para, $f_prob) = @funcs[0, -1]; my $nrmd = $self / $step; eval { my @paras = $nrmd->$f_para(); $pars{$distr} = \@paras; @paras = map { $_->dummy(0) } @paras; $ll{$distr} = $nrmd->$f_prob( @paras )->log->sumover; my %curve_opts = (style=>++$c, key=>sprintf("$distr LL = %.2f", $ll{$distr}->sum)); my $inc = 0; # curve_opts only once if ($f_prob =~ /^pdf/) { $win->oplot( map +(with=>'lines', ($inc++?():%curve_opts), $xvals, $_), ($xvals/$step)->$f_prob(@paras)->dog ); } else { $win->oplot( with=>'points', %curve_opts, $xvals_int, ($xvals_int/$step_int)->$f_prob(@paras) ); } }; carp $@ if $@; } return (\%ll, \%pars); } =head1 DEPENDENCIES GSL - GNU Scientific Library =head1 SEE ALSO L L =head1 AUTHOR Copyright (C) 2009 Maggie J. Xiong , David Mertens All rights reserved. There is no warranty. You are allowed to redistribute this software / documentation as described in the file COPYING in the PDL distribution. =cut EOD pp_done(); PDL-GSL-2.103/lib/PDL/Demos/0000755000175000017500000000000015160062236014744 5ustar osboxesosboxesPDL-GSL-2.103/lib/PDL/Demos/GSL_RNG.pm0000644000175000017500000000641414736061645016455 0ustar osboxesosboxespackage PDL::Demos::GSL_RNG; sub info {('gsl_rng', 'GSL randomness functions (Req.: PDL::Graphics::Simple)')} my @demo = ( [act => q| # This demo illustrates the PDL::GSL::RNG module. # It shows the power of PDL with a concise way to generate graphs of # different random number distributions. use PDL::Graphics::Simple; use PDL::GSL::RNG; $x = zeroes(100)->xlinvals(-5,5); $w = pgswin(); # Exponential Power Distribution $w->plot( with=>'lines', key=>'a=1 b=2.5', $x, ran_exppow_pdf($x, 1, 2.5), with=>'lines', key=>'a=1 b=0.5', $x, ran_exppow_pdf($x, 1, 0.5), {le=>'tr', yrange=>[0,0.8], title=>'Exponential Power Distribution', xlabel=>'x', ylabel=>'p(x)'} ); |], [act => q| # Cauchy Distribution $w->plot( with=>'lines', key=>'a=1', $x, ran_cauchy_pdf($x, 1), with=>'lines', key=>'a=2', $x, ran_cauchy_pdf($x, 2), {le=>'tr', yrange=>[0,0.4], title=>'Cauchy Distribution', xlabel=>'x', ylabel=>'p(x)'} ); |], [act => q| # Rayleigh Tail Distribution $x = zeroes(100)->xlinvals(0,5); $w->plot( with=>'lines', key=>'a=1 sigma=1', $x, ran_rayleigh_tail_pdf($x, 1, 1), with=>'lines', key=>'a=0.5 sigma=2', $x, ran_rayleigh_tail_pdf($x, 0.5, 2), {le=>'tr', yrange=>[0,1.1], title=>'Rayleigh Tail Distribution', xlabel=>'x', ylabel=>'p(x)'} ); |], [act => q| # Gamma Distribution $x = zeroes(100)->xlinvals(0,5); $w->plot( with=>'lines', key=>'a=1 b=1', $x, ran_gamma_pdf($x, 1, 1), with=>'lines', key=>'a=2 b=1', $x, ran_gamma_pdf($x, 2, 1), with=>'lines', key=>'a=3 b=1', $x, ran_gamma_pdf($x, 3, 1), {le=>'tr', yrange=>[0,1], title=>'Gamma Distribution', xlabel=>'x', ylabel=>'p(x)'} ); |], [act => q| # Bivariate Gaussian Distribution # inspired by https://www.perlmonks.org/?node_id=11104262 $points = pdl '[219 88 2.7; 38 95 1.7; 45 268 0.8]'; ($XSIZE, $YSIZE) = (300, 300); ($xcoord, $ycoord, $weight) = $points # xyw nweights ->slice(",*$XSIZE,*$YSIZE,") # xyw nx ny nweights ->using(0..2); # nx ny nweights $xbase = xvals($XSIZE)->slice(",*$YSIZE"); # nx ny $ybase = xvals($YSIZE)->slice("*$XSIZE,"); # nx ny for (1..90) { $h = ( $weight * ran_bivariate_gaussian_pdf( $xcoord-$xbase, $ycoord-$ybase, $_, $_, 0 ) # nx ny nweights )->mv(-1,0)->sumover; # nx ny $w->plot(with=>'image', $h, {title=>'Bivariate Gaussian Distribution',j=>1}); } |], [act => q| # Same, but with a colourful heatmap (if you have the right libraries) sub as_heatmap { my ($d) = @_; my $max = $d->max; die "as_heatmap: can't work if max == 0" if $max == 0; $d /= $max; # negative OK my $hue = (1 - $d)*240; $d = cat($hue, pdl(1), pdl(1)); (hsv_to_rgb($d->mv(-1,0)) * 255)->byte->mv(0,-1); } if (eval 'use PDL::Graphics::ColorSpace; 1') { for (1..90) { $h = ( $weight * ran_bivariate_gaussian_pdf( $xcoord-$xbase, $ycoord-$ybase, $_, $_, 0 ) # nx ny nweights )->mv(-1,0)->sumover; # nx ny $w->plot( with=>'image', as_heatmap($h), {title=>'Bivariate Gaussian Distribution (heatmap)',j=>1} ); } } |], [comment => q| See https://www.gnu.org/software/gsl/doc/html/randist.html for more. |], ); sub demo { @demo } sub done {' undef $w; '} 1; PDL-GSL-2.103/lib/PDL/Demos/GSL_CDF.pm0000644000175000017500000000140114736061645016412 0ustar osboxesosboxespackage PDL::Demos::GSL_CDF; sub info {('gsl_cdf', 'GSL cumulative distribution functions')} my @demo = ( [act => q| # This demo illustrates the PDL::GSL::CDF module. # It shows the power of PDL with a concise way to generate a table of # more extreme small p-values, and the associated Z scores. use PDL::GSL::CDF; $pvalue = ipow(pdl(10),-(sequence(32) + 1)); $z = gsl_cdf_ugaussian_Qinv($pvalue); $pdl = $pvalue->cat($z)->transpose; print $pdl->splitdim(1,8)->mv(2,1)->clump(-2)->string("%4.4g"); |], [act => q| # And more extreme high Z scores, and the associated p-values. $z = sequence(24) + 1; $pvalue = gsl_cdf_ugaussian_Q($z); $pdl = $z->cat($pvalue)->transpose; print $pdl->splitdim(1,8)->mv(2,1)->clump(-2)->string("%4.4g"); |], ); sub demo { @demo } 1; PDL-GSL-2.103/README0000644000175000017500000000062014736061645013401 0ustar osboxesosboxesPDL interface to GSL by Christian Pellegrin , Copyleft, 1999 see COPYING in the root of the PDL build tree. The documentation is in the .pd file and is automaticaly generated. We need: - an example for every function (C<=for example> section in docs). - a test for every SF function (to go into t/gsl_sf.t) Patches by GSL users are most welcome! 2002 Christian Soeller PDL-GSL-2.103/MANIFEST0000644000175000017500000000317615160062241013644 0ustar osboxesosboxesChanges gslerr.h lib/PDL/Demos/GSL_CDF.pm lib/PDL/Demos/GSL_RNG.pm lib/PDL/GSL.pm lib/PDL/GSL/CDF.pd lib/PDL/GSL/DIFF-FUNC.c lib/PDL/GSL/DIFF.pd lib/PDL/GSL/INTEG-FUNC.c lib/PDL/GSL/INTEG.pd lib/PDL/GSL/INTERP.pd lib/PDL/GSL/LINALG.pd lib/PDL/GSL/MROOT-FUNC.c lib/PDL/GSL/MROOT.pd lib/PDL/GSL/RNG.pd lib/PDL/GSL/SF.pd lib/PDL/Stats/Distr.pd Makefile.PL MANIFEST This list of files MANIFEST.SKIP README t/cdf.t t/gsl_diff.t t/gsl_integ.t t/gsl_interp.t t/gsl_linalg.t t/gsl_mroot.t t/gsl_rng.t t/gsl_sf.t t/stats_distr.t typemap META.yml Module YAML meta-data (added by MakeMaker) META.json Module JSON meta-data (added by MakeMaker) GENERATED/PDL/GSL/CDF.pm mod=PDL::GSL::CDF pd=lib/PDL/GSL/CDF.pd (added by pdlpp_mkgen) GENERATED/PDL/GSL/DIFF.pm mod=PDL::GSL::DIFF pd=lib/PDL/GSL/DIFF.pd (added by pdlpp_mkgen) GENERATED/PDL/GSL/INTEG.pm mod=PDL::GSL::INTEG pd=lib/PDL/GSL/INTEG.pd (added by pdlpp_mkgen) GENERATED/PDL/GSL/INTERP.pm mod=PDL::GSL::INTERP pd=lib/PDL/GSL/INTERP.pd (added by pdlpp_mkgen) GENERATED/PDL/GSL/LINALG.pm mod=PDL::GSL::LINALG pd=lib/PDL/GSL/LINALG.pd (added by pdlpp_mkgen) GENERATED/PDL/GSL/MROOT.pm mod=PDL::GSL::MROOT pd=lib/PDL/GSL/MROOT.pd (added by pdlpp_mkgen) GENERATED/PDL/GSL/RNG.pm mod=PDL::GSL::RNG pd=lib/PDL/GSL/RNG.pd (added by pdlpp_mkgen) GENERATED/PDL/GSL/SF.pm mod=PDL::GSL::SF pd=lib/PDL/GSL/SF.pd (added by pdlpp_mkgen) GENERATED/PDL/Stats/Distr.pm mod=PDL::Stats::Distr pd=lib/PDL/Stats/Distr.pd (added by pdlpp_mkgen) PDL-GSL-2.103/Makefile.PL0000644000175000017500000000443714754015303014473 0ustar osboxesosboxesuse strict; use warnings; use ExtUtils::MakeMaker; use PDL::Core::Dev; use File::Spec::Functions; sub get_gsl_config { my ($flags) = @_; no warnings 'exec'; `gsl-config $flags`; } # Version check chomp (my $version = get_gsl_config('--version') // '0'); my $new_enough = 0; if (!$version) { $version = 'UNKNOWN VERSION'; } else { my $major = (split /\./,$version)[0]; $new_enough= $major >= 2; } if (!$new_enough) { die "GSL modules: GSL version $version found, but need at least 2.0"; } # the real stuff happens in the subdirs sub get_gsl_libs { my $lib = ($ENV{GSL_LIBS} || get_gsl_config('--libs') || warn "\tno GSL link info (libgsl probably not available)\n"); my $inc = ($ENV{GSL_INC} || get_gsl_config('--cflags') || warn "\tno GSL include info (libgsl probably not available)\n\n"); chomp $lib; chomp $inc; ($inc,$lib); } # these will be used in the subdirs my ($GSL_includes, $GSL_libs) = get_gsl_libs(); # create GENERATED subdir with *.pm files during 'make dist' (to make metacpan.org happy) my $preop = '$(PERLRUNINST) -MPDL::Core::Dev -e pdlpp_mkgen $(DISTVNAME)'; my $package_name = "PDL::GSL"; (my $repo = $package_name) =~ s#::#-#g; $repo = "PDLPorters/$repo"; WriteMakefile( NAME => $package_name, VERSION_FROM => 'lib/PDL/GSL.pm', AUTHOR => 'PerlDL Developers ', LICENSE=> "perl", MIN_PERL_VERSION => '5.016', CONFIGURE_REQUIRES => { 'ExtUtils::MakeMaker' => 0, 'PDL' => '2.096', }, PREREQ_PM => { 'PDL' => '2.096', }, INC => join(' ', "-I".curdir(), $GSL_includes), LIBS => [$GSL_libs], dist => { COMPRESS => 'gzip', SUFFIX => 'gz', PREOP => $preop }, META_MERGE => { "meta-spec" => { version => 2 }, resources => { homepage => 'http://pdl.perl.org/', bugtracker => {web=>"https://github.com/$repo/issues"}, repository => { url => "git://github.com/$repo.git", type => 'git', web => "https://github.com/$repo", }, x_IRC => 'irc://irc.perl.org/#pdl', }, }, clean => { FILES => join ' ', qw(MANIFEST.bak) }, ); my @pd_srcs; sub MY::init_PM { package MY; # so that "SUPER" works right my ($self) = @_; $self->SUPER::init_PM; @pd_srcs = ::pdlpp_eumm_update_deep($self); } sub MY::postamble { ::pdlpp_postamble(@pd_srcs); }