Skip to content

Commit

Permalink
Merge pull request #88 from shlomif/remote-trailing-whitespace
Browse files Browse the repository at this point in the history
Remove trailing whitespace (with a test).
  • Loading branch information
leto committed Apr 7, 2015
2 parents 46c8f48 + b36456d commit 902d897
Show file tree
Hide file tree
Showing 102 changed files with 3,845 additions and 3,814 deletions.
10 changes: 5 additions & 5 deletions Build.PL
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ sub check_gsl_version_pkgconfig {
my $gsl_version = $gsl_pkgcfg->pkg_version;
if (GSLBuilder::cmp_versions($gsl_version, $MIN_GSL_VERSION) == -1) {
printf "
***
***
*** You need to have GSL %s or greater installed. (You have $gsl_version).
*** Get GSL at http://www.gnu.org/software/gsl\n", $MIN_GSL_VERSION;
exit 0;
Expand All @@ -305,8 +305,8 @@ sub check_gsl_version {
my $gsl_version = qx{gsl-config --version};
if (not defined $gsl_version) {
print "
***
*** Can't find GSL with gsl-config.
***
*** Can't find GSL with gsl-config.
*** Trying with PkgConfig.
";
return undef;
Expand All @@ -331,7 +331,7 @@ sub check_gsl_version {

if (GSLBuilder::cmp_versions($current_version, $MIN_GSL_VERSION) == -1) {
printf "
***
***
*** You need to have GSL %s or greater installed. (You have $gsl_version).
*** Get GSL at http://www.gnu.org/software/gsl\n", $MIN_GSL_VERSION;
exit 0;
Expand All @@ -346,7 +346,7 @@ sub check_gsl_version {
}
} else {
print "
***
***
*** Can't parse GSL version $gsl_version.
*** Trying with PkgConfig.
";
Expand Down
20 changes: 10 additions & 10 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
- Added as_vector() to Matrix and MatrixComplex objects
- Added inverse(), is_square(), det(), lndet(), zero() and identity()
to Matrix objects
- Added inverse(), is_square(), det(), lndet(), zero(), identity()
- Added inverse(), is_square(), det(), lndet(), zero(), identity()
and hermitian() to MatrixComplex objects
- Added dot product to Matrix objects
- Fixed various typos in documentation
Expand Down Expand Up @@ -151,7 +151,7 @@
- Examples and new documentation in Statistics, as well as tests (Thierry)
- Bugfixes relating to compiling on 64bit Red Hat Linux, reported by Michael Roberge
- Improved FFT, Deriv, Integration, Chebyshev, Combination and Roots docs
- Documentation for Math::GSL::Test
- Documentation for Math::GSL::Test
- Improved introduction examples in Math::GSL
- Improved Minimization subsystem tests, but it is not functional
- Added examples/fft/forward_real
Expand All @@ -164,8 +164,8 @@
Script which tests the erfc() special function against computing
the integral definition with gsl_integration_qagiu()

- Added example/vector/speed
- Added example/vector/speed

This shows a considerable performance boost using Math::GSL::Vectors
instead of List::Util when searching for the min and max elements of
large sets of random numbers.
Expand All @@ -177,7 +177,7 @@

=head1 v0.12 - September 14 2008

- Darwin support!
- Darwin support!
- Minimum Perl version changed to 5.8.0
- Make platform check compile time constants for performance
aka The Wilhelm Speedup (thanks to Eric Wilhelm <scratchcomputing@gmail.com>)
Expand All @@ -199,7 +199,7 @@
- Added 'examples/gsl_repl' which is a rapid prototyping tool/interactive interpreter
- Compile support for GSL's as old as 1.8 (test suite still needs to be properly guarded)

=head1 v0.10
=head1 v0.10

- Continued porting to MSWin32, fixing many NaN and Inf handling issues

Expand All @@ -208,15 +208,15 @@
- Large documentation improvements
- MSWin32 support thanks to testing and feedback from <sisyphus@cpan.org>

=head1 v0.07
=head1 v0.07

- Initial CPAN release
=head1 v0.042

=head1 v0.042

- Started change to Test::Class

=head1 v0.01
=head1 v0.01

- Added swig interface files and swig-ified build script
- initial tests for special function library gsl_sf <--> Math::GSL::Sf
Expand Down
1 change: 1 addition & 0 deletions MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,7 @@ t/Vector.t
t/VectorComplex.t
t/Wavelet.t
t/Wavelet2D.t
t/style-trailing-space.t
TODO
xs/BLAS_wrap.1.11.c
xs/BLAS_wrap.1.12.c
Expand Down
4 changes: 2 additions & 2 deletions RELEASE.pod
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ for the C<libgsl> wrapping. If not, check the previous step.

Build the module, with C<./Build>. Check that everything compiles.

=item 6.
=item 6.

Run the standard test suite with C<./Build test>.

Expand Down Expand Up @@ -106,4 +106,4 @@ current release and create the next one, if it does not still exist.

=back

=cut
=cut
2 changes: 1 addition & 1 deletion examples/clicker/chart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ my @x = map { $_/ 100 } ( 0 .. 3000 ) ;
my @negx = map { -$_ } reverse @x ;
my $series;

{
{
no strict 'refs';
$series = new Chart::Clicker::Data::Series({
keys => [@negx, @x],
Expand Down
2 changes: 1 addition & 1 deletion examples/clicker/logo
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ my @x = map { $_/ 100 } ( 0 .. 3000 ) ;
my @negx = map { -$_ } reverse @x ;
my $series;

{
{
no strict 'refs';
$series = new Chart::Clicker::Data::Series({
keys => [@negx, @x],
Expand Down
4 changes: 2 additions & 2 deletions examples/gsl_repl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use Devel::REPL;

package Devel::REPL::Plugin::GSL;
use Devel::REPL::Plugin;
sub BEFORE_PLUGIN
sub BEFORE_PLUGIN
{
package Devel::REPL::Plugin::Packages::DefaultScratchpad;
use aliased 'Math::GSL::Matrix';
Expand All @@ -20,7 +20,7 @@ sub BEFORE_PLUGIN
}

# FancyPrompt
my @plugins = qw(GSL History LexEnv Colors Packages Timing);
my @plugins = qw(GSL History LexEnv Colors Packages Timing);
my $repl = Devel::REPL->new;
$repl->load_plugin($_) for @plugins;
$repl->run;
2 changes: 1 addition & 1 deletion examples/matrix/nonsymmetric_eigen_old
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use Math::Complex;
use Data::Dumper;
use strict;
my $matrix = Math::GSL::Matrix->new(2,2)
->set_row(0, [0,-1] )
->set_row(0, [0,-1] )
->set_row(1, [1, 0] );
print <<STUFF;
Finding eigenvalue/eigenvectors for
Expand Down
2 changes: 1 addition & 1 deletion examples/sf/README
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Requirements:
* Gnuplot

To see a graph of Bessel functions, run the script named "bessel" in the current directory:

./bessel
Expand Down
2 changes: 1 addition & 1 deletion examples/sf/bessel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/perl -w
# Run this script in the same directory as plot_bessel.gnuplot
# i.e cd examples/sf ; ./bessel
# i.e cd examples/sf ; ./bessel
use strict;
use warnings;
use Math::GSL::SF qw/:bessel/;
Expand Down
6 changes: 3 additions & 3 deletions examples/sf/erfc_check
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/usr/bin/perl
# interfc
# v0.2 Keith Lofstrom 2008 Sept 18
# v0.2 Keith Lofstrom 2008 Sept 18
# with tweaks by Jonathan Leto
#
# Compare the results of numerical integration of
# Compare the results of numerical integration of
# (2.0/sqrt(PI)*integral[x,inf](e^(-x^2) ) with the
# erfc() function.
# erfc() function.
#
# The results are pretty good, within 1e-14 or better
# for the examples tried
Expand Down
2 changes: 1 addition & 1 deletion examples/sf/plot_bessel.gnuplot
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set title "Bessel Functions J_0(x), J_1(x), J_2(x), J_3(x), J_4(x), J_5(x)"
set terminal png
set output "bessel.png"

plot "bessel.data" using 1:7 t 'J_5(x)' with lines, "bessel.data" using 1:6 t 'J_4(x)' with lines, "bessel.data" using 1:5 t 'J_3(x)' with lines, "bessel.data" using 1:4 t 'J_2(x)' with lines, "bessel.data" using 1:3 t 'J_1(x)' with lines, "bessel.data" using 1:2 title 'J_0(x)' with lines
plot "bessel.data" using 1:7 t 'J_5(x)' with lines, "bessel.data" using 1:6 t 'J_4(x)' with lines, "bessel.data" using 1:5 t 'J_3(x)' with lines, "bessel.data" using 1:4 t 'J_2(x)' with lines, "bessel.data" using 1:3 t 'J_1(x)' with lines, "bessel.data" using 1:2 title 'J_0(x)' with lines

unset output
set terminal x11
Expand Down
2 changes: 1 addition & 1 deletion examples/tkplotdataset
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/perl
#!/usr/bin/perl
use Tk;
use Tk::PlotDataset;
use Tk::LineGraphDataset;
Expand Down
2 changes: 1 addition & 1 deletion examples/vector/serialize
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ if ( -e 'data' ) {
# The next line coredumps my box
print Dumper [ $v->as_list ];
print join (" ", $v->as_list ) . "\n";
} else {
} else {
my %data;
my $rng = Math::GSL::RNG->new;
my @stuff = map { $rng->get } (1..10) ;
Expand Down
4 changes: 2 additions & 2 deletions examples/vector/speed
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ my $vector = Math::GSL::Vector->new([@stuff]);
my $runs = shift || 50_000;
timethese($runs, {
'min - List::Util ' => sub { min(@stuff) },
'min of Math::GSL vector ' => sub { $vector->min },
'min of Math::GSL vector ' => sub { $vector->min },
});
timethese($runs, {
'max - List::Util ' => sub { max(@stuff) },
'max of Math::GSL vector ' => sub { $vector->max },
'max of Math::GSL vector ' => sub { $vector->max },
});
2 changes: 1 addition & 1 deletion inc/GSLBuilder.pm
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ sub compile_swig {
move($from, "$from.$ver");

{
## updates the version number.
## updates the version number.
## all files are being processed right now.
## later versions might use a fixed list of candidate files.
undef $/;
Expand Down
34 changes: 17 additions & 17 deletions lib/Math/GSL/Test.pm
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ use Math::GSL::Sys qw/gsl_nan gsl_isnan gsl_isinf/;
use Data::Dumper;
use Carp qw/croak/;
our @EXPORT = qw();
our @EXPORT_OK = qw(
is_similar ok_similar
our @EXPORT_OK = qw(
is_similar ok_similar
ok_similar_relative
is_similar_relative
verify verify_results
is_windows
is_similar_relative
verify verify_results
is_windows
ok_status is_status_ok
);
use constant GSL_IS_WINDOWS => ($^O =~ /MSWin32/i) ? 1 : 0 ;
Expand Down Expand Up @@ -51,17 +51,17 @@ Returns true if current system is Windows-like.
sub is_windows() { GSL_IS_WINDOWS }

=head2 is_similar($x,$y;$eps,$similarity_function)
is_similar($x,$y);
is_similar($x, $y, 1e-7);
is_similar($x,$y, 1e-3, sub { ... } );
Return true if $x and $y are within $eps of each other, i.e.
Return true if $x and $y are within $eps of each other, i.e.
abs($x-$y) <= $eps
abs($x-$y) <= $eps
If passed a code reference $similarity_function, it will pass $x and $y as parameters to it and
will check to see if
If passed a code reference $similarity_function, it will pass $x and $y as parameters to it and
will check to see if
$similarity_function->($x,$y_) <= $eps
Expand All @@ -78,7 +78,7 @@ sub is_similar {
diag "is_similar(): items differ in length, $#$x != $#$y !!!";
return 0;
} else {
map {
map {
my $delta = (gsl_isnan($x->[$_]) or gsl_isnan($y->[$_])) ? gsl_nan() : abs($x->[$_] - $y->[$_]);
if($delta > $eps){
diag "\n\tElements start differing at index $_, delta = $delta\n";
Expand All @@ -92,7 +92,7 @@ sub is_similar {
} else {
if( ref $similarity_function eq 'CODE') {
$similarity_function->($x,$y) <= $eps ? return 1 : return 0;
} elsif( defined $x && defined $y) {
} elsif( defined $x && defined $y) {
my $delta = (gsl_isnan($x) or gsl_isnan($y)) ? gsl_nan() : abs($x-$y);
$delta > $eps ? diag qq{\t\t\$x=$x\n\t\t\$y=$y\n\t\tdelta=$delta\n} && return 0 : return 1;
} else {
Expand Down Expand Up @@ -120,7 +120,7 @@ sub verify_results
my $status = eval qq{${class}::$code};

ok(0, qq{'$code' died} ) if !defined $status;

if ( defined $r && $code =~ /_e\(.*\$r/) {
$x = $r->{val};

Expand All @@ -137,7 +137,7 @@ sub verify_results
}
if (gsl_isnan($x)) {
ok( gsl_isnan($expected), sprintf("'$expected'?='$x' (%16b ?= %16b)", $expected, $x) );
} elsif(gsl_isinf($x)) {
} elsif(gsl_isinf($x)) {
ok( gsl_isinf($expected), sprintf("'$expected'?='$x' (%16b ?= %16b)", $expected, $x) );
} else {
cmp_ok( $res,'<=', $eps, "$code ?= $x,\nres= +-$res, eps=$eps" );
Expand All @@ -146,12 +146,12 @@ sub verify_results
}
}

=head2 verify( $results, $class)
=head2 verify( $results, $class)
Takes a hash reference of key/value pairs where the keys are bits of code, which when evaluated should
be within some tolerance of the value. For example:
my $results = {
my $results = {
'gsl_cdf_ugaussian_P(2.0)' => [ 0.977250, 1e-5 ],
'gsl_cdf_ugaussian_Q(2.0)' => [ 0.022750, 1e-7 ],
'gsl_cdf_ugaussian_Pinv(0.977250)'=> [ 2.000000 ],
Expand Down Expand Up @@ -186,7 +186,7 @@ sub verify
ok( gsl_isinf($expected), "'$expected'?='$x'" );
} else {
my $res = abs($x - $expected);
ok( $res <= $eps, "$code ?= $x,\nres= +-$res, eps=$eps" );
ok( $res <= $eps, "$code ?= $x,\nres= +-$res, eps=$eps" );
}
}
}
Expand Down
Loading

0 comments on commit 902d897

Please sign in to comment.