Struct SignedCoefficientBuilder

Source
pub struct SignedCoefficientBuilder<ObType, MorType> { /* private fields */ }
Expand description

Builder for signed coefficient matrices and analyses based on them.

Used to construct the linear and Lotka-Volterra ODE analyses.

Implementations§

Source§

impl SignedCoefficientBuilder<QualifiedName, QualifiedPath>

Source

pub fn linear_ode_analysis( &self, model: &DiscreteDblModel, data: LinearODEProblemData, ) -> ODEAnalysis<LinearODESystem>

Linear ODE analysis for a model of a double theory.

This analysis is a special case of linear ODE analysis for extended causal loop diagrams but can serve as a simple/naive semantics for causal loop diagrams, hopefully useful for toy models and demonstration purposes.

Source§

impl SignedCoefficientBuilder<QualifiedName, QualifiedPath>

Source

pub fn lotka_volterra_analysis( &self, model: &DiscreteDblModel, data: LotkaVolterraProblemData, ) -> ODEAnalysis<LotkaVolterraSystem>

Lotka-Volterra ODE analysis for a model of a double theory.

The main application we have in mind is the Lotka-Volterra ODE semantics for signed graphs described in our paper on regulatory networks.

Source§

impl<ObType, MorType> SignedCoefficientBuilder<ObType, MorType>

Source

pub fn new(var_ob_type: ObType) -> Self

Creates a new builder for the given object type.

Source

pub fn add_positive(self, mor_type: MorType) -> Self

Adds a morphism type defining a positive interaction between objects.

Source

pub fn add_negative(self, mor_type: MorType) -> Self

Adds a morphism type defining a negative interaction between objects.

Source

pub fn build_matrix<Id>( &self, model: &impl FgDblModel<ObType = ObType, MorType = MorType, Ob = Id, ObGen = Id, MorGen = Id>, coeffs: &HashMap<Id, f32>, ) -> (DMatrix<f32>, BTreeMap<Id, usize>)
where Id: Eq + Clone + Hash + Ord,

Builds the matrix of coefficients for the given model.

Returns the coefficient matrix along with an ordered map from object generators to integer indices.

Auto Trait Implementations§

§

impl<ObType, MorType> Freeze for SignedCoefficientBuilder<ObType, MorType>
where ObType: Freeze,

§

impl<ObType, MorType> RefUnwindSafe for SignedCoefficientBuilder<ObType, MorType>
where ObType: RefUnwindSafe, MorType: RefUnwindSafe,

§

impl<ObType, MorType> Send for SignedCoefficientBuilder<ObType, MorType>
where ObType: Send, MorType: Send,

§

impl<ObType, MorType> Sync for SignedCoefficientBuilder<ObType, MorType>
where ObType: Sync, MorType: Sync,

§

impl<ObType, MorType> Unpin for SignedCoefficientBuilder<ObType, MorType>
where ObType: Unpin, MorType: Unpin,

§

impl<ObType, MorType> UnwindSafe for SignedCoefficientBuilder<ObType, MorType>
where ObType: UnwindSafe, MorType: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

§

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

Checks if self is actually part of its subset T (and can be converted to it).
§

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

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.