Math-GSL
view release on metacpan or search on metacpan
lib/Math/GSL/Histogram.pm view on Meta::CPAN
=item C<gsl_histogram_clone($src)> - This function returns a pointer to a newly created histogram which is an exact copy of the histogram $src.
=item C<gsl_histogram_max_val($h)> - This function returns the maximum value contained in the histogram bins.
=item C<gsl_histogram_max_bin($h)> - This function returns the index of the bin containing the maximum value. In the case where several bins contain the same maximum value the smallest index is returned.
=item C<gsl_histogram_min_val($h)> - This function returns the minimum value contained in the histogram bins.
=item C<gsl_histogram_min_bin($h)> - This function returns the index of the bin containing the minimum value. In the case where several bins contain the same maximum value the smallest index is returned.
=item C<gsl_histogram_equal_bins_p($h1, $h2)> - This function returns 1 if the all of the individual bin ranges of the two histograms are identical, and 0 otherwise.
=item C<gsl_histogram_add($h1, $h2)> - This function adds the contents of the bins in histogram $h2 to the corresponding bins of histogram $h1, i.e. h'_1(i) = h_1(i) + h_2(i). The two histograms must have identical bin ranges.
=item C<gsl_histogram_sub($h1, $h2)> - This function subtracts the contents of the bins in histogram $h2 from the corresponding bins of histogram $h1, i.e. h'_1(i) = h_1(i) - h_2(i). The two histograms must have identical bin ranges.
=item C<gsl_histogram_mul($h1, $h2)> - This function multiplies the contents of the bins of histogram $h1 by the contents of the corresponding bins in histogram $h2, i.e. h'_1(i) = h_1(i) * h_2(i). The two histograms must have identical bin ranges.
=item C<gsl_histogram_div($h1, $h2)> - This function divides the contents of the bins of histogram $h1 by the contents of the corresponding bins in histogram $h2, i.e. h'_1(i) = h_1(i) / h_2(i). The two histograms must have identical bin ranges.
=item C<gsl_histogram_scale($h, $scale)> - This function multiplies the contents of the bins of histogram $h by the constant $scale, i.e. h'_1(i) = h_1(i) * scale.
=item C<gsl_histogram_shift($h, $offset)> - This function shifts the contents of the bins of histogram $h by the constant $offset, i.e. h'_1(i) = h_1(i) + offset.
=item C<gsl_histogram_sigma($h)> - This function returns the standard deviation of the histogrammed variable, where the histogram is regarded as a probability distribution. Negative bin values are ignored for the purposes of this calculation. The acc...
=item C<gsl_histogram_mean($h)> - This function returns the mean of the histogrammed variable, where the histogram is regarded as a probability distribution. Negative bin values are ignored for the purposes of this calculation. The accuracy of the re...
=item C<gsl_histogram_sum($h)> - This function returns the sum of all bin values. Negative bin values are included in the sum.
=item C<gsl_histogram_fwrite($stream, $h)> - This function writes the ranges and bins of the histogram $h to the stream $stream, which has been opened by the gsl_fopen function from the Math::GSL module, in binary format. The return value is 0 for su...
=item C<gsl_histogram_fread($stream, $h)> - This function reads into the histogram $h from the open stream $stream, which has been opened by the gsl_fopen function from the Math::GSL module, in binary format. The histogram $h must be preallocated wi...
=item C<gsl_histogram_fprintf($stream, $h, $range_format, $bin_format)> - This function writes the ranges and bins of the histogram $h line-by-line to the stream $stream (from the gsl_fopen function from the Math::GSL module) using the format specifi...
=over
=item range[0] range[1] bin[0]
=item range[1] range[2] bin[1]
=item range[2] range[3] bin[2]
=item ....
=item range[n-1] range[n] bin[n-1]
=back
The values of the ranges are formatted using range_format and the value of the bins are formatted using bin_format. Each line contains the lower and upper limit of the range of the bins and the value of the bin itself. Since the upper limit of one bi...
=item C<gsl_histogram_fscanf($stream, $h)> - This function reads formatted data from the stream $stream, which has been opened by the gsl_fopen function from the Math::GSL module, into the histogram $h. The data is assumed to be in the three-column f...
=item C<gsl_histogram_pdf_alloc($n)> - This function allocates memory for a probability distribution with $n bins and returns a pointer to a newly initialized gsl_histogram_pdf struct. If insufficient memory is available a null pointer is returned an...
=item C<gsl_histogram_pdf_init($p, $h)> - This function initializes the probability distribution $p with the contents of the histogram $h. If any of the bins of $h are negative then the error handler is invoked with an error code of $GSL_EDOM because...
=item C<gsl_histogram_pdf_free($p)> - This function frees the probability distribution function $p and all of the memory associated with it.
=item C<gsl_histogram_pdf_sample($p, $r)> - This function uses $r, a uniform random number between zero and one, to compute a single random sample from the probability distribution $p. The algorithm used to compute the sample s is given by the fo...
=back
=head1 EXAMPLES
The following example shows how to create a histogram with logarithmic bins with ranges [1,10), [10,100) and [100,1000).
$h = gsl_histogram_alloc (3);
# bin[0] covers the range 1 <= x < 10
# bin[1] covers the range 10 <= x < 100
# bin[2] covers the range 100 <= x < 1000
$range = [ 1.0, 10.0, 100.0, 1000.0 ];
gsl_histogram_set_ranges($h, $range, 4);
=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
1;
( run in 0.601 second using v1.01-cache-2.11-cpan-39bf76dae61 )