pub struct LikelihoodExpression { /* private fields */ }Expand description
A combination of LikelihoodTerms as well as sums and products of them.
§Notes
When multiple terms provide parameters with the same name, the term earliest in the expression (or argument list) defines the fixed/free status and default value.
Implementations§
Source§impl LikelihoodExpression
impl LikelihoodExpression
Sourcepub fn from_term(term: Box<dyn LikelihoodTerm>) -> Self
pub fn from_term(term: Box<dyn LikelihoodTerm>) -> Self
Build a LikelihoodExpression from a single LikelihoodTerm.
Sourcepub fn parameters(&self) -> Vec<String>
pub fn parameters(&self) -> Vec<String>
The parameter names referenced across all terms in this expression.
Sourcepub fn free_parameters(&self) -> Vec<String>
pub fn free_parameters(&self) -> Vec<String>
The free parameter names which require user-provided values.
Sourcepub fn fixed_parameters(&self) -> Vec<String>
pub fn fixed_parameters(&self) -> Vec<String>
The names of parameters with constant (fixed) values.
Sourcepub fn fix(&self, name: &str, value: f64) -> LadduResult<Self>
pub fn fix(&self, name: &str, value: f64) -> LadduResult<Self>
Return a new LikelihoodExpression 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 LikelihoodExpression 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 LikelihoodExpression with the given 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 LikelihoodExpression with several parameters renamed.
Sourcepub fn load(&self) -> LikelihoodEvaluator
pub fn load(&self) -> LikelihoodEvaluator
Load a LikelihoodExpression so it can be evaluated repeatedly.
Trait Implementations§
Source§impl Add<&LikelihoodExpression> for &LikelihoodExpression
impl Add<&LikelihoodExpression> for &LikelihoodExpression
Source§type Output = LikelihoodExpression
type Output = LikelihoodExpression
+ operator.Source§impl Add<&LikelihoodExpression> for LikelihoodExpression
impl Add<&LikelihoodExpression> for LikelihoodExpression
Source§type Output = LikelihoodExpression
type Output = LikelihoodExpression
+ operator.Source§impl Add<LikelihoodExpression> for &LikelihoodExpression
impl Add<LikelihoodExpression> for &LikelihoodExpression
Source§type Output = LikelihoodExpression
type Output = LikelihoodExpression
+ operator.Source§impl Add for LikelihoodExpression
impl Add for LikelihoodExpression
Source§type Output = LikelihoodExpression
type Output = LikelihoodExpression
+ operator.Source§impl Clone for LikelihoodExpression
impl Clone for LikelihoodExpression
Source§fn clone(&self) -> LikelihoodExpression
fn clone(&self) -> LikelihoodExpression
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LikelihoodExpression
impl Debug for LikelihoodExpression
Source§impl Default for LikelihoodExpression
impl Default for LikelihoodExpression
Source§fn default() -> LikelihoodExpression
fn default() -> LikelihoodExpression
Source§impl Display for LikelihoodExpression
impl Display for LikelihoodExpression
Source§impl Mul<&LikelihoodExpression> for &LikelihoodExpression
impl Mul<&LikelihoodExpression> for &LikelihoodExpression
Source§type Output = LikelihoodExpression
type Output = LikelihoodExpression
* operator.Source§impl Mul<&LikelihoodExpression> for LikelihoodExpression
impl Mul<&LikelihoodExpression> for LikelihoodExpression
Source§type Output = LikelihoodExpression
type Output = LikelihoodExpression
* operator.Source§impl Mul<LikelihoodExpression> for &LikelihoodExpression
impl Mul<LikelihoodExpression> for &LikelihoodExpression
Source§type Output = LikelihoodExpression
type Output = LikelihoodExpression
* operator.Source§impl Mul for LikelihoodExpression
impl Mul for LikelihoodExpression
Source§type Output = LikelihoodExpression
type Output = LikelihoodExpression
* operator.Auto Trait Implementations§
impl Freeze for LikelihoodExpression
impl !RefUnwindSafe for LikelihoodExpression
impl Send for LikelihoodExpression
impl Sync for LikelihoodExpression
impl Unpin for LikelihoodExpression
impl !UnwindSafe for LikelihoodExpression
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.