Math::Histo::PDL

High-performance PDL (Perl Data Language) integration and zero-copy ingestion for Math::Histo.

Features

Installation

perl Makefile.PL
make
make test
make install

Quick Example

use PDL;
use Math::Histo;
use Math::Histo::PDL qw(:all);

# Create and fill 1D histogram from a piddle
my $data = grandom(1_000_000);
my $h = hist1d($data, bins => 100, min => -5, max => 5);

# Export to PDL
my ($counts, $edges, $errors) = $h->to_pdl;
my $centers = $h->centers_pdl;

# 2D Histogram from coordinate matrix
my $coords = grandom(2, 500_000);
my $h2d = hist2d($coords, bins => 50);
my ($matrix, $x_edges, $y_edges) = $h2d->to_pdl;

License

MIT License. Copyright (c) 2026 Steffen Mueller.