# This file was automatically generated by SWIG (http://www.swig.org).
# Version 3.0.4
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.

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

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

package Math::GSL::Min;

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

*gsl_error = *Math::GSL::Minc::gsl_error;
*gsl_stream_printf = *Math::GSL::Minc::gsl_stream_printf;
*gsl_strerror = *Math::GSL::Minc::gsl_strerror;
*gsl_set_error_handler = *Math::GSL::Minc::gsl_set_error_handler;
*gsl_set_error_handler_off = *Math::GSL::Minc::gsl_set_error_handler_off;
*gsl_set_stream_handler = *Math::GSL::Minc::gsl_set_stream_handler;
*gsl_set_stream = *Math::GSL::Minc::gsl_set_stream;
*gsl_min_fminimizer_alloc = *Math::GSL::Minc::gsl_min_fminimizer_alloc;
*gsl_min_fminimizer_free = *Math::GSL::Minc::gsl_min_fminimizer_free;
*gsl_min_fminimizer_set = *Math::GSL::Minc::gsl_min_fminimizer_set;
*gsl_min_fminimizer_set_with_values = *Math::GSL::Minc::gsl_min_fminimizer_set_with_values;
*gsl_min_fminimizer_iterate = *Math::GSL::Minc::gsl_min_fminimizer_iterate;
*gsl_min_fminimizer_name = *Math::GSL::Minc::gsl_min_fminimizer_name;
*gsl_min_fminimizer_x_minimum = *Math::GSL::Minc::gsl_min_fminimizer_x_minimum;
*gsl_min_fminimizer_x_lower = *Math::GSL::Minc::gsl_min_fminimizer_x_lower;
*gsl_min_fminimizer_x_upper = *Math::GSL::Minc::gsl_min_fminimizer_x_upper;
*gsl_min_fminimizer_f_minimum = *Math::GSL::Minc::gsl_min_fminimizer_f_minimum;
*gsl_min_fminimizer_f_lower = *Math::GSL::Minc::gsl_min_fminimizer_f_lower;
*gsl_min_fminimizer_f_upper = *Math::GSL::Minc::gsl_min_fminimizer_f_upper;
*gsl_min_fminimizer_minimum = *Math::GSL::Minc::gsl_min_fminimizer_minimum;
*gsl_min_test_interval = *Math::GSL::Minc::gsl_min_test_interval;
*gsl_min_find_bracket = *Math::GSL::Minc::gsl_min_find_bracket;

############# Class : Math::GSL::Min::gsl_min_fminimizer_type ##############

package Math::GSL::Min::gsl_min_fminimizer_type;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( Math::GSL::Min );
%OWNER = ();
%ITERATORS = ();
*swig_name_get = *Math::GSL::Minc::gsl_min_fminimizer_type_name_get;
*swig_name_set = *Math::GSL::Minc::gsl_min_fminimizer_type_name_set;
*swig_size_get = *Math::GSL::Minc::gsl_min_fminimizer_type_size_get;
*swig_size_set = *Math::GSL::Minc::gsl_min_fminimizer_type_size_set;
*swig_set_get = *Math::GSL::Minc::gsl_min_fminimizer_type_set_get;
*swig_set_set = *Math::GSL::Minc::gsl_min_fminimizer_type_set_set;
*swig_iterate_get = *Math::GSL::Minc::gsl_min_fminimizer_type_iterate_get;
*swig_iterate_set = *Math::GSL::Minc::gsl_min_fminimizer_type_iterate_set;
sub new {
    my $pkg = shift;
    my $self = Math::GSL::Minc::new_gsl_min_fminimizer_type(@_);
    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::Minc::delete_gsl_min_fminimizer_type($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::Min::gsl_min_fminimizer ##############

package Math::GSL::Min::gsl_min_fminimizer;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( Math::GSL::Min );
%OWNER = ();
%ITERATORS = ();
sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        Math::GSL::Minc::delete_gsl_min_fminimizer($self);
        delete $OWNER{$self};
    }
}

*swig_type_get = *Math::GSL::Minc::gsl_min_fminimizer_type_get;
*swig_type_set = *Math::GSL::Minc::gsl_min_fminimizer_type_set;
*swig_function_get = *Math::GSL::Minc::gsl_min_fminimizer_function_get;
*swig_function_set = *Math::GSL::Minc::gsl_min_fminimizer_function_set;
*swig_x_minimum_get = *Math::GSL::Minc::gsl_min_fminimizer_x_minimum_get;
*swig_x_minimum_set = *Math::GSL::Minc::gsl_min_fminimizer_x_minimum_set;
*swig_x_lower_get = *Math::GSL::Minc::gsl_min_fminimizer_x_lower_get;
*swig_x_lower_set = *Math::GSL::Minc::gsl_min_fminimizer_x_lower_set;
*swig_x_upper_get = *Math::GSL::Minc::gsl_min_fminimizer_x_upper_get;
*swig_x_upper_set = *Math::GSL::Minc::gsl_min_fminimizer_x_upper_set;
*swig_f_minimum_get = *Math::GSL::Minc::gsl_min_fminimizer_f_minimum_get;
*swig_f_minimum_set = *Math::GSL::Minc::gsl_min_fminimizer_f_minimum_set;
*swig_f_lower_get = *Math::GSL::Minc::gsl_min_fminimizer_f_lower_get;
*swig_f_lower_set = *Math::GSL::Minc::gsl_min_fminimizer_f_lower_set;
*swig_f_upper_get = *Math::GSL::Minc::gsl_min_fminimizer_f_upper_get;
*swig_f_upper_set = *Math::GSL::Minc::gsl_min_fminimizer_f_upper_set;
*swig_state_get = *Math::GSL::Minc::gsl_min_fminimizer_state_get;
*swig_state_set = *Math::GSL::Minc::gsl_min_fminimizer_state_set;
sub new {
    my $pkg = shift;
    my $self = Math::GSL::Minc::new_gsl_min_fminimizer(@_);
    bless $self, $pkg if defined($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::Min::gsl_function_struct ##############

package Math::GSL::Min::gsl_function_struct;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( Math::GSL::Min );
%OWNER = ();
%ITERATORS = ();
*swig_function_get = *Math::GSL::Minc::gsl_function_struct_function_get;
*swig_function_set = *Math::GSL::Minc::gsl_function_struct_function_set;
*swig_params_get = *Math::GSL::Minc::gsl_function_struct_params_get;
*swig_params_set = *Math::GSL::Minc::gsl_function_struct_params_set;
sub new {
    my $pkg = shift;
    my $self = Math::GSL::Minc::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::Minc::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::Min::gsl_function_fdf_struct ##############

package Math::GSL::Min::gsl_function_fdf_struct;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( Math::GSL::Min );
%OWNER = ();
%ITERATORS = ();
*swig_f_get = *Math::GSL::Minc::gsl_function_fdf_struct_f_get;
*swig_f_set = *Math::GSL::Minc::gsl_function_fdf_struct_f_set;
*swig_df_get = *Math::GSL::Minc::gsl_function_fdf_struct_df_get;
*swig_df_set = *Math::GSL::Minc::gsl_function_fdf_struct_df_set;
*swig_fdf_get = *Math::GSL::Minc::gsl_function_fdf_struct_fdf_get;
*swig_fdf_set = *Math::GSL::Minc::gsl_function_fdf_struct_fdf_set;
*swig_params_get = *Math::GSL::Minc::gsl_function_fdf_struct_params_get;
*swig_params_set = *Math::GSL::Minc::gsl_function_fdf_struct_params_set;
sub new {
    my $pkg = shift;
    my $self = Math::GSL::Minc::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::Minc::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::Min::gsl_function_vec_struct ##############

package Math::GSL::Min::gsl_function_vec_struct;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( Math::GSL::Min );
%OWNER = ();
%ITERATORS = ();
*swig_function_get = *Math::GSL::Minc::gsl_function_vec_struct_function_get;
*swig_function_set = *Math::GSL::Minc::gsl_function_vec_struct_function_set;
*swig_params_get = *Math::GSL::Minc::gsl_function_vec_struct_params_get;
*swig_params_set = *Math::GSL::Minc::gsl_function_vec_struct_params_set;
sub new {
    my $pkg = shift;
    my $self = Math::GSL::Minc::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::Minc::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::Min;

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

my %__gsl_min_fminimizer_goldensection_hash;
tie %__gsl_min_fminimizer_goldensection_hash,"Math::GSL::Min::gsl_min_fminimizer_type", $Math::GSL::Minc::gsl_min_fminimizer_goldensection;
$gsl_min_fminimizer_goldensection= \%__gsl_min_fminimizer_goldensection_hash;
bless $gsl_min_fminimizer_goldensection, Math::GSL::Min::gsl_min_fminimizer_type;

my %__gsl_min_fminimizer_brent_hash;
tie %__gsl_min_fminimizer_brent_hash,"Math::GSL::Min::gsl_min_fminimizer_type", $Math::GSL::Minc::gsl_min_fminimizer_brent;
$gsl_min_fminimizer_brent= \%__gsl_min_fminimizer_brent_hash;
bless $gsl_min_fminimizer_brent, Math::GSL::Min::gsl_min_fminimizer_type;

my %__gsl_min_fminimizer_quad_golden_hash;
tie %__gsl_min_fminimizer_quad_golden_hash,"Math::GSL::Min::gsl_min_fminimizer_type", $Math::GSL::Minc::gsl_min_fminimizer_quad_golden;
$gsl_min_fminimizer_quad_golden= \%__gsl_min_fminimizer_quad_golden_hash;
bless $gsl_min_fminimizer_quad_golden, Math::GSL::Min::gsl_min_fminimizer_type;
*M_E = *Math::GSL::Minc::M_E;
*M_LOG2E = *Math::GSL::Minc::M_LOG2E;
*M_LOG10E = *Math::GSL::Minc::M_LOG10E;
*M_SQRT2 = *Math::GSL::Minc::M_SQRT2;
*M_SQRT1_2 = *Math::GSL::Minc::M_SQRT1_2;
*M_SQRT3 = *Math::GSL::Minc::M_SQRT3;
*M_PI = *Math::GSL::Minc::M_PI;
*M_PI_2 = *Math::GSL::Minc::M_PI_2;
*M_PI_4 = *Math::GSL::Minc::M_PI_4;
*M_SQRTPI = *Math::GSL::Minc::M_SQRTPI;
*M_2_SQRTPI = *Math::GSL::Minc::M_2_SQRTPI;
*M_1_PI = *Math::GSL::Minc::M_1_PI;
*M_2_PI = *Math::GSL::Minc::M_2_PI;
*M_LN10 = *Math::GSL::Minc::M_LN10;
*M_LN2 = *Math::GSL::Minc::M_LN2;
*M_LNPI = *Math::GSL::Minc::M_LNPI;
*M_EULER = *Math::GSL::Minc::M_EULER;


@EXPORT_OK = qw/
   gsl_min_fminimizer_alloc
   gsl_min_fminimizer_free
   gsl_min_fminimizer_set
   gsl_min_fminimizer_set_with_values
   gsl_min_fminimizer_iterate
   gsl_min_fminimizer_name
   gsl_min_fminimizer_x_minimum
   gsl_min_fminimizer_x_lower
   gsl_min_fminimizer_x_upper
   gsl_min_fminimizer_f_minimum
   gsl_min_fminimizer_f_lower
   gsl_min_fminimizer_f_upper
   gsl_min_fminimizer_minimum
   gsl_min_test_interval
   gsl_min_find_bracket
   $gsl_min_fminimizer_brent
   $gsl_min_fminimizer_goldensection
/;

%EXPORT_TAGS = ( all => [ @EXPORT_OK ] );

__END__

=encoding utf8

=head1 NAME

Math::GSL::Min - 1-D Minimization

=head1 SYNOPSIS

    use Math::GSL::Min qw/:all/;
    use Math::GSL::Const qw/$M_PI/;

    my $m = gsl_min_fminimizer_alloc($gsl_min_fminimizer_goldensection);

    gsl_min_fminimizer_set_with_values($m,
        sub { cos($_[0]) },
        3, cos(3),
        0, cos(0),
        2*$M_PI, cos(2*$M_PI)
    );
    my $status  = gsl_min_fminimizer_iterate($m);

    my $x_min   = gsl_min_fminimizer_x_minimum($m);
    my $x_lower = gsl_min_fminimizer_x_lower($m);
    my $x_upper = gsl_min_fminimizer_x_upper($m);

    my $f_min   = gsl_min_fminimizer_f_minimum($m);
    my $f_lower = gsl_min_fminimizer_f_lower($m);
    my $f_upper = gsl_min_fminimizer_f_upper($m);

=head1 DESCRIPTION

Here is a list of all the functions in this module :

=over

=item * C<gsl_min_fminimizer_alloc($type)>

=item * C<gsl_min_fminimizer_free>

Don't call this function explicitly. It will be called automatically in DESTROY for fminimizer.

=item * C<gsl_min_fminimizer_set >

Don't apply this function twice to the same fminimizer. It will cause a memory leak. Instead of this you should create new fminimizer.

=item * C<gsl_min_fminimizer_set_with_values>

Don't apply this function twice to the same fminimizer. It will cause a memory leak. Instead of this you should create new fminimizer.

=item * C<gsl_min_fminimizer_iterate($m)>

=item * C<gsl_min_fminimizer_name >

=item * C<gsl_min_fminimizer_x_minimum($m)>

=item * C<gsl_min_fminimizer_x_lower($m) >

=item * C<gsl_min_fminimizer_x_upper($m) >

=item * C<gsl_min_fminimizer_f_minimum($m)>

=item * C<gsl_min_fminimizer_f_lower($m) >

=item * C<gsl_min_fminimizer_f_upper($m) >

=item * C<gsl_min_fminimizer_minimum($m) >

=item * C<gsl_min_test_interval($m) >

=item * C<gsl_min_find_bracket($m) >

=back

This module also includes the following constants :

=over

=item * C<$gsl_min_fminimizer_brent>

=item * C<$gsl_min_fminimizer_goldensection>

=back

For more informations on the functions, we refer you to the GSL offcial
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-2014 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;
