1# This file was automatically generated by SWIG (http://www.swig.org). 2# Version 4.0.1 3# 4# Do not make changes to this file unless you know what you are doing--modify 5# the SWIG interface file instead. 6 7package Math::GSL::BSpline; 8use base qw(Exporter); 9use base qw(DynaLoader); 10package Math::GSL::BSplinec; 11bootstrap Math::GSL::BSpline; 12package Math::GSL::BSpline; 13@EXPORT = qw(); 14 15# ---------- BASE METHODS ------------- 16 17package Math::GSL::BSpline; 18 19sub TIEHASH { 20 my ($classname,$obj) = @_; 21 return bless $obj, $classname; 22} 23 24sub CLEAR { } 25 26sub FIRSTKEY { } 27 28sub NEXTKEY { } 29 30sub FETCH { 31 my ($self,$field) = @_; 32 my $member_func = "swig_${field}_get"; 33 $self->$member_func(); 34} 35 36sub STORE { 37 my ($self,$field,$newval) = @_; 38 my $member_func = "swig_${field}_set"; 39 $self->$member_func($newval); 40} 41 42sub this { 43 my $ptr = shift; 44 return tied(%$ptr); 45} 46 47 48# ------- FUNCTION WRAPPERS -------- 49 50package Math::GSL::BSpline; 51 52*gsl_error = *Math::GSL::BSplinec::gsl_error; 53*gsl_stream_printf = *Math::GSL::BSplinec::gsl_stream_printf; 54*gsl_strerror = *Math::GSL::BSplinec::gsl_strerror; 55*gsl_set_error_handler = *Math::GSL::BSplinec::gsl_set_error_handler; 56*gsl_set_error_handler_off = *Math::GSL::BSplinec::gsl_set_error_handler_off; 57*gsl_set_stream_handler = *Math::GSL::BSplinec::gsl_set_stream_handler; 58*gsl_set_stream = *Math::GSL::BSplinec::gsl_set_stream; 59*gsl_bspline_alloc = *Math::GSL::BSplinec::gsl_bspline_alloc; 60*gsl_bspline_free = *Math::GSL::BSplinec::gsl_bspline_free; 61*gsl_bspline_ncoeffs = *Math::GSL::BSplinec::gsl_bspline_ncoeffs; 62*gsl_bspline_order = *Math::GSL::BSplinec::gsl_bspline_order; 63*gsl_bspline_nbreak = *Math::GSL::BSplinec::gsl_bspline_nbreak; 64*gsl_bspline_breakpoint = *Math::GSL::BSplinec::gsl_bspline_breakpoint; 65*gsl_bspline_greville_abscissa = *Math::GSL::BSplinec::gsl_bspline_greville_abscissa; 66*gsl_bspline_knots = *Math::GSL::BSplinec::gsl_bspline_knots; 67*gsl_bspline_knots_uniform = *Math::GSL::BSplinec::gsl_bspline_knots_uniform; 68*gsl_bspline_knots_greville = *Math::GSL::BSplinec::gsl_bspline_knots_greville; 69*gsl_bspline_eval = *Math::GSL::BSplinec::gsl_bspline_eval; 70*gsl_bspline_eval_nonzero = *Math::GSL::BSplinec::gsl_bspline_eval_nonzero; 71*gsl_bspline_deriv_eval = *Math::GSL::BSplinec::gsl_bspline_deriv_eval; 72*gsl_bspline_deriv_eval_nonzero = *Math::GSL::BSplinec::gsl_bspline_deriv_eval_nonzero; 73 74############# Class : Math::GSL::BSpline::gsl_function_struct ############## 75 76package Math::GSL::BSpline::gsl_function_struct; 77use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS); 78@ISA = qw( Math::GSL::BSpline ); 79%OWNER = (); 80%ITERATORS = (); 81*swig_function_get = *Math::GSL::BSplinec::gsl_function_struct_function_get; 82*swig_function_set = *Math::GSL::BSplinec::gsl_function_struct_function_set; 83*swig_params_get = *Math::GSL::BSplinec::gsl_function_struct_params_get; 84*swig_params_set = *Math::GSL::BSplinec::gsl_function_struct_params_set; 85sub new { 86 my $pkg = shift; 87 my $self = Math::GSL::BSplinec::new_gsl_function_struct(@_); 88 bless $self, $pkg if defined($self); 89} 90 91sub DESTROY { 92 return unless $_[0]->isa('HASH'); 93 my $self = tied(%{$_[0]}); 94 return unless defined $self; 95 delete $ITERATORS{$self}; 96 if (exists $OWNER{$self}) { 97 Math::GSL::BSplinec::delete_gsl_function_struct($self); 98 delete $OWNER{$self}; 99 } 100} 101 102sub DISOWN { 103 my $self = shift; 104 my $ptr = tied(%$self); 105 delete $OWNER{$ptr}; 106} 107 108sub ACQUIRE { 109 my $self = shift; 110 my $ptr = tied(%$self); 111 $OWNER{$ptr} = 1; 112} 113 114 115############# Class : Math::GSL::BSpline::gsl_function_fdf_struct ############## 116 117package Math::GSL::BSpline::gsl_function_fdf_struct; 118use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS); 119@ISA = qw( Math::GSL::BSpline ); 120%OWNER = (); 121%ITERATORS = (); 122*swig_f_get = *Math::GSL::BSplinec::gsl_function_fdf_struct_f_get; 123*swig_f_set = *Math::GSL::BSplinec::gsl_function_fdf_struct_f_set; 124*swig_df_get = *Math::GSL::BSplinec::gsl_function_fdf_struct_df_get; 125*swig_df_set = *Math::GSL::BSplinec::gsl_function_fdf_struct_df_set; 126*swig_fdf_get = *Math::GSL::BSplinec::gsl_function_fdf_struct_fdf_get; 127*swig_fdf_set = *Math::GSL::BSplinec::gsl_function_fdf_struct_fdf_set; 128*swig_params_get = *Math::GSL::BSplinec::gsl_function_fdf_struct_params_get; 129*swig_params_set = *Math::GSL::BSplinec::gsl_function_fdf_struct_params_set; 130sub new { 131 my $pkg = shift; 132 my $self = Math::GSL::BSplinec::new_gsl_function_fdf_struct(@_); 133 bless $self, $pkg if defined($self); 134} 135 136sub DESTROY { 137 return unless $_[0]->isa('HASH'); 138 my $self = tied(%{$_[0]}); 139 return unless defined $self; 140 delete $ITERATORS{$self}; 141 if (exists $OWNER{$self}) { 142 Math::GSL::BSplinec::delete_gsl_function_fdf_struct($self); 143 delete $OWNER{$self}; 144 } 145} 146 147sub DISOWN { 148 my $self = shift; 149 my $ptr = tied(%$self); 150 delete $OWNER{$ptr}; 151} 152 153sub ACQUIRE { 154 my $self = shift; 155 my $ptr = tied(%$self); 156 $OWNER{$ptr} = 1; 157} 158 159 160############# Class : Math::GSL::BSpline::gsl_function_vec_struct ############## 161 162package Math::GSL::BSpline::gsl_function_vec_struct; 163use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS); 164@ISA = qw( Math::GSL::BSpline ); 165%OWNER = (); 166%ITERATORS = (); 167*swig_function_get = *Math::GSL::BSplinec::gsl_function_vec_struct_function_get; 168*swig_function_set = *Math::GSL::BSplinec::gsl_function_vec_struct_function_set; 169*swig_params_get = *Math::GSL::BSplinec::gsl_function_vec_struct_params_get; 170*swig_params_set = *Math::GSL::BSplinec::gsl_function_vec_struct_params_set; 171sub new { 172 my $pkg = shift; 173 my $self = Math::GSL::BSplinec::new_gsl_function_vec_struct(@_); 174 bless $self, $pkg if defined($self); 175} 176 177sub DESTROY { 178 return unless $_[0]->isa('HASH'); 179 my $self = tied(%{$_[0]}); 180 return unless defined $self; 181 delete $ITERATORS{$self}; 182 if (exists $OWNER{$self}) { 183 Math::GSL::BSplinec::delete_gsl_function_vec_struct($self); 184 delete $OWNER{$self}; 185 } 186} 187 188sub DISOWN { 189 my $self = shift; 190 my $ptr = tied(%$self); 191 delete $OWNER{$ptr}; 192} 193 194sub ACQUIRE { 195 my $self = shift; 196 my $ptr = tied(%$self); 197 $OWNER{$ptr} = 1; 198} 199 200 201############# Class : Math::GSL::BSpline::gsl_bspline_workspace ############## 202 203package Math::GSL::BSpline::gsl_bspline_workspace; 204use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS); 205@ISA = qw( Math::GSL::BSpline ); 206%OWNER = (); 207%ITERATORS = (); 208*swig_k_get = *Math::GSL::BSplinec::gsl_bspline_workspace_k_get; 209*swig_k_set = *Math::GSL::BSplinec::gsl_bspline_workspace_k_set; 210*swig_km1_get = *Math::GSL::BSplinec::gsl_bspline_workspace_km1_get; 211*swig_km1_set = *Math::GSL::BSplinec::gsl_bspline_workspace_km1_set; 212*swig_l_get = *Math::GSL::BSplinec::gsl_bspline_workspace_l_get; 213*swig_l_set = *Math::GSL::BSplinec::gsl_bspline_workspace_l_set; 214*swig_nbreak_get = *Math::GSL::BSplinec::gsl_bspline_workspace_nbreak_get; 215*swig_nbreak_set = *Math::GSL::BSplinec::gsl_bspline_workspace_nbreak_set; 216*swig_n_get = *Math::GSL::BSplinec::gsl_bspline_workspace_n_get; 217*swig_n_set = *Math::GSL::BSplinec::gsl_bspline_workspace_n_set; 218*swig_knots_get = *Math::GSL::BSplinec::gsl_bspline_workspace_knots_get; 219*swig_knots_set = *Math::GSL::BSplinec::gsl_bspline_workspace_knots_set; 220*swig_deltal_get = *Math::GSL::BSplinec::gsl_bspline_workspace_deltal_get; 221*swig_deltal_set = *Math::GSL::BSplinec::gsl_bspline_workspace_deltal_set; 222*swig_deltar_get = *Math::GSL::BSplinec::gsl_bspline_workspace_deltar_get; 223*swig_deltar_set = *Math::GSL::BSplinec::gsl_bspline_workspace_deltar_set; 224*swig_B_get = *Math::GSL::BSplinec::gsl_bspline_workspace_B_get; 225*swig_B_set = *Math::GSL::BSplinec::gsl_bspline_workspace_B_set; 226*swig_A_get = *Math::GSL::BSplinec::gsl_bspline_workspace_A_get; 227*swig_A_set = *Math::GSL::BSplinec::gsl_bspline_workspace_A_set; 228*swig_dB_get = *Math::GSL::BSplinec::gsl_bspline_workspace_dB_get; 229*swig_dB_set = *Math::GSL::BSplinec::gsl_bspline_workspace_dB_set; 230sub new { 231 my $pkg = shift; 232 my $self = Math::GSL::BSplinec::new_gsl_bspline_workspace(@_); 233 bless $self, $pkg if defined($self); 234} 235 236sub DESTROY { 237 return unless $_[0]->isa('HASH'); 238 my $self = tied(%{$_[0]}); 239 return unless defined $self; 240 delete $ITERATORS{$self}; 241 if (exists $OWNER{$self}) { 242 Math::GSL::BSplinec::delete_gsl_bspline_workspace($self); 243 delete $OWNER{$self}; 244 } 245} 246 247sub DISOWN { 248 my $self = shift; 249 my $ptr = tied(%$self); 250 delete $OWNER{$ptr}; 251} 252 253sub ACQUIRE { 254 my $self = shift; 255 my $ptr = tied(%$self); 256 $OWNER{$ptr} = 1; 257} 258 259 260# ------- VARIABLE STUBS -------- 261 262package Math::GSL::BSpline; 263 264*GSL_VERSION = *Math::GSL::BSplinec::GSL_VERSION; 265*GSL_MAJOR_VERSION = *Math::GSL::BSplinec::GSL_MAJOR_VERSION; 266*GSL_MINOR_VERSION = *Math::GSL::BSplinec::GSL_MINOR_VERSION; 267*GSL_POSZERO = *Math::GSL::BSplinec::GSL_POSZERO; 268*GSL_NEGZERO = *Math::GSL::BSplinec::GSL_NEGZERO; 269*GSL_SUCCESS = *Math::GSL::BSplinec::GSL_SUCCESS; 270*GSL_FAILURE = *Math::GSL::BSplinec::GSL_FAILURE; 271*GSL_CONTINUE = *Math::GSL::BSplinec::GSL_CONTINUE; 272*GSL_EDOM = *Math::GSL::BSplinec::GSL_EDOM; 273*GSL_ERANGE = *Math::GSL::BSplinec::GSL_ERANGE; 274*GSL_EFAULT = *Math::GSL::BSplinec::GSL_EFAULT; 275*GSL_EINVAL = *Math::GSL::BSplinec::GSL_EINVAL; 276*GSL_EFAILED = *Math::GSL::BSplinec::GSL_EFAILED; 277*GSL_EFACTOR = *Math::GSL::BSplinec::GSL_EFACTOR; 278*GSL_ESANITY = *Math::GSL::BSplinec::GSL_ESANITY; 279*GSL_ENOMEM = *Math::GSL::BSplinec::GSL_ENOMEM; 280*GSL_EBADFUNC = *Math::GSL::BSplinec::GSL_EBADFUNC; 281*GSL_ERUNAWAY = *Math::GSL::BSplinec::GSL_ERUNAWAY; 282*GSL_EMAXITER = *Math::GSL::BSplinec::GSL_EMAXITER; 283*GSL_EZERODIV = *Math::GSL::BSplinec::GSL_EZERODIV; 284*GSL_EBADTOL = *Math::GSL::BSplinec::GSL_EBADTOL; 285*GSL_ETOL = *Math::GSL::BSplinec::GSL_ETOL; 286*GSL_EUNDRFLW = *Math::GSL::BSplinec::GSL_EUNDRFLW; 287*GSL_EOVRFLW = *Math::GSL::BSplinec::GSL_EOVRFLW; 288*GSL_ELOSS = *Math::GSL::BSplinec::GSL_ELOSS; 289*GSL_EROUND = *Math::GSL::BSplinec::GSL_EROUND; 290*GSL_EBADLEN = *Math::GSL::BSplinec::GSL_EBADLEN; 291*GSL_ENOTSQR = *Math::GSL::BSplinec::GSL_ENOTSQR; 292*GSL_ESING = *Math::GSL::BSplinec::GSL_ESING; 293*GSL_EDIVERGE = *Math::GSL::BSplinec::GSL_EDIVERGE; 294*GSL_EUNSUP = *Math::GSL::BSplinec::GSL_EUNSUP; 295*GSL_EUNIMPL = *Math::GSL::BSplinec::GSL_EUNIMPL; 296*GSL_ECACHE = *Math::GSL::BSplinec::GSL_ECACHE; 297*GSL_ETABLE = *Math::GSL::BSplinec::GSL_ETABLE; 298*GSL_ENOPROG = *Math::GSL::BSplinec::GSL_ENOPROG; 299*GSL_ENOPROGJ = *Math::GSL::BSplinec::GSL_ENOPROGJ; 300*GSL_ETOLF = *Math::GSL::BSplinec::GSL_ETOLF; 301*GSL_ETOLX = *Math::GSL::BSplinec::GSL_ETOLX; 302*GSL_ETOLG = *Math::GSL::BSplinec::GSL_ETOLG; 303*GSL_EOF = *Math::GSL::BSplinec::GSL_EOF; 304*GSL_DISABLE_DEPRECATED = *Math::GSL::BSplinec::GSL_DISABLE_DEPRECATED; 305*M_E = *Math::GSL::BSplinec::M_E; 306*M_LOG2E = *Math::GSL::BSplinec::M_LOG2E; 307*M_LOG10E = *Math::GSL::BSplinec::M_LOG10E; 308*M_SQRT2 = *Math::GSL::BSplinec::M_SQRT2; 309*M_SQRT1_2 = *Math::GSL::BSplinec::M_SQRT1_2; 310*M_SQRT3 = *Math::GSL::BSplinec::M_SQRT3; 311*M_PI = *Math::GSL::BSplinec::M_PI; 312*M_PI_2 = *Math::GSL::BSplinec::M_PI_2; 313*M_PI_4 = *Math::GSL::BSplinec::M_PI_4; 314*M_SQRTPI = *Math::GSL::BSplinec::M_SQRTPI; 315*M_2_SQRTPI = *Math::GSL::BSplinec::M_2_SQRTPI; 316*M_1_PI = *Math::GSL::BSplinec::M_1_PI; 317*M_2_PI = *Math::GSL::BSplinec::M_2_PI; 318*M_LN10 = *Math::GSL::BSplinec::M_LN10; 319*M_LN2 = *Math::GSL::BSplinec::M_LN2; 320*M_LNPI = *Math::GSL::BSplinec::M_LNPI; 321*M_EULER = *Math::GSL::BSplinec::M_EULER; 322 323@EXPORT_OK = qw/ 324 gsl_bspline_alloc 325 gsl_bspline_free 326 gsl_bspline_ncoeffs 327 gsl_bspline_order 328 gsl_bspline_nbreak 329 gsl_bspline_breakpoint 330 gsl_bspline_knots 331 gsl_bspline_knots_uniform 332 gsl_bspline_eval 333 /; 334%EXPORT_TAGS = ( all => [ @EXPORT_OK ] ); 335 336__END__ 337 338=encoding utf8 339 340=head1 NAME 341 342Math::GSL::BSpline - Functions for the computation of smoothing basis splines 343 344=head1 SYNOPSIS 345 346 use Math::GSL::BSpline qw/:all/; 347 348=head1 DESCRIPTION 349 350=over 351 352=item gsl_bspline_alloc($k, $nbreak) 353 354This function allocates a workspace for computing B-splines of order $k. The 355number of breakpoints is given by $nbreak. This leads to n = $nbreak + $k - 2 356basis functions. Cubic B-splines are specified by $k = 4. 357 358=item gsl_bspline_free($w) 359 360This function frees the memory associated with the workspace $w. 361 362=item gsl_bspline_ncoeffs($w) 363 364This function returns the number of B-spline coefficients given by n = nbreak + k - 2. 365 366=item gsl_bspline_order 367 368=item gsl_bspline_nbreak 369 370=item gsl_bspline_breakpoint 371 372=item gsl_bspline_knots($breakpts, $w) 373 374This function computes the knots associated with the given breakpoints inside 375the vector $breakpts and stores them internally in $w->{knots}. 376 377=item gsl_bspline_knots_uniform($a, $b, $w) 378 379This function assumes uniformly spaced breakpoints on [$a,$b] and constructs 380the corresponding knot vector using the previously specified nbreak parameter. 381The knots are stored in $w->{knots}. 382 383=item gsl_bspline_eval($x, $B, $w) 384 385This function evaluates all B-spline basis functions at the position $x and 386stores them in the vector $B, so that the ith element of $B is B_i($x). $B must 387be of length n = $nbreak + $k - 2. This value may also be obtained by calling 388gsl_bspline_ncoeffs. It is far more efficient to compute all of the basis 389functions at once than to compute them individually, due to the nature of the 390defining recurrence relation. 391 392For more informations on the functions, we refer you to the GSL official documentation: 393http://www.gnu.org/software/gsl/manual/html_node/ 394 395=back 396 397=head1 EXAMPLES 398 399Coming soon. 400 401=head1 AUTHORS 402 403Jonathan "Duke" Leto <jonathan@leto.net> and Thierry Moisan <thierry.moisan@gmail.com> 404 405=head1 COPYRIGHT AND LICENSE 406 407Copyright (C) 2008-2021 Jonathan "Duke" Leto and Thierry Moisan 408 409This program is free software; you can redistribute it and/or modify it 410under the same terms as Perl itself. 411 412=cut 413 4141; 415