ndhistogram ::axis Struct Uniform Copy item path Source pub struct Uniform<T = f64 > { }
Expand description An axis with equal sized bins.
An axis with N equally spaced, equal sized, bins between [low, high).
Below (above) this range is an underflow (overflow) bin.
Hence this axis has N+2 bins.
For floating point types, positive and negative infinities map to overflow
and underflow bins respectively. NaN maps to the overflow bin.
§ Example
Create a 1D histogram with 10 uniform bins between -5.0 and 5.0, plus overflow and underflow bins.
use ndhistogram::{ndhistogram, Histogram};
use ndhistogram::axis::{Axis, Uniform, BinInterval};
let hist = ndhistogram! (Uniform::new(10 , -5.0 , 5.0 )? );
let axis = & hist.axes().as_tuple().0 ;
assert_eq! (axis.bin(0 ), Some (BinInterval::underflow(-5.0 )));
assert_eq! (axis.bin(1 ), Some (BinInterval::new(-5.0 , -4.0 )));
assert_eq! (axis.bin(11 ), Some (BinInterval::overflow(5.0 )));
Factory method to create an axis with num uniformly spaced bins in the range [low, high). Under/overflow bins cover values outside this range.
Only implemented for Float . Use Uniform::with_step_size for integers.
Factory method to create an axis with num uniformly spaced bins in the range [low, low+num*step). Under/overflow bins cover values outside this range.
The number of bins and step size must both be greater than zero, otherwise an error is returned.
The number of bins must be representable in the type T, otherwise an error is returned.
Low edge of axis (excluding underflow bin).
High edge of axis (excluding overflow bin).
The type representing a location on this axis.
The type of an interval representing the set of Coordinates that correspond to a histogram bin
Map from coordinate to bin number.
Returns an option as not all valid coordinates are necessarily contained within a bin.
The number of bins in this axis, including underflow and overflow.
Map from bin number to axis to the interval covering the range of coordinates that this bin contains.
Returns an option in case an index >=
Axis::num_bins is given.
An iterator over bin numbers
An iterator over bin numbers and bin intervals
An iterator over bin intervals.
The number of dimensions that this object corresponds to.
For most Axis types this will simply be 1.
However,
Axes (i.e. a set of
Axis ) also implement
Axis
and should return the number of
Axis that it contains.
Performs copy-assignment from
source
.
Read more Formats the value using the given formatter.
Read more Returns the “default value” for a type.
Read more Formats the value using the given formatter.
Read more The type of the elements being iterated over.
Which kind of iterator are we turning this into?
Compares and returns the maximum of two values.
Read more Compares and returns the minimum of two values.
Read more Restrict a value to a certain interval.
Read more Tests for self
and other
values to be equal, and is used by ==
.
Tests for !=
. The default implementation is almost always sufficient,
and should not be overridden without very good reason.
This method returns an ordering between
self
and
other
values if one exists.
Read more Tests less than (for
self
and
other
) and is used by the
<
operator.
Read more Tests less than or equal to (for
self
and
other
) and is used by the
<=
operator.
Read more Tests greater than (for
self
and
other
) and is used by the
>
operator.
Read more Tests greater than or equal to (for
self
and
other
) and is used by
the
>=
operator.
Read more Immutably borrows from an owned value.
Read more Mutably borrows from an owned value.
Read more 🔬 This is a nightly-only experimental API. (clone_to_uninit
#126799 ) Performs copy-assignment from
self
to
dst
.
Read more Returns the argument unchanged.
Calls U::from(self)
.
That is, this conversion is whatever the implementation of
From <T> for U
chooses to do.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning.
Read more Uses borrowed data to replace owned data, usually by cloning.
Read more Converts the given value to a
String
.
Read more The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.