pub struct JointHistogram { /* private fields */ }Expand description
An N-dimensional empirical weighted histogram stored in row-major order.
The last axis varies fastest. Bins are half-open on both ordinary and final
upper edges, matching crate::histogram::Histogram flow semantics.
Implementations§
Source§impl JointHistogram
impl JointHistogram
Sourcepub fn empty(axes: Vec<Vec<f64>>) -> Result<JointHistogram, LadduPhysicsError>
pub fn empty(axes: Vec<Vec<f64>>) -> Result<JointHistogram, LadduPhysicsError>
Construct an empty joint histogram from ordered axis edges.
§Errors
Returns an error for no axes, malformed axis edges, shape overflow, or an accumulator allocation that cannot be satisfied.
Sourcepub fn sum_squared_weights(&self) -> &[f64]
pub fn sum_squared_weights(&self) -> &[f64]
Row-major flattened squared-weight sums.
Sourcepub fn reported_errors(&self) -> Option<Vec<f64>>
pub fn reported_errors(&self) -> Option<Vec<f64>>
Return errors only when the stored constituents define an honest uncertainty.
Sourcepub fn uncertainty_status(&self) -> HistogramUncertaintyStatus
pub fn uncertainty_status(&self) -> HistogramUncertaintyStatus
Return whether covariance information is sufficient to report errors.
Sourcepub fn diagnostics(&self) -> &JointHistogramDiagnostics
pub fn diagnostics(&self) -> &JointHistogramDiagnostics
Aggregate invalid-event diagnostics.
Sourcepub fn fill_weighted(
&mut self,
coordinates: &[f64],
weight: f64,
) -> Result<(), LadduPhysicsError>
pub fn fill_weighted( &mut self, coordinates: &[f64], weight: f64, ) -> Result<(), LadduPhysicsError>
Fill one ordered coordinate using an empirical event weight.
§Errors
Returns an error when the coordinate rank differs from the histogram rank or a finite weight’s square cannot be represented.
Sourcepub fn merge(&mut self, other: &JointHistogram) -> Result<(), LadduPhysicsError>
pub fn merge(&mut self, other: &JointHistogram) -> Result<(), LadduPhysicsError>
Merge a histogram filled from a disjoint event partition atomically.
§Errors
Returns an error for incompatible geometry, count overflow, or a
nonfinite merged accumulator. A failure leaves self unchanged.
Sourcepub fn add(
&self,
other: &JointHistogram,
) -> Result<JointHistogram, LadduPhysicsError>
pub fn add( &self, other: &JointHistogram, ) -> Result<JointHistogram, LadduPhysicsError>
Add a compatible histogram without assuming the inputs are independent.
§Errors
Returns an error for incompatible geometry or non-finite output.
Sourcepub fn add_independent(
&self,
other: &JointHistogram,
) -> Result<JointHistogram, LadduPhysicsError>
pub fn add_independent( &self, other: &JointHistogram, ) -> Result<JointHistogram, LadduPhysicsError>
Add a compatible histogram with an explicit caller assertion of independence.
§Errors
Returns an error for incompatible geometry or non-finite output.
Sourcepub fn subtract(
&self,
other: &JointHistogram,
) -> Result<JointHistogram, LadduPhysicsError>
pub fn subtract( &self, other: &JointHistogram, ) -> Result<JointHistogram, LadduPhysicsError>
Subtract a compatible histogram without assuming the inputs are independent.
§Errors
Returns an error for incompatible geometry or non-finite output.
Sourcepub fn subtract_independent(
&self,
other: &JointHistogram,
) -> Result<JointHistogram, LadduPhysicsError>
pub fn subtract_independent( &self, other: &JointHistogram, ) -> Result<JointHistogram, LadduPhysicsError>
Subtract a compatible histogram with an explicit caller assertion of independence.
§Errors
Returns an error for incompatible geometry or non-finite output.
Sourcepub fn scaled(&self, factor: f64) -> Result<JointHistogram, LadduPhysicsError>
pub fn scaled(&self, factor: f64) -> Result<JointHistogram, LadduPhysicsError>
Scale central values, diagnostic weights, and uncertainty constituents.
§Errors
Returns an error when the factor or scaled output is non-finite.
Trait Implementations§
Source§impl Clone for JointHistogram
impl Clone for JointHistogram
Source§fn clone(&self) -> JointHistogram
fn clone(&self) -> JointHistogram
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for JointHistogram
impl Debug for JointHistogram
Source§impl<'de> Deserialize<'de> for JointHistogram
impl<'de> Deserialize<'de> for JointHistogram
Source§fn deserialize<D>(
deserializer: D,
) -> Result<JointHistogram, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<JointHistogram, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Source§impl PartialEq for JointHistogram
impl PartialEq for JointHistogram
Source§impl Serialize for JointHistogram
impl Serialize for JointHistogram
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for JointHistogram
Auto Trait Implementations§
impl Freeze for JointHistogram
impl RefUnwindSafe for JointHistogram
impl Send for JointHistogram
impl Sync for JointHistogram
impl Unpin for JointHistogram
impl UnsafeUnpin for JointHistogram
impl UnwindSafe for JointHistogram
Blanket Implementations§
impl<T> Allocation for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
impl<T> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.