File: Integration.pm.1.15

package info (click to toggle)
libmath-gsl-perl 0.45-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 192,156 kB
  • sloc: ansic: 895,524; perl: 24,682; makefile: 12
file content (843 lines) | stat: -rw-r--r-- 31,867 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
# This file was automatically generated by SWIG (https://www.swig.org).
# Version 4.2.0
#
# Do not make changes to this file unless you know what you are doing - modify
# the SWIG interface file instead.

package Math::GSL::Integration;
use base qw(Exporter);
use base qw(DynaLoader);
package Math::GSL::Integrationc;
bootstrap Math::GSL::Integration;
package Math::GSL::Integration;
@EXPORT = qw();

# ---------- BASE METHODS -------------

package Math::GSL::Integration;

sub TIEHASH {
    my ($classname,$obj) = @_;
    return bless $obj, $classname;
}

sub CLEAR { }

sub FIRSTKEY { }

sub NEXTKEY { }

sub FETCH {
    my ($self,$field) = @_;
    my $member_func = "swig_${field}_get";
    $self->$member_func();
}

sub STORE {
    my ($self,$field,$newval) = @_;
    my $member_func = "swig_${field}_set";
    $self->$member_func($newval);
}

sub this {
    my $ptr = shift;
    return tied(%$ptr);
}


# ------- FUNCTION WRAPPERS --------

package Math::GSL::Integration;

*gsl_error = *Math::GSL::Integrationc::gsl_error;
*gsl_stream_printf = *Math::GSL::Integrationc::gsl_stream_printf;
*gsl_strerror = *Math::GSL::Integrationc::gsl_strerror;
*gsl_set_error_handler = *Math::GSL::Integrationc::gsl_set_error_handler;
*gsl_set_error_handler_off = *Math::GSL::Integrationc::gsl_set_error_handler_off;
*gsl_set_stream_handler = *Math::GSL::Integrationc::gsl_set_stream_handler;
*gsl_set_stream = *Math::GSL::Integrationc::gsl_set_stream;
*gsl_integration_workspace_alloc = *Math::GSL::Integrationc::gsl_integration_workspace_alloc;
*gsl_integration_workspace_free = *Math::GSL::Integrationc::gsl_integration_workspace_free;
*gsl_integration_qaws_table_alloc = *Math::GSL::Integrationc::gsl_integration_qaws_table_alloc;
*gsl_integration_qaws_table_set = *Math::GSL::Integrationc::gsl_integration_qaws_table_set;
*gsl_integration_qaws_table_free = *Math::GSL::Integrationc::gsl_integration_qaws_table_free;
*gsl_integration_qawo_table_alloc = *Math::GSL::Integrationc::gsl_integration_qawo_table_alloc;
*gsl_integration_qawo_table_set = *Math::GSL::Integrationc::gsl_integration_qawo_table_set;
*gsl_integration_qawo_table_set_length = *Math::GSL::Integrationc::gsl_integration_qawo_table_set_length;
*gsl_integration_qawo_table_free = *Math::GSL::Integrationc::gsl_integration_qawo_table_free;
*gsl_integration_qk15 = *Math::GSL::Integrationc::gsl_integration_qk15;
*gsl_integration_qk21 = *Math::GSL::Integrationc::gsl_integration_qk21;
*gsl_integration_qk31 = *Math::GSL::Integrationc::gsl_integration_qk31;
*gsl_integration_qk41 = *Math::GSL::Integrationc::gsl_integration_qk41;
*gsl_integration_qk51 = *Math::GSL::Integrationc::gsl_integration_qk51;
*gsl_integration_qk61 = *Math::GSL::Integrationc::gsl_integration_qk61;
*gsl_integration_qcheb = *Math::GSL::Integrationc::gsl_integration_qcheb;
*gsl_integration_qk = *Math::GSL::Integrationc::gsl_integration_qk;
*gsl_integration_qng = *Math::GSL::Integrationc::gsl_integration_qng;
*gsl_integration_qag = *Math::GSL::Integrationc::gsl_integration_qag;
*gsl_integration_qagi = *Math::GSL::Integrationc::gsl_integration_qagi;
*gsl_integration_qagiu = *Math::GSL::Integrationc::gsl_integration_qagiu;
*gsl_integration_qagil = *Math::GSL::Integrationc::gsl_integration_qagil;
*gsl_integration_qags = *Math::GSL::Integrationc::gsl_integration_qags;
*gsl_integration_qagp = *Math::GSL::Integrationc::gsl_integration_qagp;
*gsl_integration_qawc = *Math::GSL::Integrationc::gsl_integration_qawc;
*gsl_integration_qaws = *Math::GSL::Integrationc::gsl_integration_qaws;
*gsl_integration_qawo = *Math::GSL::Integrationc::gsl_integration_qawo;
*gsl_integration_qawf = *Math::GSL::Integrationc::gsl_integration_qawf;
*gsl_integration_glfixed_table_alloc = *Math::GSL::Integrationc::gsl_integration_glfixed_table_alloc;
*gsl_integration_glfixed_table_free = *Math::GSL::Integrationc::gsl_integration_glfixed_table_free;
*gsl_integration_glfixed = *Math::GSL::Integrationc::gsl_integration_glfixed;
*gsl_integration_glfixed_point = *Math::GSL::Integrationc::gsl_integration_glfixed_point;
*gsl_integration_cquad_workspace_alloc = *Math::GSL::Integrationc::gsl_integration_cquad_workspace_alloc;
*gsl_integration_cquad_workspace_free = *Math::GSL::Integrationc::gsl_integration_cquad_workspace_free;
*gsl_integration_cquad = *Math::GSL::Integrationc::gsl_integration_cquad;

############# Class : Math::GSL::Integration::gsl_integration_workspace ##############

package Math::GSL::Integration::gsl_integration_workspace;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( Math::GSL::Integration );
%OWNER = ();
%ITERATORS = ();
*swig_limit_get = *Math::GSL::Integrationc::gsl_integration_workspace_limit_get;
*swig_limit_set = *Math::GSL::Integrationc::gsl_integration_workspace_limit_set;
*swig_size_get = *Math::GSL::Integrationc::gsl_integration_workspace_size_get;
*swig_size_set = *Math::GSL::Integrationc::gsl_integration_workspace_size_set;
*swig_nrmax_get = *Math::GSL::Integrationc::gsl_integration_workspace_nrmax_get;
*swig_nrmax_set = *Math::GSL::Integrationc::gsl_integration_workspace_nrmax_set;
*swig_i_get = *Math::GSL::Integrationc::gsl_integration_workspace_i_get;
*swig_i_set = *Math::GSL::Integrationc::gsl_integration_workspace_i_set;
*swig_maximum_level_get = *Math::GSL::Integrationc::gsl_integration_workspace_maximum_level_get;
*swig_maximum_level_set = *Math::GSL::Integrationc::gsl_integration_workspace_maximum_level_set;
*swig_alist_get = *Math::GSL::Integrationc::gsl_integration_workspace_alist_get;
*swig_alist_set = *Math::GSL::Integrationc::gsl_integration_workspace_alist_set;
*swig_blist_get = *Math::GSL::Integrationc::gsl_integration_workspace_blist_get;
*swig_blist_set = *Math::GSL::Integrationc::gsl_integration_workspace_blist_set;
*swig_rlist_get = *Math::GSL::Integrationc::gsl_integration_workspace_rlist_get;
*swig_rlist_set = *Math::GSL::Integrationc::gsl_integration_workspace_rlist_set;
*swig_elist_get = *Math::GSL::Integrationc::gsl_integration_workspace_elist_get;
*swig_elist_set = *Math::GSL::Integrationc::gsl_integration_workspace_elist_set;
*swig_order_get = *Math::GSL::Integrationc::gsl_integration_workspace_order_get;
*swig_order_set = *Math::GSL::Integrationc::gsl_integration_workspace_order_set;
*swig_level_get = *Math::GSL::Integrationc::gsl_integration_workspace_level_get;
*swig_level_set = *Math::GSL::Integrationc::gsl_integration_workspace_level_set;
sub new {
    my $pkg = shift;
    my $self = Math::GSL::Integrationc::new_gsl_integration_workspace(@_);
    bless $self, $pkg if defined($self);
}

sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        Math::GSL::Integrationc::delete_gsl_integration_workspace($self);
        delete $OWNER{$self};
    }
}

sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : Math::GSL::Integration::gsl_integration_qaws_table ##############

package Math::GSL::Integration::gsl_integration_qaws_table;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( Math::GSL::Integration );
%OWNER = ();
%ITERATORS = ();
*swig_alpha_get = *Math::GSL::Integrationc::gsl_integration_qaws_table_alpha_get;
*swig_alpha_set = *Math::GSL::Integrationc::gsl_integration_qaws_table_alpha_set;
*swig_beta_get = *Math::GSL::Integrationc::gsl_integration_qaws_table_beta_get;
*swig_beta_set = *Math::GSL::Integrationc::gsl_integration_qaws_table_beta_set;
*swig_mu_get = *Math::GSL::Integrationc::gsl_integration_qaws_table_mu_get;
*swig_mu_set = *Math::GSL::Integrationc::gsl_integration_qaws_table_mu_set;
*swig_nu_get = *Math::GSL::Integrationc::gsl_integration_qaws_table_nu_get;
*swig_nu_set = *Math::GSL::Integrationc::gsl_integration_qaws_table_nu_set;
*swig_ri_get = *Math::GSL::Integrationc::gsl_integration_qaws_table_ri_get;
*swig_ri_set = *Math::GSL::Integrationc::gsl_integration_qaws_table_ri_set;
*swig_rj_get = *Math::GSL::Integrationc::gsl_integration_qaws_table_rj_get;
*swig_rj_set = *Math::GSL::Integrationc::gsl_integration_qaws_table_rj_set;
*swig_rg_get = *Math::GSL::Integrationc::gsl_integration_qaws_table_rg_get;
*swig_rg_set = *Math::GSL::Integrationc::gsl_integration_qaws_table_rg_set;
*swig_rh_get = *Math::GSL::Integrationc::gsl_integration_qaws_table_rh_get;
*swig_rh_set = *Math::GSL::Integrationc::gsl_integration_qaws_table_rh_set;
sub new {
    my $pkg = shift;
    my $self = Math::GSL::Integrationc::new_gsl_integration_qaws_table(@_);
    bless $self, $pkg if defined($self);
}

sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        Math::GSL::Integrationc::delete_gsl_integration_qaws_table($self);
        delete $OWNER{$self};
    }
}

sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : Math::GSL::Integration::gsl_integration_qawo_table ##############

package Math::GSL::Integration::gsl_integration_qawo_table;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( Math::GSL::Integration );
%OWNER = ();
%ITERATORS = ();
*swig_n_get = *Math::GSL::Integrationc::gsl_integration_qawo_table_n_get;
*swig_n_set = *Math::GSL::Integrationc::gsl_integration_qawo_table_n_set;
*swig_omega_get = *Math::GSL::Integrationc::gsl_integration_qawo_table_omega_get;
*swig_omega_set = *Math::GSL::Integrationc::gsl_integration_qawo_table_omega_set;
*swig_L_get = *Math::GSL::Integrationc::gsl_integration_qawo_table_L_get;
*swig_L_set = *Math::GSL::Integrationc::gsl_integration_qawo_table_L_set;
*swig_par_get = *Math::GSL::Integrationc::gsl_integration_qawo_table_par_get;
*swig_par_set = *Math::GSL::Integrationc::gsl_integration_qawo_table_par_set;
*swig_sine_get = *Math::GSL::Integrationc::gsl_integration_qawo_table_sine_get;
*swig_sine_set = *Math::GSL::Integrationc::gsl_integration_qawo_table_sine_set;
*swig_chebmo_get = *Math::GSL::Integrationc::gsl_integration_qawo_table_chebmo_get;
*swig_chebmo_set = *Math::GSL::Integrationc::gsl_integration_qawo_table_chebmo_set;
sub new {
    my $pkg = shift;
    my $self = Math::GSL::Integrationc::new_gsl_integration_qawo_table(@_);
    bless $self, $pkg if defined($self);
}

sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        Math::GSL::Integrationc::delete_gsl_integration_qawo_table($self);
        delete $OWNER{$self};
    }
}

sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : Math::GSL::Integration::gsl_integration_glfixed_table ##############

package Math::GSL::Integration::gsl_integration_glfixed_table;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( Math::GSL::Integration );
%OWNER = ();
%ITERATORS = ();
*swig_n_get = *Math::GSL::Integrationc::gsl_integration_glfixed_table_n_get;
*swig_n_set = *Math::GSL::Integrationc::gsl_integration_glfixed_table_n_set;
*swig_x_get = *Math::GSL::Integrationc::gsl_integration_glfixed_table_x_get;
*swig_x_set = *Math::GSL::Integrationc::gsl_integration_glfixed_table_x_set;
*swig_w_get = *Math::GSL::Integrationc::gsl_integration_glfixed_table_w_get;
*swig_w_set = *Math::GSL::Integrationc::gsl_integration_glfixed_table_w_set;
*swig_precomputed_get = *Math::GSL::Integrationc::gsl_integration_glfixed_table_precomputed_get;
*swig_precomputed_set = *Math::GSL::Integrationc::gsl_integration_glfixed_table_precomputed_set;
sub new {
    my $pkg = shift;
    my $self = Math::GSL::Integrationc::new_gsl_integration_glfixed_table(@_);
    bless $self, $pkg if defined($self);
}

sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        Math::GSL::Integrationc::delete_gsl_integration_glfixed_table($self);
        delete $OWNER{$self};
    }
}

sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : Math::GSL::Integration::gsl_integration_cquad_ival ##############

package Math::GSL::Integration::gsl_integration_cquad_ival;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( Math::GSL::Integration );
%OWNER = ();
%ITERATORS = ();
*swig_a_get = *Math::GSL::Integrationc::gsl_integration_cquad_ival_a_get;
*swig_a_set = *Math::GSL::Integrationc::gsl_integration_cquad_ival_a_set;
*swig_b_get = *Math::GSL::Integrationc::gsl_integration_cquad_ival_b_get;
*swig_b_set = *Math::GSL::Integrationc::gsl_integration_cquad_ival_b_set;
*swig_c_get = *Math::GSL::Integrationc::gsl_integration_cquad_ival_c_get;
*swig_c_set = *Math::GSL::Integrationc::gsl_integration_cquad_ival_c_set;
*swig_fx_get = *Math::GSL::Integrationc::gsl_integration_cquad_ival_fx_get;
*swig_fx_set = *Math::GSL::Integrationc::gsl_integration_cquad_ival_fx_set;
*swig_igral_get = *Math::GSL::Integrationc::gsl_integration_cquad_ival_igral_get;
*swig_igral_set = *Math::GSL::Integrationc::gsl_integration_cquad_ival_igral_set;
*swig_err_get = *Math::GSL::Integrationc::gsl_integration_cquad_ival_err_get;
*swig_err_set = *Math::GSL::Integrationc::gsl_integration_cquad_ival_err_set;
*swig_depth_get = *Math::GSL::Integrationc::gsl_integration_cquad_ival_depth_get;
*swig_depth_set = *Math::GSL::Integrationc::gsl_integration_cquad_ival_depth_set;
*swig_rdepth_get = *Math::GSL::Integrationc::gsl_integration_cquad_ival_rdepth_get;
*swig_rdepth_set = *Math::GSL::Integrationc::gsl_integration_cquad_ival_rdepth_set;
*swig_ndiv_get = *Math::GSL::Integrationc::gsl_integration_cquad_ival_ndiv_get;
*swig_ndiv_set = *Math::GSL::Integrationc::gsl_integration_cquad_ival_ndiv_set;
sub new {
    my $pkg = shift;
    my $self = Math::GSL::Integrationc::new_gsl_integration_cquad_ival(@_);
    bless $self, $pkg if defined($self);
}

sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        Math::GSL::Integrationc::delete_gsl_integration_cquad_ival($self);
        delete $OWNER{$self};
    }
}

sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : Math::GSL::Integration::gsl_integration_cquad_workspace ##############

package Math::GSL::Integration::gsl_integration_cquad_workspace;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( Math::GSL::Integration );
%OWNER = ();
%ITERATORS = ();
*swig_size_get = *Math::GSL::Integrationc::gsl_integration_cquad_workspace_size_get;
*swig_size_set = *Math::GSL::Integrationc::gsl_integration_cquad_workspace_size_set;
*swig_ivals_get = *Math::GSL::Integrationc::gsl_integration_cquad_workspace_ivals_get;
*swig_ivals_set = *Math::GSL::Integrationc::gsl_integration_cquad_workspace_ivals_set;
*swig_heap_get = *Math::GSL::Integrationc::gsl_integration_cquad_workspace_heap_get;
*swig_heap_set = *Math::GSL::Integrationc::gsl_integration_cquad_workspace_heap_set;
sub new {
    my $pkg = shift;
    my $self = Math::GSL::Integrationc::new_gsl_integration_cquad_workspace(@_);
    bless $self, $pkg if defined($self);
}

sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        Math::GSL::Integrationc::delete_gsl_integration_cquad_workspace($self);
        delete $OWNER{$self};
    }
}

sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : Math::GSL::Integration::gsl_function_struct ##############

package Math::GSL::Integration::gsl_function_struct;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( Math::GSL::Integration );
%OWNER = ();
%ITERATORS = ();
*swig_function_get = *Math::GSL::Integrationc::gsl_function_struct_function_get;
*swig_function_set = *Math::GSL::Integrationc::gsl_function_struct_function_set;
*swig_params_get = *Math::GSL::Integrationc::gsl_function_struct_params_get;
*swig_params_set = *Math::GSL::Integrationc::gsl_function_struct_params_set;
sub new {
    my $pkg = shift;
    my $self = Math::GSL::Integrationc::new_gsl_function_struct(@_);
    bless $self, $pkg if defined($self);
}

sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        Math::GSL::Integrationc::delete_gsl_function_struct($self);
        delete $OWNER{$self};
    }
}

sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : Math::GSL::Integration::gsl_function_fdf_struct ##############

package Math::GSL::Integration::gsl_function_fdf_struct;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( Math::GSL::Integration );
%OWNER = ();
%ITERATORS = ();
*swig_f_get = *Math::GSL::Integrationc::gsl_function_fdf_struct_f_get;
*swig_f_set = *Math::GSL::Integrationc::gsl_function_fdf_struct_f_set;
*swig_df_get = *Math::GSL::Integrationc::gsl_function_fdf_struct_df_get;
*swig_df_set = *Math::GSL::Integrationc::gsl_function_fdf_struct_df_set;
*swig_fdf_get = *Math::GSL::Integrationc::gsl_function_fdf_struct_fdf_get;
*swig_fdf_set = *Math::GSL::Integrationc::gsl_function_fdf_struct_fdf_set;
*swig_params_get = *Math::GSL::Integrationc::gsl_function_fdf_struct_params_get;
*swig_params_set = *Math::GSL::Integrationc::gsl_function_fdf_struct_params_set;
sub new {
    my $pkg = shift;
    my $self = Math::GSL::Integrationc::new_gsl_function_fdf_struct(@_);
    bless $self, $pkg if defined($self);
}

sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        Math::GSL::Integrationc::delete_gsl_function_fdf_struct($self);
        delete $OWNER{$self};
    }
}

sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : Math::GSL::Integration::gsl_function_vec_struct ##############

package Math::GSL::Integration::gsl_function_vec_struct;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( Math::GSL::Integration );
%OWNER = ();
%ITERATORS = ();
*swig_function_get = *Math::GSL::Integrationc::gsl_function_vec_struct_function_get;
*swig_function_set = *Math::GSL::Integrationc::gsl_function_vec_struct_function_set;
*swig_params_get = *Math::GSL::Integrationc::gsl_function_vec_struct_params_get;
*swig_params_set = *Math::GSL::Integrationc::gsl_function_vec_struct_params_set;
sub new {
    my $pkg = shift;
    my $self = Math::GSL::Integrationc::new_gsl_function_vec_struct(@_);
    bless $self, $pkg if defined($self);
}

sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        Math::GSL::Integrationc::delete_gsl_function_vec_struct($self);
        delete $OWNER{$self};
    }
}

sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


# ------- VARIABLE STUBS --------

package Math::GSL::Integration;

*GSL_VERSION = *Math::GSL::Integrationc::GSL_VERSION;
*GSL_MAJOR_VERSION = *Math::GSL::Integrationc::GSL_MAJOR_VERSION;
*GSL_MINOR_VERSION = *Math::GSL::Integrationc::GSL_MINOR_VERSION;
*GSL_POSZERO = *Math::GSL::Integrationc::GSL_POSZERO;
*GSL_NEGZERO = *Math::GSL::Integrationc::GSL_NEGZERO;
*GSL_SUCCESS = *Math::GSL::Integrationc::GSL_SUCCESS;
*GSL_FAILURE = *Math::GSL::Integrationc::GSL_FAILURE;
*GSL_CONTINUE = *Math::GSL::Integrationc::GSL_CONTINUE;
*GSL_EDOM = *Math::GSL::Integrationc::GSL_EDOM;
*GSL_ERANGE = *Math::GSL::Integrationc::GSL_ERANGE;
*GSL_EFAULT = *Math::GSL::Integrationc::GSL_EFAULT;
*GSL_EINVAL = *Math::GSL::Integrationc::GSL_EINVAL;
*GSL_EFAILED = *Math::GSL::Integrationc::GSL_EFAILED;
*GSL_EFACTOR = *Math::GSL::Integrationc::GSL_EFACTOR;
*GSL_ESANITY = *Math::GSL::Integrationc::GSL_ESANITY;
*GSL_ENOMEM = *Math::GSL::Integrationc::GSL_ENOMEM;
*GSL_EBADFUNC = *Math::GSL::Integrationc::GSL_EBADFUNC;
*GSL_ERUNAWAY = *Math::GSL::Integrationc::GSL_ERUNAWAY;
*GSL_EMAXITER = *Math::GSL::Integrationc::GSL_EMAXITER;
*GSL_EZERODIV = *Math::GSL::Integrationc::GSL_EZERODIV;
*GSL_EBADTOL = *Math::GSL::Integrationc::GSL_EBADTOL;
*GSL_ETOL = *Math::GSL::Integrationc::GSL_ETOL;
*GSL_EUNDRFLW = *Math::GSL::Integrationc::GSL_EUNDRFLW;
*GSL_EOVRFLW = *Math::GSL::Integrationc::GSL_EOVRFLW;
*GSL_ELOSS = *Math::GSL::Integrationc::GSL_ELOSS;
*GSL_EROUND = *Math::GSL::Integrationc::GSL_EROUND;
*GSL_EBADLEN = *Math::GSL::Integrationc::GSL_EBADLEN;
*GSL_ENOTSQR = *Math::GSL::Integrationc::GSL_ENOTSQR;
*GSL_ESING = *Math::GSL::Integrationc::GSL_ESING;
*GSL_EDIVERGE = *Math::GSL::Integrationc::GSL_EDIVERGE;
*GSL_EUNSUP = *Math::GSL::Integrationc::GSL_EUNSUP;
*GSL_EUNIMPL = *Math::GSL::Integrationc::GSL_EUNIMPL;
*GSL_ECACHE = *Math::GSL::Integrationc::GSL_ECACHE;
*GSL_ETABLE = *Math::GSL::Integrationc::GSL_ETABLE;
*GSL_ENOPROG = *Math::GSL::Integrationc::GSL_ENOPROG;
*GSL_ENOPROGJ = *Math::GSL::Integrationc::GSL_ENOPROGJ;
*GSL_ETOLF = *Math::GSL::Integrationc::GSL_ETOLF;
*GSL_ETOLX = *Math::GSL::Integrationc::GSL_ETOLX;
*GSL_ETOLG = *Math::GSL::Integrationc::GSL_ETOLG;
*GSL_EOF = *Math::GSL::Integrationc::GSL_EOF;
*GSL_INTEG_COSINE = *Math::GSL::Integrationc::GSL_INTEG_COSINE;
*GSL_INTEG_SINE = *Math::GSL::Integrationc::GSL_INTEG_SINE;
*GSL_INTEG_GAUSS15 = *Math::GSL::Integrationc::GSL_INTEG_GAUSS15;
*GSL_INTEG_GAUSS21 = *Math::GSL::Integrationc::GSL_INTEG_GAUSS21;
*GSL_INTEG_GAUSS31 = *Math::GSL::Integrationc::GSL_INTEG_GAUSS31;
*GSL_INTEG_GAUSS41 = *Math::GSL::Integrationc::GSL_INTEG_GAUSS41;
*GSL_INTEG_GAUSS51 = *Math::GSL::Integrationc::GSL_INTEG_GAUSS51;
*GSL_INTEG_GAUSS61 = *Math::GSL::Integrationc::GSL_INTEG_GAUSS61;
*M_E = *Math::GSL::Integrationc::M_E;
*M_LOG2E = *Math::GSL::Integrationc::M_LOG2E;
*M_LOG10E = *Math::GSL::Integrationc::M_LOG10E;
*M_SQRT2 = *Math::GSL::Integrationc::M_SQRT2;
*M_SQRT1_2 = *Math::GSL::Integrationc::M_SQRT1_2;
*M_SQRT3 = *Math::GSL::Integrationc::M_SQRT3;
*M_PI = *Math::GSL::Integrationc::M_PI;
*M_PI_2 = *Math::GSL::Integrationc::M_PI_2;
*M_PI_4 = *Math::GSL::Integrationc::M_PI_4;
*M_SQRTPI = *Math::GSL::Integrationc::M_SQRTPI;
*M_2_SQRTPI = *Math::GSL::Integrationc::M_2_SQRTPI;
*M_1_PI = *Math::GSL::Integrationc::M_1_PI;
*M_2_PI = *Math::GSL::Integrationc::M_2_PI;
*M_LN10 = *Math::GSL::Integrationc::M_LN10;
*M_LN2 = *Math::GSL::Integrationc::M_LN2;
*M_LNPI = *Math::GSL::Integrationc::M_LNPI;
*M_EULER = *Math::GSL::Integrationc::M_EULER;

@EXPORT_OK = qw/
               gsl_integration_workspace_alloc
               gsl_integration_workspace_free
               gsl_integration_qaws_table_alloc
               gsl_integration_qaws_table_set
               gsl_integration_qaws_table_free
               gsl_integration_qawo_table_alloc
               gsl_integration_qawo_table_set
               gsl_integration_qawo_table_set_length
               gsl_integration_qawo_table_free
               gsl_integration_qk15
               gsl_integration_qk21
               gsl_integration_qk31
               gsl_integration_qk41
               gsl_integration_qk51
               gsl_integration_qk61
               gsl_integration_qcheb
               gsl_integration_qk
               gsl_integration_qng
               gsl_integration_qag
               gsl_integration_qagi
               gsl_integration_qagiu
               gsl_integration_qagil
               gsl_integration_qags
               gsl_integration_qagp
               gsl_integration_qawc
               gsl_integration_qaws
               gsl_integration_qawo
               gsl_integration_qawf
               $GSL_INTEG_COSINE
               $GSL_INTEG_SINE
               $GSL_INTEG_GAUSS15
               $GSL_INTEG_GAUSS21
               $GSL_INTEG_GAUSS31
               $GSL_INTEG_GAUSS41
               $GSL_INTEG_GAUSS51
               $GSL_INTEG_GAUSS61
             /;
%EXPORT_TAGS = ( all => [ @EXPORT_OK ] );

__END__

=encoding utf8

=head1 NAME

Math::GSL::Integration - Routines for performing numerical integration (quadrature) of a function in one dimension

=head1 SYNOPSIS

    use Math::GSL::Integration qw /:all/;

    my $function = sub { $_[0]**2 } ;
    my ($lower, $upper ) = (0,1);
    my ($relerr,$abserr) = (0,1e-7);

    my ($status, $result, $abserr, $num_evals) = gsl_integration_qng ( $function,
                                                    $lower, $upper, $relerr, $abserr
                                                 );

=head1 DESCRIPTION

This module allows you to numerically integrate a Perl subroutine. Depending
on the properties of your function (singularities, smoothness) and the type
of integration range (finite, infinite, semi-infinite), you will need to
choose a quadrature routine that fits your needs.


=over

=item * C<gsl_integration_workspace_alloc($n)>

This function allocates a workspace sufficient to hold $n double precision
intervals, their integration results and error estimates.

=item * C<gsl_integration_workspace_free($w)>

 This function frees the memory associated with the workspace $w.

=item * C<gsl_integration_qaws_table_alloc($alpha, $beta, $mu, $nu)>

 This function allocates space for a gsl_integration_qaws_table struct
 describing a singular weight function W(x) with the parameters ($alpha, $beta,
 $mu, $nu), W(x) = (x-a)^alpha (b-x)^beta log^mu (x-a) log^nu (b-x) where
 $alpha > -1, $beta > -1, and $mu = 0, 1, $nu = 0, 1. The weight function can
 take four different forms depending on the values of $mu and $nu,

              W(x) = (x-a)^alpha (b-x)^beta                   (mu = 0, nu = 0)
              W(x) = (x-a)^alpha (b-x)^beta log(x-a)          (mu = 1, nu = 0)
              W(x) = (x-a)^alpha (b-x)^beta log(b-x)          (mu = 0, nu = 1)
              W(x) = (x-a)^alpha (b-x)^beta log(x-a) log(b-x) (mu = 1, nu = 1)

The singular points (a,b) do not have to be specified until the integral is
computed, where they are the endpoints of the integration range.  The function
returns a pointer to the newly allocated table gsl_integration_qaws_table if no
errors were detected, and 0 in the case of error.

=item * C<gsl_integration_qaws_table_set($t, $alpha, $beta, $mu, $nu)>

 This function modifies the parameters ($alpha, $beta, $mu, $nu) of an existing
 gsl_integration_qaws_table struct $t.

=item * C<gsl_integration_qaws_table_free($t)>

 This function frees all the memory associated with the
 gsl_integration_qaws_table struct $t.

=item * C<gsl_integration_qawo_table_alloc($omega, $L, $sine, $n)>

=item * C<gsl_integration_qawo_table_set($t, $omega, $L, $sine, $n)>

 This function changes the parameters omega, L and sine of the existing
 workspace $t.

=item * C<gsl_integration_qawo_table_set_length($t, $L)>

 This function allows the length parameter $L of the workspace $t to be
 changed.

=item * C<gsl_integration_qawo_table_free($t)>

 This function frees all the memory associated with the workspace $t.

=item * C<gsl_integration_qk15($function,$a,$b,$resabs,$resasc) >

=item * C<gsl_integration_qk21($function,$a,$b,$resabs,$resasc) >

=item * C<gsl_integration_qk31($function,$a,$b,$resabs,$resasc) >

=item * C<gsl_integration_qk41($function,$a,$b,$resabs,$resasc) >

=item * C<gsl_integration_qk51($function,$a,$b,$resabs,$resasc) >

=item * C<gsl_integration_qk61($function,$a,$b,$resabs,$resasc) >

=item * C<gsl_integration_qcheb($function, $a, $b, $cheb12, $cheb24) >

=item * C<gsl_integration_qk >

=item * C<gsl_integration_qng($function,$a,$b,$epsabs,$epsrel,$num_evals) >

This routine QNG (Quadrature Non-Adaptive Gaussian) is inexpensive is the sense
that it will evaluate the function much fewer times than the adaptive routines.
Because of this it does not need any workspaces, so it is also more memory
efficient. It should be perfectly fine for well-behaved functions (smooth and
nonsingular), but will not be able to get the required accuracy or may not
converge for more complicated functions.

=item * C<gsl_integration_qag($function,$a,$b,$epsabs,$epsrel,$limit,$key,$workspace) >

This routine QAG (Quadrature Adaptive Gaussian) ...

=item * C<gsl_integration_qagi($function,$epsabs,$epsrel,$limit,$workspace) >

=item * C<gsl_integration_qagiu($function,$a,$epsabs,$epsrel,$limit,$workspace) >

=item * C<gsl_integration_qagil($function,$b,$epsabs,$epsrel,$limit,$workspace) >

=item * C<gsl_integration_qags($func,$a,$b,$epsabs,$epsrel,$limit,$workspace)>

    ($status, $result, $abserr) = gsl_integration_qags (
                            sub { 1/$_[0]} ,
                            1, 10, 0, 1e-7, 1000,
                            $workspace,
                        );

 This function applies the Gauss-Kronrod 21-point integration rule
 adaptively until an estimate of the integral of $func over ($a,$b) is
 achieved within the desired absolute and relative error limits,
 $epsabs and $epsrel.


=item * C<gsl_integration_qagp($function, $pts, $npts, $epsbs, $epsrel, $limit, $workspace) >

=item * C<gsl_integration_qawc($function, $a, $b, $c, $epsabs, $epsrel, $limit, $workspace) >

=item * C<gsl_integration_qaws($function, $a, $b, $qaws_table, $epsabs, $epsrel, $limit, $workspace) >

=item * C<gsl_integration_qawo($function, $a, $epsabs, $epsrel, $limit, $workspace, $qawo_table) >

=item * C<gsl_integration_qawf($function, $a, $epsabs, $limit, $workspace, $cycle_workspace, $qawo_table) >

=back

This module also includes the following constants :

=over

=item * $GSL_INTEG_COSINE

=item * $GSL_INTEG_SINE

=item * $GSL_INTEG_GAUSS15

=item * $GSL_INTEG_GAUSS21

=item * $GSL_INTEG_GAUSS31

=item * $GSL_INTEG_GAUSS41

=item * $GSL_INTEG_GAUSS51

=item * $GSL_INTEG_GAUSS61

=back

The following error constants are part of the Math::GSL::Errno module and can
be returned by the gsl_integration_* functions :

=over

=item * $GSL_EMAXITER

Maximum number of subdivisions was exceeded.

=item * $GSL_EROUND

Cannot reach tolerance because of roundoff error, or roundoff error was detected in the extrapolation table.

=item * GSL_ESING

A non-integrable singularity or other bad integrand behavior was found in the integration interval.

=item * GSL_EDIVERGE

The integral is divergent, or too slowly convergent to be integrated numerically.

=back

=head1 MORE INFO

For more information on the functions, we refer you to the GSL official
documentation: L<http://www.gnu.org/software/gsl/manual/html_node/>

=head1 AUTHORS

Jonathan "Duke" Leto <jonathan@leto.net> and Thierry Moisan <thierry.moisan@gmail.com>

=head1 COPYRIGHT AND LICENSE

Copyright (C) 2008-2024 Jonathan "Duke" Leto and Thierry Moisan

This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.

=cut

1;