pub struct BinLimits(_);
Expand description

Structure representing bin limits.

Implementations

Constructor for BinLimits.

Panics

TODO

Returns the number of bins.

Returns the bin index for observable value. If the value over- or underflows, the return value is None.

Panics

TODO

Returns the left-most bin limit

Panics

TODO

Returns the limits in a Vec.

Examples
use pineappl::bin::BinLimits;

// example with equally sized bins
let equal_bins = BinLimits::new(vec![0.25, 0.5, 0.75, 1.0]);
assert_eq!(equal_bins.limits(), vec![0.25, 0.5, 0.75, 1.0]);

// example with unequally sized bins
let unequal_bins = BinLimits::new(vec![0.125, 0.25, 1.0, 1.5]);
assert_eq!(unequal_bins.limits(), vec![0.125, 0.25, 1.0, 1.5]);

Merges the bins for the corresponding range together in a single one.

Errors

When bins contains any indices that do not correspond to bins this method returns an error.

Returns the size for each bin.

Examples
use pineappl::bin::BinLimits;

// example with equally sized bins
let equal_bins = BinLimits::new(vec![0.25, 0.5, 0.75, 1.0]);
assert_eq!(equal_bins.bin_sizes(), vec![0.25, 0.25, 0.25]);

// example with unequally sized bins
let unequal_bins = BinLimits::new(vec![0.125, 0.25, 1.0, 1.5]);
assert_eq!(unequal_bins.bin_sizes(), vec![0.125, 0.75, 0.5]);

Merge the limits of other into self on the right-hand-side. If both limits are non-consecutive, an error is returned.

Errors

If the right-most limit of self is different from the left-most limit of other, the bins are non-consecutive and an error is returned.

Panics

TODO

Returns the right-most bin limit

Panics

TODO

Delete bins number of bins from the start.

Delete bins number of bins from the end.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Deserialize this value from the given Serde deserializer. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. 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
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.