pub struct Evaluator {
pub amplitudes: Vec<Box<dyn Amplitude>>,
pub resources: Arc<RwLock<Resources>>,
pub dataset: Arc<Dataset>,
pub expression: ExpressionNode,
/* private fields */
}Expand description
Evaluator for Expression that mirrors the existing evaluator behavior.
Fields§
§amplitudes: Vec<Box<dyn Amplitude>>§resources: Arc<RwLock<Resources>>§dataset: Arc<Dataset>§expression: ExpressionNodeImplementations§
Source§impl Evaluator
impl Evaluator
Sourcepub fn parameters(&self) -> Vec<String>
pub fn parameters(&self) -> Vec<String>
Get the list of parameter names in the order they appear in the Evaluator::evaluate
method.
Sourcepub fn free_parameters(&self) -> Vec<String>
pub fn free_parameters(&self) -> Vec<String>
Get the list of free parameter names.
Sourcepub fn fixed_parameters(&self) -> Vec<String>
pub fn fixed_parameters(&self) -> Vec<String>
Get the list of fixed parameter names.
Sourcepub fn n_parameters(&self) -> usize
pub fn n_parameters(&self) -> usize
Total number of parameters.
Sourcepub fn fix(&self, name: &str, value: f64) -> LadduResult<Self>
pub fn fix(&self, name: &str, value: f64) -> LadduResult<Self>
Return a new Evaluator with the given parameter fixed to a value.
Sourcepub fn free(&self, name: &str) -> LadduResult<Self>
pub fn free(&self, name: &str) -> LadduResult<Self>
Return a new Evaluator with the given parameter freed.
Sourcepub fn rename_parameter(&self, old: &str, new: &str) -> LadduResult<Self>
pub fn rename_parameter(&self, old: &str, new: &str) -> LadduResult<Self>
Return a new Evaluator with a single parameter renamed.
Sourcepub fn rename_parameters(
&self,
mapping: &HashMap<String, String>,
) -> LadduResult<Self>
pub fn rename_parameters( &self, mapping: &HashMap<String, String>, ) -> LadduResult<Self>
Return a new Evaluator with several parameters renamed.
Sourcepub fn activate<T: AsRef<str>>(&self, name: T)
pub fn activate<T: AsRef<str>>(&self, name: T)
Activate an Amplitude by name, skipping missing entries.
Sourcepub fn activate_strict<T: AsRef<str>>(&self, name: T) -> LadduResult<()>
pub fn activate_strict<T: AsRef<str>>(&self, name: T) -> LadduResult<()>
Activate an Amplitude by name and return an error if it is missing.
Sourcepub fn activate_many<T: AsRef<str>>(&self, names: &[T])
pub fn activate_many<T: AsRef<str>>(&self, names: &[T])
Activate several Amplitudes by name, skipping missing entries.
Sourcepub fn activate_many_strict<T: AsRef<str>>(
&self,
names: &[T],
) -> LadduResult<()>
pub fn activate_many_strict<T: AsRef<str>>( &self, names: &[T], ) -> LadduResult<()>
Activate several Amplitudes by name and return an error if any are missing.
Sourcepub fn activate_all(&self)
pub fn activate_all(&self)
Activate all registered Amplitudes.
Sourcepub fn deactivate<T: AsRef<str>>(&self, name: T)
pub fn deactivate<T: AsRef<str>>(&self, name: T)
Dectivate an Amplitude by name, skipping missing entries.
Sourcepub fn deactivate_strict<T: AsRef<str>>(&self, name: T) -> LadduResult<()>
pub fn deactivate_strict<T: AsRef<str>>(&self, name: T) -> LadduResult<()>
Dectivate an Amplitude by name and return an error if it is missing.
Sourcepub fn deactivate_many<T: AsRef<str>>(&self, names: &[T])
pub fn deactivate_many<T: AsRef<str>>(&self, names: &[T])
Deactivate several Amplitudes by name, skipping missing entries.
Sourcepub fn deactivate_many_strict<T: AsRef<str>>(
&self,
names: &[T],
) -> LadduResult<()>
pub fn deactivate_many_strict<T: AsRef<str>>( &self, names: &[T], ) -> LadduResult<()>
Dectivate several Amplitudes by name and return an error if any are missing.
Sourcepub fn deactivate_all(&self)
pub fn deactivate_all(&self)
Deactivate all registered Amplitudes.
Sourcepub fn isolate<T: AsRef<str>>(&self, name: T)
pub fn isolate<T: AsRef<str>>(&self, name: T)
Isolate an Amplitude by name (deactivate the rest), skipping missing entries.
Sourcepub fn isolate_strict<T: AsRef<str>>(&self, name: T) -> LadduResult<()>
pub fn isolate_strict<T: AsRef<str>>(&self, name: T) -> LadduResult<()>
Isolate an Amplitude by name (deactivate the rest) and return an error if it is missing.
Sourcepub fn isolate_many<T: AsRef<str>>(&self, names: &[T])
pub fn isolate_many<T: AsRef<str>>(&self, names: &[T])
Isolate several Amplitudes by name (deactivate the rest), skipping missing entries.
Sourcepub fn isolate_many_strict<T: AsRef<str>>(&self, names: &[T]) -> LadduResult<()>
pub fn isolate_many_strict<T: AsRef<str>>(&self, names: &[T]) -> LadduResult<()>
Isolate several Amplitudes by name (deactivate the rest) and return an error if any are missing.
Sourcepub fn evaluate_local(&self, parameters: &[f64]) -> Vec<Complex64> ⓘ
pub fn evaluate_local(&self, parameters: &[f64]) -> Vec<Complex64> ⓘ
Evaluate the stored Expression over the events in the Dataset stored by the
Evaluator with the given values for free parameters (non-MPI version).
§Notes
This method is not intended to be called in analyses but rather in writing methods
that have mpi-feature-gated versions. Most users will want to call Evaluator::evaluate instead.
Sourcepub fn evaluate(&self, parameters: &[f64]) -> Vec<Complex64> ⓘ
pub fn evaluate(&self, parameters: &[f64]) -> Vec<Complex64> ⓘ
Evaluate the stored Expression over the events in the Dataset stored by the
Evaluator with the given values for free parameters.
Sourcepub fn evaluate_batch_local(
&self,
parameters: &[f64],
indices: &[usize],
) -> Vec<Complex64> ⓘ
pub fn evaluate_batch_local( &self, parameters: &[f64], indices: &[usize], ) -> Vec<Complex64> ⓘ
See Evaluator::evaluate_local. This method evaluates over a subset of events rather
than all events in the total dataset.
Sourcepub fn evaluate_batch(
&self,
parameters: &[f64],
indices: &[usize],
) -> Vec<Complex64> ⓘ
pub fn evaluate_batch( &self, parameters: &[f64], indices: &[usize], ) -> Vec<Complex64> ⓘ
Evaluate the stored Expression over a subset of events in the Dataset stored by the
Evaluator with the given values for free parameters. See also [Expression::evaluate].
Sourcepub fn evaluate_gradient_local(
&self,
parameters: &[f64],
) -> Vec<DVector<Complex64>> ⓘ
pub fn evaluate_gradient_local( &self, parameters: &[f64], ) -> Vec<DVector<Complex64>> ⓘ
Evaluate the gradient of the stored Expression over the events in the Dataset stored by the
Evaluator with the given values for free parameters (non-MPI version).
§Notes
This method is not intended to be called in analyses but rather in writing methods
that have mpi-feature-gated versions. Most users will want to call Evaluator::evaluate_gradient instead.
Sourcepub fn evaluate_gradient(&self, parameters: &[f64]) -> Vec<DVector<Complex64>> ⓘ
pub fn evaluate_gradient(&self, parameters: &[f64]) -> Vec<DVector<Complex64>> ⓘ
Evaluate the gradient of the stored Expression over the events in the Dataset stored by the
Evaluator with the given values for free parameters.
Sourcepub fn evaluate_gradient_batch_local(
&self,
parameters: &[f64],
indices: &[usize],
) -> Vec<DVector<Complex64>> ⓘ
pub fn evaluate_gradient_batch_local( &self, parameters: &[f64], indices: &[usize], ) -> Vec<DVector<Complex64>> ⓘ
See Evaluator::evaluate_gradient_local. This method evaluates over a subset
of events rather than all events in the total dataset.
Sourcepub fn evaluate_gradient_batch(
&self,
parameters: &[f64],
indices: &[usize],
) -> Vec<DVector<Complex64>> ⓘ
pub fn evaluate_gradient_batch( &self, parameters: &[f64], indices: &[usize], ) -> Vec<DVector<Complex64>> ⓘ
Evaluate the gradient of the stored Expression over a subset of the
events in the Dataset stored by the Evaluator with the given values
for free parameters. See also [Expression::evaluate_gradient].
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Evaluator
impl !RefUnwindSafe for Evaluator
impl Send for Evaluator
impl Sync for Evaluator
impl Unpin for Evaluator
impl !UnwindSafe for Evaluator
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)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
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.