"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "GENERATED/PDL/Minuit.pm" between
PDL-2.078.tar.gz and PDL-2.079.tar.gz

About: PDL (Perl Data Language) aims to turn perl into an efficient numerical language for scientific computing (similar to IDL and MatLab).

Minuit.pm  (PDL-2.078):Minuit.pm  (PDL-2.079)
skipping to change at line 37 skipping to change at line 37
=head1 SYNOPSIS =head1 SYNOPSIS
A basic fit with Minuit will call three functions in this package. First, a basi c A basic fit with Minuit will call three functions in this package. First, a basi c
initialization is done with mn_init(). Then, the parameters are defined via initialization is done with mn_init(). Then, the parameters are defined via
the function mn_def_pars(), which allows setting upper and lower bounds. Then the function mn_def_pars(), which allows setting upper and lower bounds. Then
the function mn_excm() can be used to issue many Minuit commands, including simp lex the function mn_excm() can be used to issue many Minuit commands, including simp lex
and migrad minimization algorithms (see Minuit manual for more details). and migrad minimization algorithms (see Minuit manual for more details).
See the test file minuit.t in the test (t/) directory for a basic example. See the test file minuit.t in the test (t/) directory for a basic example.
#line 45 "Minuit.pm"
=cut
#line 47 "Minuit.pm"
=head1 FUNCTIONS =head1 FUNCTIONS
=cut =cut
#line 36 "minuit.pd" #line 37 "minuit.pd"
use strict; use strict;
use warnings; use warnings;
# Package variable # Package variable
my $mn_options; my $mn_options;
sub mn_init{ sub mn_init{
my $fun_ref = shift; my $fun_ref = shift;
$mn_options = { Log => undef, $mn_options = { Log => undef,
skipping to change at line 88 skipping to change at line 90
} }
PDL::Minuit::mninit(5,$mn_options->{Unit},$mn_options->{Unit}); PDL::Minuit::mninit(5,$mn_options->{Unit},$mn_options->{Unit});
PDL::Minuit::mnseti($mn_options->{Title}); PDL::Minuit::mnseti($mn_options->{Title});
if (defined (my $logfile = $mn_options->{Log})){ if (defined (my $logfile = $mn_options->{Log})){
PDL::Minuit::mn_cierra($mn_options->{Unit}); PDL::Minuit::mn_cierra($mn_options->{Unit});
} }
} }
#line 105 "Minuit.pm" #line 107 "Minuit.pm"
#line 1058 "../../blib/lib/PDL/PP.pm" #line 1058 "../../blib/lib/PDL/PP.pm"
=head2 mninit =head2 mninit
=for sig =for sig
Signature: (longlong a();longlong b(); longlong c()) Signature: (longlong a();longlong b(); longlong c())
=for ref =for ref
info not available info not available
=for bad =for bad
mninit does not process bad values. mninit does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
=cut =cut
#line 132 "Minuit.pm" #line 134 "Minuit.pm"
#line 1060 "../../blib/lib/PDL/PP.pm" #line 1060 "../../blib/lib/PDL/PP.pm"
*mninit = \&PDL::Minuit::mninit; *mninit = \&PDL::Minuit::mninit;
#line 139 "Minuit.pm" #line 141 "Minuit.pm"
#line 1058 "../../blib/lib/PDL/PP.pm" #line 1058 "../../blib/lib/PDL/PP.pm"
=head2 mn_abre =head2 mn_abre
=for sig =for sig
Signature: (longlong l(); char* nombre; char* mode) Signature: (longlong l(); char* nombre; char* mode)
=for ref =for ref
info not available info not available
=for bad =for bad
mn_abre does not process bad values. mn_abre does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
=cut =cut
#line 166 "Minuit.pm" #line 168 "Minuit.pm"
#line 1060 "../../blib/lib/PDL/PP.pm" #line 1060 "../../blib/lib/PDL/PP.pm"
*mn_abre = \&PDL::Minuit::mn_abre; *mn_abre = \&PDL::Minuit::mn_abre;
#line 173 "Minuit.pm" #line 175 "Minuit.pm"
#line 1058 "../../blib/lib/PDL/PP.pm" #line 1058 "../../blib/lib/PDL/PP.pm"
=head2 mn_cierra =head2 mn_cierra
=for sig =for sig
Signature: (longlong l()) Signature: (longlong l())
=for ref =for ref
info not available info not available
=for bad =for bad
mn_cierra does not process bad values. mn_cierra does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
=cut =cut
#line 200 "Minuit.pm" #line 202 "Minuit.pm"
#line 1060 "../../blib/lib/PDL/PP.pm" #line 1060 "../../blib/lib/PDL/PP.pm"
*mn_cierra = \&PDL::Minuit::mn_cierra; *mn_cierra = \&PDL::Minuit::mn_cierra;
#line 207 "Minuit.pm" #line 209 "Minuit.pm"
#line 107 "minuit.pd" #line 108 "minuit.pd"
sub mn_def_pars{ sub mn_def_pars{
my $pars = shift; my $pars = shift;
my $steps = shift; my $steps = shift;
my $n = nelem($pars); my $n = nelem($pars);
$mn_options->{N} = $n; $mn_options->{N} = $n;
#print "Unit :".$mn_options->{Unit}."\n"; #print "Unit :".$mn_options->{Unit}."\n";
skipping to change at line 212 skipping to change at line 214
$lo_bounds->slice("($i)"), $lo_bounds->slice("($i)"),
$up_bounds->slice("($i)"), $up_bounds->slice("($i)"),
$names[$i]); $names[$i]);
barf "Problem initializing parameter $i in Minuit, got $iflag" unless ($ifl ag == 0); barf "Problem initializing parameter $i in Minuit, got $iflag" unless ($ifl ag == 0);
} }
if (defined (my $logfile = $mn_options->{Log})){ if (defined (my $logfile = $mn_options->{Log})){
PDL::Minuit::mn_cierra($mn_options->{Unit}); PDL::Minuit::mn_cierra($mn_options->{Unit});
} }
} }
#line 259 "Minuit.pm" #line 261 "Minuit.pm"
#line 1058 "../../blib/lib/PDL/PP.pm" #line 1058 "../../blib/lib/PDL/PP.pm"
=head2 mnparm =head2 mnparm
=for sig =for sig
Signature: (longlong a(); double b(); double c(); double d(); double e(); long long [o] ia(); char* str) Signature: (longlong a(); double b(); double c(); double d(); double e(); long long [o] ia(); char* str)
=for ref =for ref
info not available info not available
=for bad =for bad
mnparm does not process bad values. mnparm does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
=cut =cut
#line 286 "Minuit.pm" #line 288 "Minuit.pm"
#line 1060 "../../blib/lib/PDL/PP.pm" #line 1060 "../../blib/lib/PDL/PP.pm"
*mnparm = \&PDL::Minuit::mnparm; *mnparm = \&PDL::Minuit::mnparm;
#line 293 "Minuit.pm" #line 295 "Minuit.pm"
#line 163 "minuit.pd" #line 164 "minuit.pd"
sub mn_excm{ sub mn_excm{
my $command = shift; my $command = shift;
my $fun_ref = $mn_options->{Function}; my $fun_ref = $mn_options->{Function};
my ($arglis,$narg); my ($arglis,$narg);
if ( @_ ) { $arglis = shift; $narg = nelem($arglis);} if ( @_ ) { $arglis = shift; $narg = nelem($arglis);}
else { $arglis = pdl(0); $narg = 0; } else { $arglis = pdl(0); $narg = 0; }
skipping to change at line 267 skipping to change at line 269
$iflag = PDL::Minuit::mnexcm($arglis, $narg, $command, $fun_ref,$mn_options->{ N}); $iflag = PDL::Minuit::mnexcm($arglis, $narg, $command, $fun_ref,$mn_options->{ N});
warn "Problem executing command '$command' " unless ($iflag == 0); warn "Problem executing command '$command' " unless ($iflag == 0);
if (defined (my $logfile = $mn_options->{Log})){ if (defined (my $logfile = $mn_options->{Log})){
PDL::Minuit::mn_cierra($mn_options->{Unit}); PDL::Minuit::mn_cierra($mn_options->{Unit});
} }
return $iflag; return $iflag;
} }
#line 327 "Minuit.pm" #line 329 "Minuit.pm"
#line 1058 "../../blib/lib/PDL/PP.pm" #line 1058 "../../blib/lib/PDL/PP.pm"
=head2 mnexcm =head2 mnexcm
=for sig =for sig
Signature: (double a(n); longlong ia(); longlong [o] ib(); char* str; SV* func tion; IV numelem) Signature: (double a(n); longlong ia(); longlong [o] ib(); char* str; SV* func tion; IV numelem)
=for ref =for ref
info not available info not available
=for bad =for bad
mnexcm does not process bad values. mnexcm does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
=cut =cut
#line 354 "Minuit.pm" #line 356 "Minuit.pm"
#line 1060 "../../blib/lib/PDL/PP.pm" #line 1060 "../../blib/lib/PDL/PP.pm"
*mnexcm = \&PDL::Minuit::mnexcm; *mnexcm = \&PDL::Minuit::mnexcm;
#line 361 "Minuit.pm" #line 363 "Minuit.pm"
#line 204 "minuit.pd" #line 205 "minuit.pd"
sub mn_pout{ sub mn_pout{
barf "Usage: mn_pout(par_number)" unless ($#_ == 0); barf "Usage: mn_pout(par_number)" unless ($#_ == 0);
my $par_num = shift; my $par_num = shift;
my $n = $mn_options->{N}; my $n = $mn_options->{N};
if (($par_num < 1) || ($par_num > $n)) { barf "Parameter numbers range from 1 to $n "; } if (($par_num < 1) || ($par_num > $n)) { barf "Parameter numbers range from 1 to $n "; }
if (defined (my $logfile = $mn_options->{Log})){ if (defined (my $logfile = $mn_options->{Log})){
PDL::Minuit::mn_abre($mn_options->{Unit},$logfile,'old'); PDL::Minuit::mn_abre($mn_options->{Unit},$logfile,'old');
} }
skipping to change at line 320 skipping to change at line 322
my $ivarbl = pdl(0); my $ivarbl = pdl(0);
my $par_name = " "; my $par_name = " ";
PDL::Minuit::mnpout($par_num,$val,$err,$bnd1,$bnd2,$ivarbl,\$par_name); PDL::Minuit::mnpout($par_num,$val,$err,$bnd1,$bnd2,$ivarbl,\$par_name);
if (defined (my $logfile = $mn_options->{Log})){ if (defined (my $logfile = $mn_options->{Log})){
PDL::Minuit::mn_cierra($mn_options->{Unit}); PDL::Minuit::mn_cierra($mn_options->{Unit});
} }
return ($val,$err,$bnd1,$bnd2,$ivarbl,$par_name); return ($val,$err,$bnd1,$bnd2,$ivarbl,$par_name);
} }
#line 392 "Minuit.pm" #line 394 "Minuit.pm"
#line 1058 "../../blib/lib/PDL/PP.pm" #line 1058 "../../blib/lib/PDL/PP.pm"
=head2 mnpout =head2 mnpout
=for sig =for sig
Signature: (longlong ia(); double [o] a(); double [o] b(); double [o] c(); dou ble [o] d();longlong [o] ib(); SV* str) Signature: (longlong ia(); double [o] a(); double [o] b(); double [o] c(); dou ble [o] d();longlong [o] ib(); SV* str)
=for ref =for ref
info not available info not available
=for bad =for bad
mnpout does not process bad values. mnpout does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
=cut =cut
#line 419 "Minuit.pm" #line 421 "Minuit.pm"
#line 1060 "../../blib/lib/PDL/PP.pm" #line 1060 "../../blib/lib/PDL/PP.pm"
*mnpout = \&PDL::Minuit::mnpout; *mnpout = \&PDL::Minuit::mnpout;
#line 426 "Minuit.pm" #line 428 "Minuit.pm"
#line 241 "minuit.pd" #line 242 "minuit.pd"
sub mn_stat{ sub mn_stat{
if (defined (my $logfile = $mn_options->{Log})){ if (defined (my $logfile = $mn_options->{Log})){
PDL::Minuit::mn_abre($mn_options->{Unit},$logfile,'old'); PDL::Minuit::mn_abre($mn_options->{Unit},$logfile,'old');
} }
my ($fmin,$fedm,$errdef,$npari,$nparx,$istat) = PDL::Minuit::mnstat(); my ($fmin,$fedm,$errdef,$npari,$nparx,$istat) = PDL::Minuit::mnstat();
if (defined (my $logfile = $mn_options->{Log})){ if (defined (my $logfile = $mn_options->{Log})){
PDL::Minuit::mn_cierra($mn_options->{Unit}); PDL::Minuit::mn_cierra($mn_options->{Unit});
} }
return ($fmin,$fedm,$errdef,$npari,$nparx,$istat); return ($fmin,$fedm,$errdef,$npari,$nparx,$istat);
} }
#line 447 "Minuit.pm" #line 449 "Minuit.pm"
#line 1058 "../../blib/lib/PDL/PP.pm" #line 1058 "../../blib/lib/PDL/PP.pm"
=head2 mnstat =head2 mnstat
=for sig =for sig
Signature: (double [o] a(); double [o] b(); double [o] c(); longlong [o] ia(); longlong [o] ib(); longlong [o] ic()) Signature: (double [o] a(); double [o] b(); double [o] c(); longlong [o] ia(); longlong [o] ib(); longlong [o] ic())
=for ref =for ref
info not available info not available
=for bad =for bad
mnstat does not process bad values. mnstat does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
=cut =cut
#line 474 "Minuit.pm" #line 476 "Minuit.pm"
#line 1060 "../../blib/lib/PDL/PP.pm" #line 1060 "../../blib/lib/PDL/PP.pm"
*mnstat = \&PDL::Minuit::mnstat; *mnstat = \&PDL::Minuit::mnstat;
#line 481 "Minuit.pm" #line 483 "Minuit.pm"
#line 263 "minuit.pd" #line 264 "minuit.pd"
sub mn_emat{ sub mn_emat{
if (defined (my $logfile = $mn_options->{Log})){ if (defined (my $logfile = $mn_options->{Log})){
PDL::Minuit::mn_abre($mn_options->{Unit},$logfile,'old'); PDL::Minuit::mn_abre($mn_options->{Unit},$logfile,'old');
} }
my ($fmin,$fedm,$errdef,$npari,$nparx,$istat) = PDL::Minuit::mnstat(); my ($fmin,$fedm,$errdef,$npari,$nparx,$istat) = PDL::Minuit::mnstat();
my $n = $npari->sum->at; my $n = $npari->sum->at;
my $mat = zeroes($n,$n); my $mat = zeroes($n,$n);
PDL::Minuit::mnemat($mat); PDL::Minuit::mnemat($mat);
if (defined (my $logfile = $mn_options->{Log})){ if (defined (my $logfile = $mn_options->{Log})){
PDL::Minuit::mn_cierra($mn_options->{Unit}); PDL::Minuit::mn_cierra($mn_options->{Unit});
} }
return $mat; return $mat;
} }
#line 507 "Minuit.pm" #line 509 "Minuit.pm"
#line 1058 "../../blib/lib/PDL/PP.pm" #line 1058 "../../blib/lib/PDL/PP.pm"
=head2 mnemat =head2 mnemat
=for sig =for sig
Signature: (double [o] mat(n,n)) Signature: (double [o] mat(n,n))
=for ref =for ref
info not available info not available
=for bad =for bad
mnemat does not process bad values. mnemat does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
=cut =cut
#line 534 "Minuit.pm" #line 536 "Minuit.pm"
#line 1060 "../../blib/lib/PDL/PP.pm" #line 1060 "../../blib/lib/PDL/PP.pm"
*mnemat = \&PDL::Minuit::mnemat; *mnemat = \&PDL::Minuit::mnemat;
#line 541 "Minuit.pm" #line 543 "Minuit.pm"
#line 291 "minuit.pd" #line 292 "minuit.pd"
sub mn_err{ sub mn_err{
barf "Usage: mn_err(par_number)" unless ($#_ == 0); barf "Usage: mn_err(par_number)" unless ($#_ == 0);
my $par_num = shift; my $par_num = shift;
my $n = $mn_options->{N}; my $n = $mn_options->{N};
if (($par_num < 1) || ($par_num > $n)) { barf "Parameter numbers range from 1 to $n "; } if (($par_num < 1) || ($par_num > $n)) { barf "Parameter numbers range from 1 to $n "; }
if (defined (my $logfile = $mn_options->{Log})){ if (defined (my $logfile = $mn_options->{Log})){
skipping to change at line 459 skipping to change at line 461
} }
my ($eplus,$eminus,$eparab,$globcc) = PDL::Minuit::mnerrs($par_num); my ($eplus,$eminus,$eparab,$globcc) = PDL::Minuit::mnerrs($par_num);
if (defined (my $logfile = $mn_options->{Log})){ if (defined (my $logfile = $mn_options->{Log})){
PDL::Minuit::mn_cierra($mn_options->{Unit}); PDL::Minuit::mn_cierra($mn_options->{Unit});
} }
return ($eplus,$eminus,$eparab,$globcc); return ($eplus,$eminus,$eparab,$globcc);
} }
#line 568 "Minuit.pm" #line 570 "Minuit.pm"
#line 1058 "../../blib/lib/PDL/PP.pm" #line 1058 "../../blib/lib/PDL/PP.pm"
=head2 mnerrs =head2 mnerrs
=for sig =for sig
Signature: (longlong ia(); double [o] a(); double [o] b(); double [o] c(); dou ble [o] d()) Signature: (longlong ia(); double [o] a(); double [o] b(); double [o] c(); dou ble [o] d())
=for ref =for ref
info not available info not available
=for bad =for bad
mnerrs does not process bad values. mnerrs does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
=cut =cut
#line 595 "Minuit.pm" #line 597 "Minuit.pm"
#line 1060 "../../blib/lib/PDL/PP.pm" #line 1060 "../../blib/lib/PDL/PP.pm"
*mnerrs = \&PDL::Minuit::mnerrs; *mnerrs = \&PDL::Minuit::mnerrs;
#line 602 "Minuit.pm" #line 604 "Minuit.pm"
#line 319 "minuit.pd" #line 320 "minuit.pd"
sub mn_contour{ sub mn_contour{
barf "Usage: mn_contour(par_number_1,par_number_2,npt)" unless ($#_ == 2); barf "Usage: mn_contour(par_number_1,par_number_2,npt)" unless ($#_ == 2);
my $par_num_1 = shift; my $par_num_1 = shift;
my $par_num_2 = shift; my $par_num_2 = shift;
my $npt = shift; my $npt = shift;
my $fun_ref = $mn_options->{Function}; my $fun_ref = $mn_options->{Function};
my $n = $mn_options->{N}; my $n = $mn_options->{N};
skipping to change at line 513 skipping to change at line 515
my $nfound = pdl->new; my $nfound = pdl->new;
PDL::Minuit::mncont($par_num_1,$par_num_2,$npt,$xpt,$ypt,$nfound,$fun_ref,$n ); PDL::Minuit::mncont($par_num_1,$par_num_2,$npt,$xpt,$ypt,$nfound,$fun_ref,$n );
if (defined (my $logfile = $mn_options->{Log})){ if (defined (my $logfile = $mn_options->{Log})){
PDL::Minuit::mn_cierra($mn_options->{Unit}); PDL::Minuit::mn_cierra($mn_options->{Unit});
} }
return ($xpt,$ypt,$nfound); return ($xpt,$ypt,$nfound);
} }
#line 634 "Minuit.pm" #line 636 "Minuit.pm"
#line 1058 "../../blib/lib/PDL/PP.pm" #line 1058 "../../blib/lib/PDL/PP.pm"
=head2 mncont =head2 mncont
=for sig =for sig
Signature: (longlong ia(); longlong ib(); longlong ic(); double [o] a(n); doub le [o] b(n); longlong [o] id(); SV* function; IV numelem) Signature: (longlong ia(); longlong ib(); longlong ic(); double [o] a(n); doub le [o] b(n); longlong [o] id(); SV* function; IV numelem)
=for ref =for ref
info not available info not available
=for bad =for bad
mncont does not process bad values. mncont does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
=cut =cut
#line 661 "Minuit.pm" #line 663 "Minuit.pm"
#line 1060 "../../blib/lib/PDL/PP.pm" #line 1060 "../../blib/lib/PDL/PP.pm"
*mncont = \&PDL::Minuit::mncont; *mncont = \&PDL::Minuit::mncont;
#line 668 "Minuit.pm" #line 670 "Minuit.pm"
#line 357 "minuit.pd" #line 358 "minuit.pd"
=head2 mn_init() =head2 mn_init()
=for ref =for ref
The function mn_init() does the basic initialization of the fit. The first argum ent The function mn_init() does the basic initialization of the fit. The first argum ent
has to be a reference to the function to be minimized. The function has to be a reference to the function to be minimized. The function
to be minimized has to receive five arguments to be minimized has to receive five arguments
($npar,$grad,$fval,$xval,$iflag). The first is the number ($npar,$grad,$fval,$xval,$iflag). The first is the number
of parameters currently variable. The second is the gradient of parameters currently variable. The second is the gradient
skipping to change at line 805 skipping to change at line 807
=head1 AUTHOR =head1 AUTHOR
This file copyright (C) 2007 Andres Jordan <ajordan@eso.org>. This file copyright (C) 2007 Andres Jordan <ajordan@eso.org>.
All rights reserved. There is no warranty. You are allowed to redistribute this All rights reserved. There is no warranty. You are allowed to redistribute this
software/documentation under certain conditions. For details, see the file software/documentation under certain conditions. For details, see the file
COPYING in the PDL distribution. If this file is separated from the COPYING in the PDL distribution. If this file is separated from the
PDL distribution, the copyright notice should be included in the file. PDL distribution, the copyright notice should be included in the file.
=cut =cut
#line 943 "Minuit.pm" #line 945 "Minuit.pm"
# Exit with OK status # Exit with OK status
1; 1;
 End of changes. 39 change blocks. 
39 lines changed or deleted 41 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)