logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

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

Authors

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

Description

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

       •   gsl_min_fminimizer_alloc($type)

       •   "gsl_min_fminimizer_free"

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

       •   "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.

       •   "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.

       •   gsl_min_fminimizer_iterate($m)

       •   "gsl_min_fminimizer_name "

       •   gsl_min_fminimizer_x_minimum($m)

       •   gsl_min_fminimizer_x_lower($m)

       •   gsl_min_fminimizer_x_upper($m)

       •   gsl_min_fminimizer_f_minimum($m)

       •   gsl_min_fminimizer_f_lower($m)

       •   gsl_min_fminimizer_f_upper($m)

       •   gsl_min_fminimizer_minimum($m)

       •   gsl_min_test_interval($m)

       •   gsl_min_find_bracket($m)

       This module also includes the following constants :

       •   $gsl_min_fminimizer_brent

       •   $gsl_min_fminimizer_goldensection

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

Name

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

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);

See Also