The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

PDL::NDBin::Action::Sum - Action for PDL::NDBin that computes sum

VERSION

version 0.019

DESCRIPTION

This class implements an action for PDL::NDBin.

METHODS

new()

my $instance = PDL::NDBin::Action::Sum->new(
	N    => $N,
	type => double,   # optional
);

Construct an instance for this action. Requires the number of bins $N as input. Optionally allows the type of the output piddle to be set (defaults to the type of the variable this instance is associated with, or at least long).

process()

$instance->process( $iter );

Run the action with the given iterator $iter. This action will compute all bins during the first call and will subsequently deactivate the variable.

result()

my $result = $instance->result;

Return the result of the computation.

AUTHOR

Edward Baudrez <ebaudrez@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2020 by Edward Baudrez.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.