Skip to content
Browse files

patch for README

  • Loading branch information...
1 parent dcd49ab commit 0b85ba3516c0f20532a6773a0b7af64fafb992f7 @kmx committed Jun 16, 2011
Showing with 121 additions and 25 deletions.
  1. +1 −0 .gitignore
  2. +18 −11 Build.PL
  3. +57 −1 README
  4. +45 −13 lib/Math/EasyGSL.pm
View
1 .gitignore
@@ -18,4 +18,5 @@ tmp*
*.exp
META.yml
MYMETA.yml
+MYMETA.json
MANIFEST
View
29 Build.PL
@@ -9,19 +9,26 @@ BEGIN {
}
}
-
my $builder = Module::Build->new(
- module_name => 'Math::EasyGSL',
- license => 'perl',
- dist_author => q{KMX <kmx@cpan.org>},
- dist_version_from => 'lib/Math/EasyGSL.pm',
- build_requires => {
- 'Test::More' => 0,
+ module_name => 'Math::EasyGSL',
+ license => 'perl',
+ dist_author => q{KMX <kmx@cpan.org>},
+ dist_version_from => 'lib/Math/EasyGSL.pm',
+ build_requires => { #need to have for running: ./Build (install|test)
+ 'Test::More' => 0,
+ 'Test::Number::Delta' => 0,
+ },
+ c_source => 'src', # ppport.h
+ create_readme => 1,
+ extra_linker_flags => `gsl-config --libs` || `pkg-config --libs gsl`,
+ extra_compiler_flags=> `gsl-config --cflags` || `pkg-config --cflags gsl`,
+ add_to_cleanup => [ 'Math-EasyGSL-*' ],
+ meta_merge => {
+ resources => {
+ bugtracker => 'https://rt.cpan.org/NoAuth/Bugs.html?Dist=Math-EasyGSL',
+ repository => 'https://github.com/kmx/perl-math-easygsl'
},
- c_source => 'src', # ppport.h
- extra_linker_flags => `gsl-config --libs` || `pkg-config --libs gsl`,
- extra_compiler_flags=> `gsl-config --cflags` || `pkg-config --cflags gsl`,
- add_to_cleanup => [ 'Math-EasyGSL-*' ],
+ },
);
$builder->create_build_script();
View
58 README
@@ -1 +1,57 @@
-Math-EasyGSL
+NAME
+ Math::EasyGSL - Perl bindings to GSL (GNU Scientific Library)
+
+VERSION
+ Version 0.001
+
+SYNOPSIS
+ # the main module Math::EasyGSL has just functions providing simple info
+ use Math::EasyGSL ':all';
+ print "Welcome to Math::EasyGSL version=" . GSL_VERSION;
+
+ # the real math related function are in accompanying modules
+ use Math::EasyGSL::Statistics ':all';
+ my @data = (11, 12, 13, 14, 15);
+ print "Mean=" . stats_mean(\@data);
+
+ This module is not intended as a replacement for Math::GSL.
+
+ Math::EasyGSL is not covering 100% of all GSL functions. It binds into
+ perl just part of GSL library (I am adding more functions on "if-needed"
+ basis - if you miss something let me know).
+
+ On the other hand the interface of Math::EasyGSL is more perl-friendly
+ than Math::GSL - it is not 1:1 translation of the original C functions.
+
+EXPORT
+ By default there are no functions exported. You can import into your
+ program all available functions by calling:
+
+ use Math::EasyGSL ':all';
+
+ Or you can import just selected functions:
+
+ use Math::EasyGSL::PDF qw(GSL_VERSION);
+
+ There are no other import tags.
+
+SUBROUTINES/METHODS
+ Version related functions
+ GSL_VERSION
+ Returns a string with version of underlaying GSL library like: `1.14'
+
+ GSL_MAJOR_VERSION
+ Returns major version number like: `1' (for GSL v1.14)
+
+ GSL_MINOR_VERSION
+ Returns version number like: `14' (for GSL v1.14)
+
+LICENSE AND COPYRIGHT
+ Copyright 2011 KMX.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of either: the GNU General Public License as published
+ by the Free Software Foundation; or the Artistic License.
+
+ See http://dev.perl.org/licenses/ for more information.
+
View
58 lib/Math/EasyGSL.pm
@@ -2,15 +2,17 @@ package Math::EasyGSL;
=head1 NAME
-Math::EasyGSL - The great new Math::EasyGSL!
+Math::EasyGSL - Perl bindings to GSL (GNU Scientific Library)
=head1 VERSION
-Version 0.01
+Version 0.001
=cut
-our $VERSION = "0.01";
+# following recommendation from http://www.dagolden.com/index.php/369/version-numbers-should-be-boring/
+our $VERSION = "0.001";
+$VERSION = eval $VERSION;
@ISA = qw/ DynaLoader /;
require DynaLoader;
@@ -25,25 +27,55 @@ GSL_MAJOR_VERSION
);
%EXPORT_TAGS = ( 'all' => \@EXPORT_OK );
-sub xxx {
-}
-
=head1 SYNOPSIS
-Perhaps a little code snippet.
+ # the main module Math::EasyGSL has just functions providing simple info
+ use Math::EasyGSL ':all';
+ print "Welcome to Math::EasyGSL version=" . GSL_VERSION;
+
+ # the real math related function are in accompanying modules
+ use Math::EasyGSL::Statistics ':all';
+ my @data = (11, 12, 13, 14, 15);
+ print "Mean=" . stats_mean(\@data);
- use Math::EasyGSL;
+This module B<is not intended> as a replacement for L<Math::GSL>.
- my $foo = Math::EasyGSL->new();
- ...
+Math::EasyGSL is not covering 100% of all GSL functions. It binds into
+perl just part of GSL library (I am adding more functions on "if-needed"
+basis - if you miss something let me know).
+On the other hand the interface of L<Math::EasyGSL> is more perl-friendly than
+L<Math::GSL> - it is not 1:1 translation of the original C functions.
+
=head1 EXPORT
-A list of functions that can be exported. You can delete this section
-if you don't export anything, such as for a purely object-oriented module.
+By default there are no functions exported. You can import into your
+program all available functions by calling:
+
+ use Math::EasyGSL ':all';
+
+Or you can import just selected functions:
+
+ use Math::EasyGSL::PDF qw(GSL_VERSION);
+
+There are no other import tags.
=head1 SUBROUTINES/METHODS
+=head2 Version related functions
+
+=head3 GSL_VERSION
+
+Returns a string with version of underlaying GSL library like: C<1.14>
+
+=head3 GSL_MAJOR_VERSION
+
+Returns major version number like: C<1> (for GSL v1.14)
+
+=head3 GSL_MINOR_VERSION
+
+Returns version number like: C<14> (for GSL v1.14)
+
=head1 LICENSE AND COPYRIGHT
Copyright 2011 KMX.
@@ -56,4 +88,4 @@ See http://dev.perl.org/licenses/ for more information.
=cut
-1; # End of Math::EasyGSL
+1;

0 comments on commit 0b85ba3

Please sign in to comment.
Something went wrong with that request. Please try again.