pub struct Amplitude<F: Field> {
pub name: String,
pub node: Box<dyn Node<F>>,
pub active: bool,
pub parameters: Vec<String>,
pub cache_position: usize,
pub parameter_index_start: usize,
}
Expand description
Fields§
§name: String
A name which uniquely identifies an Amplitude
within a sum and group.
node: Box<dyn Node<F>>
A Node
which contains all of the operations needed to compute a Complex
from an
Event
in a Dataset
, a Vec<Field>
of parameter values, and possibly some
precomputed values.
active: bool
Indicates whether the amplitude should be included in calculations or skipped.
parameters: Vec<String>
Contains the parameter names associated with this amplitude.
cache_position: usize
Indicates the reserved position in the cache for shortcutting computation with a precomputed cache.
parameter_index_start: usize
Indicates the position in the final parameter vector that coincides with the starting index
for parameters in this Amplitude
Implementations§
Source§impl<F: Field> Amplitude<F>
impl<F: Field> Amplitude<F>
Sourcepub fn register(
&mut self,
cache_position: usize,
parameter_index_start: usize,
dataset: &Dataset<F>,
) -> Result<(), RustitudeError>
pub fn register( &mut self, cache_position: usize, parameter_index_start: usize, dataset: &Dataset<F>, ) -> Result<(), RustitudeError>
Set the Amplitude::cache_position
and Amplitude::parameter_index_start
and runs
Amplitude::precalculate
over the given Dataset
.
§Errors
This function will raise a RustitudeError
if the precalculation step fails.
Trait Implementations§
Source§impl<F: Field> AmpLike<F> for Amplitude<F>
impl<F: Field> AmpLike<F> for Amplitude<F>
Source§fn walk_mut(&mut self) -> Vec<&mut Self>
fn walk_mut(&mut self) -> Vec<&mut Self>
AmpLike::walk
, but returns mutable references rather than
clones.Source§fn real(&self) -> Real<F>where
Self: Sized + 'static,
fn real(&self) -> Real<F>where
Self: Sized + 'static,
Amplitude
or Amplitude-like
struct.Source§fn imag(&self) -> Imag<F>where
Self: Sized + 'static,
fn imag(&self) -> Imag<F>where
Self: Sized + 'static,
Amplitude
or Amplitude-like
struct.Source§impl<F: Field> AsTree for Amplitude<F>
impl<F: Field> AsTree for Amplitude<F>
Source§fn _get_tree(&self, _bits: &mut Vec<bool>) -> String
fn _get_tree(&self, _bits: &mut Vec<bool>) -> String
AsTree
-implementor starting with a particular indentation structure
defined by bits
. A true
bit will print a vertical line, while a false
bit
will not.Source§fn get_tree(&self) -> String
fn get_tree(&self) -> String
Source§fn _get_indent(&self, bits: Vec<bool>) -> String
fn _get_indent(&self, bits: Vec<bool>) -> String
AsTree::get_tree
. A true
bit will yield a vertical line, while a
false
bit will not.Source§fn _get_intermediate(&self) -> String
fn _get_intermediate(&self) -> String
AsTree::get_tree
.Source§fn _get_end(&self) -> String
fn _get_end(&self) -> String
AsTree::get_tree
.Source§impl<F: Field> Node<F> for Amplitude<F>
impl<F: Field> Node<F> for Amplitude<F>
Source§fn precalculate(&mut self, dataset: &Dataset<F>) -> Result<(), RustitudeError>
fn precalculate(&mut self, dataset: &Dataset<F>) -> Result<(), RustitudeError>
Source§fn calculate(
&self,
parameters: &[F],
event: &Event<F>,
) -> Result<Complex<F>, RustitudeError>
fn calculate( &self, parameters: &[F], event: &Event<F>, ) -> Result<Complex<F>, RustitudeError>
Source§fn parameters(&self) -> Vec<String>
fn parameters(&self) -> Vec<String>
Source§fn named(self, name: &str) -> Amplitude<F>where
Self: Sized + 'static,
fn named(self, name: &str) -> Amplitude<F>where
Self: Sized + 'static,
Node
s into Amplitude
s. This method has a
shorter name than Node::into_amplitude
, which it calls.Source§fn is_python_node(&self) -> bool
fn is_python_node(&self) -> bool
Auto Trait Implementations§
impl<F> Freeze for Amplitude<F>
impl<F> !RefUnwindSafe for Amplitude<F>
impl<F> Send for Amplitude<F>
impl<F> Sync for Amplitude<F>
impl<F> Unpin for Amplitude<F>
impl<F> !UnwindSafe for Amplitude<F>
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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.