package gsl

  1. Overview
  2. Docs

Module Gsl.HistoSource

Histograms

Sourcetype t = private {
  1. n : int;
    (*

    number of histogram bins

    *)
  2. range : float array;
    (*

    ranges of the bins ; n+1 elements

    *)
  3. bin : float array;
    (*

    counts for each bin ; n elements

    *)
}

The histogram type

Sourceval check : t -> bool

Allocating histograms

Sourceval make : int -> t
Sourceval copy : t -> t
Sourceval set_ranges : t -> float array -> unit
Sourceval set_ranges_uniform : t -> xmin:float -> xmax:float -> unit

Updating and accessing histogram elements

Sourceval accumulate : t -> ?w:float -> float -> unit
Sourceval get : t -> int -> float
Sourceval get_range : t -> int -> float * float
Sourceval h_max : t -> float
Sourceval h_min : t -> float
Sourceval bins : t -> int
Sourceval reset : t -> unit

Searching histogram ranges

Sourceval find : t -> float -> int

Histograms statistics

Sourceval max_val : t -> float
Sourceval max_bin : t -> int
Sourceval min_val : t -> float
Sourceval min_bin : t -> int
Sourceval mean : t -> float
Sourceval sigma : t -> float
Sourceval sum : t -> float

Histogram operations

Sourceval equal_bins_p : t -> t -> bool
Sourceval add : t -> t -> unit
Sourceval sub : t -> t -> unit
Sourceval mul : t -> t -> unit
Sourceval div : t -> t -> unit
Sourceval scale : t -> float -> unit
Sourceval shift : t -> float -> unit

Resampling

Sourcetype histo_pdf = private {
  1. pdf_n : int;
  2. pdf_range : float array;
  3. pdf_sum : float array;
}
Sourceval init : t -> histo_pdf
Sourceval sample : histo_pdf -> float -> float