"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "Libtmp/Slatec/t/linfit.t" between
PDL-2.082.tar.gz and PDL-2.083.tar.gz

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

linfit.t  (PDL-2.082):linfit.t  (PDL-2.083)
skipping to change at line 75 skipping to change at line 75
# printf(" %4d %g %g\n",$i,$PulsedB[$i],$Pulse[$i]); # printf(" %4d %g %g\n",$i,$PulsedB[$i],$Pulse[$i]);
} }
$pave = $psum/$noPoints; $pave = $psum/$noPoints;
# printf("DC Value = %g\n",$pave); # printf("DC Value = %g\n",$pave);
# Make PDL from waveform: # Make PDL from waveform:
my $data = new PDL( \@Pulse); my $data = PDL->new(\@Pulse);
my @functions; my @functions;
# setup matrix contains functions to fit # setup matrix contains functions to fit
for ($i=0; $i<$noPoints; $i++) { for ($i=0; $i<$noPoints; $i++) {
$functions[0][$i] = $pave; $functions[0][$i] = $pave;
$functions[1][$i] = $i; $functions[1][$i] = $i;
$functions[2][$i] = sin($pi*$i/($noPoints-1)); $functions[2][$i] = sin($pi*$i/($noPoints-1));
$functions[3][$i] = sin(2*$pi*$i/($noPoints-1)); $functions[3][$i] = sin(2*$pi*$i/($noPoints-1));
} }
my $fitFuncs = new PDL( \@functions); my $fitFuncs = PDL->new(\@functions);
my ($yfit, $coeffs) = linfit1d( $data, $fitFuncs); my ($yfit, $coeffs) = linfit1d($data, $fitFuncs);
my @coefs = $coeffs->list; my @coefs = $coeffs->list;
ok all approx( $coeffs, pdl( \@expectedCoefs ) ); ok all approx( $coeffs, pdl( \@expectedCoefs ) );
} }
done_testing; done_testing;
 End of changes. 3 change blocks. 
3 lines changed or deleted 3 lines changed or added

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