pub enum MassProposal {
Fixed {
mass: f64,
},
Uniform {
low: f64,
high: f64,
},
}Expand description
Invariant-mass proposal for a generated edge.
Variants§
Fixed
Always use one invariant mass.
Uniform
Sample uniformly between the given bounds, clipped to kinematic support.
Implementations§
Source§impl MassProposal
impl MassProposal
Sourcepub fn propose(
&self,
minimum: f64,
maximum: f64,
rng: &mut ProposalRng,
) -> LadduPhysicsResult<MassProposalResult>
pub fn propose( &self, minimum: f64, maximum: f64, rng: &mut ProposalRng, ) -> LadduPhysicsResult<MassProposalResult>
Draw a mass within the supplied kinematic interval.
§Errors
Returns LadduPhysicsError when the kinematic interval or proposal
bounds are non-finite, empty, or exclude a fixed mass.
Sourcepub fn density(
&self,
minimum: f64,
maximum: f64,
mass: f64,
) -> LadduPhysicsResult<Option<f64>>
pub fn density( &self, minimum: f64, maximum: f64, mass: f64, ) -> LadduPhysicsResult<Option<f64>>
Evaluate the proposal density when it is available.
Custom proposals may retain the default None; density-aware generators
use this hook only for optional importance adaptation.
§Errors
Returns LadduPhysicsError when the kinematic interval and uniform
proposal have no valid finite overlap.
Trait Implementations§
Source§impl Clone for MassProposal
impl Clone for MassProposal
Source§fn clone(&self) -> MassProposal
fn clone(&self) -> MassProposal
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for MassProposal
Source§impl Debug for MassProposal
impl Debug for MassProposal
Source§impl<'de> Deserialize<'de> for MassProposal
impl<'de> Deserialize<'de> for MassProposal
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<f64> for MassProposal
impl From<f64> for MassProposal
Auto Trait Implementations§
impl Freeze for MassProposal
impl RefUnwindSafe for MassProposal
impl Send for MassProposal
impl Sync for MassProposal
impl Unpin for MassProposal
impl UnsafeUnpin for MassProposal
impl UnwindSafe for MassProposal
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
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<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>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
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
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.