pub struct Evaluator {
pub amplitudes: Vec<Box<dyn Amplitude>>,
pub resources: Arc<RwLock<Resources>>,
pub dataset: Arc<Dataset>,
pub expression: Expression,
}
Expand description
A structure which can be used to evaluate the stored Expression
built on registered
Amplitude
s. This contains a Resources
struct which already contains cached values for
precomputed Amplitude
s and any relevant free parameters and constants.
Fields§
§amplitudes: Vec<Box<dyn Amplitude>>
A list of Amplitude
s which were registered with the Manager
used to create the
internal Expression
. This includes but is not limited to those which are actually used
in the Expression
.
resources: Arc<RwLock<Resources>>
The internal Resources
where precalculated values are stored
dataset: Arc<Dataset>
The internal Dataset
expression: Expression
The internal Expression
Implementations§
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 activate<T: AsRef<str>>(&self, name: T) -> Result<(), LadduError>
pub fn activate<T: AsRef<str>>(&self, name: T) -> Result<(), LadduError>
Activate an Amplitude
by name.
Sourcepub fn activate_many<T: AsRef<str>>(
&self,
names: &[T],
) -> Result<(), LadduError>
pub fn activate_many<T: AsRef<str>>( &self, names: &[T], ) -> Result<(), LadduError>
Activate several Amplitude
s by name.
Sourcepub fn activate_all(&self)
pub fn activate_all(&self)
Activate all registered Amplitude
s.
Sourcepub fn deactivate<T: AsRef<str>>(&self, name: T) -> Result<(), LadduError>
pub fn deactivate<T: AsRef<str>>(&self, name: T) -> Result<(), LadduError>
Dectivate an Amplitude
by name.
Sourcepub fn deactivate_many<T: AsRef<str>>(
&self,
names: &[T],
) -> Result<(), LadduError>
pub fn deactivate_many<T: AsRef<str>>( &self, names: &[T], ) -> Result<(), LadduError>
Deactivate several Amplitude
s by name.
Sourcepub fn deactivate_all(&self)
pub fn deactivate_all(&self)
Deactivate all registered Amplitude
s.
Sourcepub fn isolate<T: AsRef<str>>(&self, name: T) -> Result<(), LadduError>
pub fn isolate<T: AsRef<str>>(&self, name: T) -> Result<(), LadduError>
Isolate an Amplitude
by name (deactivate the rest).
Sourcepub fn isolate_many<T: AsRef<str>>(&self, names: &[T]) -> Result<(), LadduError>
pub fn isolate_many<T: AsRef<str>>(&self, names: &[T]) -> Result<(), LadduError>
Isolate several Amplitude
s by name (deactivate the rest).
Sourcepub fn evaluate_local(&self, parameters: &[Float]) -> Vec<Complex<Float>>
pub fn evaluate_local(&self, parameters: &[Float]) -> Vec<Complex<Float>>
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: &[Float]) -> Vec<Complex<Float>>
pub fn evaluate(&self, parameters: &[Float]) -> Vec<Complex<Float>>
Evaluate the stored Expression
over the events in the Dataset
stored by the
Evaluator
with the given values for free parameters.
Sourcepub fn evaluate_gradient_local(
&self,
parameters: &[Float],
) -> Vec<DVector<Complex<Float>>> ⓘ
pub fn evaluate_gradient_local( &self, parameters: &[Float], ) -> Vec<DVector<Complex<Float>>> ⓘ
Evaluate 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.
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§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.