Struct ODE
pub struct ODE { /* private fields */ }Implementations§
§impl ODE
impl ODE
pub fn new( diffeq: fn(&NalgebraVec<f64>, &NalgebraVec<f64>, f64, &mut NalgebraVec<f64>, &NalgebraVec<f64>, &NalgebraVec<f64>, &Covariates), lag: fn(&NalgebraVec<f64>, f64, &Covariates) -> HashMap<usize, f64>, fa: fn(&NalgebraVec<f64>, f64, &Covariates) -> HashMap<usize, f64>, init: fn(&NalgebraVec<f64>, f64, &Covariates, &mut NalgebraVec<f64>), out: fn(&NalgebraVec<f64>, &NalgebraVec<f64>, f64, &Covariates, &mut NalgebraVec<f64>), ) -> ODE
pub fn with_nstates(self, nstates: usize) -> ODE
pub fn with_nstates(self, nstates: usize) -> ODE
Set the number of state variables (ODE compartments).
pub fn with_ndrugs(self, ndrugs: usize) -> ODE
pub fn with_ndrugs(self, ndrugs: usize) -> ODE
Set the number of drug inputs (size of bolus[] and rateiv[]).
pub fn with_solver(self, solver: OdeSolver) -> ODE
pub fn with_solver(self, solver: OdeSolver) -> ODE
Set the ODE solver algorithm.
pub fn with_tolerances(self, rtol: f64, atol: f64) -> ODE
pub fn with_tolerances(self, rtol: f64, atol: f64) -> ODE
Set the relative and absolute tolerances for the ODE solver.
pub fn with_metadata(
self,
metadata: ModelMetadata,
) -> Result<ODE, OdeMetadataError>
pub fn with_metadata( self, metadata: ModelMetadata, ) -> Result<ODE, OdeMetadataError>
Attach validated handwritten-model metadata to this ODE.
pub fn metadata(&self) -> Option<&ValidatedModelMetadata>
pub fn metadata(&self) -> Option<&ValidatedModelMetadata>
Access the validated metadata attached to this ODE, if any.
pub fn parameter_index(&self, name: &str) -> Option<usize>
pub fn covariate_index(&self, name: &str) -> Option<usize>
pub fn state_index(&self, name: &str) -> Option<usize>
Trait Implementations§
§impl Cache for ODE
impl Cache for ODE
§fn with_cache_capacity(self, size: usize) -> ODE
fn with_cache_capacity(self, size: usize) -> ODE
Enable caching with the given maximum number of entries. Read more
§fn enable_cache(self) -> ODE
fn enable_cache(self) -> ODE
Enable caching with the default size (100,000 entries). Read more
§fn clear_cache(&self)
fn clear_cache(&self)
Clear all entries from this equation’s cache, if caching is enabled. Read more
§fn disable_cache(self) -> ODE
fn disable_cache(self) -> ODE
Disable caching. Read more
§impl Equation for ODE
impl Equation for ODE
§fn estimate_likelihood(
&self,
subject: &Subject,
parameters: &Parameters,
error_models: &AssayErrorModels,
) -> Result<f64, PharmsolError>
fn estimate_likelihood( &self, subject: &Subject, parameters: &Parameters, error_models: &AssayErrorModels, ) -> Result<f64, PharmsolError>
👎Deprecated since 0.23.0:
Use estimate_log_likelihood() instead for better numerical stability
Estimate the likelihood of the subject given the parameters and error model. Read more
§fn estimate_predictions(
&self,
subject: &Subject,
parameters: &Parameters,
) -> Result<<ODE as EquationTypes>::P, PharmsolError>
fn estimate_predictions( &self, subject: &Subject, parameters: &Parameters, ) -> Result<<ODE as EquationTypes>::P, PharmsolError>
Generate predictions for a subject with given parameters. Read more
§fn estimate_log_likelihood(
&self,
subject: &Subject,
parameters: &Parameters,
error_models: &AssayErrorModels,
) -> Result<f64, PharmsolError>
fn estimate_log_likelihood( &self, subject: &Subject, parameters: &Parameters, error_models: &AssayErrorModels, ) -> Result<f64, PharmsolError>
Estimate the log-likelihood of the subject given the parameters and error model. Read more
fn kind() -> EqnKind
§fn simulate_subject(
&self,
subject: &Subject,
parameters: &Parameters,
error_models: Option<&AssayErrorModels>,
) -> Result<(<ODE as EquationTypes>::P, Option<f64>), PharmsolError>
fn simulate_subject( &self, subject: &Subject, parameters: &Parameters, error_models: Option<&AssayErrorModels>, ) -> Result<(<ODE as EquationTypes>::P, Option<f64>), PharmsolError>
Simulate a subject with given parameters and optionally calculate likelihood. Read more
Source§impl EquationMetadataSource for ODE
impl EquationMetadataSource for ODE
fn equation_metadata(&self) -> Option<&ValidatedModelMetadata>
§impl EquationTypes for ODE
impl EquationTypes for ODE
Auto Trait Implementations§
impl Freeze for ODE
impl !RefUnwindSafe for ODE
impl Send for ODE
impl Sync for ODE
impl Unpin for ODE
impl UnsafeUnpin for ODE
impl !UnwindSafe for ODE
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> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
fn rand<T>(&self, rng: &mut (impl Rng + ?Sized)) -> Twhere
Self: Distribution<T>,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
Converts
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>
Converts
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 more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§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 more§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).§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.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.