1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109
|
%perlcode %{
use Data::Dumper;
use Carp qw/croak/;
use Math::GSL::Errno qw/:all/;
@EXPORT_OK = qw/
gsl_ntuple_open
gsl_ntuple_create
gsl_ntuple_write
gsl_ntuple_read
gsl_ntuple_bookdata
gsl_ntuple_project
gsl_ntuple_close
/;
%EXPORT_TAGS = ( all => [ @EXPORT_OK ] );
=encoding utf8
=head1 NAME
Math::GSL::NTuple - Functions for creating and manipulating ntuples, sets of values
=head1 SYNOPSIS
This module is partially implemented. Patches Welcome!
use Math::GSL::NTuple qw /:all/;
=head1 DESCRIPTION
Here is a list of all the functions in this module :
=over
=cut
sub new
{
my ($class,$values) = @_;
my $this = {};
my $ntuple = Math::GSL::NTuple::gsl_ntuple->new;
$this->{_ntuple} = $ntuple;
bless $this, $class;
}
sub raw
{
return (shift)->{_ntuple};
}
=item * <gsl_ntuple_open($filename, $ntuple_data, $size)>
This function opens an existing ntuple file $filename for reading and returns a
pointer to a corresponding ntuple struct. The ntuples in the file must have size
$size. A pointer to memory for the current ntuple row $ntuple_data, which is an
array reference, must be supplied -- this is used to copy ntuples in and out of
the file.
=item * <gsl_ntuple_create>
This function creates a new write-only ntuple file $filename for ntuples of size
$size and returns a pointer to the newly created ntuple struct. Any existing
file with the same name is truncated to zero length and overwritten. A pointer
to memory for the current ntuple row $ntuple_data, which is an array reference,
must be supplied -- this is used to copy ntuples in and out of the file.
=item * <gsl_ntuple_write($ntuple)>
This function writes the current $ntuple $ntuple->{ntuple_data} of size
$ntuple->{size} to the corresponding file.
=item * <gsl_ntuple_bookdata($ntuple)>
This function is a synonym for gsl_ntuple_write.
=item * <gsl_ntuple_read($ntuple)>
This function reads the current row of the ntuple file for ntuple and stores the
values in $ntuple->{data}.
=item * <gsl_ntuple_project()>
=item * <gsl_ntuple_close($ntuple)>
This function closes the ntuple file ntuple and frees its associated allocated
memory.
=back
For more information on the functions, we refer you to the GSL official
documentation: L<http://www.gnu.org/software/gsl/manual/html_node/>
=head1 AUTHORS
Jonathan "Duke" Leto <jonathan@leto.net> and Thierry Moisan <thierry.moisan@gmail.com>
=head1 COPYRIGHT AND LICENSE
Copyright (C) 2008-2024 Jonathan "Duke" Leto and Thierry Moisan
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
=cut
%}
|