# 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::Rstat;
use base qw(Exporter);
use base qw(DynaLoader);
package Math::GSL::Rstatc;
bootstrap Math::GSL::Rstat;
package Math::GSL::Rstat;
@EXPORT = qw();

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

package Math::GSL::Rstat;

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::Rstat;

*gsl_error = *Math::GSL::Rstatc::gsl_error;
*gsl_stream_printf = *Math::GSL::Rstatc::gsl_stream_printf;
*gsl_strerror = *Math::GSL::Rstatc::gsl_strerror;
*gsl_set_error_handler = *Math::GSL::Rstatc::gsl_set_error_handler;
*gsl_set_error_handler_off = *Math::GSL::Rstatc::gsl_set_error_handler_off;
*gsl_set_stream_handler = *Math::GSL::Rstatc::gsl_set_stream_handler;
*gsl_set_stream = *Math::GSL::Rstatc::gsl_set_stream;
*gsl_rstat_quantile_alloc = *Math::GSL::Rstatc::gsl_rstat_quantile_alloc;
*gsl_rstat_quantile_free = *Math::GSL::Rstatc::gsl_rstat_quantile_free;
*gsl_rstat_quantile_reset = *Math::GSL::Rstatc::gsl_rstat_quantile_reset;
*gsl_rstat_quantile_add = *Math::GSL::Rstatc::gsl_rstat_quantile_add;
*gsl_rstat_quantile_get = *Math::GSL::Rstatc::gsl_rstat_quantile_get;
*gsl_rstat_alloc = *Math::GSL::Rstatc::gsl_rstat_alloc;
*gsl_rstat_free = *Math::GSL::Rstatc::gsl_rstat_free;
*gsl_rstat_n = *Math::GSL::Rstatc::gsl_rstat_n;
*gsl_rstat_add = *Math::GSL::Rstatc::gsl_rstat_add;
*gsl_rstat_min = *Math::GSL::Rstatc::gsl_rstat_min;
*gsl_rstat_max = *Math::GSL::Rstatc::gsl_rstat_max;
*gsl_rstat_mean = *Math::GSL::Rstatc::gsl_rstat_mean;
*gsl_rstat_variance = *Math::GSL::Rstatc::gsl_rstat_variance;
*gsl_rstat_sd = *Math::GSL::Rstatc::gsl_rstat_sd;
*gsl_rstat_rms = *Math::GSL::Rstatc::gsl_rstat_rms;
*gsl_rstat_norm = *Math::GSL::Rstatc::gsl_rstat_norm;
*gsl_rstat_sd_mean = *Math::GSL::Rstatc::gsl_rstat_sd_mean;
*gsl_rstat_median = *Math::GSL::Rstatc::gsl_rstat_median;
*gsl_rstat_skew = *Math::GSL::Rstatc::gsl_rstat_skew;
*gsl_rstat_kurtosis = *Math::GSL::Rstatc::gsl_rstat_kurtosis;
*gsl_rstat_reset = *Math::GSL::Rstatc::gsl_rstat_reset;

############# Class : Math::GSL::Rstat::gsl_rstat_quantile_workspace ##############

package Math::GSL::Rstat::gsl_rstat_quantile_workspace;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( Math::GSL::Rstat );
%OWNER = ();
%ITERATORS = ();
*swig_p_get = *Math::GSL::Rstatc::gsl_rstat_quantile_workspace_p_get;
*swig_p_set = *Math::GSL::Rstatc::gsl_rstat_quantile_workspace_p_set;
*swig_q_get = *Math::GSL::Rstatc::gsl_rstat_quantile_workspace_q_get;
*swig_q_set = *Math::GSL::Rstatc::gsl_rstat_quantile_workspace_q_set;
*swig_npos_get = *Math::GSL::Rstatc::gsl_rstat_quantile_workspace_npos_get;
*swig_npos_set = *Math::GSL::Rstatc::gsl_rstat_quantile_workspace_npos_set;
*swig_np_get = *Math::GSL::Rstatc::gsl_rstat_quantile_workspace_np_get;
*swig_np_set = *Math::GSL::Rstatc::gsl_rstat_quantile_workspace_np_set;
*swig_dnp_get = *Math::GSL::Rstatc::gsl_rstat_quantile_workspace_dnp_get;
*swig_dnp_set = *Math::GSL::Rstatc::gsl_rstat_quantile_workspace_dnp_set;
*swig_n_get = *Math::GSL::Rstatc::gsl_rstat_quantile_workspace_n_get;
*swig_n_set = *Math::GSL::Rstatc::gsl_rstat_quantile_workspace_n_set;
sub new {
    my $pkg = shift;
    my $self = Math::GSL::Rstatc::new_gsl_rstat_quantile_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::Rstatc::delete_gsl_rstat_quantile_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::Rstat::gsl_rstat_workspace ##############

package Math::GSL::Rstat::gsl_rstat_workspace;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( Math::GSL::Rstat );
%OWNER = ();
%ITERATORS = ();
*swig_min_get = *Math::GSL::Rstatc::gsl_rstat_workspace_min_get;
*swig_min_set = *Math::GSL::Rstatc::gsl_rstat_workspace_min_set;
*swig_max_get = *Math::GSL::Rstatc::gsl_rstat_workspace_max_get;
*swig_max_set = *Math::GSL::Rstatc::gsl_rstat_workspace_max_set;
*swig_mean_get = *Math::GSL::Rstatc::gsl_rstat_workspace_mean_get;
*swig_mean_set = *Math::GSL::Rstatc::gsl_rstat_workspace_mean_set;
*swig_M2_get = *Math::GSL::Rstatc::gsl_rstat_workspace_M2_get;
*swig_M2_set = *Math::GSL::Rstatc::gsl_rstat_workspace_M2_set;
*swig_M3_get = *Math::GSL::Rstatc::gsl_rstat_workspace_M3_get;
*swig_M3_set = *Math::GSL::Rstatc::gsl_rstat_workspace_M3_set;
*swig_M4_get = *Math::GSL::Rstatc::gsl_rstat_workspace_M4_get;
*swig_M4_set = *Math::GSL::Rstatc::gsl_rstat_workspace_M4_set;
*swig_n_get = *Math::GSL::Rstatc::gsl_rstat_workspace_n_get;
*swig_n_set = *Math::GSL::Rstatc::gsl_rstat_workspace_n_set;
*swig_median_workspace_p_get = *Math::GSL::Rstatc::gsl_rstat_workspace_median_workspace_p_get;
*swig_median_workspace_p_set = *Math::GSL::Rstatc::gsl_rstat_workspace_median_workspace_p_set;
sub new {
    my $pkg = shift;
    my $self = Math::GSL::Rstatc::new_gsl_rstat_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::Rstatc::delete_gsl_rstat_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;
}


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

package Math::GSL::Rstat;

*GSL_VERSION = *Math::GSL::Rstatc::GSL_VERSION;
*GSL_MAJOR_VERSION = *Math::GSL::Rstatc::GSL_MAJOR_VERSION;
*GSL_MINOR_VERSION = *Math::GSL::Rstatc::GSL_MINOR_VERSION;
*GSL_POSZERO = *Math::GSL::Rstatc::GSL_POSZERO;
*GSL_NEGZERO = *Math::GSL::Rstatc::GSL_NEGZERO;
*GSL_SUCCESS = *Math::GSL::Rstatc::GSL_SUCCESS;
*GSL_FAILURE = *Math::GSL::Rstatc::GSL_FAILURE;
*GSL_CONTINUE = *Math::GSL::Rstatc::GSL_CONTINUE;
*GSL_EDOM = *Math::GSL::Rstatc::GSL_EDOM;
*GSL_ERANGE = *Math::GSL::Rstatc::GSL_ERANGE;
*GSL_EFAULT = *Math::GSL::Rstatc::GSL_EFAULT;
*GSL_EINVAL = *Math::GSL::Rstatc::GSL_EINVAL;
*GSL_EFAILED = *Math::GSL::Rstatc::GSL_EFAILED;
*GSL_EFACTOR = *Math::GSL::Rstatc::GSL_EFACTOR;
*GSL_ESANITY = *Math::GSL::Rstatc::GSL_ESANITY;
*GSL_ENOMEM = *Math::GSL::Rstatc::GSL_ENOMEM;
*GSL_EBADFUNC = *Math::GSL::Rstatc::GSL_EBADFUNC;
*GSL_ERUNAWAY = *Math::GSL::Rstatc::GSL_ERUNAWAY;
*GSL_EMAXITER = *Math::GSL::Rstatc::GSL_EMAXITER;
*GSL_EZERODIV = *Math::GSL::Rstatc::GSL_EZERODIV;
*GSL_EBADTOL = *Math::GSL::Rstatc::GSL_EBADTOL;
*GSL_ETOL = *Math::GSL::Rstatc::GSL_ETOL;
*GSL_EUNDRFLW = *Math::GSL::Rstatc::GSL_EUNDRFLW;
*GSL_EOVRFLW = *Math::GSL::Rstatc::GSL_EOVRFLW;
*GSL_ELOSS = *Math::GSL::Rstatc::GSL_ELOSS;
*GSL_EROUND = *Math::GSL::Rstatc::GSL_EROUND;
*GSL_EBADLEN = *Math::GSL::Rstatc::GSL_EBADLEN;
*GSL_ENOTSQR = *Math::GSL::Rstatc::GSL_ENOTSQR;
*GSL_ESING = *Math::GSL::Rstatc::GSL_ESING;
*GSL_EDIVERGE = *Math::GSL::Rstatc::GSL_EDIVERGE;
*GSL_EUNSUP = *Math::GSL::Rstatc::GSL_EUNSUP;
*GSL_EUNIMPL = *Math::GSL::Rstatc::GSL_EUNIMPL;
*GSL_ECACHE = *Math::GSL::Rstatc::GSL_ECACHE;
*GSL_ETABLE = *Math::GSL::Rstatc::GSL_ETABLE;
*GSL_ENOPROG = *Math::GSL::Rstatc::GSL_ENOPROG;
*GSL_ENOPROGJ = *Math::GSL::Rstatc::GSL_ENOPROGJ;
*GSL_ETOLF = *Math::GSL::Rstatc::GSL_ETOLF;
*GSL_ETOLX = *Math::GSL::Rstatc::GSL_ETOLX;
*GSL_ETOLG = *Math::GSL::Rstatc::GSL_ETOLG;
*GSL_EOF = *Math::GSL::Rstatc::GSL_EOF;

@EXPORT_OK = qw/
    gsl_rstat_quantile_alloc
    gsl_rstat_quantile_free
    gsl_rstat_quantile_reset
    gsl_rstat_quantile_add
    gsl_rstat_quantile_get
    gsl_rstat_alloc
    gsl_rstat_free
    gsl_rstat_n
    gsl_rstat_add
    gsl_rstat_min
    gsl_rstat_max
    gsl_rstat_mean
    gsl_rstat_variance
    gsl_rstat_sd
    gsl_rstat_rms
    gsl_rstat_sd_mean
    gsl_rstat_median
    gsl_rstat_skew
    gsl_rstat_kurtosis
    gsl_rstat_reset
/;

%EXPORT_TAGS = (
                all => \@EXPORT_OK,
               );
__END__

=encoding utf8

=head1 NAME

Math::GSL::Rstat - Running Statistical functions

=head1 SYNOPSIS

    use Math::GSL::Rstat qw /:all/;
    my @data = (17.2, 18.1, 16.5, 18.3, 12.6);
    map { gsl_rstat_add( $_, $rstat) } @data;
    my $rstat    = gsl_rstat_alloc();
    my $mean     = gsl_rstat_mean($rstat);
    my $variance = gsl_rstat_variance($rstat);
    my $largest  = gsl_rstat_max($rstat);
    my $smallest = gsl_rstat_min($rstat);
    my $sd       = gsl_rstat_sd($rstat);
    my $rms      = gsl_rstat_rms($rstat);
    my $sd_mean  = gsl_rstat_sd_mean($rstat);
    my $median   = gsl_rstat_median($rstat);
    my $skew     = gsl_rstat_skew($rstat);
    my $kurtosis = gsl_rstat_kurtosis($rstat);
    my $n        = gsl_rstat_n($rstat);

=head1 DESCRIPTION

NOTE: This module requires GSL 2.0 or higher.

For more informations 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>

=head1 COPYRIGHT AND LICENSE

Copyright (C) 2008-2024 Jonathan "Duke" Leto

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

=cut

1;
