package Math::Histogram;
use 5.008001;
use strict;
use warnings;
use Carp qw(croak);
use JSON::XS ();
our $VERSION = '1.04';
require XSLoader;
XSLoader::load('Math::Histogram', $VERSION);
require M
shift;
my $hash = $self->_as_hash;
return JSON::XS::encode_json($hash);
}
sub deserialize {
my $class = shift;
my $hash = JSON::XS::decode_json(ref($_[0]) ? ${$_[0]} : $_[0]);
return $clas
ins in the histogram.
=head2 serialize
Returns a JSON string that represents this histogram object.
=head2 deserialize
Class method. Given a JSON string as generated by C<serialize()>,
recreates t
istogram ();
use JSON::XS ();
# rest of implementation in C, see XS.xs and mh_axis.h
sub serialize {
my $self = shift;
my $hash = $self->_as_hash;
return JSON::XS::encode_json($hash);
}
sub d
eserialize {
my $class = shift;
my $hash = JSON::XS::decode_json(ref($_[0]) ? ${$_[0]} : $_[0]);
return $class->_from_hash($hash);
}
1;
__END__
=head1 NAME
Math::Histogram::Axis - Object
nbins + 1> for overflow.
=head2 serialize
Returns a JSON string that represents this axis object.
=head2 deserialize
Class method. Given a JSON string as generated by C<serialize()>,
recreates the